Commit e5fb3375 authored by Claes Sjofors's avatar Claes Sjofors

Ge, new script functions and colortheme fix for subwindows

parent 34491186
...@@ -685,9 +685,12 @@ void Graph::update_color_theme( int ct) ...@@ -685,9 +685,12 @@ void Graph::update_color_theme( int ct)
int sts; int sts;
sprintf( color_theme_file, "pwr_colortheme%d", ct); sprintf( color_theme_file, "pwr_colortheme%d", ct);
sts = grow_ReadCustomColorFile( grow->ctx, color_theme_file);
sts = grow_ReadCustomColorFile( grow->base_ctx(), color_theme_file);
if ( EVEN(sts)) return; if ( EVEN(sts)) return;
grow_SetDefaultColorTheme( color_theme_file);
color_theme = ct; color_theme = ct;
if ( update_colorpalette_cb) if ( update_colorpalette_cb)
...@@ -1591,19 +1594,19 @@ int Graph::get_attr_items( grow_tObject object, attr_sItem **itemlist, ...@@ -1591,19 +1594,19 @@ int Graph::get_attr_items( grow_tObject object, attr_sItem **itemlist,
"Scale9", "Folder9.Scale", "Scale9", "Folder9.Scale",
"VerticalScrollbar9", "Folder9.VerticalScrollbar", "VerticalScrollbar9", "Folder9.VerticalScrollbar",
"HorizontalScrollbar9", "Folder9.HorizontalScrollbar", "HorizontalScrollbar9", "Folder9.HorizontalScrollbar",
"Owner10", "Folder9.Object", "Owner9", "Folder9.Object",
"FileName10", "Folder10.FileName", "FileName10", "Folder10.FileName",
"Text10", "Folder10.Text", "Text10", "Folder10.Text",
"Scale10", "Folder10.Scale", "Scale10", "Folder10.Scale",
"VerticalScrollbar10", "Folder10.VerticalScrollbar", "VerticalScrollbar10", "Folder10.VerticalScrollbar",
"HorizontalScrollbar10","Folder10.HorizontalScrollbar", "HorizontalScrollbar10","Folder10.HorizontalScrollbar",
"Owner11", "Folder10.Object", "Owner10", "Folder10.Object",
"FileName11", "Folder11.FileName", "FileName11", "Folder11.FileName",
"Text11", "Folder11.Text", "Text11", "Folder11.Text",
"Scale11", "Folder11.Scale", "Scale11", "Folder11.Scale",
"VerticalScrollbar11", "Folder11.VerticalScrollbar", "VerticalScrollbar11", "Folder11.VerticalScrollbar",
"HorizontalScrollbar11","Folder11.HorizontalScrollbar", "HorizontalScrollbar11","Folder11.HorizontalScrollbar",
"Owner12", "Folder11.Object", "Owner11", "Folder11.Object",
"FileName12", "Folder12.FileName", "FileName12", "Folder12.FileName",
"Text12", "Folder12.Text", "Text12", "Folder12.Text",
"Scale12", "Folder12.Scale", "Scale12", "Folder12.Scale",
......
...@@ -399,6 +399,12 @@ class GraphGrow { ...@@ -399,6 +399,12 @@ class GraphGrow {
if ( stack_cnt > 0) if ( stack_cnt > 0)
ctx = ctx_stack[--stack_cnt]; ctx = ctx_stack[--stack_cnt];
} }
GrowCtx *base_ctx() {
if ( stack_cnt > 0)
return ctx_stack[0];
else
return ctx;
}
}; };
......
This diff is collapsed.
...@@ -2025,7 +2025,7 @@ void GlowDrawGtk::clear( GlowWind *wind) ...@@ -2025,7 +2025,7 @@ void GlowDrawGtk::clear( GlowWind *wind)
if ( !w->double_buffer_on) if ( !w->double_buffer_on)
gdk_window_clear( w->window); gdk_window_clear( w->window);
else else
buffer_background( w); buffer_background( w, 0);
} }
void GlowDrawGtk::copy_buffer( GlowWind *wind, void GlowDrawGtk::copy_buffer( GlowWind *wind,
...@@ -2410,7 +2410,7 @@ void GlowDrawGtk::set_background( GlowWind *wind, glow_eDrawType drawtype, glow_ ...@@ -2410,7 +2410,7 @@ void GlowDrawGtk::set_background( GlowWind *wind, glow_eDrawType drawtype, glow_
gtk_widget_modify_bg( w->toplevel, GTK_STATE_NORMAL, &background); gtk_widget_modify_bg( w->toplevel, GTK_STATE_NORMAL, &background);
if ( w->buffer) if ( w->buffer)
buffer_background( w); buffer_background( w, 0);
} }
else { else {
GdkBitmap *mask; GdkBitmap *mask;
...@@ -2425,7 +2425,7 @@ void GlowDrawGtk::set_background( GlowWind *wind, glow_eDrawType drawtype, glow_ ...@@ -2425,7 +2425,7 @@ void GlowDrawGtk::set_background( GlowWind *wind, glow_eDrawType drawtype, glow_
w->background_pixmap_height = pixmap_height; w->background_pixmap_height = pixmap_height;
gdk_window_set_back_pixmap( w->window, w->background_pixmap, FALSE); gdk_window_set_back_pixmap( w->window, w->background_pixmap, FALSE);
if ( w->buffer) if ( w->buffer)
buffer_background( w); buffer_background( w, 0);
} }
} }
...@@ -2622,7 +2622,7 @@ int GlowDrawGtk::create_buffer( GlowWind *wind) ...@@ -2622,7 +2622,7 @@ int GlowDrawGtk::create_buffer( GlowWind *wind)
w->buffer_width = window_width; w->buffer_width = window_width;
w->buffer_height = window_height; w->buffer_height = window_height;
buffer_background( w); buffer_background( w, 0);
return 1; return 1;
} }
...@@ -2637,7 +2637,7 @@ void GlowDrawGtk::delete_buffer( GlowWind *wind) ...@@ -2637,7 +2637,7 @@ void GlowDrawGtk::delete_buffer( GlowWind *wind)
w->buffer_height = 0; w->buffer_height = 0;
} }
void GlowDrawGtk::buffer_background( DrawWind *wind) void GlowDrawGtk::buffer_background( DrawWind *wind, GlowCtx *cctx)
{ {
DrawWindGtk *w = (DrawWindGtk *) wind; DrawWindGtk *w = (DrawWindGtk *) wind;
int window_width, window_height, subwindow_x, subwindow_y; int window_width, window_height, subwindow_x, subwindow_y;
...@@ -2687,14 +2687,21 @@ void GlowDrawGtk::buffer_background( DrawWind *wind) ...@@ -2687,14 +2687,21 @@ void GlowDrawGtk::buffer_background( DrawWind *wind)
reset_clip( w, get_gc( this, glow_eDrawType_Line, 0)); reset_clip( w, get_gc( this, glow_eDrawType_Line, 0));
} }
else { else {
glow_eDrawType bg;
if ( cctx)
bg = ((GrowCtx *)cctx)->background_color;
else
bg = ((GrowCtx *)ctx)->background_color;
//glow_eDrawType bg = glow_eDrawType_CustomColor1;
//glow_eDrawType bg = glow_eDrawType_LineErase;
if ( w->clip_on) if ( w->clip_on)
set_clip( w, get_gc( this, glow_eDrawType_LineErase, 0)); set_clip( w, get_gc( this, bg, 0));
gdk_draw_rectangle( w->buffer, gdk_draw_rectangle( w->buffer,
get_gc( this, glow_eDrawType_LineErase, 0), 1, get_gc( this, bg, 0), 1,
subwindow_x, subwindow_y, window_width, window_height); subwindow_x, subwindow_y, window_width, window_height);
if ( w->clip_on) if ( w->clip_on)
reset_clip( w, get_gc( this, glow_eDrawType_LineErase, 0)); reset_clip( w, get_gc( this, bg, 0));
} }
} }
......
...@@ -191,7 +191,7 @@ class GlowDrawGtk : public GlowDraw { ...@@ -191,7 +191,7 @@ class GlowDrawGtk : public GlowDraw {
virtual void draw_background( GlowWind *wind, int x, int y, int w, int h); virtual void draw_background( GlowWind *wind, int x, int y, int w, int h);
virtual int create_buffer( GlowWind *w); virtual int create_buffer( GlowWind *w);
virtual void delete_buffer( GlowWind *w); virtual void delete_buffer( GlowWind *w);
virtual void buffer_background( DrawWind *w); virtual void buffer_background( DrawWind *w, GlowCtx *cctx);
virtual int print( char *filename, double x0, double x1, int end); virtual int print( char *filename, double x0, double x1, int end);
virtual int export_image( char *filename); virtual int export_image( char *filename);
void set_clip( DrawWind *w, GdkGC *gc); void set_clip( DrawWind *w, GdkGC *gc);
......
...@@ -1938,7 +1938,7 @@ void GlowDrawXLib::clear( GlowWind *wind) ...@@ -1938,7 +1938,7 @@ void GlowDrawXLib::clear( GlowWind *wind)
if ( !w->double_buffer_on) if ( !w->double_buffer_on)
XClearWindow( display, w->window); XClearWindow( display, w->window);
else else
buffer_background( w); buffer_background( w, 0);
} }
void GlowDrawXLib::copy_buffer( GlowWind *wind, void GlowDrawXLib::copy_buffer( GlowWind *wind,
...@@ -2341,7 +2341,7 @@ void GlowDrawXLib::set_background( GlowWind *wind, glow_eDrawType drawtype, glow ...@@ -2341,7 +2341,7 @@ void GlowDrawXLib::set_background( GlowWind *wind, glow_eDrawType drawtype, glow
XtSetValues( w->toplevel, args, i); XtSetValues( w->toplevel, args, i);
if ( w->buffer) if ( w->buffer)
buffer_background( w); buffer_background( w, 0);
} }
else { else {
if ( w->background_pixmap) if ( w->background_pixmap)
...@@ -2352,7 +2352,7 @@ void GlowDrawXLib::set_background( GlowWind *wind, glow_eDrawType drawtype, glow ...@@ -2352,7 +2352,7 @@ void GlowDrawXLib::set_background( GlowWind *wind, glow_eDrawType drawtype, glow
w->background_pixmap_height = pixmap_height; w->background_pixmap_height = pixmap_height;
XSetWindowBackgroundPixmap( display, w->window, (Pixmap)pixmap); XSetWindowBackgroundPixmap( display, w->window, (Pixmap)pixmap);
if ( w->buffer) if ( w->buffer)
buffer_background( w); buffer_background( w, 0);
} }
} }
...@@ -2580,7 +2580,7 @@ int GlowDrawXLib::create_buffer( GlowWind *wind) ...@@ -2580,7 +2580,7 @@ int GlowDrawXLib::create_buffer( GlowWind *wind)
w->buffer_width = window_width; w->buffer_width = window_width;
w->buffer_height = window_height; w->buffer_height = window_height;
buffer_background( w); buffer_background( w, 0);
return 1; return 1;
} }
...@@ -2595,7 +2595,7 @@ void GlowDrawXLib::delete_buffer( GlowWind *wind) ...@@ -2595,7 +2595,7 @@ void GlowDrawXLib::delete_buffer( GlowWind *wind)
w->buffer_height = 0; w->buffer_height = 0;
} }
void GlowDrawXLib::buffer_background( DrawWind *wind) void GlowDrawXLib::buffer_background( DrawWind *wind, GlowCtx *cctx)
{ {
DrawWindXLib *w = (DrawWindXLib *) wind; DrawWindXLib *w = (DrawWindXLib *) wind;
int window_width, window_height, subwindow_x, subwindow_y; int window_width, window_height, subwindow_x, subwindow_y;
......
...@@ -212,7 +212,7 @@ class GlowDrawXLib : public GlowDraw { ...@@ -212,7 +212,7 @@ class GlowDrawXLib : public GlowDraw {
virtual void draw_background( GlowWind *wind, int x, int y, int w, int h); virtual void draw_background( GlowWind *wind, int x, int y, int w, int h);
virtual int create_buffer( GlowWind *w); virtual int create_buffer( GlowWind *w);
virtual void delete_buffer( GlowWind *w); virtual void delete_buffer( GlowWind *w);
virtual void buffer_background( DrawWind *w); virtual void buffer_background( DrawWind *w, GlowCtx *cctx);
virtual int print( char *filename, double x0, double x1, int end); virtual int print( char *filename, double x0, double x1, int end);
void set_clip( DrawWind *w, GC gc); void set_clip( DrawWind *w, GC gc);
void reset_clip( DrawWind *w, GC gc); void reset_clip( DrawWind *w, GC gc);
......
...@@ -222,6 +222,7 @@ class GlowArrayElem { ...@@ -222,6 +222,7 @@ class GlowArrayElem {
virtual glow_eDrawType get_border_color() { return glow_eDrawType_No;} virtual glow_eDrawType get_border_color() { return glow_eDrawType_No;}
virtual glow_eDrawType get_text_color() { return glow_eDrawType_No;} virtual glow_eDrawType get_text_color() { return glow_eDrawType_No;}
virtual glow_eGradient get_gradient() { return glow_eGradient_No;} virtual glow_eGradient get_gradient() { return glow_eGradient_No;}
virtual void get_gradient( glow_eGradient gradient) {}
virtual void set_colortheme_lightness() {} virtual void set_colortheme_lightness() {}
virtual ~GlowArrayElem() {}; virtual ~GlowArrayElem() {};
......
...@@ -562,6 +562,41 @@ int ColPalCtx::event_handler( glow_eEvent event, int x, int y, int w, int h) ...@@ -562,6 +562,41 @@ int ColPalCtx::event_handler( glow_eEvent event, int x, int y, int w, int h)
event_callback[event]( this, &e); event_callback[event]( this, &e);
} }
} }
else if ( strcmp( name, "ColorEntryBg") == 0) {
if ( event_callback[event]) {
static glow_sEvent e;
e.event = event;
e.any.type = glow_eEventType_ColorTone;
e.any.x_pixel = x;
e.any.y_pixel = y;
e.any.x = 1.0 * (x + mw.offset_x) / mw.zoom_factor_x;
e.any.y = 1.0 * (y + mw.offset_y) / mw.zoom_factor_y;
e.colortone.tone = (glow_eDrawTone) glow_eDrawType_LineErase;
event_callback[event]( this, &e);
}
}
}
else if ( callback_object->type() == glow_eObjectType_GrowText) {
GrowText *text;
char name[32];
text = (GrowText *)callback_object;
text->get_object_name( name);
if ( strcmp( name, "ColorEntryBg") == 0) {
if ( event_callback[event]) {
static glow_sEvent e;
e.event = event;
e.any.type = glow_eEventType_ColorTone;
e.any.x_pixel = x;
e.any.y_pixel = y;
e.any.x = 1.0 * (x + mw.offset_x) / mw.zoom_factor_x;
e.any.y = 1.0 * (y + mw.offset_y) / mw.zoom_factor_y;
e.colortone.tone = (glow_eDrawTone) glow_eDrawType_LineErase;
event_callback[event]( this, &e);
}
}
} }
} }
break; break;
......
...@@ -140,7 +140,7 @@ class GlowDraw { ...@@ -140,7 +140,7 @@ class GlowDraw {
virtual void draw_background( GlowWind *wind, int x, int y, int w, int h) {} virtual void draw_background( GlowWind *wind, int x, int y, int w, int h) {}
virtual int create_buffer( GlowWind *w) {return 1;} virtual int create_buffer( GlowWind *w) {return 1;}
virtual void delete_buffer( GlowWind *w) {} virtual void delete_buffer( GlowWind *w) {}
virtual void buffer_background( DrawWind *w) {} virtual void buffer_background( DrawWind *w, GlowCtx *cctx) {}
virtual int export_image( char *filename) { return 1;} virtual int export_image( char *filename) { return 1;}
virtual int print( char *filename, double x0, double x1, int end) { return 1;} virtual int print( char *filename, double x0, double x1, int end) { return 1;}
//virtual void set_clip( DrawWind *w, GC gc) {} //virtual void set_clip( DrawWind *w, GC gc) {}
......
...@@ -4945,6 +4945,16 @@ void grow_SetNodeClassExtern( grow_tNodeClass nodeclass, int ext) ...@@ -4945,6 +4945,16 @@ void grow_SetNodeClassExtern( grow_tNodeClass nodeclass, int ext)
((GlowNodeClass *)nodeclass)->set_extern( ext); ((GlowNodeClass *)nodeclass)->set_extern( ext);
} }
void grow_SetNodeClassExternAll( grow_tCtx ctx, int ext)
{
GlowNodeClass **nc_list;
int num;
ctx->get_nodeclasslist( (GlowArrayElem ***)&nc_list, &num);
for ( int i = 0; i < num; i++)
nc_list[i]->set_extern( ext);
}
int grow_GetBackgroundObjectLimits( grow_tCtx ctx, glow_eTraceType type, int grow_GetBackgroundObjectLimits( grow_tCtx ctx, glow_eTraceType type,
double x, double y, grow_tObject *background, double x, double y, grow_tObject *background,
double *min, double *max, glow_eDirection *direction) double *min, double *max, glow_eDirection *direction)
...@@ -5497,6 +5507,11 @@ glow_eGradient grow_GetObjectGradient( grow_tObject o) ...@@ -5497,6 +5507,11 @@ glow_eGradient grow_GetObjectGradient( grow_tObject o)
return ((GlowArrayElem *)o)->get_gradient(); return ((GlowArrayElem *)o)->get_gradient();
} }
void grow_SetObjectGradient( grow_tObject o, glow_eGradient gradient)
{
((GlowArrayElem *)o)->set_gradient( gradient);
}
int grow_GetObjectShadow( grow_tObject o) int grow_GetObjectShadow( grow_tObject o)
{ {
return ((GlowArrayElem *)o)->get_shadow(); return ((GlowArrayElem *)o)->get_shadow();
...@@ -5532,6 +5547,22 @@ void grow_ResetObjectBackgroundColor( grow_tObject object) ...@@ -5532,6 +5547,22 @@ void grow_ResetObjectBackgroundColor( grow_tObject object)
((GlowArrayElem *)object)->reset_background_color(); ((GlowArrayElem *)object)->reset_background_color();
} }
int grow_SetObjectClass( grow_tObject object, grow_tNodeClass nodeclass)
{
if ( ((GlowArrayElem *)object)->type() == glow_eObjectType_GrowNode ||
((GlowArrayElem *)object)->type() == glow_eObjectType_GrowSlider ||
((GlowArrayElem *)object)->type() == glow_eObjectType_GrowConGlue ||
((GlowArrayElem *)object)->type() == glow_eObjectType_GrowGroup) {
((GrowNode *)object)->nc = (GlowNodeClass *)nodeclass;
((GrowNode *)object)->nc_root = (GlowNodeClass *)nodeclass;
((GrowNode *)object)->get_node_borders();
}
else
return 0;
return 1;
}
/*@}*/ /*@}*/
......
...@@ -2754,6 +2754,8 @@ extern "C" { ...@@ -2754,6 +2754,8 @@ extern "C" {
*/ */
void grow_SetNodeClassExtern( grow_tNodeClass nodeclass, int ext); void grow_SetNodeClassExtern( grow_tNodeClass nodeclass, int ext);
void grow_SetNodeClassExternAll( grow_tCtx ctx, int ext);
//! Get the limits configured in a background object for a slider. //! Get the limits configured in a background object for a slider.
/*! /*!
\param ctx Grow context. \param ctx Grow context.
...@@ -3114,6 +3116,7 @@ extern "C" { ...@@ -3114,6 +3116,7 @@ extern "C" {
glow_eDrawType grow_GetObjectBorderColor( grow_tObject o); glow_eDrawType grow_GetObjectBorderColor( grow_tObject o);
glow_eDrawType grow_GetObjectTextColor( grow_tObject o); glow_eDrawType grow_GetObjectTextColor( grow_tObject o);
glow_eGradient grow_GetObjectGradient( grow_tObject o); glow_eGradient grow_GetObjectGradient( grow_tObject o);
void grow_SetObjectGradient( grow_tObject o, glow_eGradient gradient);
int grow_GetObjectShadow( grow_tObject o); int grow_GetObjectShadow( grow_tObject o);
void grow_SetObjectOriginalFillColor( grow_tObject o, glow_eDrawType color); void grow_SetObjectOriginalFillColor( grow_tObject o, glow_eDrawType color);
void grow_SetObjectOriginalBorderColor( grow_tObject o, glow_eDrawType color); void grow_SetObjectOriginalBorderColor( grow_tObject o, glow_eDrawType color);
...@@ -3121,6 +3124,7 @@ extern "C" { ...@@ -3121,6 +3124,7 @@ extern "C" {
void grow_SetObjectBackgroundColor( grow_tObject o, glow_eDrawType color); void grow_SetObjectBackgroundColor( grow_tObject o, glow_eDrawType color);
void grow_SetObjectOriginalBackgroundColor( grow_tObject o, glow_eDrawType color); void grow_SetObjectOriginalBackgroundColor( grow_tObject o, glow_eDrawType color);
void grow_ResetObjectBackgroundColor( grow_tObject object); void grow_ResetObjectBackgroundColor( grow_tObject object);
int grow_SetObjectClass( grow_tObject object, grow_tNodeClass nodeclass);
/*@}*/ /*@}*/
......
...@@ -99,11 +99,13 @@ class NextElem { ...@@ -99,11 +99,13 @@ class NextElem {
GrowCtx::~GrowCtx() GrowCtx::~GrowCtx()
{ {
if ( gdraw) if ( gdraw) {
set_nodraw();
clear_all( 0); clear_all( 0);
}
if ( dynamic) if ( dynamic)
free( dynamic); free( dynamic);
if ( ctx_type == glow_eCtxType_Grow && customcolors) { if ( gdraw && ctx_type == glow_eCtxType_Grow && customcolors) {
gdraw->reset_customcolors( customcolors); gdraw->reset_customcolors( customcolors);
free( customcolors); free( customcolors);
} }
...@@ -2528,6 +2530,7 @@ void GrowCtx::clear_all( int keep_paste) ...@@ -2528,6 +2530,7 @@ void GrowCtx::clear_all( int keep_paste)
nav_clear(); nav_clear();
set_nodraw(); set_nodraw();
reset_custom_colors();
zoom_absolute( mw.base_zoom_factor); zoom_absolute( mw.base_zoom_factor);
mw.offset_x = 0; mw.offset_x = 0;
mw.offset_y = 0; mw.offset_y = 0;
...@@ -2571,11 +2574,11 @@ void GrowCtx::clear_all( int keep_paste) ...@@ -2571,11 +2574,11 @@ void GrowCtx::clear_all( int keep_paste)
} }
} }
} }
reset_custom_colors();
reset_nodraw(); reset_nodraw();
// if ( show_grid) // if ( show_grid)
// draw_grid( 0, 0, mw.window_width, mw.window_height); // draw_grid( 0, 0, mw.window_width, mw.window_height);
draw( &mw, mw.subwindow_x, mw.subwindow_y, mw.subwindow_x + mw.window_width, mw.subwindow_y + mw.window_height); draw( &mw, mw.subwindow_x, mw.subwindow_y, mw.subwindow_x + mw.window_width, mw.subwindow_y + mw.window_height);
reset_custom_colors();
} }
void GrowCtx::redraw_defered() void GrowCtx::redraw_defered()
...@@ -2615,7 +2618,7 @@ void GrowCtx::draw( GlowWind *w, int ll_x, int ll_y, int ur_x, int ur_y) ...@@ -2615,7 +2618,7 @@ void GrowCtx::draw( GlowWind *w, int ll_x, int ll_y, int ur_x, int ur_y)
if ( redraw_callback) if ( redraw_callback)
(redraw_callback) ( redraw_data); (redraw_callback) ( redraw_data);
if ( w->double_buffer_on()) if ( w->double_buffer_on())
gdraw->buffer_background( w->window); gdraw->buffer_background( w->window, this);
for ( i = 0; i < a.a_size; i++) { for ( i = 0; i < a.a_size; i++) {
if ( a.a[i]->type() == glow_eObjectType_Con) if ( a.a[i]->type() == glow_eObjectType_Con)
a.a[i]->draw( w, ll_x, ll_y, ur_x, ur_y); a.a[i]->draw( w, ll_x, ll_y, ur_x, ur_y);
...@@ -4692,11 +4695,21 @@ int GrowCtx::read_customcolor_file( char *name) ...@@ -4692,11 +4695,21 @@ int GrowCtx::read_customcolor_file( char *name)
{ {
int sts; int sts;
if ( environment == glow_eEnv_Runtime && strcmp( color_theme, "$default") != 0)
return 0;
if ( customcolors) { if ( customcolors) {
sts = customcolors->read_colorfile( this, name); sts = customcolors->read_colorfile( this, name);
if ( ODD(sts)) { if ( ODD(sts)) {
set_background( background_color); set_background( background_color);
} }
for ( int i = 0; i < a.a_size; i++) {
if ( a[i]->type() == glow_eObjectType_GrowWindow ||
a[i]->type() == glow_eObjectType_GrowFolder) {
((GrowWindow *)a[i])->window_ctx->read_customcolor_file( name);
}
}
return sts; return sts;
} }
else else
......
...@@ -99,7 +99,7 @@ class GrowCtx : public GlowCtx { ...@@ -99,7 +99,7 @@ class GrowCtx : public GlowCtx {
is_javaapplication(0), cycle(glow_eCycle_Slow), is_javaapplication(0), cycle(glow_eCycle_Slow),
mb3_action(glow_eMB3Action_PopupMenu), scale_equal(0), translate_on(0), mb3_action(glow_eMB3Action_PopupMenu), scale_equal(0), translate_on(0),
input_focus_mark(glow_eInputFocusMark_Relief), background_disabled(0), input_focus_mark(glow_eInputFocusMark_Relief), background_disabled(0),
redraw_callback(0), redraw_data(0), has_subwindows(-1), bitmap_fonts(0), redraw_callback(0), redraw_data(0), has_subwindows(-1), is_subwindow(0), bitmap_fonts(0),
environment(glow_eEnv_Runtime), text_coding(glow_eTextCoding_ISO8859_1), recursive_trace(0), environment(glow_eEnv_Runtime), text_coding(glow_eTextCoding_ISO8859_1), recursive_trace(0),
edit_set_mode(glow_eEditSetMode_None) edit_set_mode(glow_eEditSetMode_None)
{ ctx_type = glow_eCtxType_Grow; { ctx_type = glow_eCtxType_Grow;
...@@ -964,6 +964,7 @@ class GrowCtx : public GlowCtx { ...@@ -964,6 +964,7 @@ class GrowCtx : public GlowCtx {
void (*redraw_callback)( void *); //!< Backcall function before drawing (if ctx is window component). void (*redraw_callback)( void *); //!< Backcall function before drawing (if ctx is window component).
void *redraw_data; //!< Data for redraw callback. void *redraw_data; //!< Data for redraw callback.
int has_subwindows; //!< Graph contains subwindow objects (GrowWindow or GrowFolder) int has_subwindows; //!< Graph contains subwindow objects (GrowWindow or GrowFolder)
int is_subwindow; //!< Is a subwindow context.
char owner[256]; //!< Owner, used by application char owner[256]; //!< Owner, used by application
int bitmap_fonts; //!< Use bitmap fonts int bitmap_fonts; //!< Use bitmap fonts
glow_eEnv environment; //!< Environment Development or Runtime. glow_eEnv environment; //!< Environment Development or Runtime.
......
...@@ -298,10 +298,10 @@ void GrowWindow::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, vo ...@@ -298,10 +298,10 @@ void GrowWindow::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, vo
window_ctx->mw.zoom_factor_y = window_ctx->mw.subwindow_scale * w->zoom_factor_y; window_ctx->mw.zoom_factor_y = window_ctx->mw.subwindow_scale * w->zoom_factor_y;
// window_ctx->draw_buffer_only = ctx->draw_buffer_only; // window_ctx->draw_buffer_only = ctx->draw_buffer_only;
ctx->gdraw->push_customcolors( window_ctx->customcolors);
if ( fill) if ( fill)
ctx->gdraw->fill_rect( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, fill_drawtype); ctx->gdraw->fill_rect( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, fill_drawtype);
ctx->gdraw->push_customcolors( window_ctx->customcolors);
window_ctx->draw( &window_ctx->mw, ll_x, ll_y, ur_x, ur_y); window_ctx->draw( &window_ctx->mw, ll_x, ll_y, ur_x, ur_y);
ctx->gdraw->pop_customcolors(); ctx->gdraw->pop_customcolors();
} }
...@@ -903,6 +903,7 @@ void GrowWindow::new_ctx() ...@@ -903,6 +903,7 @@ void GrowWindow::new_ctx()
window_ctx = new GrowCtx( "WindowComponent", ctx->mw.zoom_factor_x * window_scale); window_ctx = new GrowCtx( "WindowComponent", ctx->mw.zoom_factor_x * window_scale);
window_ctx->gdraw = ctx->gdraw; window_ctx->gdraw = ctx->gdraw;
window_ctx->is_subwindow = 1;
window_ctx->mw.window = ctx->mw.window; window_ctx->mw.window = ctx->mw.window;
window_ctx->navw.window = ctx->navw.window; window_ctx->navw.window = ctx->navw.window;
window_ctx->userdata_save_callback = ctx->userdata_save_callback; window_ctx->userdata_save_callback = ctx->userdata_save_callback;
......
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