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
a XttGraph object. To close a graph from a button inside the graph
$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=
/object <t>A XttGraph-object. If the namestring begins with '*', * is
<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> close multiview <style> function
......
......@@ -2257,12 +2257,13 @@ Kommando close graph
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=
/object <t>Ett XttGraph-objekt. Om namnsträngen börjar med '*', ersätts * med
<t>nodeobjektet.
/instance <t>Stänger objektsbilden för angiven instans.
/iconify <t>Grafen blir ikoniserad istället för stängd.
</TOPIC>
<TOPIC> close alarmlist <style> function
......
......@@ -286,6 +286,11 @@ void XttGeGtk::pop()
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)
{
XttGeGtk::activate_exit(w, ge);
......@@ -581,4 +586,4 @@ void XttGeGtk::create_confirm_dialog()
gtk_box_pack_end( GTK_BOX(confirm_vbox), confirm_hboxbuttons, FALSE, FALSE, 15);
gtk_container_add( GTK_CONTAINER(confirm_widget), confirm_vbox);
gtk_widget_show_all( confirm_widget);
}
\ No newline at end of file
}
......@@ -75,6 +75,7 @@ class XttGeGtk : public XttGe {
~XttGeGtk();
void pop();
void iconify();
void set_size( int width, int height);
void create_confirm_dialog();
void confirm_reply( int ok);
......@@ -104,4 +105,4 @@ class XttGeGtk : public XttGe {
};
#endif
\ No newline at end of file
#endif
......@@ -87,6 +87,7 @@ class XttGe : XttUtility {
virtual ~XttGe();
virtual void pop() {}
virtual void iconify() {}
virtual void set_size( int width, int height) {}
virtual void confirm_reply( int ok) {}
virtual void *get_widget() { return 0;}
......@@ -129,4 +130,4 @@ class XttGe : XttUtility {
static void eventlog_enable( int enable);
};
#endif
\ No newline at end of file
#endif
......@@ -557,7 +557,7 @@ class XNav {
const char *focus, int inputempty, int use_default_access,
unsigned int access, unsigned int options, void *basewidget,
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,
char *focus, int inputempty, int use_default_access,
unsigned int access, unsigned int options, void *basewidget);
......@@ -677,4 +677,4 @@ int xnav_call_method_cb( void *xnav, const char *method, const char *filter,
void xnav_start_trace_cb( void *xnav, pwr_tObjid objid, char *name);
int xnav_get_trace_attr( pwr_sAttrRef *arp, char *attr);
#endif
\ No newline at end of file
#endif
......@@ -296,7 +296,8 @@ dcli_tCmdTable xnav_command_table[] = {
"CLOSE",
&xnav_close_func,
{ "dcli_arg1", "dcli_arg2", "/NAME", "/OBJECT",
"/INSTANCE", "/CLASSGRAPH", "/ALL", "/EXCEPT", "/MVEXCEPT" ""}
"/INSTANCE", "/CLASSGRAPH", "/ALL", "/EXCEPT", "/MVEXCEPT",
"/ICONIFY", ""}
},
{
"CREATE",
......@@ -5200,6 +5201,9 @@ static int xnav_close_func( void *client_data,
pwr_tAName instance_str;
char *instance_p;
int classgraph;
int iconify;
iconify = ODD( dcli_get_qualifier( "/ICONIFY", 0, 0));
if ( ODD( dcli_get_qualifier( "/INSTANCE", instance_str, sizeof(instance_str))))
instance_p = instance_str;
......@@ -5242,7 +5246,7 @@ static int xnav_close_func( void *client_data,
cdh_ToLower( action, xttgraph_p->Action);
if ( (s = strstr( action, ".pwg"))) {
*s = 0;
xnav->close_graph( action, 0);
xnav->close_graph( action, 0, iconify);
}
}
else
......@@ -5285,9 +5289,13 @@ static int xnav_close_func( void *client_data,
if ( cdh_NoCaseStrcmp(file_str, "$current") == 0) {
if ( xnav->current_cmd_ctx) {
xnav->appl.remove( (void *)xnav->current_cmd_ctx);
delete (XttGe *)xnav->current_cmd_ctx;
return GLOW__TERMINATED;
if ( iconify)
((XttGe *)xnav->current_cmd_ctx)->iconify();
else {
xnav->appl.remove( (void *)xnav->current_cmd_ctx);
delete (XttGe *)xnav->current_cmd_ctx;
return GLOW__TERMINATED;
}
}
else {
xnav->message('E', "No current graph");
......@@ -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;
}
}
......@@ -5535,7 +5543,7 @@ static int xnav_close_func( void *client_data,
continue;
}
next_elem = elem->next;
xnav->close_graph( elem->name, elem->instance);
xnav->close_graph( elem->name, elem->instance, 0);
elem = next_elem;
continue;
}
......@@ -9900,13 +9908,16 @@ 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;
if ( appl.find( applist_eType_Graph, filename, object_name,
(void **) &gectx)) {
delete gectx;
if ( iconify)
gectx->iconify();
else
delete gectx;
}
}
......@@ -10711,4 +10722,4 @@ static int xnav_replace_node_str( char *out, char *object_str)
if ( out != object_str)
strcpy( out, object_str);
return 0;
}
\ No newline at end of file
}
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