Commit 67243729 authored by Claes Sjofors's avatar Claes Sjofors

Ge, set subwindow fix

parent d28b2480
...@@ -4386,8 +4386,9 @@ int Graph::set_subwindow_source( const char *name, char *source, char *owner) ...@@ -4386,8 +4386,9 @@ int Graph::set_subwindow_source( const char *name, char *source, char *owner)
if ( ctx != grow->ctx) if ( ctx != grow->ctx)
grow->pop(ctx); grow->pop(ctx);
if ( sts)
return GLOW__SUBTERMINATED; return GLOW__SUBTERMINATED;
// return sts; return 1;
} }
int Graph::sound( pwr_tAttrRef *aref) int Graph::sound( pwr_tAttrRef *aref)
......
...@@ -1968,7 +1968,7 @@ int GrowCtx::event_handler( glow_eEvent event, int x, int y, int w, int h) ...@@ -1968,7 +1968,7 @@ int GrowCtx::event_handler( glow_eEvent event, int x, int y, int w, int h)
if ( callback_object_type != glow_eObjectType_NoObject) if ( callback_object_type != glow_eObjectType_NoObject)
e.object.object = callback_object; e.object.object = callback_object;
sts = event_callback[event]( this, &e); sts = event_callback[event]( this, &e);
if ( sts == GLOW__TERMINATED) if ( sts == GLOW__TERMINATED || sts == GLOW__SUBTERMINATED)
return sts; return sts;
} }
return 1; return 1;
......
...@@ -694,6 +694,10 @@ int GrowWindow::event_handler( GlowWind *w, glow_eEvent event, int x, int y, dou ...@@ -694,6 +694,10 @@ int GrowWindow::event_handler( GlowWind *w, glow_eEvent event, int x, int y, dou
sts = window_ctx->event_handler( event, x, y, 0, 0); sts = window_ctx->event_handler( event, x, y, 0, 0);
if ( sts == GLOW__TERMINATED) if ( sts == GLOW__TERMINATED)
return sts; return sts;
else if (sts == GLOW__SUBTERMINATED) {
ctx->gdraw->pop_customcolors();
return 1;
}
window_ctx->redraw_callback = 0; window_ctx->redraw_callback = 0;
window_ctx->redraw_data = 0; window_ctx->redraw_data = 0;
...@@ -732,8 +736,10 @@ void GrowWindow::set_input_focus( int focus, glow_eEvent event) ...@@ -732,8 +736,10 @@ void GrowWindow::set_input_focus( int focus, glow_eEvent event)
} }
} }
void GrowWindow::update_attributes() int GrowWindow::update_attributes()
{ {
int sts = 0;
if ( strcmp( input_file_name, file_name) != 0 || if ( strcmp( input_file_name, file_name) != 0 ||
(window_ctx && strcmp( window_ctx->owner, owner) != 0)) { (window_ctx && strcmp( window_ctx->owner, owner) != 0)) {
// New graph, create new context // New graph, create new context
...@@ -762,6 +768,7 @@ void GrowWindow::update_attributes() ...@@ -762,6 +768,7 @@ void GrowWindow::update_attributes()
} }
strcpy( file_name, input_file_name); strcpy( file_name, input_file_name);
new_ctx(); new_ctx();
sts = 1;
//#if 0 //#if 0
ctx->gdraw->reset_clip_rectangle( &ctx->mw); ctx->gdraw->reset_clip_rectangle( &ctx->mw);
...@@ -780,6 +787,7 @@ void GrowWindow::update_attributes() ...@@ -780,6 +787,7 @@ void GrowWindow::update_attributes()
v_scrollbar->set_colors( scrollbar_bg_color, scrollbar_color); v_scrollbar->set_colors( scrollbar_bg_color, scrollbar_color);
if ( h_scrollbar) if ( h_scrollbar)
h_scrollbar->set_colors( scrollbar_bg_color, scrollbar_color); h_scrollbar->set_colors( scrollbar_bg_color, scrollbar_color);
return sts;
} }
void GrowWindow::set_transform_from_stored( GlowTransform *t) void GrowWindow::set_transform_from_stored( GlowTransform *t)
...@@ -1062,6 +1070,7 @@ int GrowWindow::get_background_object_limits(GlowTransform *t, ...@@ -1062,6 +1070,7 @@ int GrowWindow::get_background_object_limits(GlowTransform *t,
int GrowWindow::set_source( char *source, char *new_owner) int GrowWindow::set_source( char *source, char *new_owner)
{ {
int clip_removed = 0; int clip_removed = 0;
int sts;
if ( ctx->gdraw->clip_level( &ctx->mw)) { if ( ctx->gdraw->clip_level( &ctx->mw)) {
// Remove any clip // Remove any clip
...@@ -1072,7 +1081,7 @@ int GrowWindow::set_source( char *source, char *new_owner) ...@@ -1072,7 +1081,7 @@ int GrowWindow::set_source( char *source, char *new_owner)
strcpy( input_file_name, source); strcpy( input_file_name, source);
if ( new_owner) if ( new_owner)
strncpy( owner, new_owner, sizeof(owner)); strncpy( owner, new_owner, sizeof(owner));
update_attributes(); sts = update_attributes();
window_ctx->gdraw->push_customcolors( window_ctx->customcolors); window_ctx->gdraw->push_customcolors( window_ctx->customcolors);
draw(); draw();
...@@ -1082,5 +1091,5 @@ int GrowWindow::set_source( char *source, char *new_owner) ...@@ -1082,5 +1091,5 @@ int GrowWindow::set_source( char *source, char *new_owner)
// Set a clip to match the previous reset // Set a clip to match the previous reset
ctx->gdraw->set_clip_rectangle( &ctx->mw, 0, 0, ctx->mw.window_width, ctx->mw.window_height); ctx->gdraw->set_clip_rectangle( &ctx->mw, 0, 0, ctx->mw.window_width, ctx->mw.window_height);
return 1; return sts;
} }
...@@ -258,7 +258,7 @@ class GrowWindow : public GrowRect { ...@@ -258,7 +258,7 @@ class GrowWindow : public GrowRect {
double fy); double fy);
//! Check if new filename //! Check if new filename
void update_attributes(); int update_attributes();
//! Create a new grow context //! Create a new grow context
void new_ctx(); void new_ctx();
......
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