Commit 4263a939 authored by claes's avatar claes

Set all intern added to menu

parent daaea6e7
/* /*
* Proview $Id: ge_subgraphs_gtk.cpp,v 1.2 2008-01-24 09:28:01 claes Exp $ * Proview $Id: ge_subgraphs_gtk.cpp,v 1.3 2008-05-13 13:53:11 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -106,6 +106,13 @@ static void subgraphs_activate_set_intern( GtkWidget *w, gpointer data) ...@@ -106,6 +106,13 @@ static void subgraphs_activate_set_intern( GtkWidget *w, gpointer data)
item->set_extern( 0); item->set_extern( 0);
} }
static void subgraphs_activate_set_all_intern( GtkWidget *w, gpointer data)
{
SubGraphsGtk *subgraphs = (SubGraphsGtk *)data;
((SubGraphs *)subgraphs)->set_all_extern( 0);
}
static void subgraphs_activate_help( GtkWidget *w, gpointer data) static void subgraphs_activate_help( GtkWidget *w, gpointer data)
{ {
} }
...@@ -160,6 +167,12 @@ SubGraphsGtk::SubGraphsGtk( ...@@ -160,6 +167,12 @@ SubGraphsGtk::SubGraphsGtk(
gtk_widget_add_accelerator( file_setintern, "activate", accel_g, gtk_widget_add_accelerator( file_setintern, "activate", accel_g,
'i', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); 'i', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
GtkWidget *file_setallintern = gtk_menu_item_new_with_mnemonic( "Set _All Intern");
g_signal_connect( file_setallintern, "activate",
G_CALLBACK(subgraphs_activate_set_all_intern), this);
gtk_widget_add_accelerator( file_setallintern, "activate", accel_g,
'l', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
GtkWidget *file_close = gtk_image_menu_item_new_from_stock(GTK_STOCK_CLOSE, accel_g); GtkWidget *file_close = gtk_image_menu_item_new_from_stock(GTK_STOCK_CLOSE, accel_g);
g_signal_connect(file_close, "activate", G_CALLBACK(subgraphs_activate_close), this); g_signal_connect(file_close, "activate", G_CALLBACK(subgraphs_activate_close), this);
...@@ -167,6 +180,7 @@ SubGraphsGtk::SubGraphsGtk( ...@@ -167,6 +180,7 @@ SubGraphsGtk::SubGraphsGtk(
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_attributes); gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_attributes);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_setextern); gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_setextern);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_setintern); gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_setintern);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_setallintern);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_close); gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_close);
GtkWidget *file = gtk_menu_item_new_with_mnemonic("_File"); GtkWidget *file = gtk_menu_item_new_with_mnemonic("_File");
......
/* /*
* Proview $Id: ge_subgraphs.cpp,v 1.6 2008-01-24 09:28:01 claes Exp $ * Proview $Id: ge_subgraphs.cpp,v 1.7 2008-05-13 13:49:25 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -180,6 +180,23 @@ int SubGraphs::get_select( void **subgraph_item) ...@@ -180,6 +180,23 @@ int SubGraphs::get_select( void **subgraph_item)
return 1; return 1;
} }
int SubGraphs::set_all_extern( int eval)
{
brow_tNode *node_list;
int node_count;
SubGraphBaseItem *item;
brow_GetObjectList( brow->ctx, &node_list, &node_count);
if ( !node_count)
return 0;
for ( int i = 0; i < node_count; i++) {
brow_GetUserData( node_list[i], (void **)&item);
if ( item->type == subgraphs_eItemType_SubGraph)
((ItemSubGraph *)item)->set_extern( eval);
}
return 1;
}
// //
// Callbacks from brow // Callbacks from brow
...@@ -691,7 +708,6 @@ static void subgraphs_attr_close_cb( Attr *attrctx) ...@@ -691,7 +708,6 @@ static void subgraphs_attr_close_cb( Attr *attrctx)
SubGraphs *subgraphs = (SubGraphs *) attrctx->parent_ctx; SubGraphs *subgraphs = (SubGraphs *) attrctx->parent_ctx;
subgraphs_tAttr attrlist_p, prev_p; subgraphs_tAttr attrlist_p, prev_p;
printf( "Here in attr close\n");
// if ( attrctx->object) // if ( attrctx->object)
// grow_FreeObjectAttrInfo( (grow_sAttrInfo *)attrctx->client_data); // grow_FreeObjectAttrInfo( (grow_sAttrInfo *)attrctx->client_data);
// else // else
......
/* /*
* Proview $Id: ge_subgraphs.h,v 1.4 2007-01-04 08:18:35 claes Exp $ * Proview $Id: ge_subgraphs.h,v 1.5 2008-05-13 13:49:25 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -101,6 +101,7 @@ class SubGraphs { ...@@ -101,6 +101,7 @@ class SubGraphs {
subgraphs_tAttr attrlist; subgraphs_tAttr attrlist;
int get_select( pwr_sAttrRef *attrref, int *is_attr); int get_select( pwr_sAttrRef *attrref, int *is_attr);
int set_all_extern( int eval);
void message( char sev, char *text); void message( char sev, char *text);
void set_inputfocus(); void set_inputfocus();
int object_attr(); int object_attr();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment