The PICTUREBUTTON control is a push button that displays a bitmap on its face instead of text and a background color. Dialog Editor places your indicated bitmap file name and path in the Bitmap attribute. This parameter is used for background color in most other controls. Although the control does not normally display text, you can place a text string in Text attribute of the controls definition. WinBatch will display the text when it cannot find the bitmap indicated in the Bitmap attribute while loading the dialog template. Also, if you include an ampersand in the text, your users will be able to use an accelerator key to navigate to buttons just like they can with regular push buttons.
Return Value:
The PICTUREBUTTON control will return the value you supply as the Value attribute in the controls definition.
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,PICTUREBUTTON,"PictureButton_1",DEFAULT,"Pict button 1",2,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
|
PICTUREBUTTON
|
The type of control.
|
control-name
|
"PictureButton_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
|
"Pict button 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
|
2
|
The value returned by the control. Note: should be within the range of 0 - 127.
|
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.
|
@csDefButton (32)
|
A button with this style is the default button when no push or picture button has the input focus. The user can select this button by pressing the enter key if no button has the input focus. You should only give one button this style. If you give the style to more than one button, only the first button (in the tab order) will have the style. Generally, give this style to the button that is the most likely option in your dialog.
|
@csFlat (128)
|
Creates a button with a flat appearance. All aspects of the button's border are removed including the 3d shadowing.
|
@csShield (8192)
|
Display Security Shield icon on button (Vista or newer).
|
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
|
@dePbPush (2)
|
PUSHBUTTON or PICTUREBUTTON Pushed: User has pressed a PUSHBUTTON or PICTUREBUTTON 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.
|
@csDefButton (32)
|
A button with this style is the default button when no push or picture button has the input focus. The user can select this button by pressing the enter key if no button has the input focus. You should only give one button this style. If you give the style to more than one button, only the first button (in the tab order) will have the style. Generally, give this style to the button that is the most likely option in your dialog.
|
@csFlat (128)
|
Creates a button with a flat appearance. All aspects of the button's border are removed including the 3d shadowing.
|
@csShield (8192)
|
Display Security Shield icon on button (Vista or newer).
|
|
|
|
§ 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
|