Commit 45386425 authored by Claes Sjofors's avatar Claes Sjofors

Xtt command, /iconfify added to 'close graph'

parent 916f1880
...@@ -2435,12 +2435,13 @@ Close a ge graph. The graph can be supplied as a pwg-file or as ...@@ -2435,12 +2435,13 @@ Close a ge graph. The graph can be supplied as a pwg-file or as
a XttGraph object. To close a graph from a button inside the graph a XttGraph object. To close a graph from a button inside the graph
$current can be used, 'close graph $current'. $current can be used, 'close graph $current'.
<B>xtt> close graph 'filename' /instance= <B>xtt> close graph 'filename' [/instance=] [/iconify]
<B>xtt> close graph /object= <B>xtt> close graph /object=
/object <t>A XttGraph-object. If the namestring begins with '*', * is /object <t>A XttGraph-object. If the namestring begins with '*', * is
<t>replaced by the node object. <t>replaced by the node object.
/instance <t>Open the class graph for this instance. /instance <t>Close the class graph for this instance.
/iconify <t>The graph is iconified instead of closed.
</TOPIC> </TOPIC>
<TOPIC> close multiview <style> function <TOPIC> close multiview <style> function
......
...@@ -2257,12 +2257,13 @@ Kommando close graph ...@@ -2257,12 +2257,13 @@ Kommando close graph
Stäng en Ge graf. Grafen kan anges som en pwg-fil eller med ett XttGraph objekt. Stäng en Ge graf. Grafen kan anges som en pwg-fil eller med ett XttGraph objekt.
<B>xtt> close graph 'filename' /instance= <B>xtt> close graph 'filename' [/instance=] [/iconify]
<B>xtt> close graph /object= <B>xtt> close graph /object=
/object <t>Ett XttGraph-objekt. Om namnsträngen börjar med '*', ersätts * med /object <t>Ett XttGraph-objekt. Om namnsträngen börjar med '*', ersätts * med
<t>nodeobjektet. <t>nodeobjektet.
/instance <t>Stänger objektsbilden för angiven instans. /instance <t>Stänger objektsbilden för angiven instans.
/iconify <t>Grafen blir ikoniserad istället för stängd.
</TOPIC> </TOPIC>
<TOPIC> close alarmlist <style> function <TOPIC> close alarmlist <style> function
......
...@@ -286,6 +286,11 @@ void XttGeGtk::pop() ...@@ -286,6 +286,11 @@ void XttGeGtk::pop()
gtk_window_present( GTK_WINDOW(toplevel)); gtk_window_present( GTK_WINDOW(toplevel));
} }
void XttGeGtk::iconify()
{
gtk_window_iconify( GTK_WINDOW(toplevel));
}
static gint delete_event( GtkWidget *w, GdkEvent *event, gpointer ge) static gint delete_event( GtkWidget *w, GdkEvent *event, gpointer ge)
{ {
XttGeGtk::activate_exit(w, ge); XttGeGtk::activate_exit(w, ge);
......
...@@ -75,6 +75,7 @@ class XttGeGtk : public XttGe { ...@@ -75,6 +75,7 @@ class XttGeGtk : public XttGe {
~XttGeGtk(); ~XttGeGtk();
void pop(); void pop();
void iconify();
void set_size( int width, int height); void set_size( int width, int height);
void create_confirm_dialog(); void create_confirm_dialog();
void confirm_reply( int ok); void confirm_reply( int ok);
......
...@@ -87,6 +87,7 @@ class XttGe : XttUtility { ...@@ -87,6 +87,7 @@ class XttGe : XttUtility {
virtual ~XttGe(); virtual ~XttGe();
virtual void pop() {} virtual void pop() {}
virtual void iconify() {}
virtual void set_size( int width, int height) {} virtual void set_size( int width, int height) {}
virtual void confirm_reply( int ok) {} virtual void confirm_reply( int ok) {}
virtual void *get_widget() { return 0;} virtual void *get_widget() { return 0;}
......
...@@ -557,7 +557,7 @@ class XNav { ...@@ -557,7 +557,7 @@ class XNav {
const char *focus, int inputempty, int use_default_access, const char *focus, int inputempty, int use_default_access,
unsigned int access, unsigned int options, void *basewidget, unsigned int access, unsigned int options, void *basewidget,
double *borders); double *borders);
void close_graph( char *filename, char *object_name); void close_graph( char *filename, char *object_name, int iconify);
int exec_xttgraph( pwr_tObjid xttgraph, char *instance, int exec_xttgraph( pwr_tObjid xttgraph, char *instance,
char *focus, int inputempty, int use_default_access, char *focus, int inputempty, int use_default_access,
unsigned int access, unsigned int options, void *basewidget); unsigned int access, unsigned int options, void *basewidget);
......
...@@ -296,7 +296,8 @@ dcli_tCmdTable xnav_command_table[] = { ...@@ -296,7 +296,8 @@ dcli_tCmdTable xnav_command_table[] = {
"CLOSE", "CLOSE",
&xnav_close_func, &xnav_close_func,
{ "dcli_arg1", "dcli_arg2", "/NAME", "/OBJECT", { "dcli_arg1", "dcli_arg2", "/NAME", "/OBJECT",
"/INSTANCE", "/CLASSGRAPH", "/ALL", "/EXCEPT", "/MVEXCEPT" ""} "/INSTANCE", "/CLASSGRAPH", "/ALL", "/EXCEPT", "/MVEXCEPT",
"/ICONIFY", ""}
}, },
{ {
"CREATE", "CREATE",
...@@ -5200,6 +5201,9 @@ static int xnav_close_func( void *client_data, ...@@ -5200,6 +5201,9 @@ static int xnav_close_func( void *client_data,
pwr_tAName instance_str; pwr_tAName instance_str;
char *instance_p; char *instance_p;
int classgraph; int classgraph;
int iconify;
iconify = ODD( dcli_get_qualifier( "/ICONIFY", 0, 0));
if ( ODD( dcli_get_qualifier( "/INSTANCE", instance_str, sizeof(instance_str)))) if ( ODD( dcli_get_qualifier( "/INSTANCE", instance_str, sizeof(instance_str))))
instance_p = instance_str; instance_p = instance_str;
...@@ -5242,7 +5246,7 @@ static int xnav_close_func( void *client_data, ...@@ -5242,7 +5246,7 @@ static int xnav_close_func( void *client_data,
cdh_ToLower( action, xttgraph_p->Action); cdh_ToLower( action, xttgraph_p->Action);
if ( (s = strstr( action, ".pwg"))) { if ( (s = strstr( action, ".pwg"))) {
*s = 0; *s = 0;
xnav->close_graph( action, 0); xnav->close_graph( action, 0, iconify);
} }
} }
else else
...@@ -5285,10 +5289,14 @@ static int xnav_close_func( void *client_data, ...@@ -5285,10 +5289,14 @@ static int xnav_close_func( void *client_data,
if ( cdh_NoCaseStrcmp(file_str, "$current") == 0) { if ( cdh_NoCaseStrcmp(file_str, "$current") == 0) {
if ( xnav->current_cmd_ctx) { if ( xnav->current_cmd_ctx) {
if ( iconify)
((XttGe *)xnav->current_cmd_ctx)->iconify();
else {
xnav->appl.remove( (void *)xnav->current_cmd_ctx); xnav->appl.remove( (void *)xnav->current_cmd_ctx);
delete (XttGe *)xnav->current_cmd_ctx; delete (XttGe *)xnav->current_cmd_ctx;
return GLOW__TERMINATED; return GLOW__TERMINATED;
} }
}
else { else {
xnav->message('E', "No current graph"); xnav->message('E', "No current graph");
return XNAV__SUCCESS; return XNAV__SUCCESS;
...@@ -5296,7 +5304,7 @@ static int xnav_close_func( void *client_data, ...@@ -5296,7 +5304,7 @@ static int xnav_close_func( void *client_data,
} }
xnav->close_graph( file_str, instance_p); xnav->close_graph( file_str, instance_p, iconify);
return XNAV__SUCCESS; return XNAV__SUCCESS;
} }
} }
...@@ -5535,7 +5543,7 @@ static int xnav_close_func( void *client_data, ...@@ -5535,7 +5543,7 @@ static int xnav_close_func( void *client_data,
continue; continue;
} }
next_elem = elem->next; next_elem = elem->next;
xnav->close_graph( elem->name, elem->instance); xnav->close_graph( elem->name, elem->instance, 0);
elem = next_elem; elem = next_elem;
continue; continue;
} }
...@@ -9900,12 +9908,15 @@ void XNav::open_graph( const char *name, const char *filename, int scrollbar, in ...@@ -9900,12 +9908,15 @@ void XNav::open_graph( const char *name, const char *filename, int scrollbar, in
} }
} }
void XNav::close_graph( char *filename, char *object_name) void XNav::close_graph( char *filename, char *object_name, int iconify)
{ {
XttGe *gectx; XttGe *gectx;
if ( appl.find( applist_eType_Graph, filename, object_name, if ( appl.find( applist_eType_Graph, filename, object_name,
(void **) &gectx)) { (void **) &gectx)) {
if ( iconify)
gectx->iconify();
else
delete gectx; delete gectx;
} }
} }
......
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