Copyright: Copyright © 1996,97 P van Lonkhuyzen
Citation: Copyright © 1996,97 P van Lonkhuyzen


About
Property About : TString (read only)

Applies to TDocPanel

Gives the version information of the component.


Arrangement
Property Arrangement : TArrangemethods

Applies to TDocPanel

This is one of the most important properties as it determines the behaviour and look of the panel when floating.

valid values are

amAuto	: This will pack all controls without any additional spacing.

amWidth	: This will leave the controls with their original spacing.

amNone	: No arrangement of the controls is done.

Default = amAuto


AutoHide
Property AutoHide : Boolean

Applies to TDocPanel

True : A close button will be displayed in the caption of the floating window which will hide the window.

False : The user has no way of hiding the floating window.

Setting this property to true will switch off the DropDown option due to the shared button.

Default = True


AutoWrap
Property AutoWrap : Boolean

Applies to TDocPanel

If On Autowrap will automatically resize to toolbar and rearrange the components when docked to a side if the components on the toolbar don't fit.

Default False


Bug Reports

All efforts will be made to fix a bug as quickly as possible but I can only do that if it can easily be reproduced. In the event of you finding a bug, see if you can reproduce it in a simple piece of code and email me that code including the DFM file with a description of the bug. As soon as the bug is fixed you will be sent an intermediate version with the bug fix.

Email :

peterv@global.co.za

Home page :

http://www.global.co.za/~peterv/


CaptionType
Property CaptionType : TCaptionType

Applies to TDocPanel

This Property controls what type of caption is used

ctCustom : A custom caption is created with the size determined by the TitleFont property.

ctNot3x : A standard windows caption is used on windows 95 and higher while a custom caption is used on all pre 95 versions of windows.

ctSmall : Corresponds to the bsSizeToolWin and bsToolWindow borderstyles (32 Bit Only)

ctWindows : The standard windows caption is used.

ctNone : No Caption is visible.

Default = ctCustom


Control History

The latest version of the component is always available on on my home page at

http://www.global.co.za/~peterv/

Version 2.55b

Added ShrinkSpeed Property to adjust the steppingspeed in shrinking

Version 2.55

Added the Shrink and ShrinkDelay properties to allow for the panel to shrink off the client when docked

Fixed bug in Autowrap that incorrectly set the positions if a double bevel was used.

Changed the behaviour of the dmDrag/dmBoth docking methods to first calculate the inner client rectangle so as to allow the use of multiple toolbars as well as statusbars.

Changed the default component palette tab to Peter's Components

Version 2.54

Fixed bug where the dropdown button wouldn't reposition itself when Dropdown = true, CaptionType = ctCustom, Floatborder = fbSizeable and PanelDown=false when resized in the x position.

Fixed bug where windows refuses to shutdown if Autohide and Dropdown are both set to false

Added Dropdown panel capabilities using the new

Dropdown property

PanelDown property

OnDropDown event

OnPopUp event

Stopped the Inifile/RegistryKey changing the position of a panel that gets undocked using dmdrag

Version 2.5

Added the ability to drag outside the clientarea without docking.

Added Visual Notification

Fixed problems with amNone Arrangements

Fixed Initial fbSingle Floatborder

Added StartMoving Method

Added ctNone To CaptionType

Added NotificationCursor Property

Changed the behaviour of Autowrap when the panel is docked to the left or right sides.

Fixed more problems with restoring alLeft/alRight aligned panels' widths

Modified the behaviour of the PrepareForChange and DoneChange Methods

Added the AutoWrap Property

Added Inifile property for 32 Bit as well due to slow speed of registry

Added the runtime property Handle

Removed the restriction on changing the FloatBorder and CaptionType Properties while Docked is false

Added the StayOnTop property

Fixed the corruption of alLeft/alRight Aligned panel widths during formload

Changed the handling of WM_MOVE and WM_SIZE to WM_WINDOWPOSCHANGING

so as to cause less flicker when resizing the floating window if the Windows 95 Plus

pack is installed with show windowcontents while dragging set to True

Fixed bug where a Left/Right Aligned Panel could be dragged off the screen

Fixed bug that allowed you to undock outside another docking side

Added position saving capabilities using the Following Properties :

IniFile Property 16 Bit

RegistryKey Property 32 Bit

Added dmBoth to DockingMethod

Added ctSmall to CaptionType to conform to '95 Standards (32 Bit only)

Version 2.4

Fixed hints if using parentshowhint is true

Included 32 Bit Versions of control see instalation instructions.

Added Icon Property

Version 2.3

