Commit 8abc2280 authored by Claes Sjofors's avatar Claes Sjofors

Xtt transent also works for trend, fast, sevhist, tcurve, multiview and login

parent 8dea9c42
......@@ -466,7 +466,7 @@ CoLogin *WNavGtk::login_new( const char *name,
void (* bc_cancel)( void *),
pwr_tStatus *status)
{
return new CoLoginGtk( this, parent_wid, name, groupname, bc_success, bc_cancel, status);
return new CoLoginGtk( this, parent_wid, name, groupname, bc_success, bc_cancel, 0, status);
}
WCrr *WNavGtk::wcrr_new( pwr_tAttrRef *aref, pwr_tStatus *status)
......
......@@ -45,6 +45,14 @@
#include "co_api.h"
#include "co_dcli.h"
void CoLoginGtk::pop()
{
gtk_editable_delete_text( GTK_EDITABLE(widgets.usernamevalue), 0, -1);
gtk_editable_delete_text( GTK_EDITABLE(widgets.passwordvalue), 0, -1);
gtk_window_present( GTK_WINDOW(widgets.toplevel));
}
//
// Callback from the pushbutton.
//
......@@ -104,6 +112,7 @@ CoLoginGtk::CoLoginGtk( void *wl_parent_ctx,
const char *wl_groupname,
void (* wl_bc_success)( void *),
void (* wl_bc_cancel)( void *),
void *basewidget,
pwr_tStatus *status) :
CoLogin(wl_parent_ctx,wl_name,wl_groupname,wl_bc_success,wl_bc_cancel,status),
parent_wid(wl_parent_wid)
......@@ -180,6 +189,9 @@ CoLoginGtk::CoLoginGtk( void *wl_parent_ctx,
gtk_widget_show_all( widgets.toplevel);
gtk_widget_grab_focus( widgets.usernamevalue);
if ( basewidget)
gtk_window_set_transient_for(GTK_WINDOW(widgets.toplevel), GTK_WINDOW(basewidget));
*status = 1;
}
......
......@@ -62,11 +62,13 @@ class CoLoginGtk : public CoLogin {
const char *wl_groupname,
void (* wl_bc_success)( void *),
void (* wl_bc_cancel)( void *),
void *base_widget,
pwr_tStatus *sts);
~CoLoginGtk();
pwr_tStatus get_values();
void message( const char *new_label);
void pop();
static void activate_ok( GtkWidget *w, gpointer data);
static void activate_cancel( GtkWidget *w, gpointer data);
......
......@@ -79,6 +79,7 @@ class CoLogin {
virtual pwr_tStatus get_values() {return 0;}
virtual void message( const char *new_label) {}
virtual void pop() {}
static pwr_tStatus user_check( const char *groupname, const char *username, const char *password);
static pwr_tStatus insert_login_info( const char *groupname, const char *password, const char *username,
......
......@@ -750,7 +750,8 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx,
int gc_width,
int gc_height,
unsigned int gc_options,
int gc_color_theme) :
int gc_color_theme,
void *basewidget) :
GeCurve( gc_parent_ctx, curve_name, filename, curve_data, pos_right,
gc_width, gc_height, gc_options, gc_color_theme),
minmax_widget(0), export_widget(0), disable_timecombo_callback(0), clock_cursor(0)
......@@ -1166,6 +1167,10 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx,
gtk_window_iconify( GTK_WINDOW(toplevel));
else if ( options & curve_mOptions_Invisible)
g_object_set( toplevel, "visible", FALSE, NULL);
if ( basewidget)
gtk_window_set_transient_for(GTK_WINDOW(toplevel), GTK_WINDOW(basewidget));
}
}
......
......@@ -49,7 +49,8 @@ class GeCurveGtk : public GeCurve {
public:
GeCurveGtk( void *gc_parent_ctx, GtkWidget *parent_widget, char *curve_name,
char *filename, GeCurveData *curve_data, int pos_right,
int gc_width, int gc_height, unsigned int gc_options, int gc_color_theme);
int gc_width, int gc_height, unsigned int gc_options, int gc_color_theme,
void *basewidget);
GtkWidget *parent_wid;
GtkWidget *grow_widget;
GtkWidget *curve_widget;
......
......@@ -70,7 +70,8 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
int width,
int height,
unsigned int options,
int xn_color_theme,
int xn_color_theme,
void *basewidget,
int *sts) :
XttFast( parent_ctx, name, fast_arp, xn_color_theme, sts), parent_widget(parent_wid)
{
......@@ -87,7 +88,7 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
gdh_AttrrefToName( fast_arp, title, sizeof(title), cdh_mNName);
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 0, width, height,
options, color_theme);
options, color_theme, basewidget);
curve->close_cb = fast_close_cb;
curve->help_cb = fast_help_cb;
curve->export_cb = fast_export_cb;
......@@ -104,7 +105,8 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
const char *name,
GtkWidget **w,
char *filename,
int xn_color_theme,
int xn_color_theme,
void *basewidget,
int *sts) :
XttFast( parent_ctx, name, filename, xn_color_theme, sts),
parent_widget(parent_wid)
......@@ -118,7 +120,7 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1, 0, 0, 0, color_theme);
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1, 0, 0, 0, color_theme, basewidget);
curve->close_cb = fast_close_cb;
curve->help_cb = fast_help_cb;
curve->enable(0);
......
......@@ -55,14 +55,16 @@ class XttFastGtk : public XttFast {
int width,
int height,
unsigned int xn_options,
int xn_color_theme,
int xn_color_theme,
void *basewidget,
int *sts);
XttFastGtk( void *parent_ctx,
GtkWidget *parent_wid,
const char *name,
GtkWidget **w,
char *filename,
int xn_color_theme,
int xn_color_theme,
void *basewidget,
int *sts);
~XttFastGtk();
};
......
......@@ -203,8 +203,8 @@ static void destroy_event( GtkWidget *w, gpointer data)
XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx, const char *mv_name,
pwr_tAttrRef *mv_aref, int mv_width, int mv_height,
int mv_x, int mv_y, unsigned int mv_options, int mv_color_theme,
pwr_tStatus *sts,
int mv_x, int mv_y, unsigned int mv_options, void *basewidget,
int mv_color_theme, pwr_tStatus *sts,
int (*mv_command_cb) (void *, char *, char *, void *),
int (*mv_get_current_objects_cb) (void *, pwr_sAttrRef **, int **),
int (*mv_is_authorized_cb) (void *, unsigned int),
......@@ -446,7 +446,7 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx,
mvctx[i*rows + j] = new XttMultiViewGtk( toplevel, this, "No title",
&graph_aref, w, h, mv_x, mv_y,
ge_mOptions_Embedded, color_theme, &lsts,
ge_mOptions_Embedded, 0, color_theme, &lsts,
multiview_ge_command_cb, multiview_ge_get_current_objects_cb,
multiview_ge_is_authorized_cb, multiview_keyboard_cb);
......@@ -497,14 +497,14 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx,
if ( plotgroup_found) {
trend[i*rows + j] = new XttTrendGtk( this, toplevel, (char *)"No title", &widget,
0, &plotgroup, w, h, (unsigned int)curve_mOptions_Embedded,
color_theme, sts);
color_theme, 0, sts);
}
else {
arefv[0] = mv.Action[i*rows+j].Object[0];
memset( &arefv[1], 0, sizeof(arefv[0]));
trend[i*rows + j] = new XttTrendGtk( this, toplevel, (char *)"No title", &widget,
arefv, 0, w, h, (unsigned int)curve_mOptions_Embedded,
color_theme, sts);
color_theme, 0, sts);
}
if ( EVEN(*sts)) break;
......@@ -701,7 +701,7 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx,
sevhist[i*rows + j] = new XttSevHistGtk( this, toplevel, (char *)"No title", &widget,
oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, w, h,
(unsigned int)curve_mOptions_Embedded, color_theme, sts);
(unsigned int)curve_mOptions_Embedded, color_theme, 0, sts);
if ( EVEN(*sts)) break;
sevhist[i*rows + j]->help_cb = multiview_trend_help_cb;
......@@ -892,11 +892,15 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx,
gtk_window_iconify( GTK_WINDOW(toplevel));
else if ( options & ge_mOptions_Invisible)
g_object_set( toplevel, "visible", FALSE, NULL);
if ( basewidget)
gtk_window_set_transient_for(GTK_WINDOW(toplevel), GTK_WINDOW(basewidget));
}
else {
gtk_widget_set_size_request( box_widget, window_width, window_height);
}
*sts = XNAV__SUCCESS;
}
......@@ -994,7 +998,7 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char
XttMultiViewGtk *ctx = new XttMultiViewGtk( toplevel, this, "No title",
&source_aref, w, h, x, y,
ge_mOptions_Embedded, color_theme, &sts,
ge_mOptions_Embedded, 0, color_theme, &sts,
multiview_ge_command_cb, multiview_ge_get_current_objects_cb,
multiview_ge_is_authorized_cb, multiview_keyboard_cb);
......@@ -1062,14 +1066,14 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char
if ( plotgroup_found) {
ctx = new XttTrendGtk( this, toplevel, (char *)"No title", &comp_w,
0, &plotgroup, w, h, (unsigned int)curve_mOptions_Embedded,
color_theme, &lsts);
color_theme, 0, &lsts);
}
else {
arefv[0] = object_aref;
memset( &arefv[1], 0, sizeof(arefv[0]));
ctx = new XttTrendGtk( this, toplevel, (char *)"No title", &comp_w,
arefv, 0, w, h, (unsigned int)curve_mOptions_Embedded,
color_theme, &lsts);
color_theme, 0, &lsts);
}
if ( EVEN(lsts)) break;
......@@ -1263,7 +1267,7 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char
ctx = new XttSevHistGtk( this, toplevel, (char *)"No title", &comp_w,
oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, w, h,
(unsigned int)curve_mOptions_Embedded, color_theme, &lsts);
(unsigned int)curve_mOptions_Embedded, color_theme, 0, &lsts);
if ( EVEN(lsts)) break;
ctx->help_cb = multiview_trend_help_cb;
......
......@@ -77,8 +77,8 @@ class XttMultiViewGtk : public XttMultiView {
CoWowFocusTimerGtk focustimer;
XttMultiViewGtk( GtkWidget *parent_wid, void *parent_ctx, const char *name, pwr_tAttrRef *aref,
int width, int height, int x, int y, unsigned int options, int color_theme,
pwr_tStatus *sts,
int width, int height, int x, int y, unsigned int options, void *basewidget,
int color_theme, pwr_tStatus *sts,
int (*mv_command_cb) (void *, char *, char *, void *),
int (*mv_get_current_objects_cb) (void *, pwr_sAttrRef **, int **),
int (*mv_is_authorized_cb) (void *, unsigned int),
......
......@@ -73,7 +73,8 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
int xn_width,
int xn_height,
unsigned int xn_options,
int xn_color_theme,
int xn_color_theme,
void *basewidget,
int *sts) :
XttSevHist( parent_ctx, name, xn_oidv, xn_anamev, xn_onamev, sevhistobjectv, xn_scctx, xn_color_theme, sts),
parent_widget(parent_wid)
......@@ -88,7 +89,7 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1,
xn_width, xn_height, xn_options, color_theme);
xn_width, xn_height, xn_options, color_theme, basewidget);
curve->close_cb = sevhist_close_cb;
curve->help_cb = sevhist_help_cb;
curve->increase_period_cb = sevhist_increase_period_cb;
......@@ -117,7 +118,8 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
const char *name,
GtkWidget **w,
char *filename,
int xn_color_theme,
int xn_color_theme,
void *basewidget,
int *sts) :
XttSevHist( parent_ctx, name, filename, xn_color_theme, sts),
parent_widget(parent_wid)
......@@ -131,7 +133,7 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1, 0, 0, 0, color_theme);
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1, 0, 0, 0, color_theme, basewidget);
curve->close_cb = sevhist_close_cb;
curve->help_cb = sevhist_help_cb;
curve->enable(0);
......
......@@ -59,14 +59,16 @@ class XttSevHistGtk : public XttSevHist {
int width,
int height,
unsigned int options,
int xn_color_theme,
int xn_color_theme,
void *basewidget,
int *sts);
XttSevHistGtk( void *parent_ctx,
GtkWidget *parent_wid,
const char *name,
GtkWidget **w,
char *filename,
int xn_color_theme,
int xn_color_theme,
void *basewidget,
int *sts);
~XttSevHistGtk();
};
......
......@@ -69,7 +69,8 @@ XttTCurveGtk::XttTCurveGtk( void *parent_ctx,
int xn_width,
int xn_height,
unsigned int xn_options,
int xn_color_theme,
int xn_color_theme,
void *basewidget,
int *sts) :
XttTCurve( parent_ctx, name, xn_arefv, xn_color_theme, sts),
parent_widget(parent_wid)
......@@ -84,7 +85,7 @@ XttTCurveGtk::XttTCurveGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1,
xn_width, xn_height, xn_options, color_theme);
xn_width, xn_height, xn_options, color_theme, basewidget);
curve->close_cb = tcurve_close_cb;
curve->help_cb = tcurve_help_cb;
curve->increase_period_cb = tcurve_increase_period_cb;
......
......@@ -55,7 +55,8 @@ class XttTCurveGtk : public XttTCurve {
int xn_width,
int xn_height,
unsigned int xn_options,
int xn_color_theme,
int xn_color_theme,
void *basewidget,
int *sts);
~XttTCurveGtk();
};
......
......@@ -69,7 +69,8 @@ XttTrendGtk::XttTrendGtk( void *parent_ctx,
int width,
int height,
unsigned int x_options,
int x_color_theme,
int x_color_theme,
void *basewidget,
int *sts) :
XttTrend( parent_ctx, name, trend_list, plotgroup, x_options, x_color_theme, sts),
parent_widget(parent_wid)
......@@ -79,7 +80,7 @@ XttTrendGtk::XttTrendGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, name, NULL, gcd, 1, width, height,
options, color_theme);
options, color_theme, basewidget);
curve->close_cb = trend_close_cb;
curve->help_cb = trend_help_cb;
curve->snapshot_cb = trend_snapshot_cb;
......
......@@ -57,6 +57,7 @@ class XttTrendGtk : public XttTrend {
int height,
unsigned int options,
int x_color_theme,
void *basewidget,
int *sts);
~XttTrendGtk();
};
......
......@@ -276,41 +276,45 @@ Op *XNavGtk::op_new( char *opplace, pwr_tStatus *sts)
}
XttTrend *XNavGtk::xtttrend_new( char *name, pwr_tAttrRef *objar, pwr_tAttrRef *plotgroup,
int width, int height, unsigned int options, int color_theme, pwr_tStatus *sts)
int width, int height, unsigned int options, int color_theme,
void *basewidget, pwr_tStatus *sts)
{
GtkWidget *w;
return new XttTrendGtk( this, parent_wid, name, &w, objar, plotgroup, width, height, options, color_theme, sts);
return new XttTrendGtk( this, parent_wid, name, &w, objar, plotgroup, width, height, options, color_theme,
basewidget, sts);
}
XttSevHist *XNavGtk::xttsevhist_new( char *name, pwr_tOid *oidv, pwr_tOName *anamev, pwr_tOName *onamev,
bool *sevhistobjectv, sevcli_tCtx scctx, char *filename,
int width, int height, unsigned int options, int color_theme, pwr_tStatus *sts)
int width, int height, unsigned int options, int color_theme,
void *basewidget, pwr_tStatus *sts)
{
GtkWidget *w;
if ( !filename)
return new XttSevHistGtk( this, parent_wid, name, &w, oidv, anamev, onamev, sevhistobjectv, scctx, width, height, options, color_theme, sts);
return new XttSevHistGtk( this, parent_wid, name, &w, oidv, anamev, onamev, sevhistobjectv, scctx, width, height, options, color_theme, basewidget, sts);
else
return new XttSevHistGtk( this, parent_wid, name, &w, filename, color_theme, sts);
return new XttSevHistGtk( this, parent_wid, name, &w, filename, color_theme, basewidget, sts);
}
XttTCurve *XNavGtk::xtttcurve_new( char *name, pwr_tAttrRef *arefv, int width, int height, unsigned int options, int color_theme, pwr_tStatus *sts)
XttTCurve *XNavGtk::xtttcurve_new( char *name, pwr_tAttrRef *arefv, int width, int height, unsigned int options, int color_theme, void *basewidget, pwr_tStatus *sts)
{
GtkWidget *w;
return new XttTCurveGtk( this, parent_wid, name, &w, arefv, width, height, options, color_theme, sts);
return new XttTCurveGtk( this, parent_wid, name, &w, arefv, width, height, options, color_theme, basewidget, sts);
}
XttFast *XNavGtk::xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height,
unsigned int options, char *filename, int color_theme, pwr_tStatus *sts)
unsigned int options, char *filename, int color_theme, void *basewidget,
pwr_tStatus *sts)
{
GtkWidget *w;
if ( !filename)
return new XttFastGtk( this, parent_wid, name, &w, objar, width, height, options, color_theme, sts);
return new XttFastGtk( this, parent_wid, name, &w, objar, width, height, options, color_theme, basewidget, sts);
else
return new XttFastGtk( this, parent_wid, name, &w, filename, color_theme, sts);
return new XttFastGtk( this, parent_wid, name, &w, filename, color_theme, basewidget, sts);
}
XAttOne *XNavGtk::xattone_new( pwr_tAttrRef *objar, char *title, unsigned int priv,
......@@ -342,14 +346,14 @@ XttGe *XNavGtk::xnav_ge_new( const char *name, const char *filename, int scrollb
XttMultiView *XNavGtk::multiview_new( const char *name, pwr_tAttrRef *aref,
int width, int height, int x, int y, unsigned int options,
int color_theme, pwr_tStatus *sts,
void *basewidget, int color_theme, pwr_tStatus *sts,
int (*command_cb) (void *, char *, char *, void *),
int (*get_current_objects_cb) (void *, pwr_sAttrRef **, int **),
int (*is_authorized_cb) (void *, unsigned int),
void (*keyboard_cb) (void *, void *, int, int))
{
return new XttMultiViewGtk( parent_wid, this, name, aref,
width, height, x, y, options, color_theme, sts, command_cb,
width, height, x, y, options, basewidget, color_theme, sts, command_cb,
get_current_objects_cb, is_authorized_cb, keyboard_cb);
}
......@@ -362,9 +366,10 @@ XttStream *XNavGtk::stream_new( const char *name, const char *uri,
}
GeCurve *XNavGtk::gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right, unsigned int options, int color_theme)
int pos_right, unsigned int options, int color_theme, void *basewidget)
{
return new GeCurveGtk( this, parent_wid, name, filename, data, pos_right, 0, 0, options, color_theme);
return new GeCurveGtk( this, parent_wid, name, filename, data, pos_right, 0, 0, options, color_theme,
basewidget);
}
XttFileview *XNavGtk::fileview_new( pwr_tOid oid, char *title, char *dir, char *pattern,
......@@ -378,9 +383,10 @@ CoLogin *XNavGtk::login_new( const char *name,
const char *groupname,
void (* bc_success)( void *),
void (* bc_cancel)( void *),
void *basewidget,
pwr_tStatus *status)
{
return new CoLoginGtk( this, parent_wid, name, groupname, bc_success, bc_cancel, status);
return new CoLoginGtk( this, parent_wid, name, groupname, bc_success, bc_cancel, basewidget, status);
}
XttKeyboard *XNavGtk::keyboard_new( const char *name, keyboard_eKeymap keymap, keyboard_eType type,
......
......@@ -77,15 +77,16 @@ class XNavGtk : public XNav {
pwr_tStatus *sts);
Op *op_new( char *opplace, pwr_tStatus *sts);
XttTrend *xtttrend_new( char *name, pwr_tAttrRef *objar, pwr_tAttrRef *plotgroup,
int width, int height, unsigned int options, int color_theme, pwr_tStatus *sts);
int width, int height, unsigned int options, int color_theme, void *basewidget,
pwr_tStatus *sts);
XttSevHist *xttsevhist_new( char *name, pwr_tOid *oidv, pwr_tOName *anamev,
pwr_tOName *onamev, bool *sevhistobjectv, sevcli_tCtx scctx,
char *filename, int width, int height, unsigned int options, int color_theme,
pwr_tStatus *sts);
void *basewidget, pwr_tStatus *sts);
XttTCurve *xtttcurve_new( char *name, pwr_tAttrRef *arefv, int width, int height, unsigned int options,
int color_theme, pwr_tStatus *sts);
int color_theme, void *basewidget, pwr_tStatus *sts);
XttFast *xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height, unsigned int options,
char *filename, int color_theme, pwr_tStatus *sts);
char *filename, int color_theme, void *basewidget, pwr_tStatus *sts);
XAttOne *xattone_new( pwr_tAttrRef *objar, char *title, unsigned int priv,
pwr_tStatus *sts);
CLog *clog_new( const char *name, pwr_tStatus *sts);
......@@ -100,7 +101,7 @@ class XNavGtk : public XNav {
void (*xg_keyboard_cb) (void *, void *, int, int));
XttMultiView *multiview_new( const char *name, pwr_tAttrRef *aref,
int width, int height, int x, int y, unsigned int options,
int color_theme, pwr_tStatus *sts,
void *basewidget, int color_theme, pwr_tStatus *sts,
int (*command_cb) (void *, char *, char *, void *),
int (*get_current_objects_cb) (void *, pwr_sAttrRef **, int **),
int (*is_authorized_cb) (void *, unsigned int),
......@@ -109,13 +110,14 @@ class XNavGtk : public XNav {
int width, int height, int x, int y, double scan_time,
unsigned int options, int embedded, pwr_tAttrRef *arp, pwr_tStatus *sts);
GeCurve *gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right, unsigned int options, int color_theme);
int pos_right, unsigned int options, int color_theme, void *basewidget);
XttFileview *fileview_new( pwr_tOid oid, char *title, char *dir, char *pattern,
int type, char *target_attr, char *trigger_attr, char *filetype);
CoLogin *login_new( const char *wl_name,
const char *wl_groupname,
void (* wl_bc_success)( void *),
void (* wl_bc_cancel)( void *),
void *basewidget,
pwr_tStatus *status);
XttKeyboard *keyboard_new( const char *name, keyboard_eKeymap keymap, keyboard_eType type,
int color_theme, pwr_tStatus *status);
......
......@@ -263,14 +263,16 @@ Op *XNavMotif::op_new( char *opplace, pwr_tStatus *sts)
}
XttTrend *XNavMotif::xtttrend_new( char *name, pwr_tAttrRef *objar, pwr_tAttrRef *plotgroup,
int width, int height, unsigned int options, pwr_tStatus *sts)
int width, int height, unsigned int options, void *basewidget,
pwr_tStatus *sts)
{
Widget w;
return new XttTrendMotif( this, parent_wid, name, &w, objar, plotgroup, width, height, options, sts);
}
XttFast *XNavMotif::xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height, unsigned int options, pwr_tStatus *sts)
XttFast *XNavMotif::xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height, unsigned int options,
void *basewidget, pwr_tStatus *sts)
{
Widget w;
......@@ -304,7 +306,7 @@ XttGe *XNavMotif::xnav_ge_new( const char *name, const char *filename, int scrol
}
GeCurve *XNavMotif::gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right, unsigned int options)
int pos_right, unsigned int options, basewidget)
{
return new GeCurveMotif( this, parent_wid, name, filename, data, pos_right, 0, 0, options);
}
......@@ -313,6 +315,7 @@ CoLogin *XNavMotif::login_new( const char *name,
const char *groupname,
void (* bc_success)( void *),
void (* bc_cancel)( void *),
void *basewidget,
pwr_tStatus *status)
{
return new CoLoginMotif( this, parent_wid, name, groupname, bc_success, bc_cancel, status);
......
......@@ -74,10 +74,10 @@ class XNavMotif : public XNav {
pwr_tStatus *sts);
Op *op_new( char *opplace, pwr_tStatus *sts);
XttTrend *xtttrend_new( char *name, pwr_tAttrRef *objar, pwr_tAttrRef *plotgroup,
int width, int height, unsigned int options,
int width, int height, unsigned int options, void *basewidget,
pwr_tStatus *sts);
XttFast *xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height,
unsigned int options, pwr_tStatus *sts);
unsigned int options, void *basewidget, pwr_tStatus *sts);
XAttOne *xattone_new( pwr_tAttrRef *objar, char *title, unsigned int priv,
pwr_tStatus *sts);
CLog *clog_new( const char *name, pwr_tStatus *sts);
......@@ -90,11 +90,12 @@ class XNavMotif : public XNav {
int (*xg_get_current_objects_cb) (void *, pwr_sAttrRef **, int **),
int (*xg_is_authorized_cb) (void *, unsigned int));
GeCurve *gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right, unsigned int options);
int pos_right, unsigned int options, void *basewidget);
CoLogin *login_new( const char *wl_name,
const char *wl_groupname,
void (* wl_bc_success)( void *),
void (* wl_bc_cancel)( void *),
void *basewidget,
pwr_tStatus *status);
void bell( int time);
void get_popup_menu( pwr_sAttrRef attrref,
......
......@@ -367,15 +367,15 @@ class XNav {
pwr_tStatus *sts) {return 0;}
virtual Op *op_new( char *opplace, pwr_tStatus *sts) {return 0;}
virtual XttTrend *xtttrend_new( char *name, pwr_tAttrRef *objar, pwr_tAttrRef *plotgroup,
int width, int height, unsigned int options, int color_theme, pwr_tStatus *sts) {return 0;}
int width, int height, unsigned int options, int color_theme, void *basewidget, pwr_tStatus *sts) {return 0;}
virtual XttSevHist *xttsevhist_new( char *name, pwr_tOid *oidv, pwr_tOName *aname,
pwr_tOName *oname, bool *sevhistobjectv, sevcli_tCtx scctx,
char *filename, int width, int height, unsigned int options,
int color_theme, pwr_tStatus *sts) {return 0;}
int color_theme, void *basewidget, pwr_tStatus *sts) {return 0;}
virtual XttTCurve *xtttcurve_new( char *name, pwr_tAttrRef *arefv, int width, int height, unsigned int options,
int color_theme, pwr_tStatus *sts) {return 0;}
int color_theme, void *basewidget, pwr_tStatus *sts) {return 0;}
virtual XttFast *xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height, unsigned int options,
char *filename, int color_theme, pwr_tStatus *sts) {return 0;}
char *filename, int color_theme, void *basewidget, pwr_tStatus *sts) {return 0;}
virtual XAttOne *xattone_new( pwr_tAttrRef *objar, char *title, unsigned int priv,
pwr_tStatus *sts) {return 0;}
virtual CLog *clog_new( const char *name, pwr_tStatus *sts) {return 0;}
......@@ -390,7 +390,7 @@ class XNav {
void (*xg_keyboard_cb) (void *, void *, int, int)) {return 0;}
virtual XttMultiView *multiview_new( const char *name, pwr_tAttrRef *aref,
int width, int height, int x, int y, unsigned int options,
int color_theme, pwr_tStatus *sts,
void *basewidget, int color_theme, pwr_tStatus *sts,
int (*command_cb) (void *, char *, char *, void *),
int (*get_current_objects_cb) (void *, pwr_sAttrRef **, int **),
int (*is_authorized_cb) (void *, unsigned int),
......@@ -399,7 +399,7 @@ class XNav {
int width, int height, int x, int y, double scan_time,
unsigned int options, int embedded, pwr_tAttrRef *arp, pwr_tStatus *sts) {return 0;}
virtual GeCurve *gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right, unsigned int options, int color_theme) {return 0;}
int pos_right, unsigned int options, int color_theme, void *basewidget) {return 0;}
virtual XttFileview *fileview_new( pwr_tOid oid, char *title, char *dir, char *pattern,
int type, char *target_attr, char *trigger_attr,
char *filetype) {return 0;}
......@@ -407,6 +407,7 @@ class XNav {
const char *wl_groupname,
void (* wl_bc_success)( void *),
void (* wl_bc_cancel)( void *),
void *basewidget,
pwr_tStatus *status) { return 0;}
virtual XttKeyboard *keyboard_new( const char *name, keyboard_eKeymap keymap, keyboard_eType type,
int color_theme, pwr_tStatus *status) {return 0;}
......
......@@ -661,6 +661,7 @@ static int xnav_login_func( void *client_data,
char systemgroup[80];
unsigned int priv;
char msg[120];
void *basewidget = 0;
sts = gdh_GetObjectInfo ( "pwrNode-System.SystemGroup", &systemgroup,
sizeof(systemgroup));
......@@ -668,9 +669,19 @@ static int xnav_login_func( void *client_data,
if ( EVEN( dcli_get_qualifier( "dcli_arg1", arg1_str, sizeof(arg1_str))))
{
xnav->cologin = xnav->login_new( "PwR Login", systemgroup, xnav_login_success_bc,
xnav_login_cancel_bc, &sts);
if ( xnav->cologin)
xnav->cologin->pop();
else {
if ( xnav->opplace_p->Options & pwr_mOpPlaceOptionsMask_AllMainTransient) {
if ( xnav->ge_main)
basewidget = xnav->ge_main->get_widget();
else if ( xnav->multiview_main)
basewidget = xnav->multiview_main->get_widget();
}
xnav->cologin = xnav->login_new( "PwR Login", systemgroup, xnav_login_success_bc,
xnav_login_cancel_bc, basewidget, &sts);
}
return 1;
}
if ( EVEN( dcli_get_qualifier( "dcli_arg2", arg2_str, sizeof(arg2_str))))
......@@ -3471,6 +3482,7 @@ static int xnav_open_func( void *client_data,
int nr;
pwr_tStatus sts;
pwr_tAttrRef aref_vect[2];
void *basewidget = 0;
// Command is "OPEN MULTIVIEW"
......@@ -3569,8 +3581,15 @@ static int xnav_open_func( void *client_data,
mvctx->pop();
}
else {
if ( xnav->opplace_p->Options & pwr_mOpPlaceOptionsMask_AllMainTransient) {
if ( xnav->ge_main)
basewidget = xnav->ge_main->get_widget();
else if ( xnav->multiview_main)
basewidget = xnav->multiview_main->get_widget();
}
mvctx = xnav->multiview_new( name_str, &aref, width, height, x, y, options,
xnav->gbl.color_theme, &sts,
basewidget, xnav->gbl.color_theme, &sts,
&xnav_multiview_command_cb,
&xnav_ge_get_current_objects_cb,
&xnav_ge_is_authorized_cb,
......@@ -4120,12 +4139,21 @@ static int xnav_open_func( void *client_data,
strcpy( title_str, "Trend");
}
void *basewidget = 0;
if ( xnav->opplace_p->Options & pwr_mOpPlaceOptionsMask_AllMainTransient) {
if ( xnav->ge_main)
basewidget = xnav->ge_main->get_widget();
else if ( xnav->multiview_main)
basewidget = xnav->multiview_main->get_widget();
}
if ( plotgroup_found) {
if ( xnav->appl.find( applist_eType_Trend, &plotgroup, (void **) &trend)) {
trend->pop();
}
else {
trend = xnav->xtttrend_new( title_str, NULL, &plotgroup, width, height, options, xnav->gbl.color_theme, &sts);
trend = xnav->xtttrend_new( title_str, NULL, &plotgroup, width, height, options, xnav->gbl.color_theme,
basewidget, &sts);
if ( EVEN(sts))
xnav->message('E',"Error in trend configuration");
else {
......@@ -4145,7 +4173,8 @@ static int xnav_open_func( void *client_data,
trend->pop();
}
else {
trend = xnav->xtttrend_new( title_str, aref_vect, 0, width, height, options, xnav->gbl.color_theme, &sts);
trend = xnav->xtttrend_new( title_str, aref_vect, 0, width, height, options, xnav->gbl.color_theme,
basewidget, &sts);
if ( EVEN(sts))
xnav->message('E',"Error in trend configuration");
else {
......@@ -4159,7 +4188,8 @@ static int xnav_open_func( void *client_data,
}
}
else {
trend = xnav->xtttrend_new( title_str, aref_vect, 0, width, height, options, xnav->gbl.color_theme, &sts);
trend = xnav->xtttrend_new( title_str, aref_vect, 0, width, height, options, xnav->gbl.color_theme,
basewidget, &sts);
if ( ODD(sts)) {
trend->close_cb = xnav_trend_close_cb;
trend->command_cb = xnav_trend_command_cb;
......@@ -4281,9 +4311,17 @@ static int xnav_open_func( void *client_data,
strcpy( title_str, "Trend");
}
void *basewidget = 0;
if ( xnav->opplace_p->Options & pwr_mOpPlaceOptionsMask_AllMainTransient) {
if ( xnav->ge_main)
basewidget = xnav->ge_main->get_widget();
else if ( xnav->multiview_main)
basewidget = xnav->multiview_main->get_widget();
}
if ( ODD( dcli_get_qualifier( "/NEW", 0, 0))) {
XttTCurve *tcurve = xnav->xtttcurve_new( title_str, 0, width, height,
options, xnav->gbl.color_theme, &sts);
options, xnav->gbl.color_theme, basewidget, &sts);
if ( ODD(sts)) {
tcurve->close_cb = xnav_tcurve_close_cb;
tcurve->command_cb = xnav_trend_command_cb;
......@@ -4324,7 +4362,8 @@ static int xnav_open_func( void *client_data,
return XNAV__HOLDCOMMAND;
}
XttTCurve *tcurve = xnav->xtttcurve_new( title_str, aref_vect,
width, height, options, xnav->gbl.color_theme, &sts);
width, height, options, xnav->gbl.color_theme,
basewidget, &sts);
if ( ODD(sts)) {
tcurve->close_cb = xnav_tcurve_close_cb;
tcurve->command_cb = xnav_trend_command_cb;
......@@ -4397,11 +4436,19 @@ static int xnav_open_func( void *client_data,
else
height = 0;
void *basewidget = 0;
if ( xnav->opplace_p->Options & pwr_mOpPlaceOptionsMask_AllMainTransient) {
if ( xnav->ge_main)
basewidget = xnav->ge_main->get_widget();
else if ( xnav->multiview_main)
basewidget = xnav->multiview_main->get_widget();
}
if ( ODD( dcli_get_qualifier( "/FILE", file_str, sizeof(file_str)))) {
// Open exported history file
hist = xnav->xttsevhist_new( file_str, 0, 0, 0, 0, 0, file_str,
width, height, options, xnav->gbl.color_theme, &sts);
width, height, options, xnav->gbl.color_theme, basewidget, &sts);
if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb;
hist->close_cb = xnav_sevhist_close_cb;
......@@ -4655,7 +4702,8 @@ static int xnav_open_func( void *client_data,
xnav->set_clock_cursor();
if ( plotgroup_found) {
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, 0, width, height, options, xnav->gbl.color_theme, &sts);
xnav->scctx, 0, width, height, options, xnav->gbl.color_theme,
basewidget, &sts);
if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb;
hist->close_cb = xnav_sevhist_close_cb;
......@@ -4666,7 +4714,8 @@ static int xnav_open_func( void *client_data,
}
else if( sevHistObjectFound ) {
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, 0, width, height, options, xnav->gbl.color_theme, &sts);
xnav->scctx, 0, width, height, options, xnav->gbl.color_theme,
basewidget, &sts);
if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb;
hist->close_cb = xnav_sevhist_close_cb;
......@@ -4677,7 +4726,8 @@ static int xnav_open_func( void *client_data,
}
else {
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, 0, width, height, options, xnav->gbl.color_theme, &sts);
xnav->scctx, 0, width, height, options, xnav->gbl.color_theme,
basewidget, &sts);
if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb;
hist->close_cb = xnav_sevhist_close_cb;
......@@ -4734,9 +4784,18 @@ static int xnav_open_func( void *client_data,
else
height = 0;
void *basewidget = 0;
if ( xnav->opplace_p->Options & pwr_mOpPlaceOptionsMask_AllMainTransient) {
if ( xnav->ge_main)
basewidget = xnav->ge_main->get_widget();
else if ( xnav->multiview_main)
basewidget = xnav->multiview_main->get_widget();
}
if ( ODD( dcli_get_qualifier( "/FILE", file_str, sizeof(file_str)))) {
// Open exported fast file
XttFast *fast = xnav->xttfast_new( title_str, 0, width, height, 0, file_str, xnav->gbl.color_theme, &sts);
XttFast *fast = xnav->xttfast_new( title_str, 0, width, height, 0, file_str, xnav->gbl.color_theme,
basewidget, &sts);
if ( EVEN(sts))
xnav->message('E',"Error in fast configuration");
else {
......@@ -4801,7 +4860,8 @@ static int xnav_open_func( void *client_data,
fast->pop();
}
else {
fast = xnav->xttfast_new( title_str, &aref, width, height, options, 0, xnav->gbl.color_theme, &sts);
fast = xnav->xttfast_new( title_str, &aref, width, height, options, 0, xnav->gbl.color_theme,
basewidget, &sts);
if ( EVEN(sts))
xnav->message('E',"Error in fast configuration");
else {
......@@ -9792,7 +9852,15 @@ int XNav::set_parameter( char *name_str, char *value_str, int publicwrite)
void XNav::open_rttlog( char *name, char *filename)
{
gecurve_new( name, filename, NULL, 0, 0, gbl.color_theme);
void *basewidget = 0;
if ( opplace_p->Options & pwr_mOpPlaceOptionsMask_AllMainTransient) {
if ( ge_main)
basewidget = ge_main->get_widget();
else if ( multiview_main)
basewidget = multiview_main->get_widget();
}
gecurve_new( name, filename, NULL, 0, 0, gbl.color_theme, basewidget);
}
......
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