User Tools

Site Tools


settarget_sets_the_active_target_.htm
Navigation:  ABC Library Reference > ToolbarClass > ToolbarClass Methods >====== SetTarget (sets the active target) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

SetTarget( **[// ID //] **)

blk2blue.jpg

SetTarget Sets the ToolbarClass object's active toolbar target.
ID An integer constant, variable, EQUATE, or expression containing the target's ID number. For targets associated with a control, this is the control number (usually represented by the control's Field Equate Label). If omitted or zero (0), SetTarget sets the most likely target.

The **SetTarget **method sets the ToolbarClass object's active toolbar target (ToolbarTarget object), and adjusts the TOOLBAR state appropriate to that target.

Implementation:

The SetTarget method calls the ToolbarTarget.TakeToolbar or ToolbarTarget.TryTakeToolbar method to set the toolbar buttons' TIP attributes and enabled/disabled status appropriate to the active toolbar target.

Example:

** ACCEPT**

**  CASE EVENT()**

**  OF EVENT:OpenWindow             !on open window**

**   DO RefreshWindow               !load the browse QUEUEs**

**  OF EVENT:Accepted               !for Accepted events (which may**

**   CASE FOCUS()                   ! come from the global toolbar)**

**   OF ?ClientList                 ! make the list with FOCUS**

**    Toolbar.SetTarget(?ClientList)! the active toolbar target**

**   OF ?PhoneList                  ! and enable appropriate toolbar**

**    Toolbar.SetTarget(?PhoneList) ! buttons and TIP attributes**

**   END**

**   Toolbar.TakeEvent(VCRRequest, WM)     !the Toolbar object calls the **

**  END                      ! active target's event handler**

** END                       ! which in turn scrolls, inserts,**

**                           ! deletes, helps, etc. The event**

**                           ! handler often simply POSTs**

**                           ! another event to the correct**

**                           ! control, e.g. **

**                           ! Event:Accepted to ?Insert  or**

**                           ! Event:PageUp to ?ClientList**

**See Also:     **ToolbarTarget.TakeToolbar, , ToolbarTarget.TryTakeToolbar

settarget_sets_the_active_target_.htm.txt · Last modified: by 127.0.0.1