Commit e2ed7339 authored by Claes Sjofors's avatar Claes Sjofors

Plc editor text editor entry in popup menu fix

parent 30c9adbf
......@@ -2080,7 +2080,7 @@ void WFoe::gre_subwindow( WGre *gre, vldh_t_node object, unsigned long subwindow
// Backcall from the controlled gre module
//
void WFoe::gre_popupmenu( WGre *gre, int x_pix, int y_pix, int popupmenu_type,
vldh_t_node node)
vldh_t_node node, int unselect)
{
WFoe *foe;
......@@ -2091,7 +2091,8 @@ void WFoe::gre_popupmenu( WGre *gre, int x_pix, int y_pix, int popupmenu_type,
if ( popupmenu_type == GRE_POPUPMENUMODE_OBJECT) {
if ( node != 0) {
gre->node_select( node);
foe->popupmenu_node = node;
if ( unselect)
foe->popupmenu_node = node;
}
unsigned int mask = foe_ePopupmenu_attribute |
......
......@@ -374,7 +374,7 @@ class WFoe : public WUtility {
static void gre_attribute( WGre *gre, vldh_t_node object);
static void gre_subwindow( WGre *gre, vldh_t_node object, unsigned long subwindow_nr);
static void gre_popupmenu( WGre *gre, int x_pix, int y_pix, int popupmenu_type,
vldh_t_node node);
vldh_t_node node, int unselect);
static void gre_getobj( WGre *gre, vldh_t_node node, unsigned long index);
static void gre_undelete( WGre *gre);
static void gre_unselect( WGre *gre);
......
......@@ -1619,6 +1619,7 @@ int WGre::flow_cb( FlowCtx *ctx, flow_tEvent event)
vldh_t_node current_node;
flow_tObject *select_list;
int select_cnt;
int unselect = 0;
if ( flow_GetPasteActive( ctx) || flow_GetAutoscrollingActive(ctx) ||
flow_GetConCreateActive(ctx))
......@@ -1635,16 +1636,22 @@ int WGre::flow_cb( FlowCtx *ctx, flow_tEvent event)
flow_GetSelectList( ctx, &select_list, &select_cnt);
if ( !select_cnt) {
if ( event->object.object_type == flow_eObjectType_Node)
if ( event->object.object_type == flow_eObjectType_Node) {
/* Get the current object */
flow_GetUserData( event->object.object, (void **)&current_node);
unselect = 1;
}
}
if ( select_cnt == 1)
flow_GetUserData( select_list[0], (void **)&current_node);
if ( current_node || select_cnt == 1)
gre->popupmenu_mode = GRE_POPUPMENUMODE_OBJECT;
else
gre->popupmenu_mode = GRE_POPUPMENUMODE_AREA;
(gre->gre_popupmenu) (gre, x_pix, y_pix,
gre->popupmenu_mode, current_node);
gre->popupmenu_mode, current_node, unselect);
break;
}
#if 0
......@@ -2101,7 +2108,7 @@ int WGre::setup_backcalls (
void (*attribute_bc)(WGre *, vldh_t_node),
void (*subwindow_bc)(WGre *, vldh_t_node, unsigned long),
void (*reserv_bc)(),
void (*popupmenu_bc)(WGre *, int, int, int, vldh_t_node),
void (*popupmenu_bc)(WGre *, int, int, int, vldh_t_node, int),
void (*getobj_bc)(WGre *, vldh_t_node, unsigned long),
void (*undelete_bc)(WGre *),
void (*unselect_bc)(WGre *),
......
......@@ -148,7 +148,7 @@ class WGre {
void (*gre_attribute)(WGre *, vldh_t_node);
void (*gre_subwindow)(WGre *, vldh_t_node, unsigned long);
void (*gre_reserv)();
void (*gre_popupmenu)(WGre *, int, int, int, vldh_t_node);
void (*gre_popupmenu)(WGre *, int, int, int, vldh_t_node, int);
void (*gre_getobj)(WGre *, vldh_t_node, unsigned long);
void (*gre_undelete)(WGre *);
void (*gre_unselect)(WGre *);
......@@ -208,7 +208,7 @@ class WGre {
void (*attribute_bc)(WGre *, vldh_t_node),
void (*subwindow_bc)(WGre *, vldh_t_node, unsigned long),
void (*reserv_bc)(),
void (*popupmenu_bc)(WGre *, int, int, int, vldh_t_node),
void (*popupmenu_bc)(WGre *, int, int, int, vldh_t_node, int),
void (*getobj_bc)(WGre *, vldh_t_node, unsigned long),
void (*undelete_bc)(WGre *),
void (*unselect_bc)(WGre *),
......
......@@ -1339,7 +1339,7 @@ static int trace_flow_cb( FlowCtx *ctx, flow_tEvent event)
}
(gre->gre_popupmenu) (gre, x_pix, y_pix,
gre->popupmenu_mode, current_node);
gre->popupmenu_mode, current_node, 1);
break;
}
case flow_eEvent_MB1ClickCtrl:
......
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