diff --git a/src/core/actions/table.c b/src/core/actions/table.c index a72f36b..7aec060 100644 --- a/src/core/actions/table.c +++ b/src/core/actions/table.c @@ -291,7 +291,7 @@ .summary = N_( "Remove selection" ), .activate = lib3270_unselect, - .group = LIB3270_ACTION_GROUP_ONLINE, + .group = LIB3270_ACTION_GROUP_SELECTION, .activatable = lib3270_has_selection }, @@ -322,7 +322,7 @@ .summary = N_( "Select Field" ), .activate = lib3270_select_field, - .group = LIB3270_ACTION_GROUP_ONLINE, + .group = LIB3270_ACTION_GROUP_FORMATTED, .activatable = lib3270_is_formatted }, @@ -337,7 +337,7 @@ .summary = N_( "Move the cursor to the first blank after the last nonblank in the field." ), .activate = lib3270_fieldend, - .group = LIB3270_ACTION_GROUP_ONLINE, + .group = LIB3270_ACTION_GROUP_FORMATTED, .activatable = lib3270_is_formatted }, @@ -351,7 +351,7 @@ .summary = N_( "Move to first unprotected field on screen." ), .activate = lib3270_firstfield, - .group = LIB3270_ACTION_GROUP_ONLINE, + .group = LIB3270_ACTION_GROUP_FORMATTED, .activatable = lib3270_is_formatted }, @@ -365,7 +365,7 @@ .summary = N_( "Tab forward to next field." ), .activate = lib3270_nextfield, - .group = LIB3270_ACTION_GROUP_ONLINE, + .group = LIB3270_ACTION_GROUP_FORMATTED, .activatable = lib3270_is_formatted }, @@ -379,7 +379,7 @@ .summary = N_( "Tab backward to previous field." ), .activate = lib3270_previousfield, - .group = LIB3270_ACTION_GROUP_ONLINE, + .group = LIB3270_ACTION_GROUP_FORMATTED, .activatable = lib3270_is_formatted }, @@ -411,8 +411,8 @@ .summary = N_( "Delete field" ), .activate = lib3270_deletefield, - .group = LIB3270_ACTION_GROUP_LOCK_STATE, - .activatable = lib3270_is_unlocked + .group = LIB3270_ACTION_GROUP_FORMATTED, + .activatable = lib3270_is_formatted }, @@ -440,7 +440,7 @@ .summary = N_( "Erase End Of Field Key." ), .activate = lib3270_eraseeof, - .group = LIB3270_ACTION_GROUP_ONLINE, + .group = LIB3270_ACTION_GROUP_FORMATTED, .activatable = lib3270_is_formatted }, diff --git a/src/core/ctlr.c b/src/core/ctlr.c index ad280be..0f5d0b8 100644 --- a/src/core/ctlr.c +++ b/src/core/ctlr.c @@ -246,7 +246,11 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) static void set_formatted(H3270 *hSession, int state) { - hSession->formatted = state; + if(state != hSession->formatted) + { + hSession->formatted = state; + lib3270_notify_actions(hSession, LIB3270_ACTION_GROUP_LOCK_STATE); + } } /** diff --git a/src/core/screen.c b/src/core/screen.c index f311082..c7f71df 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -839,7 +839,7 @@ void mcursor_set(H3270 *hSession,LIB3270_POINTER m) hSession->cbk.cursor(hSession,m & 0x03); // Notify lock state change. - lib3270_notify_actions(hSession, LIB3270_ACTION_GROUP_LOCK_STATE); + lib3270_notify_actions(hSession, LIB3270_ACTION_GROUP_FORMATTED); } } diff --git a/src/include/lib3270/actions.h b/src/include/lib3270/actions.h index ca63e7c..da85aff 100644 --- a/src/include/lib3270/actions.h +++ b/src/include/lib3270/actions.h @@ -40,6 +40,7 @@ LIB3270_ACTION_GROUP_OFFLINE, ///< @brief Action requires offline state. LIB3270_ACTION_GROUP_SELECTION, ///< @brief Action depends on selection. LIB3270_ACTION_GROUP_LOCK_STATE, ///< @brief Action depends on keyboard lock state. + LIB3270_ACTION_GROUP_FORMATTED, ///< @brief Action depends on a formatted screen. LIB3270_ACTION_GROUP_CUSTOM ///< @brief Custom group/Number of groups. } LIB3270_ACTION_GROUP; -- libgit2 0.21.2