Fixed class keyword visibility in online help.

Fixed bug in restoring of left and top positions when using alnone alignment.

Fixed flicker when undocking.

Added Support for parent not being of type TForm.

Added Support for multiple rows in docked position.

Added ControlTop, ControlLeft, ControlWidth, ControlHeight and ControlVisible runtime properties.

Added OnVisibleChanged event.

Fixed movement when changing the titlefont if docked when using alnone alignment.

Fixed arrangement and sizing when there are hidden controls on the panel.

Added the PrepareForChange and DoneChange Methods.

Version 2.2

Fixed context sensitive help of object browser (With the exception of class keyword being visible due to limitations of help editor)

Fixed changing of titlefont while not docked.

Made the Docked property visible at design time.

Fixed bug where Alt-F4 would hide the floating panel even with autohide set to false.

Fixed the position of the floating window when releasing from right/bottom alignment.

Right alignment now positions it to the top/right corner of the outline.

Bottom alignment to the bottom/left corner.

All other use the top/right corner.

Added the DockFrame Property

Version 2.1

Added CaptionType

Added dmNone to DockingMethod

Added FloatBorder

Added MaxWidthRestore

Version 2.0

Added Autohide

Added About

Added Arrangement

Added DockingMethod

Added DockingSides

Added Threshold

Version 1.00

Original Release


ControlHeight
Property ControlHeight[Control:Integer] : Integer (runtime)

Applies to TDocPanel

This property allows you to access the height of the control without worrying about the arrangement of the panel as the panel will automatically rearrange all other controls after the change.

This first calls the PrepareForChange Method

Then changes the Controls[Control].Height Property

And finally calls the DoneChange Method.

It should be used in preference to controls[i].height

Valid values for control are from 0 to controlcount-1


ControlLeft
Property ControlLeft[Control:Integer] : Integer (runtime)

Applies to TDocPanel

This property allows you to access the docked left position of the control without worrying about the arrangement of the panel as the panel will automatically rearrange all other controls after the change.

This first calls the PrepareForChange Method

Then changes the Controls[Control].Left Property

And finally calls the DoneChange Method.

It should be used in preference to controls[i].left

Valid values for control are from 0 to controlcount-1


ControlTop
Property ControlTop[Control:Integer] : Integer (runtime)

Applies to TDocPanel

This property allows you to access the docked top Position of the control without worrying about the arrangement of the panel as the panel will automatically rearrange all other controls after the change.

This first calls the PrepareForChange Method

Then changes the Controls[Control].Top Property

And finally calls the DoneChange Method.

It should be used in preference to controls[i].Top

Valid values for control are from 0 to controlcount-1


ControlVisible
Property ControlVisible[Control:Integer] : Boolean (runtime)

Applies to TDocPanel

This property allows you to access/change the visible value of the control without worrying about the arrangement of the panel as the panel will automatically rearrange all other controls after the change.

This first calls the PrepareForChange Method

Then changes the Controls[Control].Visible Property

And finally calls the DoneChange Method.

It should be used in preference to controls[i].visible

Valid values for control are from 0 to controlcount-1


ControlWidth
Property ControlWidth[Control:Integer] : Integer (runtime)

Applies to TDocPanel

This property allows you to access the width of the control without worrying about the arrangement of the panel as the panel will automatically rearrange all other controls after the change.

This first calls the PrepareForChange Method

Then changes the Controls[Control].Width Property

And finally calls the DoneChange Method.

It should be used in preference to controls[i].width

Valid values for control are from 0 to controlcount-1


DockFrame
Property DockFrame : TDockFrame

Applies to TDocPanel

This property determins which frame to use when comparing the position of the floating window to that of the parent window when the DockingMethod is set to dmDrag

dfInner : The borders of the panel inside the floating window get used.

dfOuter : The floating window's borders get used.

Default = dfInner


Docked
Property Docked : Boolean

Applies to TDocPanel

Controls the docked/floating state.

True : The panel is docked to the window

False : The panel is displayed in a floating window.

Default = True


DockingMethod
Property DockingMethod : TDockMethods

Applies to TDocPanel

This determines how the panel gets docked/undocked

dmBoth : Both dmDblClick and dmDrag

dmDblClick : The user must double click on the panel to dock/undock it.

dmDrag : The user must drag the panel away from its position by Threshhold to undock and must drag the panel over one of the DockingSides to dock.

dmNone : The user has no control over the docked status. The program can still change it by setting the Docked property.

Default = dmDblClick


DockingSides
Property DockingSides : Set of [dsLeft,dsRight,dsTop,dsBottom]

