The PICTURE control is a simple control you use to display a bitmap. You indicate the bitmap to display by placing the bitmap file name and, optionally, the file path in the Bitmap attribute parameter of the controls definition. If you supply a file path, WinBatch will check in the indicated path for the bitmap file before checking other locations. If it does not find the file there or if you do not supply a path, WinBatch will search the current directory, the Windows directory and the WinBatch directory for the bitmap file.
Your bitmap does not need to be the same size as your PICTURE control. The appropriate stretch or compress is applied to the bitmap so that the entire image is displayed. However, if the aspect ratio of your control is significantly different from the bitmaps aspect ratio, your image may appear distorted.
Although the control does not normally display text, you can still place text in the Text attribute of the control definition. WinBatch will display the text when it cannot find the bitmap indicated in the "background" attribute while loading the dialog template.
Return Value:
Not applicable to this control.
Control Definition:
<dlg-variable>nn =`x, y, width, height, type, control-name, variable, text, value, tab-order, style, font, textcolor, bitmap`
For Example:
MyDialog003=`005,005,088,088,PICTURE,"Picture_1",DEFAULT,"Picture 1",DEFAULT,30,DEFAULT,DEFAULT,DEFAULT,"C:\Program Files (x86)\WinBatch\System\WBOwl.bmp"`
Attribute
|
Value
|
Meaning
|
dlg-variable
|
MyDialog
|
The name of the dialog box.
|
nn
|
003
|
The ordinal position of the control in the dialog box (starting with 1).
|
x
|
005
|
The horizontal coordinate of the upper left corner of the control in Dialog Units.
|
y
|
005
|
The vertical coordinate of the upper left corner of the control in Dialog Units.
|
width
|
088
|
The width of the control in Dialog Units
|
height
|
088
|
The height of the control in Dialog Units.
|
type
|
PICTURE
|
The type of control.
|
control-name
|
"Picture_1"
|
The name used to identify the control in a user defined callback procedure. The name cannot be more than 30 characters in length and MUST be unique. ( This attribute can only be used with 6.2 or later dialog formats. )
|
variable
|
DEFAULT
|
Not applicable to this control.
|
text
|
"Picture 1"
|
The description which will be displayed with the control. [Use an empty string ("") if the control should appear blank.]
Although the control does not normally display text, you can still place text in the Text attribute. WinBatch will display the text when it cannot find the bitmap indicated in the "background" attribute while loading the dialog template.
|
value
|
DEFAULT
|
Not applicable to this control.
|
tab-order
|
30
|
Allows you to specify a control's tab order independently of a control's position or name in the dialog template. Tab-order controls the order in which controls are accessed when the keyboard is used to navigate the dialog. It also influences which control is on top when controls have overlapping positions in the dialog. It can be any positive integer, but each control should have a unique number.
When you navigate through a dialog using the tab key, lower number controls will be given the keyboard focus before higher controls. Likewise, low-numbered overlapping controls will appear on top of higher numbered controls. If you specify the DEFAULT keyword for this attribute or if you give two controls the same tab order, a tab order will be arbitrarily assigned to the control.
Note: The dialog function, under certain circumstances, may change the tab order you specify. The GROUPBOX controls tab order may be adjusted so that it is smaller than any of the controls it contains. In addition, the tab order of the controls inside the GROUPBOX may be adjusted so that they are consecutive.
|
style
|
DEFAULT
|
Allows you to control the initial appearance and behavior of your control. Numbers represent each style and they can be combined, using the bit-wise OR (|) operator, to set multiple styles. The following table lists the style numbers, their meanings, and the controls that they have an effect on.
Style
|
Meaning
|
@csInvisible (1)
|
Control is invisible
|
@csDisabled (2)
|
Control has disabled appearance and does not accept any user input, it would otherwise accept input.
|
Note: Specifying 0 for this attribute is equivalent to using the DEFAULT keyword and means that the control will exhibit default behavior.
|
font
|
DEFAULT
|
Not applicable to this control.
|
textcolor
|
DEFAULT
|
Not applicable to this control.
|
bitmap
|
DEFAULT
|
Used to specify the background bitmap. Specify a bitmap by a file name and path enclosed in single quotes. If you supply a file path, WinBatch will check in the indicated path for the bitmap file before checking other locations. If it does not find the file there or if you do not supply a path, WinBatch will search the current directory, the windows directory and the WinBatch directory for the bitmap file.
You cannot place a color specification in this attribute.
|
|
Event Options
Use the DialogProcOptions function to control when your User-Defined-Callback procedure is called by its associated dialog. You can also use it to control your dialog's behavior, while your procedure is executing. You usually establish callback events during the first call to the procedure i.e., event 0, but this can be done during any call.
Event-Option-Code Values
|
Meaning
|
|
Not applicable to this control.
|
|
|
Dialog Callback Procedure Function Options
DialogControlGet function returns text and state information associated with a control.
Request
|
Meaning
|
@dcTitle (4)
|
Control’s title.
|
@dcBitmap (12)
|
File specification of the controls currently displayed bitmap. If the control is not displaying a bitmap, the "DEFAULT" key string is returned.
|
@dcPosition (17)
|
Space delimited list of a control's position and size in dialog units relative to the dialog's client area. The first two numbers are the horizontal and vertical location of the upper-left corner of the control while the third and fourth numbers are the width and height of the control.
|
@dcMenuNames (18)
|
Tab delimited list of menu item names associated with the control, menu item or menu bar.
|
@dchWnd (19)
|
Window handle of a dialog control.
|
|
|
DialogControlSet function changes the text or appearance of a control.
Request
|
Meaning
|
@dcTitle (4)
|
Text replaces the existing title.
|
@dcBitmap (12)
|
The file specifications of a bitmap. You can use this request to change the bitmap the control is displaying or you can force the control to display its text instead of a bitmap by setting the parameter to an empty string "" or the "DEFAULT" key string.
|
@dcPosition (17)
|
Space delimited list of a control's position and size in dialog units relative to the dialog's client area. The first two numbers are the horizontal and vertical location of the upper-left corner of the control while the third and fourth numbers are the width and height of the control.
|
|
|
DialogControlState function changes a control’s style or gives control input focus.
Style
|
Meaning
|
@csInvisible (1)
|
Control is invisible
|
@csDisabled (2)
|
Control has disabled appearance and does not accept any user input, it would otherwise accept input.
|
|
|
|
§ Dialog
§ Dialog Overview
§ Defining the Dialog
§ Defining the Dialog Controls
§ Dialog Control Types
§ Dynamic Dialogs
§ InternetExplorer Controls
§ Dialog Units
§ Dialog Fonts
Control Types
§ Calendar
§ Checkbox
§ ComControl
§ DropListbox
§ Editbox
§ FileListbox
§ Groupbox
§ Itembox
§ MenuBar
§ MenuItem
§ MultiLinebox
§ Picture
§ PictureButton
§ PushButton
§ RadioButton
§ ReportView
§ Spinner
§ StaticText
§ VaryText
|