| based on Rapid-Q Documentation by William Yu (c)1999 | Custom components: QBEVEL |
This component duplicates the Delphi TBevel.
' Not an entirely revolutionary thing, but as with most of my components,
something to save
' time and coding. Play around with the combo boxes to see the effects.
Rather simple
' actually, only two new properties: Shape and Style. I think you'll find
them pretty self- explanatory...
' psyclops420 <psyclops420@yahoo.com>
QBevel Properties (QBEVEL EXTENDS QPANEL)
| Field | Type | R/W | Default | Support |
| Align | INTEGER | RW | alNone | W |
| Alignment | INTEGER | RW | taCenter | W |
| 'Style | ||||
| CONST bsLowered = 0 CONST bsRaised = 1 | ||||
| 'Shape' | ||||
| CONST bsSpacer = 0 CONST bsBox = 1 CONST bsTopLine = 2 CONST bsBottomLine = 3 CONST bsLeftLine = 4 CONST bsRightLine = 5 CONST bsFrame = 6 | ||||
| BevelInner | INTEGER | RW | bvNone | W |
| BevelOuter | INTEGER | RW | bvRaised | W |
| BevelWidth | INTEGER | RW | 1 | W |
| BorderStyle | INTEGER | RW | bsNone | W |
| '-- Bevel Style CONST bvNone = 0 CONST bvLowered = 1 CONST bvRaised = 2 '-- Bevel Border CONST bpNone = 0 '-- No visible border CONST bpSingle = 1 '-- Single-line border | ||||
| Caption | STRING | RW | W | |
| ClientHeight | INTEGER | RW | WX | |
| ClientWidth | INTEGER | RW | WX | |
| Color | INTEGER | RW | W | |
| Cursor | INTEGER | RW | crDefault | W |
| Enabled | INTEGER | RW | True | WX |
| Font | QFONT | W | W | |
| Height | INTEGER | RW | WX | |
| Hint | STRING | RW | W | |
| Left | INTEGER | RW | 0 | WX |
| Parent | QFORM/Qbevel/QTABCONTROL | W | WX | |
| ShowHint | INTEGER | RW | False | W |
| TabOrder | INTEGER | RW | W | |
| Tag | INTEGER | RW | WXG | |
| Top | INTEGER | RW | 0 | WX |
| Width | INTEGER | RW | WX | |
| Visible | INTEGER | RW | True | WX |
| Method | Type | Description | Params | Support |
| Repaint | SUB | Refreshes panel and all contents | 0 | W |
| Event | Type | Occurs when... | Params | Support |
| OnClick | VOID | User clicked on open area of panel | 0 | WX |
| OnDblClick | VOID | User double clicked panel | 0 | W |
| OnMouseDown | SUB (Button%, X%, Y%, Shift%) | Mouse button held down | 4 | W |
| OnMouseMove | SUB (X%, Y%, Shift%) | Mouse moves over panel | 3 | W |
| OnMouseUp | SUB (Button%, X%, Y%, Shift%) | Mouse button is released | 4 | W |
'=================================================
' Sample program
'=================================================
DECLARE SUB ChangeStyle
DECLARE SUB ChangeShape
CREATE Form AS QFORM
CREATE Menu AS QMAINMENU
CREATE Item AS QMENUITEM
Caption = "Menu"
END CREATE
END CREATE
CREATE ToolBar AS QBEVEL
Align = 1
Height = 50
Shape = bsTopLine
Caption = "ToolBar"
END CREATE
CREATE Bevel AS QBEVEL
Top = 80
Left = 30
Width = 130
Height = 30
color=&h0000ff
font.color=&hffffff
caption="Bevel"
BevelWidth=9
END CREATE
CREATE Style AS QCOMBOBOX
Top = 150
Left = 10
AddItems "bsLowered", "bsRaised"
ItemIndex = 0
OnChange = ChangeStyle
END CREATE
CREATE Shape AS QCOMBOBOX
Top = 150
Left = 160
AddItems "bsSpacer", "bsBox", "bsTopLine", "bsBottomLine", "bsLeftLine", "bsRightLine", "bsFrame"
ItemIndex = 0
OnChange = ChangeShape
END CREATE
END CREATE
Form.ShowModal
SUB ChangeStyle
Bevel.Style = Style.ItemIndex
END SUB
SUB ChangeShape
Bevel.Shape = Shape.ItemIndex
END SUB
| Prev Component | Contents | Next Component |