User Tools

Site Tools


settarget_set_current_window_or_report_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== SETTARGET (set current window or report) ====== Previous pageReturn to chapter overviewNext page

NewC7.jpg

SETTARGET ( [ target ] )
, thread
target , band

blk2blue.jpg

SETTARGET Sets the current window (or report) for drawing graphics and other window-interaction statements.
target The label of an APPLICATION, WINDOW, or REPORT structure, or a reference to any of those structures. The execution thread is always deduced from the target and any specified thread parmeter is ignored. If omitted, the last window opened and not yet closed in the specified thread is used.
thread The number of the execution thread whose topmost procedure contains the window to set as the target. If omitted, the execution thread is deduced from the target.
band The control number or field equate label of the REPORT band (or IMAGE control in a window target) to draw graphics primitives to (ARC, CHORD, etc.).

SETTARGET sets the current target for runtime property assignment, and the CREATE, SETPOSITION, GETPOSITION, SETFONT, GETFONT, DISABLE, HIDE, CONTENTS, DISPLAY, ERASE, and UPDATE statements.

Using these statements with SETTARGET allows you to manipulate the window display in the topmost window of any execution thread.

SETTARGET also specifies the target structure for drawing with the graphics primitives procedures (ARC, CHORD, etc.).

SETTARGET sets the “built-in” variable TARGET (also set when a window opens), which may be used in any statement which requires the label of the current Window or Report. SETTARGET does not change procedures, and does not change which ACCEPT loop receives the events generated by Windows. SETTARGET without any parameters resets to the procedure and execution thread with the currently active ACCEPT loop.

A REPORT structure is never the default TARGET. Therefore, SETTARGET must be used before using the graphics primitives procedures to draw graphics on a REPORT. To draw graphics to a specific band in the REPORT (or onto an IMAGE in a window), you must specify the band as the second parameter.

SETTARGET Resets TARGET to the topmost window in the execution thread with the currently active ACCEPT loop.
SETTARGET(target) Sets TARGET to the specified WINDOW or REPORT. The execution thread is deduced from the target.
SETTARGET(target,thread) Sets TARGET to the specified WINDOW or REPORT. The execution thread is determined by the target parameter and any specified thread parmeter is ignored.
SETTARGET( , thread) Sets TARGET to the topmost WINDOW in the specified execution thread.
SETTARGET(target,band) Sets TARGET to the specified target WINDOW or REPORT, and draws graphics primitives to the specified band (REPORT band or IMAGE control).

Example:

MyReport  REPORT

HEADER,USE(?PageHeader)

END

Detail   DETAIL

END

END

CODE

OPEN(MyReport)

SETTARGET(MyReport,?PageHeader)          ! Make the MyReport structure and its Pageheader band the current target

TARGET{PROP:Landscape} = 1              ! Turn on landscape mode

ARC(100,50,100,50,0,900)                        ! Draw 90 degree arc from 3 to 12 o'clock, as

! the top-right quadrant of ellipse

! to the page HEADER band

SETTARGET()                                      !Reset TARGET to top window

See Also:    

START

THREAD

NOTIFY

SYSTEM

TARGET

settarget_set_current_window_or_report_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)