Method |
Type |
Description |
Params |
|
|
|
|
AddSections |
SUBI |
Add new sections to header |
STRING, Infinite |
Clear |
SUB |
Clears all sections |
0 |
Circle |
SUB (x1%, y1%, x2%, y2%, c%, fill%) |
Draw & Fill Circle |
6 |
CopyRect |
SUB (D, Image, S) |
D and S are QRECTs, Image can be a QImage, QCanvas, or QBitmap |
3 |
Draw |
SUB (x%, y%, BMP) |
Draw Bitmap at (X,Y) |
3 |
FillRect |
SUB (x1%, y1%, x2%, y2%, c%) |
Draws & Fills a rectangle |
5 |
Line |
SUB (x1%, y1%, x2%, y2%, c%) |
Draws a line |
5 |
Paint |
SUB (x%, y%, c%, borderc%) |
Fill Region |
4 |
Pset |
SUB (x%, y%, c%) |
Pixel plot |
3 |
Rectangle |
SUB (x1%, y1%, x2%, y2%, c%) |
Draws a rectangle |
5 |
Repaint |
SUB |
Force repainting of header |
0 |
RoundRect |
SUB (x1%, y1%, x2%, y2%, x3%, y3%, c%) |
Draws & Fills a rounded rectangle |
7 |
StretchDraw |
SUB (Rect AS QRECT, BMP) |
Draw BMP and stretch to fit inside Rect |
2 |
TextHeight |
FUNCTION (Text$) AS WORD |
Returns the height, in pixels, of Text$ string |
1 |
TextWidth |
FUNCTION (Text$) AS WORD |
Returns the width, in pixels, of Text$ string |
1 |
TextRect |
SUB (Rect AS QRECT, x%, y%, S$, fc%, bc%) |
Write text, and clip within region Rect |
6 |
TextOut |
SUB (x%, y%, S$, fc%, bc%) |
Writes text to image |
5 |
Event |
Type |
Occurs when... |
Params |
|
|
|
|
OnDrawSection |
SUB (Index%, Pressed%, Rect AS QRECT) |
A header section needs to be redisplayed. Header section's Style property must be hsOwnerDraw |
3 |
OnMouseDown |
SUB (Button%, X%, Y%, Shift%) |
Mouse button held down |
4 |
OnMouseMove |
SUB (X%, Y%, Shift%) |
Mouse moves |
3 |
OnMouseUp |
SUB (Button%, X%, Y%, Shift%) |
Mouse button is released |
4 |
OnResize |
VOID |
Size of header control changes |
0 |
OnSectionClick |
SUB (Index%) |
Header section Index% is clicked |
1 |
OnSectionResize |
SUB (Index%) |
Header section is resized |
1 |
OnSectionTrack |
SUB (Index%, Width%, State%) |
Header section is dragged |
3 |
QHeader Examples
$TYPECHECK ON
$INCLUDE "RAPIDQ.INC"
DECLARE SUB DrawSection (Index AS INTEGER, Pressed AS INTEGER, Rect AS QRECT, Sender AS QHEADER)
DECLARE SUB SectionTrack (Index AS INTEGER, Width AS INTEGER, State AS INTEGER, Sender AS QHEADER)
CREATE Form AS QFORM
Caption = "QHeader example"
Center
CREATE Header AS QHEADER
AddSections "1", "2", "3"
Sections(1).AllowClick = FALSE
Sections(0).Style = hsOwnerDraw
Sections(0).Width = 100
Sections(1).Style = hsOwnerDraw
Sections(2).Style = hsOwnerDraw
OnDrawSection = DrawSection
OnSectionTrack = SectionTrack
END CREATE
CREATE ListBox1 AS QLISTBOX
Align = alLeft
Width = 100
AddItems "1. Rapid-Q", "2. Taxes"
END CREATE
CREATE StatusBar AS QSTATUSBAR
SimplePanel = TRUE
SimpleText = "Not moving"
END CREATE
ShowModal
END CREATE
SUB DrawSection (Index AS INTEGER, Pressed AS INTEGER, Rect AS QRECT, Sender AS QHEADER)
Sender.TextOut(Rect.Left+5,Rect.Top+1, STR$(Index+1), &HFF0000, -1)
SELECT CASE Index
CASE 0
Sender.FillRect(Rect.Left+20,Rect.Top+2,Rect.Right-20,Rect.Bottom-2, &H00FF00)
CASE 1
Sender.Circle(Rect.Left+20,Rect.Top+2,Rect.Right-20,Rect.Bottom-2, &HFF, &HFF)
CASE 2
END SELECT
END SUB
SUB SectionTrack (Index AS INTEGER, Width AS INTEGER, State AS INTEGER, Sender AS QHEADER)
StatusBar.SimpleText = "Moving "+STR$(Width)
SELECT CASE Index
CASE 0
ListBox1.Width = Width
END SELECT
END SUB
Prev ComponentContentsNext Component