Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ValueDescription
QualifierThe Qualifier is composed of the number of parameters and the key to the SYSREPOSEVENTEXES table, separated by an asterisk. The MENU event takes only the two standard parameters, CtrlEntID and CtrlClassID. For example, the Qualifier for the MENU event for the File, Open menu item on a SYSPROG application window named "MAIN" has the following format:

"2*SYSPROG*MENU*MAIN.MENU.FILE.OPEN"

See also

Send_Message("QUALIFY_EVENT")

Example

This example shows how to create the following "Edit" menu, which will automatically enable and disable the appropriate menu items as applicable.

...

Code Block
Function CREATE(CtrlEntID, CtrlClassID, CreateParam)
* the form designer does not support events for popup
* menus (those menu items which have sub-menu items), so
* use EVENTQUALIFIER to route events from the EDIT menu
* to the window's OMNIEVENT
Qualifier = 2: "*": @appid<1>: "*OMNIEVENT*": @window: "."
.Menu.Edit->EventQualifier = Qualifier
return 0
 
 
This is the OMNIEVENT for the window: 
Code Block
Function OMNIEVENT(CtrlEntID, CtrlClassID, Message, …)
* if the event is generated from the "Edit" menu item,
* enable and disable the appropriate sub-menu items
declare function EditFind
$insert EditFind_Equates
$insert Logical
 
begin case
  case CtrlEntID [-1,"B."] = "EDIT"
    * get the current focus
    Focus = @@window->Focus
    * check if the control type is paste-able
    locate @Focus->Type in "EDITFIELD,EDITTABLE,EDITBOX,COMBOBOX"
           using "," setting Pos then
      CanPaste = TRUE$
    end else
      CanPaste = FALSE$
    end
    * enable/disable menu items as appropriate
    .Menu.Edit.Undo->Enabled = @Focus->CanUndo
    .Menu.Edit.Cut->Enabled = |
       (abs(@Focus->Selection<2>) > 0)
    .Menu.Edit.Copy->Enabled = .Menu.Edit.Cut->Enabled
    .Menu.Edit.Paste->Enabled = |
       (CanPaste and len(ClipBoard-Text))
    .Menu.Edit.Find->Enabled = |
       EditFind(EFCMD_ISFINDABLE$,Focus)
    .Menu.Edit.Next->Enabled  = |
       EditFind(EFCMD_ISFINDNEXTABLE$,Focus)
    .Menu.Edit.Prev->Enabled  = .Menu.Edit.Next->Enabled
end case
return 0

 

...