ConnectComboBoxNotify

>>-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.

Arguments:

The arguments are:

id

The resource ID of the combo box for which a notification is to be connected to a method.

event

The event to be connected with a method:

CHANGE

The text in the edit control has been altered. This notification is sent after Windows updated the screen.

UPDATE

The text in the edit control has been altered. This notification is sent before Windows updates the screen.

CLOSEUP

The list of the combo box has been closed.

DROPDOWN

The list of the combo box is about to be made visible.

DBLCLK

An entry in the combo box list has been selected with a double click.

ERRSPACE

An out-of-memory problem has occurred.

GOTFOCUS

The combo box got the input focus.

LOSTFOCUS

The combo box lost the input focus.

SELCHANGE

Another entry in the combo box list has been selected.

SELENDOK

The list was closed after another entry was selected.

SELENDCANCEL

After the selection of another entry, another control or dialog was selected, which canceled the selection of the entry.

msgToRaise

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.

Return value:

The return codes are:

-1

The resource ID could not be resolved or the event argument is incorrect.

0

No errors were detected.

1

The message was not connected correctly.

Example:

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")

Notes:

  1. Connections are usually placed in the Init or InitDialog method. If both methods are defined, use init as the place for this connection - but not before init:super has been called.

  2. 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
      ...