Window Draw Methods

The methods listed below are used to draw, redraw, and clear window areas.

DrawButton

>>-aBaseDialog~DrawButton(--id--)-----------------------------><


The DrawButton method draws the given button.

Arguments:

The only argument is:

id

The ID of the button

RedrawRect

                                                                               +-0--------+
>>-aBaseDialog~RedrawRect(--+------+--,--left--,--top--,--right--,--bottom--,--+----------+--)-><
                            +-hwnd-+                                           +-erasebkg-+


The RedrawRect method immediately redraws a rectangle within the client area of a dialog. You can specify whether the background of the dialog is to be erased before redrawing.

Arguments:

The arguments are:

hwnd

The handle to the dialog in which parts of the client area are to be redrawn. See Get or GetItem for information on how to get a window handle. If you omit this argument, the handle of the dialog instance is used.

left, top

The upper left corner of the rectangle relative to the client area, in screen pixels.

right, bottom

The lower right corner of the rectangle relative to the client area, in screen pixels.

erasebkg

If this argument is 1 or 0, the background of the dialog is erased before redrawing. The default is 0.

Return value:

0

Redrawing was successful.

1

Redrawing failed.

RedrawButton

>>-aBaseDialog~RedrawButton(--id--+-------------+--)----------><
                                  +-,--erasebkg-+


The RedrawButton method redraws the given button.

Arguments:

The arguments are:

id

The ID of the button

erasebkg

Determines whether (1) or not (0) the background of the drawing area should be erased before redrawing. The default is 0.

RedrawWindowRect

>>-aBaseDialog~RedrawWindowRect--+-----------------------------+--><
                                 +-(--hwnd--+-------------+--)-+
                                            +-,--erasebkg-+


The RedrawWindowRect method redraws the given window rectangle.

Arguments:

The arguments are:

hwnd

The handle to the window. See Get or GetItem for information on how to get a window handle. If you omit this argument, the handle of the dialog instance is used.

erasebkg

Determines whether (1) or not (0) the background of the drawing area should be erased before redrawing. The default is 0.

ClearRect

>>-aBaseDialog~ClearRect(--hwnd--,--left--,--top--,--right--,--bottom--)--><


The ClearRect method clears the given rectangle of a window. The values are in pixels.

Arguments:

The arguments are:

hwnd

The handle of the window. See GetSelf or GetItem for information on obtaining a window handle.

left

The horizontal value of the upper-left corner of the rectangle

top

The vertical value of the upper left corner

right

The horizontal value of the lower right corner

bottom

The vertical value of the lower right corner

Example:

The following example clears a rectangle of the size 20 by 20:

hwnd=MyDialog~GetSelf
MyDialog~ClearRect(hwnd, 2, 4, 22, 24)

ClearButtonRect

>>-aBaseDialog~ClearButtonRect(--id--)------------------------><


The ClearButtonRect method erases the draw area of the given button.

Arguments:

The only argument is:

id

The ID of the push button

ClearWindowRect

>>-aBaseDialog~ClearWindowRect(--hwnd--)----------------------><


The ClearWindowRect method erases the draw area of the given window.

Arguments:

The only argument is:

hwnd

The handle of the window. See GetSelf, Get, or GetItem for some methods to get a window handle.

Example:

The following example gets the window handle of a dialog control with resource ID of 211 and then clears the dialog control window:

hwnd = MyDialog~GetItem(211)
MyDialog~ClearWindowRect(hwnd)