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

QCOOLBTN Component

QCoolbtn is an extension of QButton, but allows Flat buttons, and toggle buttons (via GroupIndex).

QCoolbtn Properties
FieldTypeR/WDefaultSupport
AlignINTEGERRWalNoneW
Align determines how the control aligns within its parent control.
AllowAllUpINTEGERRWFalseW
AllowAllUp specifies whether all buttons in the group can be unselected at the same time.
BMPSTRINGWWX
Use BMP to assign a new bitmap file, or to use BMP in a draw statement.
Examples:
DIM coolbutton AS QCOOLBTN
coolbutton.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 clicked.
The "fourth" bitmap appears when the button stays down.
You have to tell Rapid-Q how many images are in your bitmap by assigning the number to NumBMPs.
BMPHandleRESOURCEWW
CaptionSTRINGRWWXG
CursorINTEGERRWcrDefaultW
DownINTEGERRWFalseWX
Down specifies whether the button is selected (down) or unselected (up).
EnabledINTEGERRWTrueWXG
FlatINTEGERRWFalseWX
Flat determines whether the button has a 3D border that provides a raised or lowered look.
FontQFONTWW
GroupIndexINTEGERRW0W
GroupIndex allows buttons to work together as a group. If GroupIndex is 0, the button behaves independently of all other buttons.
HeightINTEGERRWWXG
HintSTRINGRWWXG
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
NumBMPsINTEGERRWW
NumBMPs determines the number of images within the bitmap button.
ParentQFORM/QPANEL/QTABCONTROLWWXG
ShowHintINTEGERRWFalseWXG
SpacingINTEGERRW4W
Determines the separation, in pixels, between the image and the caption.
TabOrderINTEGERRWW
TagINTEGERRWWXG
TopINTEGERRW0WXG
WidthINTEGERRWWXG
VisibleINTEGERRWTrueWXG

QCoolbtn Methods
MethodTypeDescriptionParamsParams
StartDragSUBAllows Button to be dragged0W

QCoolbtn Events
EventTypeOccurs when...Params
OnClickVOIDUser clicked on the button0WXG
OnMouseDownSUB (Button%, X%, Y%, Shift%)Mouse button held down4WX
OnMouseMoveSUB (X%, Y%, Shift%)Mouse moves3WX
OnMouseUpSUB (Button%, X%, Y%, Shift%)Mouse button is released4WX


QCoolbtn Examples
  '-- An example of toggle buttons (via GroupIndex)

  CONST False = 0: CONST True = 1

  DIM Form AS QForm
  DIM Cool1 AS QCoolbtn
  DIM Cool2 AS QCoolbtn

  Cool1.Parent = Form
  Cool1.GroupIndex = 1       '' Must be > 0
  Cool1.Down = True          '' Button initially down
  Cool2.Parent = Form
  Cool2.GroupIndex = 1       '' Same group as Cool1
  Cool2.Left = 40

  Form.ShowModal

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