Applies to TDocPanel

This determines which sides of the parent window will accept the panel when the Dockingmethod is dmDrag.

Default = [dsTop,dsBottom]


DoneChange
Procedure DoneChange

Applies to TDocPanel

The purpose of this method is to restore the panel after changes to the controls that it contains.

Change : Due to AutoWrap it must now be used even if Docked is true

It does this by unlocking the screen update and arranging all the child controls to their new positions. It MUST follow a call to the PrepareForChange Method (Preferably using a Try - Finally Block).

For an example see PrepareForChange


DropDown
Property DropDown : Boolean

Applies to TDocPanel

This determins if the floating panel behaves like a dropdown panel which can be toggled between the panel or the titlebar only.

False : It behaves like a standard floating window.

True : It behaves like a dropdown window.

Due to restrictions in the standard window types the close button will be used to toggle in all CaptionTypes excluding ctCustom which has a standard type down arrow glyph

Setting this property to true will switch off the Autohide option due to the shared button.

Default = False


FloatBorder
Property FloatBorder : TFloatBorder

Applies to TDocPanel

This determines if the panel can be resized in its floating state.

fbSingle : The panel can't be resized.

fbSizeable: The panel can be resized.

Default = fbSingle


Handle
Property Handle:Integer (Runtime Read Only)

Applies to TDocPanel

When docked This will return the handle of the panel

When not docked it will return the handle of the floating window


How To Install TDocPanel

To Install the Component

Freeware versions

Delphi 1.xx (16 Bit) (DOCKD1.ZIP)

1. Choose the Install Components option from the options menu.

2. Press the Add Button

3. Select DOCKBAR.DCU changing the path if neccesary.

4. Press OK Twice.

5. The component is now installed onto Peter's Components tab of the component selector.

Delphi 2.xx (32 Bit) (DOCKD2.ZIP)

1. Choose the Install option from the component menu.

2. Press the Add Button

3. Select DOCKBAR.DCU changing the path if neccesary.

4. Press OK Twice.

5. The component is now installed onto Peter's Components tab of the component selector.

Delphi 3.xx (32 Bit) (DOCKD3.ZIP)

1. Choose the Install Component option from the component menu

2. Select If to Wish to create a new package or add it to an existing package. (Dockbar is only dependent on the vcl30 package)

3. Select DOCKBAR.DCU as the unit name changing the path if neccesary.

4. Press OK. and follow the prompts.

5. The component is now installed onto Peter's Components tab of the component selector.

To Install the Component Help Delphi v1.xx and v2.xx

(These instructions assume that your copy of Delphi is installed in C:\DELPHI

 If not adjust the paths accordingly)

1. Copy DOCKBAR.KWF to C:\DELPHI\HELP.

2. Copy DOCKBAR.HLP to C:\DELPHI\BIN.

3. Run HELPINST from your delphi folder.

4. Use.FILE|OPEN to open C:\DELPHI\BIN\DELPHI.HDX.

5. Use KEYWORDS|ADD KEYWORD FILE to add C:\DELPHI\HELP\DOCKBAR.KWF.

6. Use FILE|SAVE to Compile and save the new HDX file.

7. Online help is now installed.

To Install the Component Help Delphi v3.xx

(These instructions assume that your copy of Delphi is installed in C:\PROGRAM FILES\BORLAND\DELPHI 3

 If not adjust the paths accordingly)

1. Load C:\PROGRAM FILES\BORLAND\DELPHI 3\HELP\DELPHI3.CFG in the notepad

2. Add a Link statement help file to the "Third-Party Help" section of DELPHI3.CFG.

:Link :Link Dockbar.hlp

3. Use FILE|SAVE to safe the new cfg file

4  Delete the hidden file DELPHI3.GID (This is the portion Borland forgot to tell us)

cd "C:\PROGRAM FILES\BORLAND\DELPHI 3\HELP"

attrib -h Delphi3.GID

del Delphi3.GID

5. Online help is now installed.

Source Code versions

The source also requires the additional files found in the freeware versions.

Delphi 1.xx (16 Bit)(DOCKD1.ZIP + DOCKSRC.ZIP)

1. Choose the Install Components option from the options menu.

2. Press the Add Button

3. Select DOCKBAR.PAS changing the path if neccesary.

4. Press OK Twice.

5. The component is now installed onto Peter's Components tab of the component selector.

Delphi 2.xx (32 Bit)(DOCKD2.ZIP + DOCKSRC.ZIP)

1. Choose the Install option from the component menu

2. Press the Add Button

