Appendix A: QCOOLBTN
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
Field | Type | R/W | Default | Support |
|
|
|
|
|
Align | INTEGER | RW | alNone | W |
| Align determines how the control aligns within its parent control.
|
AllowAllUp | INTEGER | RW | False | W |
| AllowAllUp specifies whether all buttons in the group can be unselected at the same time.
|
BMP | STRING | W | | WX |
| 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.
|
BMPHandle | RESOURCE | W | | W |
Caption | STRING | RW | | WXG |
Cursor | INTEGER | RW | crDefault | W |
Down | INTEGER | RW | False | WX |
| Down specifies whether the button is selected (down) or unselected (up).
|
Enabled | INTEGER | RW | True | WXG |
Flat | INTEGER | RW | False | WX |
| Flat determines whether the button has a 3D border that provides a raised or lowered look.
|
Font | QFONT | W | | W |
GroupIndex | INTEGER | RW | 0 | W |
| GroupIndex allows buttons to work together as a group. If GroupIndex is 0, the button behaves
independently of all other buttons.
|
Height | INTEGER | RW | | WXG |
Hint | STRING | RW | | WXG |
Layout | INTEGER | RW | blBMPLeft | W |
| 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
|
Left | INTEGER | RW | 0 | WXG |
NumBMPs | INTEGER | RW | | W |
| NumBMPs determines the number of images within the bitmap button.
|
Parent | QFORM/QPANEL/QTABCONTROL | W | | WXG |
ShowHint | INTEGER | RW | False | WXG |
Spacing | INTEGER | RW | 4 | W |
| Determines the separation, in pixels, between the image and the caption.
|
TabOrder | INTEGER | RW | | W |
Tag | INTEGER | RW | | WXG |
Top | INTEGER | RW | 0 | WXG |
Width | INTEGER | RW | | WXG |
Visible | INTEGER | RW | True | WXG |
QCoolbtn Methods
Method | Type | Description | Params | Params |
|
|
|
|
|
StartDrag | SUB | Allows Button to be dragged | 0 | W |
QCoolbtn Events
Event | Type | Occurs when... | Params |
|
|
|
|
OnClick | VOID | User clicked on the button | 0 | WXG |
OnMouseDown | SUB (Button%, X%, Y%, Shift%) | Mouse button held down | 4 | WX |
OnMouseMove | SUB (X%, Y%, Shift%) | Mouse moves | 3 | WX |
OnMouseUp | SUB (Button%, X%, Y%, Shift%) | Mouse button is released | 4 | WX |
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
|
|