Commit a617e56c authored by Claes Sjofors's avatar Claes Sjofors

Ctrl/Doubleclick MB1 to insert selected object into an objid attribute also...

Ctrl/Doubleclick MB1 to insert selected object into an objid attribute also works on attrref attributes.
parent 5007cbff
......@@ -1605,6 +1605,31 @@ int WNav::brow_cb( FlowCtx *ctx, flow_tEvent event)
wnav->set_attr_value( item_attr->node, item_attr->objid, str);
break;
}
if ( item_attr->type_id == pwr_eType_AttrRef) {
if ( wnav->get_global_select_cb)
sts = (wnav->get_global_select_cb)( wnav->parent_ctx, &sel_list,
&sel_is_attr, &sel_cnt);
if ( sel_cnt > 1) {
wnav->message( 'E', "Select one object");
break;
}
else if ( sel_cnt) {
char *namep;
sts = ldh_AttrRefToName( wnav->ldhses, &sel_list[0], ldh_eName_VolPath, &namep,
&size);
if ( EVEN(sts)) return sts;
strncpy( str, namep, sizeof(str));
}
else {
sts = wnav->get_selection( str, sizeof(str));
}
if ( ODD(sts))
wnav->set_attr_value( item_attr->node, item_attr->objid, str);
break;
}
}
default:
;
......
......@@ -129,8 +129,12 @@ pwr_tStatus Wtt::ldh_this_session_cb( void *ctx, ldh_sEvent *event)
{
Wtt *wtt = (Wtt *) ctx;
if ( wtt->input_open)
wtt->close_change_value();
if ( wtt->input_open) {
if ( wtt->keep_input_open)
wtt->keep_input_open = 0;
else
wtt->close_change_value();
}
wtt->wnav->ldh_event( event);
wtt->wnavnode->ldh_event( event);
return 1;
......@@ -2080,7 +2084,7 @@ Wtt::Wtt(
select_attr(0), select_type(0),
wnav_mapped(0), wnavnode_mapped(0), utedctx(0), wpkg(0),
close_cb(0), open_volume_cb(0), open_project_volume_cb(0), time_to_exit_cb(0),
mcp(0), disable_w2(0)
mcp(0), disable_w2(0), keep_input_open(0)
{
strcpy( name, wt_name);
*status = 1;
......
......@@ -182,6 +182,7 @@ class Wtt : public WUtility {
int (*time_to_exit_cb)(void *ctx);
ldh_sMenuCall *mcp;
int disable_w2;
int keep_input_open;
int restore_settings();
int save_settings();
......
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