Commit c587f32a authored by claes's avatar claes

Font can be set on node level for annot and text

parent 54f84c2b
/*
* Proview $Id: ge_gtk.cpp,v 1.21 2008-11-28 17:13:44 claes Exp $
* Proview $Id: ge_gtk.cpp,v 1.22 2008-12-01 16:40:26 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -107,7 +107,7 @@ void GeGtk::create_list( const char *title, const char *texts,
void (action_cb)( void *, char *), void *ctx)
{
CoWowGtk wow( toplevel);
wow.CreateList( title, texts, action_cb, 0, ctx);
wow.CreateList( title, texts, action_cb, 0, ctx, 1);
}
void GeGtk::subgraphs_new()
......
/*
* Proview $Id: ge_subgraphs_gtk.cpp,v 1.4 2008-10-31 12:51:33 claes Exp $
* Proview $Id: ge_subgraphs_gtk.cpp,v 1.5 2008-12-01 16:40:26 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -113,6 +113,13 @@ static void subgraphs_activate_set_all_intern( GtkWidget *w, gpointer data)
((SubGraphs *)subgraphs)->set_all_extern( 0);
}
static void subgraphs_activate_set_all_extern( GtkWidget *w, gpointer data)
{
SubGraphsGtk *subgraphs = (SubGraphsGtk *)data;
((SubGraphs *)subgraphs)->set_all_extern( 1);
}
static void subgraphs_activate_help( GtkWidget *w, gpointer data)
{
}
......@@ -173,6 +180,12 @@ SubGraphsGtk::SubGraphsGtk(
gtk_widget_add_accelerator( file_setallintern, "activate", accel_g,
'l', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
GtkWidget *file_setallextern = gtk_menu_item_new_with_mnemonic( "Set A_ll Extern");
g_signal_connect( file_setallextern, "activate",
G_CALLBACK(subgraphs_activate_set_all_extern), this);
gtk_widget_add_accelerator( file_setallextern, "activate", accel_g,
'k', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
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);
......@@ -181,6 +194,7 @@ SubGraphsGtk::SubGraphsGtk(
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_setallintern);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_setallextern);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_close);
GtkWidget *file = gtk_menu_item_new_with_mnemonic("_File");
......
/*
* Proview $Id: ge_dyn.cpp,v 1.70 2008-11-24 15:24:16 claes Exp $
* Proview $Id: ge_dyn.cpp,v 1.71 2008-12-01 16:40:26 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -13152,12 +13152,14 @@ int GePulldownMenu::action( grow_tObject object, glow_tEvent event)
int text_size;
int sts;
double scale;
glow_eFont text_font;
sts = grow_GetObjectAnnotInfo( object, 1, &text_size, &text_drawtype, &text_color, &bg_color,
&scale);
sts = grow_GetObjectAnnotInfo( object, 1, &text_size, &text_drawtype, &text_color,
&bg_color, &scale, &text_font);
if ( EVEN(sts)) {
text_size = 2;
text_drawtype = glow_eDrawType_TextHelveticaBold;
text_font = glow_eFont_Helvetica;
text_color = glow_eDrawType_Line;
bg_color = glow_eDrawType_LightGray;
}
......@@ -13168,7 +13170,7 @@ int GePulldownMenu::action( grow_tObject object, glow_tEvent event)
grow_CreateGrowMenu( dyn->graph->grow->ctx, "__Menu", &info, ll_x, ur_y, ur_x - ll_x,
glow_eDrawType_Line, 0, 1, 1, bg_color, text_size,
text_drawtype, text_color,
glow_eDrawType_MediumGray, 0,
glow_eDrawType_MediumGray, text_font, 0,
&menu_object);
grow_SetObjectScale( menu_object, scale, scale, 0, 0, glow_eScaleType_LowerLeft);
grow_SetMenuInputFocus( menu_object, 1);
......@@ -13237,14 +13239,15 @@ int GePulldownMenu::action( grow_tObject object, glow_tEvent event)
glow_eDrawType text_drawtype, text_color, bg_color, text_color_disabled;
int text_size;
glow_eFont text_font;
grow_GetMenuChar( object, &text_size, &bg_color, &text_drawtype, &text_color,
&text_color_disabled);
&text_color_disabled, &text_font);
grow_CreateGrowMenu( dyn->graph->grow->ctx, "__Menu", &info, event->menu.x, event->menu.y, 0,
glow_eDrawType_Line, 0, 1, 1, bg_color, text_size,
text_drawtype, text_color,
text_color_disabled, object,
text_color_disabled, text_font, object,
&menu_object);
grow_SetMenuInputFocus( object, 0);
grow_SetMenuInputFocus( menu_object, 1);
......@@ -13834,9 +13837,10 @@ int GeOptionMenu::action( grow_tObject object, glow_tEvent event)
int text_size;
int sts;
double scale;
glow_eFont text_font;
sts = grow_GetObjectAnnotInfo( object, 1, &text_size, &text_drawtype, &text_color, &bg_color,
&scale);
&scale, &text_font);
if ( EVEN(sts)) {
text_size = 2;
text_drawtype = glow_eDrawType_TextHelveticaBold;
......@@ -13850,7 +13854,7 @@ int GeOptionMenu::action( grow_tObject object, glow_tEvent event)
grow_CreateGrowMenu( dyn->graph->grow->ctx, "__Menu", &info, ll_x, ur_y, ur_x - ll_x,
glow_eDrawType_Line, 0, 1, 1, bg_color, text_size,
text_drawtype, text_color,
glow_eDrawType_MediumGray, 0,
glow_eDrawType_MediumGray, text_font, 0,
&menu_object);
grow_SetObjectScale( menu_object, scale, scale, 0, 0, glow_eScaleType_LowerLeft);
}
......
/*
* Proview $Id: ge_graph.cpp,v 1.57 2008-11-24 15:25:15 claes Exp $
* Proview $Id: ge_graph.cpp,v 1.58 2008-12-01 16:40:26 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -2853,10 +2853,15 @@ void GraphGrow::grow_setup()
else
grow_attr.enable_bg_pixmap = 1;
mask |= grow_eAttr_double_buffer_on;
if ( ((Graph *)graph)->mode == graph_eMode_Development)
mask |= grow_eAttr_environment;
if ( ((Graph *)graph)->mode == graph_eMode_Development) {
grow_attr.double_buffer_on = 1;
else
grow_attr.environment = glow_eEnv_Development;
}
else {
grow_attr.double_buffer_on = 0;
grow_attr.environment = glow_eEnv_Runtime;
}
grow_SetAttributes( ctx, &grow_attr, mask);
grow_SetCtxUserData( ctx, graph);
grow_SetMoveRestrictions( ctx, glow_eMoveRestriction_No, 0, 0, NULL);
......
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