3. Select DOCKBAR.PAS changing the path if neccesary.

4. Press OK Twice.

5. The component is now installed onto Peter's Components tab of the component selector.

Delphi 3.xx (32 Bit)(DOCKD3.ZIP + DOCKSRC.ZIP)

1. Choose the Install option from the component menu

2. Select If to Wish to create a new package or add it to an existing package. (Dockbar is only dependent on the vcl30 package)

3. Select DOCKBAR.PAS as the unit name changing the path if neccesary.

4. Press OK.

5. The component is now installed onto Peter's Components tab of the component selector.


How to obtain the source code

The Source code to TDocPanel is available directly from the author at a cost of US $10.00 for this you will receive the source to all future versions of TDocpanel (including intermediate bug fix releases) due to the price the source can only be distributed via the internet.

NB Please include a note with a contact email address with all cheques.

It's often quite difficult to reconcile personal email addresses with company cheques.

The author can be contacted at

E-mail :

peterv@global.co.za

Home page :

http://www.global.co.za/~peterv/

Postal Services (Snail Mail) :

P van Lonkhuyzen

PO Box 1041

Randpark Ridge

2156

South Africa


Icon
Property Icon : TIcon

Applies to TDocPanel

This determins the Icon for the floating window. Although the window cannot be minimized/maximized Win 95 also displays the Icon in the Top/Left border of the window.

The Icon is only visible when using Win 95 or higher and only when the CaptionType is ctWindows or ctNot3x

Default = (None)


IniFile
Property IniFile : String

Applies to TDocPanel

This property is used to save the positions of the dockbar.

If left blank the positions don't get saved.

The panel will save under the topic [Name] where name is the value of the Name Property

The position gets saved/restored under the following circumstances

The panel's docked is changed using dmDblClick or Programmatically

The panel is destroyed in the undocked (floating) position.

The panel is created.

Maxwidth only gets saved is MaxWidthRestore is FALSE.

Visible only gets saved if AutoHide is TRUE

RegistryKey will be set to (None) if this property is set.

For 32 Bit Users also See RegistryKey

Default = (None)


MaxWidth
Property MaxWidth : Integer

Applies to TDocPanel

The Maximum width of the client window of the panel in the floating state. If the FloatBorder is fbSizeable it will change while the floating window is resized and will retain the new value depending on the MaxWidthRestore property.

Any value less than 0 will set the width to the width of the panel in the docked position. (if it is docked to the left or right sides it will take the height).

Default = -1


MaxWidthRestore
Property MaxWidthRestore : Boolean

Applies to TDocPanel

This determins if the Maxwidth property gets restored to the value set in the property editor when the panel is docked.

True : The value gets restored.

False : The last width is retained.

Default = True


OnDockChanged

OnDropDown

OnPopUp

OnVisibleChanged


PrepareForChange

DoneChange

StartMoving


About	Arrangement	AutoHide

AutoWrap	ControlTop (Runtime only)	ControlLeft (Runtime only)

ControlWidth (Runtime only)	ControlHeight (Runtime only)	CaptionType

Docked	DockFrame	DockingMethod

DockingSides	DropDown	Floatborder

Handle (Runtime Read Only)	Icon	IniFile

MaxWidth	MaxWidthRestore	NotificationCursor

PanelDown (Runtime only)	Shrink	ShrinkDelay

ShrinkSpeed	RegistryKey (32 Bit only)	StayOnTop

Threshhold	Title	TitleFont


NotificationCursor
Property NotificationCursor : Boolean

Applies to TDocPanel

True : The floating window will change the cursor to notify the user that it is going to dock when being moved.

False : The cursors won't change.

Default True


OnDockChanged
Event OnDockChanged : TNotifyEvent

Applies to TDocPanel

This event gets called whenever the value of Docked gets changed

Do NOT change Docked in this event as that will result in stack overflow.


OnDropDown
Event OnDropDown : TNotifyEvent

Applies to TDocPanel

This event gets called whenever the floating toolbar configured as a dropdown panel is "restored" to a titlebar and panel i.e. Paneldown=True.


OnPopUp
Event OnPopUp : TNotifyEvent

Applies to TDocPanel

This event gets called whenever the floating toolbar configured as a dropdown panel is "minimized" to a titlebar only i.e. PanelDown=False.


OnVisibleChanged
Event OnVisibleChanged : TNotifyEvent

Applies to TDocPanel

This event gets called whenever the visibility of the panel changes.


PanelDown
Property PanelDown : Boolean (Runtime Only)

Applies to TDocPanel

