Commit c389321d authored by claes's avatar claes

Open Subwindow added to menu

parent b5e6968e
/*
* Proview $Id: rt_trace_gtk.cpp,v 1.4 2007-06-29 12:51:42 claes Exp $
* Proview $Id: rt_trace_gtk.cpp,v 1.5 2007-12-03 14:51:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -105,6 +105,13 @@ void RtTraceGtk::activate_open_object(GtkWidget *w, gpointer data)
tractx->activate_open_object();
}
void RtTraceGtk::activate_open_subwindow(GtkWidget *w, gpointer data)
{
RtTrace *tractx = (RtTrace *)data;
tractx->activate_open_subwindow();
}
void RtTraceGtk::activate_show_cross(GtkWidget *w, gpointer data)
{
RtTrace *tractx = (RtTrace *)data;
......@@ -403,6 +410,13 @@ RtTraceGtk::RtTraceGtk( void *tr_parent_ctx, GtkWidget *tr_parent_wid, pwr_tObji
'a', GdkModifierType(GDK_CONTROL_MASK),
GTK_ACCEL_VISIBLE);
GtkWidget *functions_open_subwindow = gtk_menu_item_new_with_mnemonic( "Open S_ubwindow");
g_signal_connect( functions_open_subwindow, "activate",
G_CALLBACK(activate_open_subwindow), this);
gtk_widget_add_accelerator( functions_open_subwindow, "activate", accel_g,
'l', GdkModifierType(GDK_CONTROL_MASK),
GTK_ACCEL_VISIBLE);
GtkWidget *functions_display_object = gtk_menu_item_new_with_mnemonic( "_Display object in Navigator");
g_signal_connect( functions_display_object, "activate",
G_CALLBACK(activate_display_object), this);
......@@ -433,6 +447,7 @@ RtTraceGtk::RtTraceGtk( void *tr_parent_ctx, GtkWidget *tr_parent_wid, pwr_tObji
GtkMenu *functions_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_open_object);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_open_subwindow);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_display_object);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_show_cross);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_open_classgraph);
......
/*
* Proview $Id: rt_trace_gtk.h,v 1.1 2007-01-04 07:52:30 claes Exp $
* Proview $Id: rt_trace_gtk.h,v 1.2 2007-12-03 14:51:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -52,6 +52,7 @@ class RtTraceGtk : public RtTrace {
static void activate_display_object(GtkWidget *w, gpointer data);
static void activate_collect_insert(GtkWidget *w, gpointer data);
static void activate_open_object(GtkWidget *w, gpointer data);
static void activate_open_subwindow(GtkWidget *w, gpointer data);
static void activate_show_cross(GtkWidget *w, gpointer data);
static void activate_open_classgraph(GtkWidget *w, gpointer data);
static void activate_trace(GtkWidget *w, gpointer data);
......
/*
* Proview $Id: rt_trace.cpp,v 1.4 2007-11-30 08:21:48 claes Exp $
* Proview $Id: rt_trace.cpp,v 1.5 2007-12-03 14:51:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -437,6 +437,49 @@ void RtTrace::activate_open_object()
}
}
void RtTrace::activate_open_subwindow()
{
flow_tObject node;
pwr_tObjid objid;
pwr_tStatus sts;
RtTrace *new_tractx;
trace_tNode *nnode;
sts = get_selected_node( &node);
if (EVEN(sts)) return;
sts = get_objid( node, &objid);
if (EVEN(sts)) return;
/* Should check for ordercond or orderact window... */
sts = gdh_GetChild( objid, &objid);
if ( EVEN(sts)) return;
if ( subwindow_cb) {
// The parent context will start the subwindow
(subwindow_cb)( parent_ctx, objid);
}
else {
new_tractx = subwindow_new( this, objid, &sts);
if ( ODD(sts)) {
new_tractx->close_cb = trace_close_cb;
new_tractx->help_cb = help_cb;
new_tractx->display_object_cb = display_object_cb;
new_tractx->collect_insert_cb = collect_insert_cb;
new_tractx->is_authorized_cb = is_authorized_cb;
nnode = trace_list;
trace_list = (trace_tNode *) malloc(sizeof(trace_tNode));
trace_list->Next = nnode;
trace_list->tractx = new_tractx;
}
else
delete new_tractx;
}
}
void RtTrace::activate_show_cross()
{
flow_tObject node;
......
/*
* Proview $Id: rt_trace.h,v 1.9 2007-01-04 07:52:31 claes Exp $
* Proview $Id: rt_trace.h,v 1.10 2007-12-03 14:51:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -99,6 +99,7 @@ class RtTrace {
void activate_display_object();
void activate_collect_insert();
void activate_open_object();
void activate_open_subwindow();
void activate_show_cross();
void activate_open_classgraph();
void activate_trace();
......
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