A PictureButton displays a picture and, like a CommandButton,
is used to carry out an action. For example, you can use a button
with a picture of a file to save a file, or a button with a picture
of a stop sign to cancel a requested deletion.
Picture format restrictions
Unlike BMP and GIF images and ICO icons, JPEG and PNG images
must reside in the file system, not in a PocketBuilder resource
file (PKR) or in a database blob. You must deploy JPEG or PNG files
to the current application directory or include the full path of
the deployed image files that you want to use in a Pocket PC device
or emulator. PNG files are not supported on the desktop, only on
Pocket PC devices and emulators, and can only be added at runtime.
PictureButton property
|
Datatype
|
Description
|
BringToTop
|
Boolean
|
Specifies whether PocketBuilder moves
the control to the top of the front-to-back order of the window.
|
Cancel
|
Boolean
|
Specifies whether the control acts as
the Cancel button (the Cancel button receives a Clicked event if
the user presses Esc). Values are:
|
ClassDefinition
|
PowerObject
|
An object of type PowerObject containing
information about the class definition of the object or control.
|
Default
|
Boolean
|
Specifies whether the control is the
default PictureButton (the default PictureButton has a thick border
and receives a clicked event if the user presses Enter without selecting
an control). Values are:
Editable controls Default behavior can be affected by editable controls on the
window. For more information, see the User’s Guide.
|
DisabledName
|
String
|
Specifies the name of the picture (bitmap
image) that displays when the control is disabled. If the string
has no extension, PocketBuilder adds an appropriate extension.
|
DragAuto
|
Boolean
|
Specifies whether PocketBuilder puts
the control automatically into Drag mode. Values are:
TRUE –
When the control is clicked, the control is automatically in Drag
mode
FALSE – When the control
is clicked, the control is not automatically in Drag mode. You have
to manually put the control into Drag mode by using the Drag function.
|
DragIcon
|
String
|
Specifies the name of the stock icon
or the file containing the icon you want to display when the user
drags the control (the ICO file). The default
icon is a box the size of the control.
When the user drags the control, the icon displays when the control
is over an area in which the control can be dropped (a valid drop
area). When the control is over an area that is not a valid drop
area, the No-Drop icon displays.
|
Enabled
|
Boolean
|
Specifies whether the control is enabled
(can be selected). Values are:
|
FaceName
|
String
|
Specifies the name of the typeface in
which the text of the control displays (for example, ARIAL or COURIER).
|
FontCharSet
|
FontCharSet (enumerated)
|
Specifies the font character set used
for the text in the control. Values are:
ANSI!
ChineseBig5!
DefaultCharSet!
Hangeul!
OEM!
ShiftJIS!
Symbol!
|
FontFamily
|
FontFamily (enumerated)
|
Specifies the font family (type style)
used for the text in the control. Values are:
AnyFont!
Decorative!
Modern!
Roman!
Script!
Swiss!
|
FontPitch
|
FontPitch (enumerated)
|
Specifies the pitch (spacing) of the
font used for the text in the control. Values are:
Default!
Fixed!
Variable!
|
Height
|
Integer
|
Specifies the height of the control,
in PowerBuilder units.
|
HTextAlign
|
Alignment (enumerated)
|
Specifies how the text in the control
is aligned. Values are:
Center!
Justify!
Left!
Right!
|
Italic
|
Boolean
|
Specifies whether the text in the control
is italic. Values are:
|
Map3DColors
|
Boolean
|
Specifies whether the system 3D colors
are mapped to the control. Values are:
|
OriginalSize
|
Boolean
|
Specifies whether the width and height
properties of a bitmap image (picture) are set to their original
values. Values are:
In the Window painter, setting OriginalSize to TRUE overrides the
existing width and height. You cannot change this property in a
script.
|
PictureName
|
String
|
Specifies the name of the file that contains
the picture.
|
Pointer
|
String
|
Specifies the name of the stock pointer
or the file containing the pointer used for the control.
|
PowerTipText
|
Long
|
Specifies a PowerTip for the control
|
TabOrder
|
Integer
|
Specifies the tab value of the control
within the window (0 means the user cannot tab to the control).
|
Tag
|
String
|
Specifies the tag value assigned to the
control.
|
Text
|
String
|
Specifies the text that displays in the
control.
|
TextSize
|
Integer
|
Specifies the size of the text in the
control, in points. For backward compatibility, the size is stored
as a negative number; for example, 10-point text size is stored
as -10.
|
Underline
|
Boolean
|
Specifies whether the text in the control
is underlined. Values are:
|
Visible
|
Boolean
|
Specifies whether the control is visible.
Values are:
|
VTextAlign
|
VTextAlign (enumerated)
|
Specifies how the text in the control
is aligned. Values are:
Bottom!
MultiLine!
Top!
VCenter!
All these values except MultiLine! assume there is only one
line of text.
|
Weight
|
Integer
|
Specifies the stroke weight of the text
in the control; for example, 400 for normal or 700 for bold.
|
Width
|
Integer
|
Specifies the width of the control, in
PowerBuilder units.
|
X
|
Integer
|
Specifies the X position (the distance
from left edge of the window), in PowerBuilder units.
|
Y
|
Integer
|
Specifies the Y position (the distance
from top of the window), in PowerBuilder units.
|
PictureButton event
|
Occurs
|
Clicked
|
When the control is clicked.
|
Constructor
|
Immediately before the Open event occurs
in the window.
|
Destructor
|
Immediately after the Close event occurs
in the window.
|
DragDrop
|
When a dragged control is dropped on
the control.
|
DragEnter
|
When a dragged control enters the control.
|
DragLeave
|
When a dragged control leaves the control.
|
DragWithin
|
When a dragged control is within the
control.
|
GetFocus
|
Just before the control receives focus
(before it is selected and becomes active).
|
Help
|
When the user presses the F1 key or drags
the context help button (question mark) from the title bar to a
menu item or control.
|
LoseFocus
|
When the control loses focus (becomes
inactive).
|
Other
|
When a Windows message occurs that is
not a PocketBuilder event.
|
RButtonDown
|
When the right mouse button is pressed
on the control.
|
PictureButton function
|
Datatype returned
|
Description
|
ClassName
|
String
|
Returns the name assigned to the control.
|
Drag
|
Integer
|
Starts or ends the dragging of the control.
|
GetContextService
|
Integer
|
Creates a reference to a context-specific
instance of the specified service.
|
GetParent
|
PowerObject
|
Returns a reference to the name of the
parent object.
|
Hide
|
Integer
|
Makes the control invisible.
|
Move
|
Integer
|
Moves the control to a specified location.
|
PointerX
|
Integer
|
Returns the distance the pointer is from
the left edge of the control.
|
PointerY
|
Integer
|
Returns the distance the pointer is from
the top of the control.
|
PostEvent
|
Boolean
|
Adds an event to the end of the message
queue for the control.
|
Print
|
Integer
|
Prints the control.
|
Resize
|
Integer
|
Changes the size of the control.
|
SetFocus
|
Integer
|
Sets focus to the specified control.
|
SetPosition
|
Integer
|
Specifies the position of the control
in the front-to-back order of the window.
|
SetRedraw
|
Integer
|
Controls automatic redrawing of the control
after each change in its properties.
|
Show
|
Integer
|
Makes the control visible.
|
TriggerEvent
|
Integer
|
Triggers a specified event in the control
and executes the script for the event.
|
TypeOf
|
Object
|
Returns the type of the control.
|