Rapid-Q Documentation by William Yu (c)1999-2000 Appendix A: QBUTTON

QBUTTON Component

QButton is a general purpose button control.

QButton Properties
FieldTypeR/WDefaultSupport
AlignINTEGERRWalNoneW
Align determines how the control aligns within its parent control.
BMPSTRINGRWW
Use BMP to assign a new bitmap file, or to use BMP in a draw statement.
Examples:
DIM button AS QBUTTON
button.BMP = "whatever.bmp"
Details:
You can hold multiple images on a single bitmap, but they must be of the same size and next to each other in a horizontal row.
The "first" bitmap appears when the button is up.
The "second" bitmap appears when the button disabled.
The "third" bitmap appears when the button is down (clicked).
You have to tell Rapid-Q how many images are in your bitmap by assigning the number to NumBMPs.
BMPHandleRESOURCEWW
Assign a BMP resource handle to appear on the selected button.
Example:
$RESOURCE game_BMP AS "game.bmp"
DIM button AS QBUTTON
button.bmpHandle = game_BMP
CancelINTEGERRWFalseW
If Cancel is True, the button's OnClick event handler executes when the user presses the Escape key.
CaptionSTRINGRWWXG
Caption specifies the text that appears on the button. To underline a character, include an ampersand (&) symbol before the character.
ColorINTEGERRWX
CursorINTEGERRWcrDefaultW
DefaultINTEGERRWFalseW
If Default is True, the button's OnClick event handler executes when the user presses the Enter key.
EnabledINTEGERRWTrueWXG
FontQFONTWW
HandleINTEGERRW
HeightINTEGERRWWXG
HintSTRINGRWWXG
KindINTEGER
'-- Button Kind
CONST bkCustom = 0 '-- None
CONST bkOK = 1 '-- Check Bitmap
CONST bkCancel = 2 '-- X Bitmap
CONST bkHelp = 3 '-- ? Bitmap
CONST bkYes = 4
CONST bkNo = 5
CONST bkClose = 6
CONST bkAbort = 7
CONST bkRetry = 8
CONST bkIgnore = 9
CONST bkAll = 10
RWbkCustomW
LayoutINTEGERRWblBMPLeftW
Layout determines where the bitmap image appears on the button.
0 = blBMPLeft -- image appears at the left side of the caption
1 = blBMPRight -- image appears at the right side of the caption
2 = blBMPTop -- image appears above the caption
3 = blBMPBottom -- image appears below the caption
LeftINTEGERRW0WXG
ModalResultINTEGERRWmrNoneW
NumBMPsINTEGERRWW
NumBMPs determines the number of images within the bitmap button.
ParentQFORM/QPANEL/QTABCONTROLWWXG
PopupMenuQPOPUPMENUWW
ShowHintINTEGERRWFalseWXG
SpacingINTEGERRW4W
Determines the separation, in pixels, between the image and the caption.
TabOrderINTEGERRWW
TagINTEGERRWWXG
TopINTEGERRW0WXG
WidthINTEGERRWWXG
VisibleINTEGERRWTrueWXG

QButton Methods
MethodTypeDescriptionParamsSupport
StartDragSUBAllows Button to be dragged0W

QButton Events
EventTypeOccurs when...ParamsSupport
OnClickVOIDUser clicked on the button0WXG
OnKeyDownSUB (Key AS Word, Shift AS INTEGER)Key held down2W
OnKeyPressSUB (Key AS BYTE)User presses a key1W
OnKeyUpSUB (Key AS Word, Shift AS INTEGER)User releases a key2W
OnMouseDownSUB (Button%, X%, Y%, Shift%)Mouse button held down4WXG
OnMouseMoveSUB (X%, Y%, Shift%)Mouse moves3WXG
OnMouseUpSUB (Button%, X%, Y%, Shift%)Mouse button is released4WXG


QButton Examples
  '-- A drag button

  DIM Form AS QForm
  DIM Button AS QButton

  SUB MouseDown
      Button.StartDrag
      SHOWMESSAGE STR$(Button.Left)+", "+STR$(Button.Top)
  END SUB

  Button.Parent = Form
  Button.OnMouseDown = MouseDown

  Form.ShowModal

Prev Component Contents Next Component
Hosted by uCoz
D>
Hosted by uCoz