>>-aMessageExtensions~ConnectComboBoxNotify(--id--,--"--+-CHANGE-------+--"--> +-UPDATE-------+ +-CLOSEUP------+ +-DROPDOWN-----+ +-DBLCLK-------+ +-ERRSPACE-----+ +-GOTFOCUS-----+ +-LOSTFOCUS----+ +-SELCHANGE----+ +-SELENDOK-----+ +-SELENDCANCEL-+ >--+---------------+--)---------------------------------------------------->< +-,--msgToRaise-+
The ConnectComboBoxNotify method connects a particular WM_NOTIFY message for a combo box with a method. The WM_NOTIFY message informs the dialog that an event has occurred in the combo box.
The arguments are:
The resource ID of the combo box for which a notification is to be connected to a method.
The event to be connected with a method:
The text in the edit control has been altered. This notification is sent after Windows updated the screen.
The text in the edit control has been altered. This notification is sent before Windows updates the screen.
The list of the combo box has been closed.
The list of the combo box is about to be made visible.
An entry in the combo box list has been selected with a double click.
An out-of-memory problem has occurred.
The combo box got the input focus.
The combo box lost the input focus.
Another entry in the combo box list has been selected.
The list was closed after another entry was selected.
After the selection of another entry, another control or dialog was selected, which canceled the selection of the entry.
The message that is to be sent whenever the specified notification is received from the combo control. Provide a method with a matching name. If you omit this argument, the event is preceded by On.
The return codes are:
The resource ID could not be resolved or the event argument is incorrect.
No errors were detected.
The message was not connected correctly.
The following example invokes method PlaySong whenever the list of the combo box with the resource ID of PROFESSIONS is about to be made visible. In this case PROFESSIONS is a symbolic ID that has been added to the ConstDir directory of the MyDlgClass in another part of the program:
::class MyDlgClass subclass UserDialog inherit MessageExtensions ::method InitDialog self~init:super(...) self~ConnectComboBoxNotify("PROFESSIONS", "DROPDOWN", "PlaySong")
The event-handling methods receive two arguments: the first is a combination of the ID of the combo box and the ID of the notification messages. (Extract the low-order word to get the combo box ID.) The second argument is the window handle of the combo box. Example:::method PlaySong use arg eventID, handle id = .DlgUtil~loWord(eventID) if id == self~ConstDir["PROFESSIONS"] then -- take some action ...