ConnectTabNotify

>>-aMessageExtensions~ConnectTabNotify(--id--,--"--+-KEYDOWN-----+--"-->
                                                   +-SELCHANGE---+
                                                   +-SELCHANGING-+

>--+---------------+--)-----------------------------------------------><
   +-,--msgToRaise-+


The ConnectTabNotify method connects a particular WM_NOTIFY message for a tab control with a method. The WM_NOTIFY message informs the dialog that an event has occurred with regard to the tab control.

Arguments:

The arguments are:

id

The ID of the tab control of which a notification is to be connected to a method.

event

The event to be connected with a method:

KEYDOWN

A key has been pressed while the tab control was focused.

SELCHANGE

Another tab has been selected in the tab control. This method is called after the selection was changed.

SELCHANGING

Another tab has been selected in the tab control. This method is called before the selection is changed.

msgToRaise

The message that is to be sent whenever the specified notification is received from the tab 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:

0

No error detected.

-1

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

1

The messages was not connected correctly.

Example:

The following example invokes method OnSelChange whenever another tab is selected in the tab control PAGE:

::class MyDlgClass subclass UserDialog inherit MessageExtensions

::method Init
  self~init:super(...)
  self~ConnectTabNotify("PAGE", "SELCHANGE")

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 method that is connected to KEYDOWN receives two arguments: the control ID of the tab control and the virtual key code that has been pressed. Use the method KeyName of the VirtualKeyCodes class to get the name of the key. Note that your class must inherit from the VirtualKeyCodes class to use the KeyName method. Example:

    ::method OnKeyDown
      use arg id, vkey
      say "Key" self~KeyName(vkey) "was pressed."

  3. All other event-handling methods receive two arguments: the ID of the tab control (extract the low-order word) and the handle to the tab control. Example:

    ::method Handler
      use arg ev_id, handle
      id = .DlgUtil~loWord(ev_id)