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

Plc editor, opened object editors follows view/edit mode

parent c0e86849
......@@ -2288,6 +2288,20 @@ int WFoe::attr_delete()
return FOE__SUCCESS;
}
//
// Delete all attribute editors and remove them from the
// attribute list.
//
void WFoe::attr_set_editmode( int mode)
{
int i;
for ( i = 0; i < attr_count; i++ ) {
if ( this == (attr_pointer + i)->foe)
((WAtt *)(attr_pointer + i)->a_ctx)->set_editmode( mode, 0);
}
}
//
// Tell all the subwindows on the screen that I am quitting now
// by setting the parentctx in foe zero.
......@@ -3633,6 +3647,7 @@ int WFoe::change_mode( int new_mode)
ldh_eAccess_ReadOnly);
if ( EVEN(sts)) return sts;
access = ldh_eAccess_ReadOnly;
attr_set_editmode(0);
}
break;
case TRACE:
......@@ -3693,6 +3708,7 @@ int WFoe::change_mode( int new_mode)
gre->disable_button_events();
edit_setup();
set_mode_button_state( VIEW, 0);
attr_set_editmode(1);
break;
case EDIT:
/* Mode unchanged */
......@@ -3961,6 +3977,7 @@ void WFoe::edit_exit_save( WFoe *foe)
foe->set_mode_button_state( EDIT, 0);
foe->set_mode_button_state( SIMULATE, 1);
foe->function = SIMULATE;
foe->attr_set_editmode(0);
break;
case TRACE:
foe->gre->disable_button_events();
......@@ -3973,6 +3990,7 @@ void WFoe::edit_exit_save( WFoe *foe)
foe->set_mode_button_state( EDIT, 0);
foe->set_mode_button_state( TRACE, 1);
foe->function = TRACE;
foe->attr_set_editmode(0);
break;
case VIEW:
foe->set_mode_button_state( EDIT, 0);
......@@ -3984,6 +4002,7 @@ void WFoe::edit_exit_save( WFoe *foe)
ldh_eAccess_ReadOnly);
foe->error_msg(sts);
foe->access = ldh_eAccess_ReadOnly;
foe->attr_set_editmode(0);
break;
}
}
......
......@@ -274,6 +274,7 @@ class WFoe : public WUtility {
void disable_ldh_cb();
int attr_create( vldh_t_node node);
int attr_delete();
void attr_set_editmode( int mode);
int parent_quit();
int child_quit( vldh_t_node node, unsigned long windowindex);
int child_delete( vldh_t_node node, vldh_t_wind subwind);
......
......@@ -80,6 +80,7 @@ void WAtt::activate_print()
void WAtt::set_editmode( int editmode, ldh_tSesContext ldhses)
{
if ( ldhses != 0)
this->ldhses = ldhses;
this->editmode = editmode;
((WAttNav *)wattnav)->set_editmode( editmode, ldhses);
......
......@@ -113,7 +113,7 @@ class WAttNav {
void redraw();
void enable_events();
void set_editmode( int editmode, ldh_tSesContext ldhses)
{ this->editmode = editmode; this->ldhses = ldhses;};
{ this->editmode = editmode; if( ldhses != 0) this->ldhses = ldhses;};
int select_by_name( const char *name);
static int init_brow_cb( FlowCtx *fctx, void *client_data);
......
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