Rapid-Q Documentation by William Yu (c)1999-2000 - Additional by Ben Laws (c) 2004 | Appendix A: QDOCKFORM |
Field | Type | Read/Write | Default Value |
Align | INTEGER | RW | 3 |
You should use this property over the left and top properties | |||
AltAlign | INTEGER | RW | 0 |
If 'style' is 1 then specify the alignment of the second location the form can dock at. If AltAlign is 0 then by default, the opposite alignment of the original position is used (e.g. original = top, alternative = bottom) | |||
AltDock | INTEGER | R | 0 |
Returns TRUE if the form is docked in the alternative position, otherwise FALSE | |||
AltPanel.Parent | QFORM | RW | This |
This must be set to where you would like your form's alternative docking location to be. | |||
CanClose | INTEGER | RW | False |
TRUE if the form can close (has a close button at the top right), otherwise FALSE | |||
Canvas | QCANVAS | RW | |
Use for drawing on the panel - use with the OnPaint event | |||
Caption | STRING | RW | |
Caption is the text that appears as the title of your dockable form. It will only appear depending on the docked and undocked styles you use | |||
Client | QPANEL | RW | |
You should always use this panel for placing components inside the form.
e.g.
CREATE Properties AS QDOCKFORM ... CREATE PropertiesGrid AS QSTRINGGRID 'This is where you set the parent to be the properties client panel Parent = Properties.Client END CREATE END CREATE You can also change the panel, like a regular QPANEL | |||
Closed | INTEGER | R | False |
Returns TRUE if the form is closed, otherwise False | |||
Docked | INTEGER | R | True |
Returns TRUE if the form is currently docked. The form is always docked on creation | |||
DockStyle | INTEGER | RW | 0 |
Changes the appearance of the form. Use styles 0 to 6, and 10. 7 to 9 are not used. They are for making your own toolbar styles. Anything past 10 is for making regular styles This style is seen when the form is docked | |||
DragCursor | INTEGER | RW | -21 |
The cursor to be displayed when it is over the draggable section of the form | |||
Font | QFONT | W | |
Height | INTEGER | RW | |
Get or set the form's vertical size (in pixels). You should use align instead | |||
Left | INTEGER | RW | 0 |
Specifies the left edge of the form relative to the desktop screen. You should use align instead | |||
Locked | INTEGER | RW | False |
Set to TRUE if the form is locked in its current docking position (i.e. cannot be moved), otherwise FALSE. Locking the form when it is not docked will result in the form not being able to move. | |||
Parent | QFORM | W | |
Sizeable | INTEGER | RW | False |
Specifies whether the form can be resized or not when undocked. Using this is not advisable as there is no way of setting the minimum size of the form - yet. | |||
ST1_TitleBackground | INTEGER | RW | 0 |
Color of the form's caption background for DockStyle 1 and UndockStyle 1 | |||
Style | INTEGER | RW | 0 |
0 = The form will dock only where it is placed 1 = The form will dock where it is placed, and in another location specified by 'AltAlign' | |||
TitleColor | INTEGER | RW | 0 |
Color of the form's caption text (if any) | |||
Top | INTEGER | RW | 0 |
UndockedForm.Handle | INTEGER | R | |
Get the form's handle for WinAPI calls. | |||
UndockedForm.Parent | INTEGER | W | This |
Set the parent when undocked | |||
UndockedHeight | INTEGER | RW | 400 |
Height of form when undocked - overridden when sized. | |||
UndockedWidth | INTEGER | RW | 170 |
UndockStyle | INTEGER | RW | 0 |
Changes the appearance of the form. Use styles 1 to 5, and 10. 6 to 9 are not used. They are for making your own toolbar styles. Anything past 10 is for making regular styles This style is seen when the form is undocked | |||
Width | INTEGER | RW | 320 |
Visible | INTEGER | RW | |
Do not use when the form is undocked |
Method | Type | Description | Params |
Close | SUB | Close the form | 0 |
Dock | SUB (Dock AS INTEGER) |
0 = Undock 1 = Dock at original position 2 = Dock at alternative (or original if not possible) This method is also used to show a closed form. | 1 |
Event | Type | Occurs when... | Params |
OnDock | SUB (Docked AS INTEGER, Alt AS INTEGER) | 'Docked' is true if the form was docked, otherwise false. 'Alt' is true if it was docked in the alternative location | 2 |
OnPaint | VOID | Form requires repainting. Use Canvas for drawing | 0 |
OnClose | VOID | Form is closing | 0 |
$INCLUDE "RAPIDQ2.INC" 'from "QDOCKFORM.inc" DECLARE SUB SortStatusBar (Docked AS INTEGER, Alt AS INTEGER) DECLARE SUB AddText DECLARE SUB DockLeft DECLARE SUB DockRight DECLARE SUB Undock DECLARE SUB Selected DECLARE SUB ShowForm DECLARE SUB FormClosed CREATE Form AS QFORM Width = 640 Height = 480 Center Caption = "Docking windows example" CREATE MainEdit AS QRICHEDIT Align = 5 Visible = 1 END CREATE CREATE EventsPanel AS QDOCKFORM UndockedForm.Parent = Form Align = 4 DockStyle = 10 UndockedWidth = EventsPanel.Width AltPanel.Parent = Form Style = 1 Caption = "Events - Locked" Client.BevelOuter = 0 Canvas.Font.Name = "Tahoma" Locked = 1 CREATE StringGrid AS QSTRINGGRID Parent = EventsPanel.Client Align = 5 ColCount = 2 ColWidths(0) = EventsPanel.Client.Width / 2 ColWidths(1) = EventsPanel.Client.Width / 2 RowCount = 10 END CREATE END CREATE CREATE ProjPanel AS QDOCKFORM AltPanel.Parent = Form 'AltAlign = 4 UndockedForm.Parent = Form Caption = "Project" Align = 3 DockStyle = 1 UnDockStyle = 1 Style = 1 Client.BevelOuter = 0 Canvas.Font.Name = "Tahoma" UndockedWidth = ProjPanel.Width CanClose = 1 OnClose = FormClosed CREATE ComponentsPanel AS QPANEL Parent = ProjPanel.Client Align = 5 CREATE AddTextButton AS QBUTTON Left = 50 Top = 150 Caption = "Add Text" OnClick = AddText END CREATE CREATE DockLeftButton AS QBUTTON Top = 30 Width = 70 Left = 10 Caption = "Dock Left" OnClick = DockLeft END CREATE CREATE DockRightButton AS QBUTTON Top = 30 Width = 70 Left = ComponentsPanel.Width - DockRightButton.Width - 20 Caption = "Dock Right" OnClick = DockRight END CREATE CREATE UndockButton AS QBUTTON Left = (ComponentsPanel.Width - UndockButton.Width) / 2 - 10 Top = 70 Caption = "Undock" OnClick = Undock END CREATE END CREATE END CREATE CREATE ToolbarBox AS QDOCKFORM UndockedForm.Parent = Form Align = 1 Height = 31 DockStyle = 6 UnDockStyle = 6 UndockedWidth = 600 UndockedHeight = 55 AltPanel.Parent = Form Style = 1 Caption = "Toolbar Example" CREATE Label AS QLABEL Parent = ToolbarBox.Client Caption = "Select a style:" Autosize = 1 Top = 5 END CREATE CREATE List AS QCOMBOBOX Parent = ToolbarBox.Client Left = 90 Top = 2 AddItems("0 - Striped","1 - Office XP","2 - Grips","3 - Striped (toolbar)","4 - Grips (toolbar)","5 - 3D (toolbar)","6 - Striped Horizontal (toolbar)","10 - Regular") ItemIndex = 1 OnChange = Selected END CREATE CREATE ShowButton AS QBUTTON Parent = ToolbarBox.Client Top = 0 Left = 290 Caption = "Show Form" Enabled = 0 OnClick = ShowForm END CREATE END CREATE CREATE StatusBarBox AS QDOCKFORM UndockedForm.Parent = Form Align = 2 Height = 25 DockStyle = 6 UnDockStyle = 6 UndockedWidth = 600 UndockedHeight = 49 AltPanel.Parent = Form Style = 1 OnDock = SortStatusBar Caption = "Status Bar" CREATE SB AS QSTATUSBAR Parent = StatusBarBox.Client Align = 5 SizeGrip = 0 AddPanels("This Statusbar can be moved!", "I'm Docked at the Bottom!") Panel(0).Width = 160 END CREATE END CREATE END CREATE Form.ShowModal SUB SortStatusBar (Docked AS INTEGER, Alt AS INTEGER) IF Docked = 0 THEN SB.Panel(1).Caption = "I'm Not Docked Anywhere!" EXIT SUB END IF IF Docked = 1 THEN SB.Panel(1).Caption = "I'm Docked at the " + IIF(Alt = 1, "Top", "Bottom") END IF END SUB SUB AddText MainEdit.AddString("You just added some text") END SUB SUB DockLeft ProjPanel.Dock(1) END SUB SUB DockRight ProjPanel.Dock(2) END SUB SUB Undock ProjPanel.Dock(0) END SUB SUB Selected ProjPanel.DockStyle = VAL(LEFT$(List.Item(List.ItemIndex), 2)) ProjPanel.UnDockStyle = VAL(LEFT$(List.Item(List.ItemIndex), 2)) ProjPanel.Canvas.Repaint END SUB SUB ShowForm ShowButton.Enabled = 0 ProjPanel.Dock(ProjPanel.AltDock + 1) END SUB SUB FormClosed ShowButton.Enabled = 1 END SUB