Determins if the panel is down or up in a floating window.

This property is allways true unless Dropdown is true.

When this value changes it will trigger either a onDropDown or OnPopUp event


PrepareForChange
Procedure PrepareForChange

Applies to TDocPanel

The purpose of this method is to prepare the panel for changes to the controls that it contains.

Change : Due to AutoWrap it must now be used even if Docked is true

It does this by locking the screen update and restoring all the child controls to their original positions. It MUST be followed by a call to the DoneChange Method (Preferably using a Try - Finally Block).

Example

This example adds a button at runtime to panel1.

Procedure AddButton;

var Button : TButton;

begin

  Panel1.PrepareForChange;

  Try

    Button1:=TButton.Create(Owner);

  ..Button1.Parent:=Panel1;

    Button1.Top:=5;

.......................

  Finally

     Panel1.DoneChange

  end

end


RegistryKey
Property RegistryKey : String (32 Bit Version Only)

Applies to TDocPanel

This property is used to save the positions of the dockbar.

If left blank the positions don't get saved.

This key gets stored as a subkey to HK_CURRENT_USER

The full key will be HK_CURRENT_USER/RegistryKey/PanelName

The position gets saved/restored under the following circumstances

The panel's docked is changed using dmDblClick or Programmatically

The panel is destroyed in the undocked (floating) position.

The panel is created.

Maxwidth only gets saved is MaxWidthRestore is FALSE.

Visible only gets saved if AutoHide is TRUE

IniFile will be set to (None) when this property is set

16 Bit Users use IniFile instead

Default = (None)


Restrictions on Use

There are no restrictions placed on the use of TDocPanel in compiled DCU format or linked into an EXE or DLL..

The source code is licenced to the purchaser to use in any of his/her development but remains copyrighted to P van Lonkhuyzen and may not be distributed in to any other parties without the written permission of P van Lonkhuyzen.

If you don't wish to get the source code you are still encouraged to send me an email with suggestions or even just to tell me that you're using it. (That way I can show my wife that these late nights are not spent in vain) in return you will be notified of all future versions of the component.

E-mail :

peterv@global.co.za

Home page :

http://www.global.co.za/~peterv/


Shrink
Property Shrink : Boolean

Applies to TDocPanel

Determins if the panel will automatically shrink to just display the bevels when the mouse is off the panel for more than ShrinkDelay Milliseconds

Default : FALSE


ShrinkDelay
Property ShrinkDelay : Integer

Applies to TDocPanel

This determins the time in milliseconds that has to elapse before the panel will shrink when the mouse is moved off the panel when shrink is set on.

Default : 2000


ShrinkSpeed
Property ShrinkSpeed : Integer

Applies to TDocPanel

This determins how fast the panel will shrink.

0 is instantaneous.

>0 apply to both shrinking and re-appearing

<0 only apply to shrinking while re-appearing is instantaneous.


StartMoving
Function StartMoving(x,y:integer) : Boolean

Applies to TDocPanel

This Function Initiates a mouse move (Drag).

Although you normally wouldn't have to use it as the user would drag on the caption. You could remove the caption by setting CaptionType to ctNone and replace this by a button on the toolbar. The Method assumes that the Left mouse button is down when it is invoked.

Parameter : X,Y : These are the starting x and y coordinates of the mouse in Screen Pixels.

Result : 	True if moving is started

False if the panel is docked or the Leftt Mouse Button isn't depressed

Example

Procedure TMyForm.Button1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

Var pt : TPoint;

begin

 pt:=Button1.clienttoscreen(point(x,y)); {Convert the XYto screen coordinates)

 TDockPanel1.StartMoving(pt.x,pt.y);

end;


StayOnTop
Property StayOnTop : Boolean

Applies to TDocPanel

Controls the floating window style.

True : The floating window is fsStayOnTop

False : The floating window style is fsNormal

Default = True


TDocPanel

Additional Properties	Additional Events	Additional Methods

Dockbar is a Fully Configurable Multi Purpose Toolbar that can act as a

Floating Toolbar

Docking Toolbar

Autowrap Toolbar

Dropdown Toolbar Window

Auto Shrinking Toolbar

How To Install TDocPanel


Threshhold
Property Threshhold : Integer

Applies to TDocPanel

The amount of pixels the user must drag the panel by before it releases itself from the window.

Default = 5


Title
Property Title : TString

Applies to TDocPanel

This is the title that appears in the caption area of the floating window.


TitleFont
Property TitleFont : TFont

Applies to TDocPanel

The font used for the floating window caption if ctCustom is used