Purpose |
Add a static graphic control to a dialog for pictures, text, etc. | ||||||||
Syntax |
CONTROL ADD GRAPHIC, hDlg, id&, "", x&, y&, wide&, high&[, style&, exstyle&] | ||||||||
hDlg |
Handle of the dialog in which the graphic control will be created. The dialog will become the parent of the control. | ||||||||
id& |
Unique identifier for the image in the range 1 to 65535, frequently specified with numeric equates for clarity of the code. For example, the equate %IDC_GRAPHIC1 is more informative than a literal value such as 497. Best practice suggests identifiers should start at 100 to avoid conflict with any of the standard predefined identifiers. | ||||||||
"" |
This
| ||||||||
x, y |
| ||||||||
wide& |
Integer expression, variable, or numeric literal value, specifying the width of the image. The width is given in the same terms (pixels or dialog units) as the parent dialog. | ||||||||
high& |
Integer expression, variable, or numeric literal value, specifying the height of the image. The height is given in the same terms (pixels or dialog units) as the parent dialog. | ||||||||
style& |
Optional primary style of the image control. This value can be a combination of the values below, combined together with the OR operator to form a bitmask. If style& is omitted, the default combination is %WS_CHILD OR %WS_VISIBLE OR %SS_OWNERDRAW.
| ||||||||
exstyle& |
Optional extended style of the graphic control. This value can be a combination of the values below, combined together with the OR operator to form a bitmask. If exstyle& is omitted, there is no default extended style.
| ||||||||
Remarks |
A graphic control is typically used with graphic statements to draw graphs, pictures, text, etc. After you create a graphic control, you must use GRAPHIC ATTACH to choose it for use with other statements and functions. A graphic control will only send notification messages to a callback if the %SS_NOTIFY style is used. Notification messages are sent to the callback function with CBMSG = %WM_COMMAND, CBCTL holding the ID (id&) of the control, and CBCTLMSG holding one of the following values:
When a callback function receives a %WM_COMMAND message, it should explicitly test the value of CBCTL and CBCTLMSG to guarantee it is responding appropriately to the notification message. All PowerBASIC graphical displays are persistent -- they will be automatically redrawn when altered or temporarily covered by another window. Due to the nature of a graphic control and its contents, it may not be resized. If a new size is needed, the control should be destroyed and recreated. | ||||||||
See also |
Dynamic Dialog Tools, GRAPHIC ATTACH, GRAPHIC COLOR, GRAPHIC SCALE, GRAPHIC STYLE, GRAPHIC WIDTH, GRAPHIC WINDOW |