Commit 8517ac9f authored by Claes Sjofors's avatar Claes Sjofors

Multiview command 'set subwindow on own graph bugfix (refs #163)

parent f5325312
...@@ -9122,12 +9122,18 @@ plant and node hierarchy. ...@@ -9122,12 +9122,18 @@ plant and node hierarchy.
<TOPIC> set subwindow <style> function <TOPIC> set subwindow <style> function
Command set subwindow Command set subwindow
Open a graph in a window object in a previously opened graph. Open a graph in a window object in a previously opened graph, or
exchange a graph in a multiview cell.
<B>wtt> set subwindow 'graph' /name= /source= <B>wtt> set subwindow 'graph' /name= /source=
<B>wtt> set subwindow 'multiview-object' /name= /source= [/continue]
/name <t>Name of the window object. /name <t>Name of the window object.
/source <t>Name of graph that is to be opened in the window object. /source <t>Name of graph that is to be opened in the window object or
<t>in the multiview cell.
/continue <t>Can be used if the command is executed from a Ge button with
<t>other dynamics to execute. Should not be used if the graph
<t>with the button itself is exchanged.
</TOPIC> </TOPIC>
<TOPIC> set template <style> function <TOPIC> set template <style> function
......
...@@ -9009,12 +9009,17 @@ nod hierarkin. ...@@ -9009,12 +9009,17 @@ nod hierarkin.
<TOPIC> set subwindow <style> function <TOPIC> set subwindow <style> function
Kommando set subwindow Kommando set subwindow
Öppna en graf i ett window objekt i en tidigare öppnad graf. Öppna en graf i ett window objekt i en tidigare öppnad graf, eller
skifta graf i en multiwindow cell.
<B>wtt> set subwindow 'graph' /name= /source= <B>wtt> set subwindow 'graph' /name= /source=
<B>wtt> set subwindow 'multiview-object' /name= /source= [/continue]
/name <t>Namn på window objektet. /name <t>Namn på window objektet.
/source <t>Namn på grafen som ska öppnas i window objektet. /source <t>Namn på grafen som ska öppnas i window objektet.
/continue <t>Kan användas om kommandot exekveras från en Ge knapp
<t>med annan dynamik som ska exekveras. Ska inte användas
<t>om grafen med knappen själv skiftas.
</TOPIC> </TOPIC>
<TOPIC> set template <style> function <TOPIC> set template <style> function
......
...@@ -63,6 +63,7 @@ typedef void *Widget; ...@@ -63,6 +63,7 @@ typedef void *Widget;
#include "xtt_log.h" #include "xtt_log.h"
#include "pwr_baseclasses.h" #include "pwr_baseclasses.h"
#include "rt_xnav_msg.h" #include "rt_xnav_msg.h"
#include "glow_msg.h"
gboolean XttMultiViewGtk::action_inputfocus( GtkWidget *w, GdkEvent *event, gpointer data) gboolean XttMultiViewGtk::action_inputfocus( GtkWidget *w, GdkEvent *event, gpointer data)
{ {
...@@ -406,7 +407,7 @@ void *XttMultiViewGtk::get_widget() ...@@ -406,7 +407,7 @@ void *XttMultiViewGtk::get_widget()
} }
int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char *object, int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char *object,
int insert) int insert, int cont)
{ {
pwr_sClass_XttMultiView mv; pwr_sClass_XttMultiView mv;
pwr_tStatus sts; pwr_tStatus sts;
...@@ -546,6 +547,9 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char ...@@ -546,6 +547,9 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char
} }
} }
} }
return 1; if ( cont)
return 1;
else
return GLOW__TERMINATED;
} }
...@@ -72,7 +72,7 @@ class XttMultiViewGtk : public XttMultiView { ...@@ -72,7 +72,7 @@ class XttMultiViewGtk : public XttMultiView {
void create_confirm_dialog(); void create_confirm_dialog();
void confirm_reply( int ok); void confirm_reply( int ok);
void *get_widget(); void *get_widget();
int set_subwindow_source( const char *name, char *source, char *object, int insert = 1); int set_subwindow_source( const char *name, char *source, char *object, int insert = 1, int more = 0);
static void ge_change_value_cb( void *ge_ctx, void *value_object, char *text); static void ge_change_value_cb( void *ge_ctx, void *value_object, char *text);
static void confirm_cb( void *ge_ctx, void *confirm_object, char *text); static void confirm_cb( void *ge_ctx, void *confirm_object, char *text);
......
...@@ -104,7 +104,7 @@ class XttMultiView { ...@@ -104,7 +104,7 @@ class XttMultiView {
virtual void pop() {} virtual void pop() {}
virtual void set_size( int width, int height) {} virtual void set_size( int width, int height) {}
virtual void *get_widget() { return 0;} virtual void *get_widget() { return 0;}
virtual int set_subwindow_source( const char *name, char *source, char *object, int insert = 1) {return 0;} virtual int set_subwindow_source( const char *name, char *source, char *object, int insert = 1, int cont = 0) {return 0;}
void message( char severity, const char *msg); void message( char severity, const char *msg);
int set_object_focus( const char *name, int empty); int set_object_focus( const char *name, int empty);
......
...@@ -354,7 +354,7 @@ dcli_tCmdTable xnav_command_table[] = { ...@@ -354,7 +354,7 @@ dcli_tCmdTable xnav_command_table[] = {
"SET", "SET",
&xnav_set_func, &xnav_set_func,
{ "dcli_arg1", "dcli_arg2", "/NAME", "/VALUE", { "dcli_arg1", "dcli_arg2", "/NAME", "/VALUE",
"/BYPASS", "/INDEX", "/SOURCE", "/OBJECT", ""} "/BYPASS", "/INDEX", "/SOURCE", "/OBJECT", "/CONTINUE", ""}
}, },
{ {
"SETUP", "SETUP",
...@@ -842,6 +842,7 @@ static int xnav_set_func( void *client_data, ...@@ -842,6 +842,7 @@ static int xnav_set_func( void *client_data,
pwr_tOName object_str; pwr_tOName object_str;
char *object_p; char *object_p;
pwr_tOName source_str; pwr_tOName source_str;
int cont;
if ( EVEN( dcli_get_qualifier( "dcli_arg2", graph_str, sizeof(graph_str)))) { if ( EVEN( dcli_get_qualifier( "dcli_arg2", graph_str, sizeof(graph_str)))) {
xnav->message('E', "Graph name is missing"); xnav->message('E', "Graph name is missing");
...@@ -866,6 +867,8 @@ static int xnav_set_func( void *client_data, ...@@ -866,6 +867,8 @@ static int xnav_set_func( void *client_data,
if ( object_p) if ( object_p)
xnav_replace_node_str( object_p, object_p); xnav_replace_node_str( object_p, object_p);
cont = ODD( dcli_get_qualifier( "/CONTINUE", 0, 0));
if ( xnav->appl.find_graph( graph_str, 0, (void **) &gectx)) { if ( xnav->appl.find_graph( graph_str, 0, (void **) &gectx)) {
return gectx->set_subwindow_source( name_str, source_str, object_p); return gectx->set_subwindow_source( name_str, source_str, object_p);
} }
...@@ -877,7 +880,7 @@ static int xnav_set_func( void *client_data, ...@@ -877,7 +880,7 @@ static int xnav_set_func( void *client_data,
sts = gdh_NameToAttrref( pwr_cNObjid, graph_str, &aref); sts = gdh_NameToAttrref( pwr_cNObjid, graph_str, &aref);
if ( ODD(sts) && xnav->appl.find( applist_eType_MultiView, &aref, (void **) &mvctx)) { if ( ODD(sts) && xnav->appl.find( applist_eType_MultiView, &aref, (void **) &mvctx)) {
return mvctx->set_subwindow_source( name_str, source_str, object_p); return mvctx->set_subwindow_source( name_str, source_str, object_p, cont);
} }
else { else {
xnav->message('E', "Graph is not open"); xnav->message('E', "Graph is not open");
......
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