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