├── source ├── TBx2_Reg.dcr ├── Package │ ├── TBx2_D7.res │ ├── tbx2_lazarus.pas │ ├── TBx2_D7.cfg │ ├── TBx2_D7.dpk │ ├── tbx2_lazarus.lpk │ └── TBx2_D7.dof ├── TBx2_LCL.pas ├── LazMessages.pas ├── ProjectGroup1.bpg ├── TBx2_Const.rst ├── TBx2_Ver.inc ├── TBx2_Reg.pas ├── TBx2_Const.pas ├── TBx2_Common.pas └── TBx2_VCL7.pas ├── Demo (Delphi) ├── Demo.res ├── Demo1.ddp ├── DemoD.res ├── DemoD.dpr ├── DemoD.cfg ├── DemoD.dof └── Demo1.pas ├── Demo (Lazarus) ├── Demo.res ├── Demo1.ddp ├── DemoD.res ├── ConverterBackup │ ├── DemoD.dpr │ ├── Demo1.pas │ └── TBx2_Toolbar.pas ├── DemoD.dpr ├── DemoD.cfg ├── DemoD.compiled ├── DemoD.dof ├── DemoD.lpi ├── Demo1.pas ├── Demo1.dfm └── DemoD.lps ├── AquaToolbar ├── Demo │ ├── Demo1.ico │ ├── Demo1.res │ ├── Demo1.dpr │ ├── Demo1.lpr │ ├── unit1.pas │ ├── Demo1.lpi │ └── Unit1.dfm └── source │ ├── package │ ├── lizard_lazarus.pas │ ├── Lizard_D7.dpk │ └── lizard_lazarus.lpk │ ├── lizardbase_lcl.pas │ ├── LazMessages.pas │ ├── lizardmessages.pas │ ├── lizard_ver.inc │ ├── lizard_reg.pas │ ├── lizardconst.pas │ ├── Lizard_Const.pas │ ├── LizardBase_VCL.pas │ ├── Lizard_Common.pas │ └── lizard_toolbar.pas ├── experiment_MyPopupForm ├── Pro1.ico ├── Pro1.res ├── Pro1.lpr ├── themypopup.lfm ├── unit1.pas ├── unit1.lfm ├── Pro1.lpi └── themypopup.pas ├── README.md ├── .gitignore └── LICENSE /source/TBx2_Reg.dcr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x2nie/flying-toolbar/HEAD/source/TBx2_Reg.dcr -------------------------------------------------------------------------------- /Demo (Delphi)/Demo.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x2nie/flying-toolbar/HEAD/Demo (Delphi)/Demo.res -------------------------------------------------------------------------------- /Demo (Delphi)/Demo1.ddp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x2nie/flying-toolbar/HEAD/Demo (Delphi)/Demo1.ddp -------------------------------------------------------------------------------- /Demo (Delphi)/DemoD.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x2nie/flying-toolbar/HEAD/Demo (Delphi)/DemoD.res -------------------------------------------------------------------------------- /Demo (Lazarus)/Demo.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x2nie/flying-toolbar/HEAD/Demo (Lazarus)/Demo.res -------------------------------------------------------------------------------- /AquaToolbar/Demo/Demo1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x2nie/flying-toolbar/HEAD/AquaToolbar/Demo/Demo1.ico -------------------------------------------------------------------------------- /AquaToolbar/Demo/Demo1.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x2nie/flying-toolbar/HEAD/AquaToolbar/Demo/Demo1.res -------------------------------------------------------------------------------- /Demo (Lazarus)/Demo1.ddp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x2nie/flying-toolbar/HEAD/Demo (Lazarus)/Demo1.ddp -------------------------------------------------------------------------------- /Demo (Lazarus)/DemoD.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x2nie/flying-toolbar/HEAD/Demo (Lazarus)/DemoD.res -------------------------------------------------------------------------------- /source/Package/TBx2_D7.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x2nie/flying-toolbar/HEAD/source/Package/TBx2_D7.res -------------------------------------------------------------------------------- /experiment_MyPopupForm/Pro1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x2nie/flying-toolbar/HEAD/experiment_MyPopupForm/Pro1.ico -------------------------------------------------------------------------------- /experiment_MyPopupForm/Pro1.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x2nie/flying-toolbar/HEAD/experiment_MyPopupForm/Pro1.res -------------------------------------------------------------------------------- /source/TBx2_LCL.pas: -------------------------------------------------------------------------------- 1 | unit TBx2_LCL; 2 | 3 | interface 4 | uses ExtCtrls; 5 | 6 | type 7 | TDockX2Ctrl = class(TCustomPanel) 8 | 9 | end; 10 | 11 | implementation 12 | 13 | { TDockX2Ctrl } 14 | 15 | 16 | end. 17 | -------------------------------------------------------------------------------- /AquaToolbar/Demo/Demo1.dpr: -------------------------------------------------------------------------------- 1 | program Demo1; 2 | 3 | uses 4 | Forms, 5 | Unit1 in 'Unit1.pas' {Form1}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.CreateForm(TForm1, Form1); 12 | Application.Run; 13 | end. 14 | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | flying-toolbar 2 | ============== 3 | 4 | Lazarus undockable toolbar 5 | 6 | Features: 7 | * Toolbar can be undocked (flying / floating) and can be docked 8 | * Using native OS's titlebar; not emulation one. So it is crossplatform (any OS, Widgetset, Themes) 9 | * Add drag-handle area 10 | * no installation required, just run 11 | -------------------------------------------------------------------------------- /Demo (Lazarus)/ConverterBackup/DemoD.dpr: -------------------------------------------------------------------------------- 1 | program DemoD; 2 | 3 | uses 4 | Controls, 5 | Forms, 6 | Demo1 in 'Demo1.pas' {DemoForm}; 7 | 8 | {$R *.RES} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.Title := 'Toolbar97 Demo'; 13 | Application.CreateForm(TDemoForm, DemoForm); 14 | Application.Run; 15 | end. 16 | -------------------------------------------------------------------------------- /Demo (Delphi)/DemoD.dpr: -------------------------------------------------------------------------------- 1 | program DemoD; 2 | 3 | uses 4 | Controls, 5 | Forms, 6 | Demo1 in 'Demo1.pas' {DemoForm}, 7 | TBx2_LCL in '..\source\TBx2_LCL.pas'; 8 | 9 | {$R *.RES} 10 | 11 | begin 12 | Application.Initialize; 13 | Application.Title := 'Toolbar97 Demo'; 14 | Application.CreateForm(TDemoForm, DemoForm); 15 | Application.Run; 16 | end. 17 | -------------------------------------------------------------------------------- /Demo (Lazarus)/DemoD.dpr: -------------------------------------------------------------------------------- 1 | program DemoD; 2 | 3 | {$IFDEF FPC} 4 | {$MODE Delphi} 5 | {$ENDIF} 6 | 7 | uses 8 | {$IFNDEF FPC} 9 | {$ELSE} 10 | Interfaces, 11 | {$ENDIF} 12 | Controls, 13 | Forms, 14 | Demo1 in 'Demo1.pas' {DemoForm}; 15 | 16 | {$R *.res} 17 | 18 | begin 19 | Application.Initialize; 20 | Application.Title := 'Toolbar97 Demo'; 21 | Application.CreateForm(TDemoForm, DemoForm); 22 | Application.Run; 23 | end. 24 | -------------------------------------------------------------------------------- /AquaToolbar/Demo/Demo1.lpr: -------------------------------------------------------------------------------- 1 | program Demo1; 2 | 3 | {.$APPTYPE CONSOLE} 4 | {$mode objfpc}{$H+} 5 | 6 | {$define VerboseDrag} 7 | uses 8 | {$IFDEF UNIX}{$IFDEF UseCThreads} 9 | cthreads, 10 | {$ENDIF}{$ENDIF} 11 | Interfaces, // this includes the LCL widgetset 12 | Forms, Unit1; 13 | 14 | {$R *.res} 15 | 16 | begin 17 | RequireDerivedFormResource := True; 18 | Application.Initialize; 19 | Application.CreateForm(TForm1, Form1); 20 | Application.Run; 21 | end. 22 | 23 | -------------------------------------------------------------------------------- /experiment_MyPopupForm/Pro1.lpr: -------------------------------------------------------------------------------- 1 | program Pro1; 2 | 3 | {$mode objfpc}{$H+} 4 | 5 | uses 6 | {$IFDEF UNIX}{$IFDEF UseCThreads} 7 | cthreads, 8 | {$ENDIF}{$ENDIF} 9 | Interfaces, // this includes the LCL widgetset 10 | Forms, datetimectrls, Unit1, TheMyPopup 11 | { you can add units after this }; 12 | 13 | {$R *.res} 14 | 15 | begin 16 | RequireDerivedFormResource := True; 17 | Application.Initialize; 18 | Application.CreateForm(TForm1, Form1); 19 | Application.Run; 20 | end. 21 | 22 | -------------------------------------------------------------------------------- /source/Package/tbx2_lazarus.pas: -------------------------------------------------------------------------------- 1 | { This file was automatically created by Lazarus. Do not edit! 2 | This source is only used to compile and install the package. 3 | } 4 | 5 | unit TBx2_Lazarus; 6 | 7 | interface 8 | 9 | uses 10 | TBx2_Reg, TBx2_Toolbar, TBx2, TBx2_Common, TBx2_Const, TBx2_LCL, 11 | LazarusPackageIntf; 12 | 13 | implementation 14 | 15 | procedure Register; 16 | begin 17 | RegisterUnit('TBx2_Reg', @TBx2_Reg.Register); 18 | end; 19 | 20 | initialization 21 | RegisterPackage('TBx2_Lazarus', @Register); 22 | end. 23 | -------------------------------------------------------------------------------- /AquaToolbar/source/package/lizard_lazarus.pas: -------------------------------------------------------------------------------- 1 | { This file was automatically created by Lazarus. Do not edit! 2 | This source is only used to compile and install the package. 3 | } 4 | 5 | unit Lizard_Lazarus; 6 | 7 | interface 8 | 9 | uses 10 | LizardConst, Lizard, Lizard_Toolbar, Lizard_Reg, Lizard_Common, 11 | LazarusPackageIntf; 12 | 13 | implementation 14 | 15 | procedure Register; 16 | begin 17 | RegisterUnit('Lizard_Reg', @Lizard_Reg.Register); 18 | end; 19 | 20 | initialization 21 | RegisterPackage('Lizard_Lazarus', @Register); 22 | end. 23 | -------------------------------------------------------------------------------- /Demo (Delphi)/DemoD.cfg: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 29 | -H+ 30 | -W+ 31 | -M 32 | -$M16384,1048576 33 | -K$00400000 34 | -LE"c:\program files\borland\delphi7\Projects\Bpl" 35 | -LN"c:\program files\borland\delphi7\Projects\Bpl" 36 | -w-UNSAFE_TYPE 37 | -w-UNSAFE_CODE 38 | -w-UNSAFE_CAST 39 | -------------------------------------------------------------------------------- /source/Package/TBx2_D7.cfg: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 29 | -H+ 30 | -W+ 31 | -M 32 | -$M16384,1048576 33 | -K$00400000 34 | -LE"c:\program files\borland\delphi7\Projects\Bpl" 35 | -LN"c:\program files\borland\delphi7\Projects\Bpl" 36 | -w-UNSAFE_TYPE 37 | -w-UNSAFE_CODE 38 | -w-UNSAFE_CAST 39 | -------------------------------------------------------------------------------- /Demo (Lazarus)/DemoD.cfg: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 29 | -H+ 30 | -W+ 31 | -M 32 | -$M16384,1048576 33 | -K$00400000 34 | -LE"c:\program files (x86)\borland\delphi7\Projects\Bpl" 35 | -LN"c:\program files (x86)\borland\delphi7\Projects\Bpl" 36 | -w-UNSAFE_TYPE 37 | -w-UNSAFE_CODE 38 | -w-UNSAFE_CAST 39 | -------------------------------------------------------------------------------- /AquaToolbar/source/lizardbase_lcl.pas: -------------------------------------------------------------------------------- 1 | unit LizardBase_LCL; 2 | 3 | {$I Lizard_Ver.inc} 4 | 5 | interface 6 | 7 | uses Controls, ExtCtrls; 8 | 9 | type 10 | 11 | { TLzbPanel } 12 | 13 | TLzbPanel = class(TCustomControl) 14 | protected 15 | procedure Paint; override; 16 | procedure PaintSurface(); virtual; //unity, because another backend may have override paint 17 | end; 18 | 19 | implementation 20 | 21 | { TLzbPanel } 22 | 23 | procedure TLzbPanel.Paint; 24 | begin 25 | PaintSurface(); 26 | end; 27 | 28 | procedure TLzbPanel.PaintSurface; 29 | begin 30 | inherited paint; 31 | end; 32 | 33 | end. 34 | 35 | -------------------------------------------------------------------------------- /AquaToolbar/Demo/unit1.pas: -------------------------------------------------------------------------------- 1 | unit Unit1; 2 | 3 | interface 4 | 5 | 6 | uses 7 | Classes, SysUtils, {FileUtil,} Forms, Controls, Graphics, Dialogs, Lizard, 8 | Lizard_Toolbar, ExtCtrls, ComCtrls; 9 | 10 | type 11 | 12 | { TForm1 } 13 | 14 | TForm1 = class(TForm) 15 | ImageList1: TImageList; 16 | LzDock1: TLzDock; 17 | LzToolbar1: TLzToolbar; 18 | LzToolbar2: TLzToolbar; 19 | LzToolbar3: TLzToolbar; 20 | 21 | private 22 | { private declarations } 23 | public 24 | { public declarations } 25 | end; 26 | 27 | var 28 | Form1: TForm1; 29 | 30 | implementation 31 | 32 | {$R *.dfm} 33 | 34 | 35 | 36 | end. 37 | 38 | -------------------------------------------------------------------------------- /Demo (Lazarus)/DemoD.compiled: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AquaToolbar/source/package/Lizard_D7.dpk: -------------------------------------------------------------------------------- 1 | package Lizard_D7; 2 | 3 | {$R *.res} 4 | {$ALIGN 8} 5 | {$ASSERTIONS ON} 6 | {$BOOLEVAL OFF} 7 | {$DEBUGINFO ON} 8 | {$EXTENDEDSYNTAX ON} 9 | {$IMPORTEDDATA ON} 10 | {$IOCHECKS ON} 11 | {$LOCALSYMBOLS ON} 12 | {$LONGSTRINGS ON} 13 | {$OPENSTRINGS ON} 14 | {$OPTIMIZATION ON} 15 | {$OVERFLOWCHECKS OFF} 16 | {$RANGECHECKS OFF} 17 | {$REFERENCEINFO ON} 18 | {$SAFEDIVIDE OFF} 19 | {$STACKFRAMES OFF} 20 | {$TYPEDADDRESS OFF} 21 | {$VARSTRINGCHECKS ON} 22 | {$WRITEABLECONST OFF} 23 | {$MINENUMSIZE 1} 24 | {$IMAGEBASE $400000} 25 | {$IMPLICITBUILD OFF} 26 | 27 | requires 28 | rtl, 29 | vcl, 30 | designide; 31 | 32 | contains 33 | LizardConst in '..\lizardconst.pas', 34 | Lizard in '..\lizard.pas', 35 | Lizard_Reg in '..\lizard_reg.pas', 36 | Lizard_Toolbar in '..\lizard_toolbar.pas', 37 | LizardBase_VCL in '..\LizardBase_VCL.pas', 38 | Lizard_Common in '..\Lizard_Common.pas', 39 | Lizard_Button in '..\Lizard_Button.pas'; 40 | 41 | end. 42 | -------------------------------------------------------------------------------- /source/Package/TBx2_D7.dpk: -------------------------------------------------------------------------------- 1 | package TBx2_D7; 2 | 3 | {$R *.res} 4 | {$R '..\TBx2_Reg.dcr'} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'Toolbench X2'} 27 | {$IMPLICITBUILD ON} 28 | 29 | requires 30 | rtl, 31 | vcl, 32 | designide, 33 | vclactnband, 34 | vclx; 35 | 36 | contains 37 | TBx2 in '..\TBx2.pas', 38 | TBx2_Button in '..\TBx2_Button.pas', 39 | TBx2_Common in '..\TBx2_Common.pas', 40 | TBx2_Const in '..\TBx2_Const.pas', 41 | TBx2_Toolbar in '..\TBx2_Toolbar.pas', 42 | TBx2_Reg in '..\TBx2_Reg.pas', 43 | LazMessages in '..\LazMessages.pas'; 44 | 45 | end. 46 | -------------------------------------------------------------------------------- /source/LazMessages.pas: -------------------------------------------------------------------------------- 1 | unit LazMessages; 2 | 3 | interface 4 | {$IFDEF FPC} 5 | 6 | 7 | uses 8 | LCLType, LCLIntf, LMessages, Types, 9 | //messages, 10 | Messages; 11 | 12 | type 13 | TWMNCCalcSize = TLMNCCalcSize; 14 | TMessage = TLMessage; 15 | TWMLButtonDblClk = TLMLButtonDblClk; 16 | TWMCancelMode = TLMNoParams;//TLMCancelMode; 17 | TWMKILLFOCUS = TLMKILLFOCUS; 18 | TWMSetFocus = TLMSetFocus; 19 | 20 | 21 | const 22 | WM_NCPAINT = LM_NCPAINT; //LM_PAINT; // 23 | WM_NCCALCSIZE = LM_NCCALCSIZE; 24 | WM_LBUTTONDBLCLK = LM_LBUTTONDBLCLK; 25 | WM_MBUTTONDBLCLK = LM_MBUTTONDBLCLK; 26 | WM_RBUTTONDBLCLK = LM_RBUTTONDBLCLK; 27 | WM_LBUTTONDOWN = LM_LBUTTONDOWN; 28 | WM_RBUTTONDOWN = LM_RBUTTONDOWN; 29 | WM_MBUTTONDOWN = LM_MBUTTONDOWN; 30 | 31 | 32 | WM_CANCELMODE = LM_CANCELMODE; 33 | WM_KILLFOCUS = LM_KILLFOCUS; 34 | WM_SETFOCUS = LM_SETFOCUS; 35 | WM_QUIT = LM_QUIT; 36 | 37 | 38 | // PEEKMESSAGE stuff 39 | PM_Noremove = 0; 40 | PM_Remove = 1; 41 | PM_NOYIELD = 2; 42 | {$ENDIF} 43 | implementation 44 | 45 | end. 46 | -------------------------------------------------------------------------------- /AquaToolbar/source/LazMessages.pas: -------------------------------------------------------------------------------- 1 | unit LazMessages; 2 | 3 | interface 4 | {$IFDEF FPC} 5 | 6 | 7 | uses 8 | LCLType, LCLIntf, LMessages, Types, 9 | //messages, 10 | Messages; 11 | 12 | type 13 | TWMNCCalcSize = TLMNCCalcSize; 14 | TMessage = TLMessage; 15 | TWMLButtonDblClk = TLMLButtonDblClk; 16 | TWMCancelMode = TLMNoParams;//TLMCancelMode; 17 | TWMKILLFOCUS = TLMKILLFOCUS; 18 | TWMSetFocus = TLMSetFocus; 19 | 20 | 21 | const 22 | WM_NCPAINT = LM_NCPAINT; //LM_PAINT; // 23 | WM_NCCALCSIZE = LM_NCCALCSIZE; 24 | WM_LBUTTONDBLCLK = LM_LBUTTONDBLCLK; 25 | WM_MBUTTONDBLCLK = LM_MBUTTONDBLCLK; 26 | WM_RBUTTONDBLCLK = LM_RBUTTONDBLCLK; 27 | WM_LBUTTONDOWN = LM_LBUTTONDOWN; 28 | WM_RBUTTONDOWN = LM_RBUTTONDOWN; 29 | WM_MBUTTONDOWN = LM_MBUTTONDOWN; 30 | 31 | 32 | WM_CANCELMODE = LM_CANCELMODE; 33 | WM_KILLFOCUS = LM_KILLFOCUS; 34 | WM_SETFOCUS = LM_SETFOCUS; 35 | WM_QUIT = LM_QUIT; 36 | 37 | 38 | // PEEKMESSAGE stuff 39 | PM_Noremove = 0; 40 | PM_Remove = 1; 41 | PM_NOYIELD = 2; 42 | {$ENDIF} 43 | implementation 44 | 45 | end. 46 | -------------------------------------------------------------------------------- /AquaToolbar/source/lizardmessages.pas: -------------------------------------------------------------------------------- 1 | unit LizardMessages; 2 | 3 | interface 4 | {$IFDEF FPC} 5 | 6 | 7 | uses 8 | LCLType, LCLIntf, LMessages, Types, 9 | //messages, 10 | Messages; 11 | 12 | type 13 | TWMNCCalcSize = TLMNCCalcSize; 14 | TMessage = TLMessage; 15 | TWMLButtonDblClk = TLMLButtonDblClk; 16 | TWMCancelMode = TLMNoParams;//TLMCancelMode; 17 | TWMKILLFOCUS = TLMKILLFOCUS; 18 | TWMSetFocus = TLMSetFocus; 19 | 20 | 21 | const 22 | WM_NCPAINT = LM_NCPAINT; //LM_PAINT; // 23 | WM_NCCALCSIZE = LM_NCCALCSIZE; 24 | WM_LBUTTONDBLCLK = LM_LBUTTONDBLCLK; 25 | WM_MBUTTONDBLCLK = LM_MBUTTONDBLCLK; 26 | WM_RBUTTONDBLCLK = LM_RBUTTONDBLCLK; 27 | WM_LBUTTONDOWN = LM_LBUTTONDOWN; 28 | WM_RBUTTONDOWN = LM_RBUTTONDOWN; 29 | WM_MBUTTONDOWN = LM_MBUTTONDOWN; 30 | 31 | 32 | WM_CANCELMODE = LM_CANCELMODE; 33 | WM_KILLFOCUS = LM_KILLFOCUS; 34 | WM_SETFOCUS = LM_SETFOCUS; 35 | WM_QUIT = LM_QUIT; 36 | 37 | 38 | // PEEKMESSAGE stuff 39 | PM_Noremove = 0; 40 | PM_Remove = 1; 41 | PM_NOYIELD = 2; 42 | {$ENDIF} 43 | implementation 44 | 45 | end. 46 | -------------------------------------------------------------------------------- /source/ProjectGroup1.bpg: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | VERSION = BWS.01 3 | #------------------------------------------------------------------------------ 4 | !ifndef ROOT 5 | ROOT = $(MAKEDIR)\.. 6 | !endif 7 | #------------------------------------------------------------------------------ 8 | MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** 9 | DCC = $(ROOT)\bin\dcc32.exe $** 10 | BRCC = $(ROOT)\bin\brcc32.exe $** 11 | #------------------------------------------------------------------------------ 12 | PROJECTS = Project1.exe DemoD.exe dockex.exe docking_del_laz.exe 13 | #------------------------------------------------------------------------------ 14 | default: $(PROJECTS) 15 | #------------------------------------------------------------------------------ 16 | 17 | Project1.exe: ..\Demo2\Project1.dpr 18 | $(DCC) 19 | 20 | DemoD.exe: ..\Demo (Delphi)\DemoD.dpr 21 | $(DCC) 22 | 23 | dockex.exe: C:\Program Files (x86)\Borland\Delphi7\Demos\Docking\dockex.dpr 24 | $(DCC) 25 | 26 | docking_del_laz.exe: ..\Delphi-Docking-from-Laz\docking_del_laz.dpr 27 | $(DCC) 28 | 29 | 30 | -------------------------------------------------------------------------------- /source/TBx2_Const.rst: -------------------------------------------------------------------------------- 1 | 2 | # hash value = 104831186 3 | tbx2_const.stbx2dockparentnotallowed='A TDockX2 control cannot be placed '+ 4 | 'inside a tool window or another TDockX2' 5 | 6 | 7 | # hash value = 35832211 8 | tbx2_const.stbx2dockcannotchangeposition='Cannot change Position of a TDo'+ 9 | 'ckX2 if it already contains controls' 10 | 11 | 12 | # hash value = 81502180 13 | tbx2_const.stbx2toolwinnamenotset='Cannot save tool window'#39's position'+ 14 | ' because Name property is not set' 15 | 16 | 17 | # hash value = 168086852 18 | tbx2_const.stbx2toolwindockedtonamenotset='Cannot save tool window'#39's '+ 19 | 'position because DockedTo'#39's Name property not set' 20 | 21 | 22 | # hash value = 67853005 23 | tbx2_const.stbx2toolwinparentnotallowed='A tool window can only be placed'+ 24 | ' on a TDockX2 or directly on the form' 25 | 26 | 27 | # hash value = 61869218 28 | tbx2_const.stbx2toolbarcontrolnotchildoftoolbar='Control '#39'%s'#39' is '+ 29 | 'not a child of the toolbar' 30 | 31 | 32 | # hash value = 79900146 33 | tbx2_const.stbx2sepparentnotallowed='TToolbarSepX2 can only be placed on '+ 34 | 'a TToolbarX2' 35 | 36 | -------------------------------------------------------------------------------- /experiment_MyPopupForm/themypopup.lfm: -------------------------------------------------------------------------------- 1 | object MyPopup: TMyPopup 2 | Left = 204 3 | Height = 265 4 | Top = 140 5 | Width = 185 6 | AutoSize = True 7 | BorderStyle = bsNone 8 | Caption = 'MyPopup' 9 | ClientHeight = 265 10 | ClientWidth = 185 11 | FormStyle = fsSystemStayOnTop 12 | OnClose = FormClose 13 | OnCreate = FormCreate 14 | OnDeactivate = FormDeactivate 15 | PopupMode = pmAuto 16 | LCLVersion = '1.4.4.0' 17 | object CheckListBox1: TCheckListBox 18 | Left = 0 19 | Height = 56 20 | Top = 24 21 | Width = 104 22 | Columns = 2 23 | Items.Strings = ( 24 | 'Aha haa' 25 | 'satu' 26 | 'dua ' 27 | 'tiga' 28 | 'empat' 29 | 'limA' 30 | ) 31 | ItemHeight = 15 32 | TabOrder = 0 33 | Visible = False 34 | Data = { 35 | 06000000000000000000 36 | } 37 | end 38 | object Shape1: TShape 39 | Left = 8 40 | Height = 138 41 | Top = 6 42 | Width = 80 43 | Pen.Color = clFuchsia 44 | end 45 | object Edit1: TEdit 46 | Left = 108 47 | Height = 21 48 | Top = 96 49 | Width = 80 50 | TabOrder = 1 51 | Text = 'Edit1' 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /experiment_MyPopupForm/unit1.pas: -------------------------------------------------------------------------------- 1 | unit Unit1; 2 | 3 | {$mode objfpc}{$H+} 4 | 5 | interface 6 | 7 | uses 8 | Classes, SysUtils, FileUtil, DateTimePicker, Forms, Controls, Graphics, 9 | Dialogs, ComboEx, EditBtn, StdCtrls; 10 | 11 | type 12 | 13 | { TForm1 } 14 | 15 | TForm1 = class(TForm) 16 | Button1: TButton; 17 | CalcEdit1: TCalcEdit; 18 | CheckComboBox1: TCheckComboBox; 19 | DateEdit1: TDateEdit; 20 | DateTimePicker1: TDateTimePicker; 21 | procedure Button1Click(Sender: TObject); 22 | private 23 | { private declarations } 24 | procedure MyPopupShowHide(Sender: TObject); 25 | public 26 | { public declarations } 27 | end; 28 | 29 | var 30 | Form1: TForm1; 31 | 32 | implementation 33 | uses 34 | TheMyPopup; 35 | {$R *.lfm} 36 | 37 | { TForm1 } 38 | 39 | procedure TForm1.Button1Click(Sender: TObject); 40 | var 41 | PopupOrigin: TPoint; 42 | ADate: TDateTime; 43 | begin 44 | //inherited ButtonClick; 45 | 46 | PopupOrigin := Button1.ControlToScreen(Point(0, Button1.Height)); 47 | ShowMyPopup(PopupOrigin, //ADate, CalendarDisplaySettings, @CalendarPopupReturnDate, 48 | @MyPopupShowHide); 49 | //Do this after the dialog, otherwise it just looks silly 50 | //if FocusOnButtonClick then FocusAndMaybeSelectAll; 51 | 52 | end; 53 | 54 | procedure TForm1.MyPopupShowHide(Sender: TObject); 55 | begin 56 | 57 | end; 58 | 59 | end. 60 | 61 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Uncomment these types if you want even more clean repository. But be careful. 2 | # It can make harm to an existing project source. Read explanations below. 3 | # 4 | # Resource files are binaries containing manifest, project icon and version info. 5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files. 6 | #*.res 7 | # 8 | # Type library file (binary). In old Delphi versions it should be stored. 9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored. 10 | #*.tlb 11 | # 12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7. 13 | # Uncomment this if you are not using diagrams or use newer Delphi version. 14 | #*.ddp 15 | # 16 | # Visual LiveBindings file. Added in Delphi XE2. 17 | # Uncomment this if you are not using LiveBindings Designer. 18 | #*.vlb 19 | # 20 | # Deployment Manager configuration file for your project. Added in Delphi XE2. 21 | # Uncomment this if it is not mobile development and you do not use remote debug feature. 22 | #*.deployproj 23 | # 24 | 25 | # Delphi compiler-generated binaries (safe to delete) 26 | *.exe 27 | *.dll 28 | *.bpl 29 | *.bpi 30 | *.dcp 31 | *.so 32 | *.apk 33 | *.drc 34 | *.map 35 | *.dres 36 | *.rsm 37 | *.tds 38 | *.dcu 39 | *.lib 40 | 41 | # Delphi autogenerated files (duplicated info) 42 | *.cfg 43 | *Resource.rc 44 | 45 | # Delphi local files (user-specific info) 46 | *.local 47 | *.identcache 48 | *.projdata 49 | *.tvsconfig 50 | *.dsk 51 | 52 | # Delphi history and backups 53 | __history/ 54 | *.~* 55 | -------------------------------------------------------------------------------- /source/TBx2_Ver.inc: -------------------------------------------------------------------------------- 1 | //original file = TB97Ver.inc 2 | 3 | { $jrsoftware: tb97/Source/TB97Ver.inc,v 1.3 2004/02/23 22:07:45 jr Exp $ } 4 | 5 | { Determine Delphi/C++Builder(/Lazarus) version } 6 | 7 | {.$DEFINE TBX2_GR32} 8 | 9 | {$IFDEF FPC} 10 | {$MODE DELPHI} 11 | {$packset fixed} 12 | {$ENDIF} 13 | 14 | 15 | {$IFNDEF FPC} 16 | {$IFNDEF WIN32} Delphi 1 is not supported. {$ENDIF} 17 | {$ENDIF} 18 | 19 | {$IFNDEF VER90} { if it's not Delphi 2.0 } 20 | {$IFNDEF VER93} { and it's not C++Builder 1.0 } 21 | {$DEFINE TB97D3} { then it must be at least Delphi 3 or C++Builder 3 } 22 | {$IFNDEF VER100} { if it's not Delphi 3.0 } 23 | {$IFNDEF VER120} { Delphi 4/5's command line compiler doesn't like the ObjExportAll directive, so don't include it on Delphi 4/5 } 24 | {$IFNDEF VER130} 25 | {$ObjExportAll On} { <- needed for compatibility with run-time packages in C++Builder 3 } 26 | {$ENDIF} 27 | {$ENDIF} 28 | {$IFNDEF VER110} { and it's not C++Builder 3.0 } 29 | {$DEFINE TB97D4} { then it must be at least Delphi 4 or C++Builder 4 } 30 | {$IFNDEF VER120} {$IFNDEF VER125} { if it's not Delphi 4 or C++Builder 4 } 31 | {$DEFINE TB97D5} { then it must be at least Delphi 5 or C++Builder 5 } 32 | {$IFNDEF VER130} { if it's not Delphi 5 or C++Builder 5 } 33 | {$DEFINE TB97D6} { then it must be at least Delphi 6 or C++Builder 6 } 34 | {$ENDIF} 35 | {$ENDIF} {$ENDIF} 36 | {$ENDIF} 37 | {$ENDIF} 38 | {$ENDIF} 39 | {$ENDIF} 40 | 41 | {$ALIGN ON} 42 | {$BOOLEVAL OFF} 43 | {$LONGSTRINGS ON} 44 | {$WRITEABLECONST ON} 45 | -------------------------------------------------------------------------------- /AquaToolbar/source/lizard_ver.inc: -------------------------------------------------------------------------------- 1 | //original file = TB97Ver.inc 2 | 3 | { $jrsoftware tb97SourceTB97Ver.inc,v 1.3 20040223 220745 jr Exp $ } 4 | 5 | { Determine DelphiC++Builder(Lazarus) version } 6 | 7 | {.$DEFINE TBX2_GR32} 8 | 9 | {$IFDEF FPC} 10 | {$MODE DELPHI} 11 | {$packset fixed} 12 | {$ENDIF} 13 | 14 | 15 | {$IFNDEF FPC} 16 | {$IFNDEF WIN32} Delphi 1 is not supported. {$ENDIF} 17 | {$ENDIF} 18 | 19 | {$IFNDEF VER90} { if it's not Delphi 2.0 } 20 | {$IFNDEF VER93} { and it's not C++Builder 1.0 } 21 | {$DEFINE TB97D3} { then it must be at least Delphi 3 or C++Builder 3 } 22 | {$IFNDEF VER100} { if it's not Delphi 3.0 } 23 | {$IFNDEF VER120} { Delphi 45's command line compiler doesn't like the ObjExportAll directive, so don't include it on Delphi 45 } 24 | {$IFNDEF VER130} 25 | {$IFnDEF FPC} 26 | {$ObjExportAll On} { - needed for compatibility with run-time packages in C++Builder 3 } 27 | {$ENDIF} 28 | {$ENDIF} 29 | {$ENDIF} 30 | {$IFNDEF VER110} { and it's not C++Builder 3.0 } 31 | {$DEFINE TB97D4} { then it must be at least Delphi 4 or C++Builder 4 } 32 | {$IFNDEF VER120} {$IFNDEF VER125} { if it's not Delphi 4 or C++Builder 4 } 33 | {$DEFINE TB97D5} { then it must be at least Delphi 5 or C++Builder 5 } 34 | {$IFNDEF VER130} { if it's not Delphi 5 or C++Builder 5 } 35 | {$DEFINE TB97D6} { then it must be at least Delphi 6 or C++Builder 6 } 36 | {$ENDIF} 37 | {$ENDIF} {$ENDIF} 38 | {$ENDIF} 39 | {$ENDIF} 40 | {$ENDIF} 41 | {$ENDIF} 42 | 43 | {$ALIGN ON} 44 | {$BOOLEVAL OFF} 45 | {$LONGSTRINGS ON} 46 | {$WRITEABLECONST ON} 47 | -------------------------------------------------------------------------------- /source/TBx2_Reg.pas: -------------------------------------------------------------------------------- 1 | unit TBx2_Reg; 2 | { 3 | ToolBench X2 4 | Copyright (c) 2013 by x2nie 5 | a custom UI based on Toolbar97 6 | 7 | ------------------------------------------- 8 | Toolbar97 9 | Copyright (C) 1998-2004 by Jordan Russell 10 | http://www.jrsoftware.org/ 11 | 12 | This software is provided 'as-is', without any express or implied 13 | warranty. In no event will the authors be held liable for any damages 14 | arising from the use of this software. 15 | 16 | Permission is granted to anyone to use this software for any purpose, 17 | including commercial applications, and to alter it and redistribute it 18 | freely, subject to the following restrictions: 19 | 20 | 1. The origin of this software must not be misrepresented; you must not 21 | claim that you wrote the original software. If you use this software 22 | in a product, an acknowledgment in the product documentation would be 23 | appreciated but is not required. 24 | 2. Altered source versions must be plainly marked as such, and must not be 25 | misrepresented as being the original software. 26 | 3. This notice may not be removed or altered from any source distribution. 27 | } 28 | 29 | interface 30 | 31 | {$I TBx2_Ver.inc} 32 | 33 | uses 34 | Classes, TypInfo, 35 | {$IFDEF FPC} 36 | LCLIntf, LResources, LazIDEIntf, PropEdits, ComponentEditors 37 | {$ELSE} 38 | {$IFDEF TB97D6} DesignIntf, DesignEditors {$ELSE} DsgnIntf {$ENDIF} 39 | {$ENDIF}; 40 | 41 | procedure Register; 42 | 43 | implementation 44 | 45 | uses 46 | TBx2,TBx2_Toolbar, TBx2_Button; 47 | 48 | procedure Register; 49 | begin 50 | RegisterComponents('Toolbench X2',[TDockX2,TToolbarX2, TToolbarButtonX2, TToolbarSepX2, TEditX2 ]); 51 | end; 52 | 53 | 54 | end. 55 | -------------------------------------------------------------------------------- /AquaToolbar/source/lizard_reg.pas: -------------------------------------------------------------------------------- 1 | unit Lizard_Reg; 2 | 3 | { 4 | ToolBench X2 5 | Copyright (c) 2013 by x2nie 6 | a custom UI based on Toolbar97 7 | 8 | ------------------------------------------- 9 | Toolbar97 10 | Copyright (C) 1998-2004 by Jordan Russell 11 | http://www.jrsoftware.org/ 12 | 13 | This software is provided 'as-is', without any express or implied 14 | warranty. In no event will the authors be held liable for any damages 15 | arising from the use of this software. 16 | 17 | Permission is granted to anyone to use this software for any purpose, 18 | including commercial applications, and to alter it and redistribute it 19 | freely, subject to the following restrictions: 20 | 21 | 1. The origin of this software must not be misrepresented; you must not 22 | claim that you wrote the original software. If you use this software 23 | in a product, an acknowledgment in the product documentation would be 24 | appreciated but is not required. 25 | 2. Altered source versions must be plainly marked as such, and must not be 26 | misrepresented as being the original software. 27 | 3. This notice may not be removed or altered from any source distribution. 28 | } 29 | 30 | interface 31 | 32 | {$I Lizard_Ver.inc} 33 | 34 | uses 35 | Classes, TypInfo, 36 | {$IFDEF FPC} 37 | LCLIntf, LResources //,LazIDEIntf, PropEdits, ComponentEditors 38 | {$ELSE} 39 | {$IFDEF TB97D6} DesignIntf, DesignEditors {$ELSE} DsgnIntf {$ENDIF} 40 | {$ENDIF}; 41 | 42 | procedure Register; 43 | 44 | implementation 45 | 46 | uses 47 | Lizard, Lizard_Toolbar, Lizard_Button; 48 | 49 | procedure Register; 50 | begin 51 | RegisterComponents('Lizard',[TLzDock, TLzToolbar, TLzToolbarSep 52 | , TLzToolbarButton, TLzEdit ]); 53 | end; 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /experiment_MyPopupForm/unit1.lfm: -------------------------------------------------------------------------------- 1 | object Form1: TForm1 2 | Left = 353 3 | Height = 240 4 | Top = 354 5 | Width = 561 6 | Caption = 'Form1' 7 | ClientHeight = 240 8 | ClientWidth = 561 9 | LCLVersion = '1.4.4.0' 10 | object CheckComboBox1: TCheckComboBox 11 | Left = 24 12 | Height = 24 13 | Top = 48 14 | Width = 100 15 | ItemHeight = 16 16 | Items.Strings = ( 17 | 'woles' 18 | 'kelse' 19 | 'couy' 20 | ) 21 | TabOrder = 0 22 | end 23 | object CalcEdit1: TCalcEdit 24 | Left = 66 25 | Height = 21 26 | Top = 32 27 | Width = 103 28 | CalculatorLayout = clNormal 29 | AsFloat = 0 30 | AsInteger = 0 31 | ButtonWidth = 23 32 | NumGlyphs = 1 33 | MaxLength = 0 34 | TabOrder = 1 35 | end 36 | object DateEdit1: TDateEdit 37 | Left = 82 38 | Height = 21 39 | Top = 151 40 | Width = 103 41 | CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames] 42 | OKCaption = 'OK' 43 | CancelCaption = 'Cancel' 44 | DateOrder = doNone 45 | ButtonWidth = 23 46 | NumGlyphs = 1 47 | MaxLength = 0 48 | TabOrder = 2 49 | end 50 | object Button1: TButton 51 | Left = 0 52 | Height = 25 53 | Top = 8 54 | Width = 75 55 | Caption = 'Button1' 56 | OnClick = Button1Click 57 | TabOrder = 3 58 | end 59 | object DateTimePicker1: TDateTimePicker 60 | Left = 192 61 | Height = 21 62 | Top = 48 63 | Width = 81 64 | CenturyFrom = 1941 65 | MaxDate = 2958465 66 | MinDate = -53780 67 | TabOrder = 4 68 | TrailingSeparator = False 69 | TextForNullDate = 'NULL' 70 | LeadingZeros = True 71 | Kind = dtkDate 72 | TimeFormat = tf24 73 | TimeDisplay = tdHMS 74 | DateMode = dmComboBox 75 | Date = 42311 76 | Time = 0.0298091203731019 77 | UseDefaultSeparators = True 78 | HideDateTimeParts = [] 79 | MonthNames = 'Long' 80 | end 81 | end 82 | -------------------------------------------------------------------------------- /AquaToolbar/source/package/lizard_lazarus.lpk: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | <_ExternHelp Items="Count"/> 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /source/Package/tbx2_lazarus.lpk: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /AquaToolbar/source/lizardconst.pas: -------------------------------------------------------------------------------- 1 | unit LizardConst; 2 | 3 | { 4 | ToolBench X2 5 | Copyright (c) 2013 by x2nie 6 | a custom UI based on Toolbar97 7 | 8 | ------------------------------------------- 9 | Toolbar97 10 | Copyright (C) 1998-2004 by Jordan Russell 11 | http://www.jrsoftware.org/ 12 | 13 | This software is provided 'as-is', without any express or implied 14 | warranty. In no event will the authors be held liable for any damages 15 | arising from the use of this software. 16 | 17 | Permission is granted to anyone to use this software for any purpose, 18 | including commercial applications, and to alter it and redistribute it 19 | freely, subject to the following restrictions: 20 | 21 | 1. The origin of this software must not be misrepresented; you must not 22 | claim that you wrote the original software. If you use this software 23 | in a product, an acknowledgment in the product documentation would be 24 | appreciated but is not required. 25 | 2. Altered source versions must be plainly marked as such, and must not be 26 | misrepresented as being the original software. 27 | 3. This notice may not be removed or altered from any source distribution. 28 | } 29 | 30 | interface 31 | 32 | const 33 | { TDockX2 exception messages } 34 | STBx2DockParentNotAllowed = 'A TDockX2 control cannot be placed inside a tool window or another TDockX2'; 35 | STBx2DockCannotChangePosition = 'Cannot change Position of a TDockX2 if it already contains controls'; 36 | 37 | { TCustomToolWindowX2 exception messages } 38 | STBx2ToolwinNameNotSet = 'Cannot save tool window''s position because Name property is not set'; 39 | STBx2ToolwinDockedToNameNotSet = 'Cannot save tool window''s position because DockedTo''s Name property not set'; 40 | STBx2ToolwinParentNotAllowed = 'A tool window can only be placed on a TDockX2 or directly on the form'; 41 | 42 | { TCustomToolbarX2 exception messages } 43 | STBx2ToolbarControlNotChildOfToolbar = 'Control ''%s'' is not a child of the toolbar'; 44 | 45 | { TToolbarSepX2 exception messages } 46 | STBx2SepParentNotAllowed = 'TToolbarSepX2 can only be placed on a TToolbarX2'; 47 | 48 | implementation 49 | 50 | end. 51 | 52 | -------------------------------------------------------------------------------- /source/TBx2_Const.pas: -------------------------------------------------------------------------------- 1 | unit TBx2_Const; 2 | 3 | { 4 | ToolBench X2 5 | Copyright (c) 2013 by x2nie 6 | a custom UI based on Toolbar97 7 | 8 | ------------------------------------------- 9 | Toolbar97 10 | Copyright (C) 1998-2004 by Jordan Russell 11 | http://www.jrsoftware.org/ 12 | 13 | This software is provided 'as-is', without any express or implied 14 | warranty. In no event will the authors be held liable for any damages 15 | arising from the use of this software. 16 | 17 | Permission is granted to anyone to use this software for any purpose, 18 | including commercial applications, and to alter it and redistribute it 19 | freely, subject to the following restrictions: 20 | 21 | 1. The origin of this software must not be misrepresented; you must not 22 | claim that you wrote the original software. If you use this software 23 | in a product, an acknowledgment in the product documentation would be 24 | appreciated but is not required. 25 | 2. Altered source versions must be plainly marked as such, and must not be 26 | misrepresented as being the original software. 27 | 3. This notice may not be removed or altered from any source distribution. 28 | } 29 | 30 | interface 31 | 32 | {$I TBx2_Ver.inc} 33 | 34 | {$IFDEF TB97D3} resourcestring {$ELSE} const {$ENDIF} 35 | { TDockX2 exception messages } 36 | STBx2DockParentNotAllowed = 'A TDockX2 control cannot be placed inside a tool window or another TDockX2'; 37 | STBx2DockCannotChangePosition = 'Cannot change Position of a TDockX2 if it already contains controls'; 38 | 39 | { TCustomToolWindowX2 exception messages } 40 | STBx2ToolwinNameNotSet = 'Cannot save tool window''s position because Name property is not set'; 41 | STBx2ToolwinDockedToNameNotSet = 'Cannot save tool window''s position because DockedTo''s Name property not set'; 42 | STBx2ToolwinParentNotAllowed = 'A tool window can only be placed on a TDockX2 or directly on the form'; 43 | 44 | { TCustomToolbarX2 exception messages } 45 | STBx2ToolbarControlNotChildOfToolbar = 'Control ''%s'' is not a child of the toolbar'; 46 | 47 | { TToolbarSepX2 exception messages } 48 | STBx2SepParentNotAllowed = 'TToolbarSepX2 can only be placed on a TToolbarX2'; 49 | 50 | implementation 51 | 52 | end. 53 | -------------------------------------------------------------------------------- /AquaToolbar/source/Lizard_Const.pas: -------------------------------------------------------------------------------- 1 | unit Lizard_Const; 2 | 3 | { 4 | ToolBench X2 5 | Copyright (c) 2013 by x2nie 6 | a custom UI based on Toolbar97 7 | 8 | ------------------------------------------- 9 | Toolbar97 10 | Copyright (C) 1998-2004 by Jordan Russell 11 | http://www.jrsoftware.org/ 12 | 13 | This software is provided 'as-is', without any express or implied 14 | warranty. In no event will the authors be held liable for any damages 15 | arising from the use of this software. 16 | 17 | Permission is granted to anyone to use this software for any purpose, 18 | including commercial applications, and to alter it and redistribute it 19 | freely, subject to the following restrictions: 20 | 21 | 1. The origin of this software must not be misrepresented; you must not 22 | claim that you wrote the original software. If you use this software 23 | in a product, an acknowledgment in the product documentation would be 24 | appreciated but is not required. 25 | 2. Altered source versions must be plainly marked as such, and must not be 26 | misrepresented as being the original software. 27 | 3. This notice may not be removed or altered from any source distribution. 28 | } 29 | 30 | interface 31 | 32 | {$I Lizard_Ver.inc} 33 | 34 | {$IFDEF TB97D3} resourcestring {$ELSE} const {$ENDIF} 35 | { TDockX2 exception messages } 36 | STBx2DockParentNotAllowed = 'A TDockX2 control cannot be placed inside a tool window or another TDockX2'; 37 | STBx2DockCannotChangePosition = 'Cannot change Position of a TDockX2 if it already contains controls'; 38 | 39 | { TCustomToolWindowX2 exception messages } 40 | STBx2ToolwinNameNotSet = 'Cannot save tool window''s position because Name property is not set'; 41 | STBx2ToolwinDockedToNameNotSet = 'Cannot save tool window''s position because DockedTo''s Name property not set'; 42 | STBx2ToolwinParentNotAllowed = 'A tool window can only be placed on a TDockX2 or directly on the form'; 43 | 44 | { TCustomToolbarX2 exception messages } 45 | STBx2ToolbarControlNotChildOfToolbar = 'Control ''%s'' is not a child of the toolbar'; 46 | 47 | { TToolbarSepX2 exception messages } 48 | STBx2SepParentNotAllowed = 'TToolbarSepX2 can only be placed on a TToolbarX2'; 49 | 50 | implementation 51 | 52 | end. 53 | -------------------------------------------------------------------------------- /experiment_MyPopupForm/Pro1.lpi: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | <ResourceType Value="res"/> 11 | <UseXPManifest Value="True"/> 12 | <Icon Value="0"/> 13 | </General> 14 | <i18n> 15 | <EnableI18N LFM="False"/> 16 | </i18n> 17 | <VersionInfo> 18 | <StringTable ProductVersion=""/> 19 | </VersionInfo> 20 | <BuildModes Count="1"> 21 | <Item1 Name="Default" Default="True"/> 22 | </BuildModes> 23 | <PublishOptions> 24 | <Version Value="2"/> 25 | </PublishOptions> 26 | <RunParams> 27 | <local> 28 | <FormatVersion Value="1"/> 29 | </local> 30 | </RunParams> 31 | <RequiredPackages Count="2"> 32 | <Item1> 33 | <PackageName Value="DateTimeCtrls"/> 34 | </Item1> 35 | <Item2> 36 | <PackageName Value="LCL"/> 37 | </Item2> 38 | </RequiredPackages> 39 | <Units Count="3"> 40 | <Unit0> 41 | <Filename Value="Pro1.lpr"/> 42 | <IsPartOfProject Value="True"/> 43 | </Unit0> 44 | <Unit1> 45 | <Filename Value="unit1.pas"/> 46 | <IsPartOfProject Value="True"/> 47 | <ComponentName Value="Form1"/> 48 | <ResourceBaseClass Value="Form"/> 49 | <UnitName Value="Unit1"/> 50 | </Unit1> 51 | <Unit2> 52 | <Filename Value="themypopup.pas"/> 53 | <IsPartOfProject Value="True"/> 54 | <ComponentName Value="MyPopup"/> 55 | <ResourceBaseClass Value="Form"/> 56 | <UnitName Value="TheMyPopup"/> 57 | </Unit2> 58 | </Units> 59 | </ProjectOptions> 60 | <CompilerOptions> 61 | <Version Value="11"/> 62 | <PathDelim Value="\"/> 63 | <Target> 64 | <Filename Value="Pro1"/> 65 | </Target> 66 | <SearchPaths> 67 | <IncludeFiles Value="$(ProjOutDir)"/> 68 | <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 69 | </SearchPaths> 70 | <Linking> 71 | <Options> 72 | <Win32> 73 | <GraphicApplication Value="True"/> 74 | </Win32> 75 | </Options> 76 | </Linking> 77 | </CompilerOptions> 78 | <Debugging> 79 | <Exceptions Count="3"> 80 | <Item1> 81 | <Name Value="EAbort"/> 82 | </Item1> 83 | <Item2> 84 | <Name Value="ECodetoolError"/> 85 | </Item2> 86 | <Item3> 87 | <Name Value="EFOpenError"/> 88 | </Item3> 89 | </Exceptions> 90 | </Debugging> 91 | </CONFIG> 92 | -------------------------------------------------------------------------------- /Demo (Delphi)/DemoD.dof: -------------------------------------------------------------------------------- 1 | [FileVersion] 2 | Version=7.0 3 | [Compiler] 4 | A=8 5 | B=0 6 | C=1 7 | D=1 8 | E=0 9 | F=0 10 | G=1 11 | H=1 12 | I=1 13 | J=0 14 | K=0 15 | L=1 16 | M=0 17 | N=1 18 | O=1 19 | P=1 20 | Q=0 21 | R=0 22 | S=0 23 | T=0 24 | U=0 25 | V=1 26 | W=0 27 | X=1 28 | Y=1 29 | Z=1 30 | ShowHints=1 31 | ShowWarnings=1 32 | UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 33 | NamespacePrefix= 34 | SymbolDeprecated=1 35 | SymbolLibrary=1 36 | SymbolPlatform=1 37 | UnitLibrary=1 38 | UnitPlatform=1 39 | UnitDeprecated=1 40 | HResultCompat=1 41 | HidingMember=1 42 | HiddenVirtual=1 43 | Garbage=1 44 | BoundsError=1 45 | ZeroNilCompat=1 46 | StringConstTruncated=1 47 | ForLoopVarVarPar=1 48 | TypedConstVarPar=1 49 | AsgToTypedConst=1 50 | CaseLabelRange=1 51 | ForVariable=1 52 | ConstructingAbstract=1 53 | ComparisonFalse=1 54 | ComparisonTrue=1 55 | ComparingSignedUnsigned=1 56 | CombiningSignedUnsigned=1 57 | UnsupportedConstruct=1 58 | FileOpen=1 59 | FileOpenUnitSrc=1 60 | BadGlobalSymbol=1 61 | DuplicateConstructorDestructor=1 62 | InvalidDirective=1 63 | PackageNoLink=1 64 | PackageThreadVar=1 65 | ImplicitImport=1 66 | HPPEMITIgnored=1 67 | NoRetVal=1 68 | UseBeforeDef=1 69 | ForLoopVarUndef=1 70 | UnitNameMismatch=1 71 | NoCFGFileFound=1 72 | MessageDirective=1 73 | ImplicitVariants=1 74 | UnicodeToLocale=1 75 | LocaleToUnicode=1 76 | ImagebaseMultiple=1 77 | SuspiciousTypecast=1 78 | PrivatePropAccessor=1 79 | UnsafeType=0 80 | UnsafeCode=0 81 | UnsafeCast=0 82 | [Linker] 83 | MapFile=0 84 | OutputObjs=0 85 | ConsoleApp=1 86 | DebugInfo=0 87 | RemoteSymbols=0 88 | MinStackSize=16384 89 | MaxStackSize=1048576 90 | ImageBase=4194304 91 | ExeDescription= 92 | [Directories] 93 | OutputDir= 94 | UnitOutputDir= 95 | PackageDLLOutputDir= 96 | PackageDCPOutputDir= 97 | SearchPath= 98 | Packages= 99 | Conditionals= 100 | DebugSourceDirs= 101 | UsePackages=0 102 | [Parameters] 103 | RunParams= 104 | HostApplication= 105 | Launcher= 106 | UseLauncher=0 107 | DebugCWD= 108 | [Language] 109 | ActiveLang= 110 | ProjectLang= 111 | RootDir= 112 | [Version Info] 113 | IncludeVerInfo=0 114 | AutoIncBuild=0 115 | MajorVer=1 116 | MinorVer=0 117 | Release=0 118 | Build=0 119 | Debug=0 120 | PreRelease=0 121 | Special=0 122 | Private=0 123 | DLL=0 124 | Locale=1057 125 | CodePage=1252 126 | [Version Info Keys] 127 | CompanyName= 128 | FileDescription= 129 | FileVersion=1.0.0.0 130 | InternalName= 131 | LegalCopyright= 132 | LegalTrademarks= 133 | OriginalFilename= 134 | ProductName= 135 | ProductVersion=1.0.0.0 136 | Comments= 137 | -------------------------------------------------------------------------------- /Demo (Lazarus)/DemoD.dof: -------------------------------------------------------------------------------- 1 | [FileVersion] 2 | Version=7.0 3 | [Compiler] 4 | A=8 5 | B=0 6 | C=1 7 | D=1 8 | E=0 9 | F=0 10 | G=1 11 | H=1 12 | I=1 13 | J=0 14 | K=0 15 | L=1 16 | M=0 17 | N=1 18 | O=1 19 | P=1 20 | Q=0 21 | R=0 22 | S=0 23 | T=0 24 | U=0 25 | V=1 26 | W=0 27 | X=1 28 | Y=1 29 | Z=1 30 | ShowHints=1 31 | ShowWarnings=1 32 | UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 33 | NamespacePrefix= 34 | SymbolDeprecated=1 35 | SymbolLibrary=1 36 | SymbolPlatform=1 37 | UnitLibrary=1 38 | UnitPlatform=1 39 | UnitDeprecated=1 40 | HResultCompat=1 41 | HidingMember=1 42 | HiddenVirtual=1 43 | Garbage=1 44 | BoundsError=1 45 | ZeroNilCompat=1 46 | StringConstTruncated=1 47 | ForLoopVarVarPar=1 48 | TypedConstVarPar=1 49 | AsgToTypedConst=1 50 | CaseLabelRange=1 51 | ForVariable=1 52 | ConstructingAbstract=1 53 | ComparisonFalse=1 54 | ComparisonTrue=1 55 | ComparingSignedUnsigned=1 56 | CombiningSignedUnsigned=1 57 | UnsupportedConstruct=1 58 | FileOpen=1 59 | FileOpenUnitSrc=1 60 | BadGlobalSymbol=1 61 | DuplicateConstructorDestructor=1 62 | InvalidDirective=1 63 | PackageNoLink=1 64 | PackageThreadVar=1 65 | ImplicitImport=1 66 | HPPEMITIgnored=1 67 | NoRetVal=1 68 | UseBeforeDef=1 69 | ForLoopVarUndef=1 70 | UnitNameMismatch=1 71 | NoCFGFileFound=1 72 | MessageDirective=1 73 | ImplicitVariants=1 74 | UnicodeToLocale=1 75 | LocaleToUnicode=1 76 | ImagebaseMultiple=1 77 | SuspiciousTypecast=1 78 | PrivatePropAccessor=1 79 | UnsafeType=0 80 | UnsafeCode=0 81 | UnsafeCast=0 82 | [Linker] 83 | MapFile=0 84 | OutputObjs=0 85 | ConsoleApp=1 86 | DebugInfo=0 87 | RemoteSymbols=0 88 | MinStackSize=16384 89 | MaxStackSize=1048576 90 | ImageBase=4194304 91 | ExeDescription= 92 | [Directories] 93 | OutputDir= 94 | UnitOutputDir= 95 | PackageDLLOutputDir= 96 | PackageDCPOutputDir= 97 | SearchPath= 98 | Packages= 99 | Conditionals= 100 | DebugSourceDirs= 101 | UsePackages=0 102 | [Parameters] 103 | RunParams= 104 | HostApplication= 105 | Launcher= 106 | UseLauncher=0 107 | DebugCWD= 108 | [Language] 109 | ActiveLang= 110 | ProjectLang= 111 | RootDir= 112 | [Version Info] 113 | IncludeVerInfo=0 114 | AutoIncBuild=0 115 | MajorVer=1 116 | MinorVer=0 117 | Release=0 118 | Build=0 119 | Debug=0 120 | PreRelease=0 121 | Special=0 122 | Private=0 123 | DLL=0 124 | Locale=1057 125 | CodePage=1252 126 | [Version Info Keys] 127 | CompanyName= 128 | FileDescription= 129 | FileVersion=1.0.0.0 130 | InternalName= 131 | LegalCopyright= 132 | LegalTrademarks= 133 | OriginalFilename= 134 | ProductName= 135 | ProductVersion=1.0.0.0 136 | Comments= 137 | -------------------------------------------------------------------------------- /Demo (Lazarus)/DemoD.lpi: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <CONFIG> 3 | <ProjectOptions> 4 | <Version Value="9"/> 5 | <PathDelim Value="\"/> 6 | <General> 7 | <Flags> 8 | <MainUnitHasUsesSectionForAllUnits Value="False"/> 9 | <MainUnitHasCreateFormStatements Value="False"/> 10 | <MainUnitHasTitleStatement Value="False"/> 11 | </Flags> 12 | <SessionStorage Value="InProjectDir"/> 13 | <MainUnit Value="0"/> 14 | <Title Value="DemoD"/> 15 | <UseAppBundle Value="False"/> 16 | <ResourceType Value="res"/> 17 | </General> 18 | <i18n> 19 | <EnableI18N LFM="False"/> 20 | </i18n> 21 | <VersionInfo> 22 | <StringTable ProductVersion=""/> 23 | </VersionInfo> 24 | <BuildModes Count="1"> 25 | <Item1 Name="Default" Default="True"/> 26 | </BuildModes> 27 | <PublishOptions> 28 | <Version Value="2"/> 29 | <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> 30 | <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/> 31 | </PublishOptions> 32 | <RunParams> 33 | <local> 34 | <FormatVersion Value="1"/> 35 | </local> 36 | </RunParams> 37 | <RequiredPackages Count="2"> 38 | <Item1> 39 | <PackageName Value="TBx2_Lazarus"/> 40 | </Item1> 41 | <Item2> 42 | <PackageName Value="LCL"/> 43 | </Item2> 44 | </RequiredPackages> 45 | <Units Count="2"> 46 | <Unit0> 47 | <Filename Value="DemoD.dpr"/> 48 | <IsPartOfProject Value="True"/> 49 | </Unit0> 50 | <Unit1> 51 | <Filename Value="Demo1.pas"/> 52 | <IsPartOfProject Value="True"/> 53 | <ComponentName Value="DemoForm"/> 54 | <HasResources Value="True"/> 55 | <ResourceBaseClass Value="Form"/> 56 | </Unit1> 57 | </Units> 58 | </ProjectOptions> 59 | <CompilerOptions> 60 | <Version Value="11"/> 61 | <PathDelim Value="\"/> 62 | <SearchPaths> 63 | <IncludeFiles Value="..\source"/> 64 | </SearchPaths> 65 | <Parsing> 66 | <SyntaxOptions> 67 | <SyntaxMode Value="delphi"/> 68 | </SyntaxOptions> 69 | </Parsing> 70 | <Linking> 71 | <Options> 72 | <Win32> 73 | <GraphicApplication Value="True"/> 74 | </Win32> 75 | </Options> 76 | </Linking> 77 | </CompilerOptions> 78 | <Debugging> 79 | <Exceptions Count="3"> 80 | <Item1> 81 | <Name Value="EAbort"/> 82 | </Item1> 83 | <Item2> 84 | <Name Value="ECodetoolError"/> 85 | </Item2> 86 | <Item3> 87 | <Name Value="EFOpenError"/> 88 | </Item3> 89 | </Exceptions> 90 | </Debugging> 91 | </CONFIG> 92 | -------------------------------------------------------------------------------- /AquaToolbar/Demo/Demo1.lpi: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <CONFIG> 3 | <ProjectOptions> 4 | <Version Value="9"/> 5 | <PathDelim Value="\"/> 6 | <General> 7 | <SessionStorage Value="InProjectDir"/> 8 | <MainUnit Value="0"/> 9 | <Title Value="Demo1"/> 10 | <ResourceType Value="res"/> 11 | <UseXPManifest Value="True"/> 12 | <Icon Value="0"/> 13 | </General> 14 | <i18n> 15 | <EnableI18N LFM="False"/> 16 | </i18n> 17 | <VersionInfo> 18 | <StringTable ProductVersion=""/> 19 | </VersionInfo> 20 | <BuildModes Count="1"> 21 | <Item1 Name="Default" Default="True"/> 22 | </BuildModes> 23 | <PublishOptions> 24 | <Version Value="2"/> 25 | </PublishOptions> 26 | <RunParams> 27 | <local> 28 | <FormatVersion Value="1"/> 29 | </local> 30 | </RunParams> 31 | <RequiredPackages Count="2"> 32 | <Item1> 33 | <PackageName Value="Lizard_Lazarus"/> 34 | </Item1> 35 | <Item2> 36 | <PackageName Value="LCL"/> 37 | </Item2> 38 | </RequiredPackages> 39 | <Units Count="2"> 40 | <Unit0> 41 | <Filename Value="Demo1.lpr"/> 42 | <IsPartOfProject Value="True"/> 43 | </Unit0> 44 | <Unit1> 45 | <Filename Value="unit1.pas"/> 46 | <IsPartOfProject Value="True"/> 47 | <ComponentName Value="Form1"/> 48 | <HasResources Value="True"/> 49 | <ResourceBaseClass Value="Form"/> 50 | <UnitName Value="Unit1"/> 51 | </Unit1> 52 | </Units> 53 | </ProjectOptions> 54 | <CompilerOptions> 55 | <Version Value="11"/> 56 | <PathDelim Value="\"/> 57 | <Target> 58 | <Filename Value="Demo1"/> 59 | </Target> 60 | <SearchPaths> 61 | <IncludeFiles Value="$(ProjOutDir)"/> 62 | <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 63 | </SearchPaths> 64 | <Parsing> 65 | <SyntaxOptions> 66 | <SyntaxMode Value="Delphi"/> 67 | <IncludeAssertionCode Value="True"/> 68 | </SyntaxOptions> 69 | </Parsing> 70 | <CodeGeneration> 71 | <Checks> 72 | <RangeChecks Value="True"/> 73 | <OverflowChecks Value="True"/> 74 | </Checks> 75 | <Optimizations> 76 | <OptimizationLevel Value="0"/> 77 | </Optimizations> 78 | </CodeGeneration> 79 | <Linking> 80 | <Debugging> 81 | <UseValgrind Value="True"/> 82 | </Debugging> 83 | <Options> 84 | <Win32> 85 | <GraphicApplication Value="True"/> 86 | </Win32> 87 | </Options> 88 | </Linking> 89 | </CompilerOptions> 90 | <Debugging> 91 | <Exceptions Count="3"> 92 | <Item1> 93 | <Name Value="EAbort"/> 94 | </Item1> 95 | <Item2> 96 | <Name Value="ECodetoolError"/> 97 | </Item2> 98 | <Item3> 99 | <Name Value="EFOpenError"/> 100 | </Item3> 101 | </Exceptions> 102 | </Debugging> 103 | </CONFIG> 104 | -------------------------------------------------------------------------------- /AquaToolbar/source/LizardBase_VCL.pas: -------------------------------------------------------------------------------- 1 | unit LizardBase_VCL; 2 | 3 | {$I Lizard_Ver.inc} 4 | 5 | interface 6 | 7 | uses Windows,Classes, Controls,ExtCtrls; 8 | 9 | type 10 | 11 | { TLzbPanel } 12 | 13 | TLzbPanel = class(TCustomControl) 14 | protected 15 | procedure Paint; override; 16 | procedure PaintSurface(); virtual; //unity, because another backend may have override paint 17 | end; 18 | 19 | { imitate the lazarus class name used, but mimimum class implementation. 20 | so it doesn't inherit TDockTree for simplicity } 21 | TDockManager = class(TInterfacedObject, IDockManager) 22 | public 23 | constructor Create(ADockSite: TWinControl); virtual; 24 | procedure BeginUpdate; virtual; 25 | procedure EndUpdate; virtual; 26 | procedure GetControlBounds(Control: TControl; 27 | out AControlBounds: TRect); virtual; abstract; 28 | procedure InsertControl(Control: TControl; InsertAt: TAlign; 29 | DropCtl: TControl); overload;virtual; abstract; 30 | procedure LoadFromStream(Stream: TStream); virtual; abstract; 31 | procedure PaintSite(DC: HDC); virtual; 32 | procedure PositionDockRect(Client, DropCtl: TControl; DropAlign: TAlign; 33 | var DockRect: TRect); {overload;}virtual; abstract; 34 | procedure RemoveControl(Control: TControl); virtual; abstract; 35 | procedure ResetBounds(Force: Boolean); virtual; abstract; 36 | procedure SaveToStream(Stream: TStream); virtual; abstract; 37 | procedure SetReplacingControl(Control: TControl); virtual; 38 | //Lazarus things: 39 | procedure InsertControl(ADockObject: TDragDockObject); overload; virtual; 40 | //procedure PositionDockRect(ADockObject: TDragDockObject); overload; virtual; 41 | //procedure MessageHandler(Sender: TControl; var Message: TLMessage); virtual; 42 | function GetDockEdge(ADockObject: TDragDockObject): boolean; virtual; 43 | function AutoFreeByControl: Boolean; virtual; 44 | end; 45 | 46 | implementation 47 | 48 | { TLzbPanel } 49 | 50 | procedure TLzbPanel.Paint; 51 | begin 52 | PaintSurface(); 53 | end; 54 | 55 | procedure TLzbPanel.PaintSurface; 56 | begin 57 | inherited paint; 58 | end; 59 | 60 | { TDockManager } 61 | 62 | function TDockManager.AutoFreeByControl: Boolean; 63 | begin 64 | Result := True; 65 | end; 66 | 67 | procedure TDockManager.BeginUpdate; 68 | begin 69 | 70 | end; 71 | 72 | constructor TDockManager.Create(ADockSite: TWinControl); 73 | begin 74 | 75 | end; 76 | 77 | procedure TDockManager.EndUpdate; 78 | begin 79 | 80 | end; 81 | 82 | function TDockManager.GetDockEdge(ADockObject: TDragDockObject): boolean; 83 | begin 84 | { Determine the DropAlign. 85 | ADockObject contains valid DragTarget, DragPos, DragTargetPos relative 86 | dock site, and DropOnControl. 87 | Return True if ADockObject.DropAlign has been determined. 88 | } 89 | Result := False; // use the DockSite.GetDockEdge 90 | end; 91 | 92 | procedure TDockManager.InsertControl(ADockObject: TDragDockObject); 93 | begin 94 | InsertControl(ADockObject.Control,ADockObject.DropAlign, 95 | ADockObject.DropOnControl); 96 | end; 97 | 98 | procedure TDockManager.PaintSite(DC: HDC); 99 | begin 100 | 101 | end; 102 | 103 | procedure TDockManager.SetReplacingControl(Control: TControl); 104 | begin 105 | 106 | end; 107 | 108 | end. 109 | 110 | -------------------------------------------------------------------------------- /source/TBx2_Common.pas: -------------------------------------------------------------------------------- 1 | unit TBx2_Common; 2 | { 3 | ToolBench X2 4 | Copyright (c) 2013 by x2nie 5 | a custom UI based on Toolbar97 6 | 7 | ------------------------------------------- 8 | Toolbar97 9 | Copyright (C) 1998-2004 by Jordan Russell 10 | http://www.jrsoftware.org/ 11 | 12 | This software is provided 'as-is', without any express or implied 13 | warranty. In no event will the authors be held liable for any damages 14 | arising from the use of this software. 15 | 16 | Permission is granted to anyone to use this software for any purpose, 17 | including commercial applications, and to alter it and redistribute it 18 | freely, subject to the following restrictions: 19 | 20 | 1. The origin of this software must not be misrepresented; you must not 21 | claim that you wrote the original software. If you use this software 22 | in a product, an acknowledgment in the product documentation would be 23 | appreciated but is not required. 24 | 2. Altered source versions must be plainly marked as such, and must not be 25 | misrepresented as being the original software. 26 | 3. This notice may not be removed or altered from any source distribution. 27 | 28 | Internal common functions 29 | 30 | } 31 | 32 | interface 33 | 34 | {$I TBx2_Ver.inc} 35 | 36 | uses 37 | Windows, Classes, 38 | {$IFDEF FPC} 39 | LMessages, {$ELSE} 40 | Messages, {$ENDIF} 41 | Controls; 42 | 43 | type 44 | THookProcCode = (hpSendActivateApp, hpSendWindowPosChanged, hpPreDestroy, 45 | hpPostMouseMove); 46 | 47 | TListSortExCompare = function(const Item1, Item2, ExtraData: Pointer): Integer; 48 | TGetToolbarDockPosType = (gtpTop, gtpBottom, gtpLeft, gtpRight, gtpNone); 49 | 50 | TArrayOfTSmallPoint = array of TSmallPoint; 51 | 52 | var 53 | GetToolbarDockPosProc: function(Ctl: TControl): TGetToolbarDockPosType = nil; 54 | 55 | procedure ListSortEx (const List: TList; const Compare: TListSortExCompare; 56 | const ExtraData: Pointer); overload; 57 | procedure ListSortEx (const List: TArrayOfTSmallPoint; const Compare: TListSortExCompare; 58 | const ExtraData: Pointer); overload; 59 | function ApplicationIsActive: Boolean; 60 | 61 | implementation 62 | 63 | function ApplicationIsActive: Boolean; 64 | { Returns True if the application is in the foreground } 65 | begin 66 | Result := GetActiveWindow <> 0; 67 | end; 68 | 69 | procedure ListSortEx (const List: TArrayOfTSmallPoint; const Compare: TListSortExCompare; 70 | const ExtraData: Pointer); 71 | { Similar to TList.Sort, but lets you pass a user-defined ExtraData pointer } 72 | procedure QuickSortEx (L: Integer; const R: Integer); 73 | var 74 | I, J: Integer; 75 | T, P: TSmallPoint; 76 | begin 77 | repeat 78 | I := L; 79 | J := R; 80 | P := List[(L + R) shr 1]; 81 | repeat 82 | while Compare(@List[I], @P, ExtraData) < 0 do Inc(I); 83 | while Compare(@List[J], @P, ExtraData) > 0 do Dec(J); 84 | if I <= J then 85 | begin 86 | //List.Exchange (I, J); 87 | T := List[I]; 88 | List[I] := List[J]; 89 | List[J] := T; 90 | Inc (I); 91 | Dec (J); 92 | end; 93 | until I > J; 94 | if L < J then QuickSortEx (L, J); 95 | L := I; 96 | until I >= R; 97 | end; 98 | begin 99 | if Length(List) > 1 then 100 | QuickSortEx (0, High(List) ); 101 | end; 102 | 103 | procedure ListSortEx (const List: TList; const Compare: TListSortExCompare; 104 | const ExtraData: Pointer); 105 | { Similar to TList.Sort, but lets you pass a user-defined ExtraData pointer } 106 | procedure QuickSortEx (L: Integer; const R: Integer); 107 | var 108 | I, J: Integer; 109 | P: Pointer; 110 | begin 111 | repeat 112 | I := L; 113 | J := R; 114 | P := List[(L + R) shr 1]; 115 | repeat 116 | while Compare(List[I], P, ExtraData) < 0 do Inc(I); 117 | while Compare(List[J], P, ExtraData) > 0 do Dec(J); 118 | if I <= J then 119 | begin 120 | List.Exchange (I, J); 121 | Inc (I); 122 | Dec (J); 123 | end; 124 | until I > J; 125 | if L < J then QuickSortEx (L, J); 126 | L := I; 127 | until I >= R; 128 | end; 129 | begin 130 | if List.Count > 1 then 131 | QuickSortEx (0, List.Count-1); 132 | end; 133 | 134 | end. 135 | -------------------------------------------------------------------------------- /AquaToolbar/source/Lizard_Common.pas: -------------------------------------------------------------------------------- 1 | unit Lizard_Common; 2 | { 3 | ToolBench X2 4 | Copyright (c) 2013 by x2nie 5 | a custom UI based on Toolbar97 6 | 7 | ------------------------------------------- 8 | Toolbar97 9 | Copyright (C) 1998-2004 by Jordan Russell 10 | http://www.jrsoftware.org/ 11 | 12 | This software is provided 'as-is', without any express or implied 13 | warranty. In no event will the authors be held liable for any damages 14 | arising from the use of this software. 15 | 16 | Permission is granted to anyone to use this software for any purpose, 17 | including commercial applications, and to alter it and redistribute it 18 | freely, subject to the following restrictions: 19 | 20 | 1. The origin of this software must not be misrepresented; you must not 21 | claim that you wrote the original software. If you use this software 22 | in a product, an acknowledgment in the product documentation would be 23 | appreciated but is not required. 24 | 2. Altered source versions must be plainly marked as such, and must not be 25 | misrepresented as being the original software. 26 | 3. This notice may not be removed or altered from any source distribution. 27 | 28 | Internal common functions 29 | 30 | } 31 | 32 | interface 33 | 34 | {$ifdef fpc}{$mode delphi}{$endif} 35 | {.$I TBx2_Ver.inc} 36 | 37 | uses 38 | Windows, Classes, 39 | {$IFDEF FPC} 40 | LMessages, {$ELSE} 41 | Messages, {$ENDIF} 42 | Controls; 43 | 44 | type 45 | THookProcCode = (hpSendActivateApp, hpSendWindowPosChanged, hpPreDestroy, 46 | hpPostMouseMove); 47 | 48 | TListSortExCompare = function(const Item1, Item2, ExtraData: Pointer): Integer; 49 | TGetToolbarDockPosType = (gtpTop, gtpBottom, gtpLeft, gtpRight, gtpNone); 50 | 51 | TArrayOfTSmallPoint = array of TSmallPoint; 52 | 53 | var 54 | GetToolbarDockPosProc: function(Ctl: TControl): TGetToolbarDockPosType = nil; 55 | 56 | procedure ListSortEx (const List: TList; const Compare: TListSortExCompare; 57 | const ExtraData: Pointer); overload; 58 | procedure ListSortEx (const List: TArrayOfTSmallPoint; const Compare: TListSortExCompare; 59 | const ExtraData: Pointer); overload; 60 | function ApplicationIsActive: Boolean; 61 | 62 | implementation 63 | 64 | function ApplicationIsActive: Boolean; 65 | { Returns True if the application is in the foreground } 66 | begin 67 | Result := GetActiveWindow <> 0; 68 | end; 69 | 70 | procedure ListSortEx (const List: TArrayOfTSmallPoint; const Compare: TListSortExCompare; 71 | const ExtraData: Pointer); 72 | { Similar to TList.Sort, but lets you pass a user-defined ExtraData pointer } 73 | procedure QuickSortEx (L: Integer; const R: Integer); 74 | var 75 | I, J: Integer; 76 | T, P: TSmallPoint; 77 | begin 78 | repeat 79 | I := L; 80 | J := R; 81 | P := List[(L + R) shr 1]; 82 | repeat 83 | while Compare(@List[I], @P, ExtraData) < 0 do Inc(I); 84 | while Compare(@List[J], @P, ExtraData) > 0 do Dec(J); 85 | if I <= J then 86 | begin 87 | //List.Exchange (I, J); 88 | T := List[I]; 89 | List[I] := List[J]; 90 | List[J] := T; 91 | Inc (I); 92 | Dec (J); 93 | end; 94 | until I > J; 95 | if L < J then QuickSortEx (L, J); 96 | L := I; 97 | until I >= R; 98 | end; 99 | begin 100 | if Length(List) > 1 then 101 | QuickSortEx (0, High(List) ); 102 | end; 103 | 104 | procedure ListSortEx (const List: TList; const Compare: TListSortExCompare; 105 | const ExtraData: Pointer); 106 | { Similar to TList.Sort, but lets you pass a user-defined ExtraData pointer } 107 | procedure QuickSortEx (L: Integer; const R: Integer); 108 | var 109 | I, J: Integer; 110 | P: Pointer; 111 | begin 112 | repeat 113 | I := L; 114 | J := R; 115 | P := List[(L + R) shr 1]; 116 | repeat 117 | while Compare(List[I], P, ExtraData) < 0 do Inc(I); 118 | while Compare(List[J], P, ExtraData) > 0 do Dec(J); 119 | if I <= J then 120 | begin 121 | List.Exchange (I, J); 122 | Inc (I); 123 | Dec (J); 124 | end; 125 | until I > J; 126 | if L < J then QuickSortEx (L, J); 127 | L := I; 128 | until I >= R; 129 | end; 130 | begin 131 | if List.Count > 1 then 132 | QuickSortEx (0, List.Count-1); 133 | end; 134 | 135 | end. 136 | -------------------------------------------------------------------------------- /source/TBx2_VCL7.pas: -------------------------------------------------------------------------------- 1 | unit TBx2_VCL7; 2 | 3 | interface 4 | uses Windows, Classes, Controls,ExtCtrls; 5 | 6 | type 7 | TDockX2Ctrl = class(TCustomPanel) 8 | private 9 | 10 | //FAutoSizingLockCount 11 | FUpdatingBounds:Integer; { Incremented while internally changing the bounds. This allows 12 | it to move the toolbar freely in design mode and prevents the 13 | SizeChanging protected method from begin called } 14 | 15 | public 16 | //integrate Lazarus 17 | procedure DisableAutoSizing; 18 | procedure EnableAutoSizing; 19 | function AutoSizeDelayed: boolean; 20 | end; 21 | 22 | { imitate the lazarus class name used, but mimimum class implementation. 23 | so it doesn't inherit TDockTree for simplicity } 24 | TDockManager = class(TInterfacedObject, IDockManager) 25 | public 26 | constructor Create(ADockSite: TWinControl); virtual; 27 | procedure BeginUpdate; virtual; 28 | procedure EndUpdate; virtual; 29 | procedure GetControlBounds(Control: TControl; 30 | out AControlBounds: TRect); virtual; abstract; 31 | procedure InsertControl(Control: TControl; InsertAt: TAlign; 32 | DropCtl: TControl); overload;virtual; abstract; 33 | procedure LoadFromStream(Stream: TStream); virtual; abstract; 34 | procedure PaintSite(DC: HDC); virtual; 35 | procedure PositionDockRect(Client, DropCtl: TControl; DropAlign: TAlign; 36 | var DockRect: TRect); {overload;}virtual; abstract; 37 | procedure RemoveControl(Control: TControl); virtual; abstract; 38 | procedure ResetBounds(Force: Boolean); virtual; abstract; 39 | procedure SaveToStream(Stream: TStream); virtual; abstract; 40 | procedure SetReplacingControl(Control: TControl); virtual; 41 | //Lazarus things: 42 | procedure InsertControl(ADockObject: TDragDockObject); overload; virtual; 43 | //procedure PositionDockRect(ADockObject: TDragDockObject); overload; virtual; 44 | //procedure MessageHandler(Sender: TControl; var Message: TLMessage); virtual; 45 | function GetDockEdge(ADockObject: TDragDockObject): boolean; virtual; 46 | function AutoFreeByControl: Boolean; virtual; 47 | end; 48 | 49 | implementation 50 | 51 | { TDockX2Ctrl } 52 | 53 | function TDockX2Ctrl.AutoSizeDelayed: boolean; 54 | begin 55 | Result:=(FUpdatingBounds>0); 56 | end; 57 | 58 | procedure TDockX2Ctrl.DisableAutoSizing; 59 | begin 60 | Inc(FUpdatingBounds); 61 | end; 62 | 63 | procedure TDockX2Ctrl.EnableAutoSizing; 64 | begin 65 | Dec(FUpdatingBounds); 66 | end; 67 | 68 | { TDockManager } 69 | 70 | (*procedure TDockManager.PositionDockRect(ADockObject: TDragDockObject); 71 | begin 72 | { for now: defer to old PositionDockRect. 73 | Overridden methods should determine DropOnControl and DropAlign, before 74 | calling inherited method. 75 | 76 | {with ADockObject do 77 | begin 78 | if DropAlign = alNone then 79 | begin 80 | if DropOnControl <> nil then 81 | DropAlign := DropOnControl.GetDockEdge(DropOnControl.ScreenToClient(DragPos)) 82 | else 83 | DropAlign := Control.GetDockEdge(DragTargetPos); 84 | end; 85 | PositionDockRect(Control, DropOnControl, DropAlign, FDockRect); 86 | end;} 87 | end;*) 88 | 89 | procedure TDockManager.SetReplacingControl(Control: TControl); 90 | begin 91 | 92 | end; 93 | 94 | function TDockManager.AutoFreeByControl: Boolean; 95 | begin 96 | Result := True; 97 | end; 98 | 99 | constructor TDockManager.Create(ADockSite: TWinControl); 100 | begin 101 | inherited Create; 102 | end; 103 | 104 | procedure TDockManager.BeginUpdate; 105 | begin 106 | 107 | end; 108 | 109 | procedure TDockManager.EndUpdate; 110 | begin 111 | 112 | end; 113 | 114 | function TDockManager.GetDockEdge(ADockObject: TDragDockObject): boolean; 115 | begin 116 | { Determine the DropAlign. 117 | ADockObject contains valid DragTarget, DragPos, DragTargetPos relative 118 | dock site, and DropOnControl. 119 | Return True if ADockObject.DropAlign has been determined. 120 | } 121 | Result := False; // use the DockSite.GetDockEdge 122 | end; 123 | 124 | procedure TDockManager.InsertControl(ADockObject: TDragDockObject); 125 | begin 126 | InsertControl(ADockObject.Control,ADockObject.DropAlign, 127 | ADockObject.DropOnControl); 128 | end; 129 | 130 | procedure TDockManager.PaintSite(DC: HDC); 131 | begin 132 | 133 | end; 134 | 135 | 136 | 137 | end. 138 | -------------------------------------------------------------------------------- /experiment_MyPopupForm/themypopup.pas: -------------------------------------------------------------------------------- 1 | unit TheMyPopup; 2 | 3 | {$mode objfpc}{$H+} 4 | 5 | interface 6 | 7 | uses 8 | Classes, SysUtils, FileUtil, LclIntf, Forms, LMessages, Controls, Graphics, 9 | Dialogs, CheckLst, LclType, LclProc, InterfaceBase, ExtCtrls, StdCtrls; 10 | 11 | const 12 | WM_MOUSEACTIVATE = $0021; //https://code.google.com/p/thtmlviewer/source/browse/trunk/source/htmlmisc.pas?r=219 13 | MA_NOACTIVATE = 3; 14 | type 15 | 16 | { TMyPopup } 17 | 18 | TMyPopup = class(TForm) 19 | CheckListBox1: TCheckListBox; 20 | Edit1: TEdit; 21 | Shape1: TShape; 22 | procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 23 | procedure FormCreate(Sender: TObject); 24 | procedure FormDeactivate(Sender: TObject); 25 | private 26 | { private declarations } 27 | procedure CMShowingChanged(var Message: TLMessage); message CM_SHOWINGCHANGED; 28 | 29 | procedure WMMouseActivate(var Msg: TLMessage); message WM_MOUSEACTIVATE; 30 | public 31 | { public declarations } 32 | end; 33 | 34 | { TMyHintWindowRendered } 35 | 36 | TMyHintWindowRendered = class(THintWindowRendered) 37 | protected 38 | procedure DoShowWindow;override; 39 | procedure WMNCHitTest(var Message: TLMessage); message LM_NCHITTEST; 40 | procedure FormMouseDown(Sender: TObject; Button: TMouseButton; 41 | Shift: TShiftState; X, Y: Integer); 42 | public 43 | function IsHintMsg(Msg: TMsg): Boolean; override; 44 | 45 | end; 46 | 47 | procedure ShowMyPopup(const Position: TPoint; 48 | const OnShowHide: TNotifyEvent = nil); 49 | var 50 | MyPopup: TMyPopup; 51 | 52 | implementation 53 | 54 | {$R *.lfm} 55 | 56 | 57 | procedure ShowMyPopup(const Position: TPoint; 58 | const OnShowHide: TNotifyEvent = nil); 59 | var 60 | PopupForm:TMyHintWindowRendered;// THintWindowRendered;//TMyPopup; 61 | begin 62 | PopupForm := TMyHintWindowRendered{TMyPopup}.Create(nil); 63 | PopupForm.OnMOuseDown := @PopupForm.FormMouseDown; 64 | with TShape.create(PopupFOrm) do 65 | begin 66 | parent := PopupForm; 67 | Align := alLeft; 68 | Pen.Color := clFuchsia; 69 | //visible := false; 70 | OnMOuseDown := @PopupForm.FormMouseDown 71 | end; 72 | with TEdit.Create(PopupFOrm) do 73 | begin 74 | //parent := popupform; 75 | end; 76 | PopupFOrm.ActiveControl := nil; 77 | //PopupForm.Initialize(Position, ADate, CalendarDisplaySettings); 78 | //PopupForm.FOnReturnDate := OnReturnDate; 79 | //PopupForm.OnShow := OnShowHide; 80 | //PopupForm.OnHide := OnShowHide; 81 | //PopupForm.Show; 82 | PopupFOrm.HintRectAdjust := Rect(0, 0, 500, 50); 83 | PopupForm.OffsetHintRect(Position); 84 | PopupForm.ActivateRendered; 85 | end; 86 | 87 | procedure TMyHintWindowRendered.DoShowWindow; 88 | begin 89 | //inherited DoShowWindow; 90 | end; 91 | 92 | procedure TMyHintWindowRendered.WMNCHitTest(var Message: TLMessage); 93 | begin 94 | Message.Result := HTNOWHERE;//HTTRANSPARENT; //WOY!! INI BISA DIMAINKAN (PLAY WITH THIS) 95 | end; 96 | 97 | procedure TMyHintWindowRendered.FormMouseDown(Sender: TObject; 98 | Button: TMouseButton; Shift: TShiftState; X, Y: Integer); 99 | begin 100 | if BUtton <> mbLeft then close; 101 | //ShowMessage(Sender.ClassName + ' woles! =' +inttostr(X)); 102 | end; 103 | 104 | function TMyHintWindowRendered.IsHintMsg(Msg: TMsg): Boolean; 105 | begin 106 | case Msg.message of 107 | LM_KEYFIRST..LM_KEYLAST, 108 | //CM_ACTIVATE, CM_DEACTIVATE, 109 | CM_APPSYSCOMMAND, 110 | LM_COMMAND, 111 | LM_LBUTTONDOWN..LM_MOUSELAST, 112 | LM_NCMOUSEMOVE : 113 | Result := True; 114 | else 115 | Result := False; 116 | end; 117 | end; 118 | 119 | { TMyPopup } 120 | 121 | procedure TMyPopup.FormDeactivate(Sender: TObject); 122 | begin 123 | Hide; 124 | Close; 125 | end; 126 | 127 | procedure TMyPopup.CMShowingChanged(var Message: TLMessage); 128 | const 129 | ShowFlags: array[Boolean] of UINT = ( 130 | SWP_NOSIZE or SWP_NOMOVE or SWP_NOZORDER or SWP_NOACTIVATE or SWP_HIDEWINDOW, 131 | SWP_NOSIZE or SWP_NOMOVE or SWP_NOZORDER or SWP_NOACTIVATE or SWP_SHOWWINDOW); 132 | begin 133 | SetWindowPos(WindowHandle, 0, 0, 0, 0, 0, ShowFlags[Showing]); 134 | end; 135 | 136 | procedure TMyPopup.WMMouseActivate(var Msg: TLMessage); 137 | begin 138 | Msg.Result := MA_NOACTIVATE; 139 | end; 140 | 141 | procedure TMyPopup.FormCreate(Sender: TObject); 142 | begin 143 | Application.AddOnDeactivateHandler(@FormDeactivate); 144 | end; 145 | 146 | procedure TMyPopup.FormClose(Sender: TObject; var CloseAction: TCloseAction); 147 | begin 148 | Application.RemoveOnDeactivateHandler(@FormDeactivate); 149 | CloseAction := caFree; 150 | end; 151 | 152 | end. 153 | 154 | -------------------------------------------------------------------------------- /source/Package/TBx2_D7.dof: -------------------------------------------------------------------------------- 1 | [FileVersion] 2 | Version=7.0 3 | [Compiler] 4 | A=8 5 | B=0 6 | C=1 7 | D=1 8 | E=0 9 | F=0 10 | G=1 11 | H=1 12 | I=1 13 | J=0 14 | K=0 15 | L=1 16 | M=0 17 | N=1 18 | O=1 19 | P=1 20 | Q=0 21 | R=0 22 | S=0 23 | T=0 24 | U=0 25 | V=1 26 | W=0 27 | X=1 28 | Y=1 29 | Z=1 30 | ShowHints=1 31 | ShowWarnings=1 32 | UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 33 | NamespacePrefix= 34 | SymbolDeprecated=1 35 | SymbolLibrary=1 36 | SymbolPlatform=1 37 | UnitLibrary=1 38 | UnitPlatform=1 39 | UnitDeprecated=1 40 | HResultCompat=1 41 | HidingMember=1 42 | HiddenVirtual=1 43 | Garbage=1 44 | BoundsError=1 45 | ZeroNilCompat=1 46 | StringConstTruncated=1 47 | ForLoopVarVarPar=1 48 | TypedConstVarPar=1 49 | AsgToTypedConst=1 50 | CaseLabelRange=1 51 | ForVariable=1 52 | ConstructingAbstract=1 53 | ComparisonFalse=1 54 | ComparisonTrue=1 55 | ComparingSignedUnsigned=1 56 | CombiningSignedUnsigned=1 57 | UnsupportedConstruct=1 58 | FileOpen=1 59 | FileOpenUnitSrc=1 60 | BadGlobalSymbol=1 61 | DuplicateConstructorDestructor=1 62 | InvalidDirective=1 63 | PackageNoLink=1 64 | PackageThreadVar=1 65 | ImplicitImport=1 66 | HPPEMITIgnored=1 67 | NoRetVal=1 68 | UseBeforeDef=1 69 | ForLoopVarUndef=1 70 | UnitNameMismatch=1 71 | NoCFGFileFound=1 72 | MessageDirective=1 73 | ImplicitVariants=1 74 | UnicodeToLocale=1 75 | LocaleToUnicode=1 76 | ImagebaseMultiple=1 77 | SuspiciousTypecast=1 78 | PrivatePropAccessor=1 79 | UnsafeType=0 80 | UnsafeCode=0 81 | UnsafeCast=0 82 | [Linker] 83 | MapFile=0 84 | OutputObjs=0 85 | ConsoleApp=1 86 | DebugInfo=0 87 | RemoteSymbols=0 88 | MinStackSize=16384 89 | MaxStackSize=1048576 90 | ImageBase=4194304 91 | ExeDescription=Toolbench X2 92 | [Directories] 93 | OutputDir= 94 | UnitOutputDir= 95 | PackageDLLOutputDir= 96 | PackageDCPOutputDir= 97 | SearchPath= 98 | Packages= 99 | Conditionals= 100 | DebugSourceDirs= 101 | UsePackages=0 102 | [Parameters] 103 | RunParams= 104 | HostApplication= 105 | Launcher= 106 | UseLauncher=0 107 | DebugCWD= 108 | [Language] 109 | ActiveLang= 110 | ProjectLang= 111 | RootDir= 112 | [Version Info] 113 | IncludeVerInfo=1 114 | AutoIncBuild=0 115 | MajorVer=1 116 | MinorVer=0 117 | Release=0 118 | Build=0 119 | Debug=0 120 | PreRelease=0 121 | Special=0 122 | Private=0 123 | DLL=0 124 | Locale=1057 125 | CodePage=1252 126 | [Version Info Keys] 127 | CompanyName= 128 | FileDescription= 129 | FileVersion=1.0.0.0 130 | InternalName= 131 | LegalCopyright= 132 | LegalTrademarks= 133 | OriginalFilename= 134 | ProductName= 135 | ProductVersion=1.0.0.0 136 | Comments= 137 | [Excluded Packages] 138 | c:\program files (x86)\borland\delphi7\Projects\Bpl\SL_D7.bpl=SQLite for Delphi Components 139 | c:\program files (x86)\borland\delphi7\Projects\Bpl\CandyPosD7.bpl=x2nie - CandyPOS 140 | c:\program files (x86)\borland\delphi7\Bin\dcldbxcds70.bpl=Borland SimpleDataset Component (DBX) 141 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\OpenWireDsnD7.bpl=OpenWire Project (Design Time) 142 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\SignalLabBasicPkgD7.bpl=Mitov - SignalLab Basic Package 143 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\SignalLabBasicDsnD7.bpl=Mitov - SignalLab Basic Design Package 144 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\SignalLabAdditionalPkgD7.bpl=Mitov - SignalLab Additional Package 145 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\SignalLabAdditionalDsnD7.bpl=Mitov - SignalLab Additional Design Package 146 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\TimingLabBasicPkgD7.bpl=Mitov - TimingLab Basic Package 147 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\AudioLabBasicPkgD7.bpl=Mitov - AudioLab Basic Package 148 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\AudioLabBasicDsnD7.bpl=Mitov - AudioLab Basic Design Package 149 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\VideoLabBasicPkgD7.bpl=Mitov - VideoLab Basic Package 150 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\VideoLabBasicDsnD7.bpl=Mitov - VideoLab Basic Design Package 151 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\VideoLabAdditionalPkgD7.bpl=Mitov - VideoLab Additional Package 152 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\VideoLabAdditionalDsnD7.bpl=Mitov - VideoLab Additional Design Package 153 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\VideoLabPkgD7.bpl=Mitov - VideoLab Package 154 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\VideoLabDsnD7.bpl=Mitov - VideoLab Design Package 155 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\SignalLabScopePkgD7.bpl=Mitov - SignalLab Scope Package 156 | C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\SignalLabScopeDsnD7.bpl=Mitov - SignalLab Scope Design Package 157 | c:\program files (x86)\borland\delphi7\Projects\Bpl\GraphicsMagic_DSGN_D7.bpl=Graphics Magic Design Time Package 158 | c:\program files (x86)\borland\delphi7\Projects\Bpl\devel_dD7.bpl=Devel Designtime for Delphi 7 159 | c:\program files (x86)\borland\delphi7\Projects\Bpl\DSLayoutD7.bpl=DictaSoft Layout [DesignTime] 160 | -------------------------------------------------------------------------------- /Demo (Lazarus)/ConverterBackup/Demo1.pas: -------------------------------------------------------------------------------- 1 | unit Demo1; 2 | 3 | interface 4 | 5 | uses 6 | Windows, SysUtils, Messages, Classes, Graphics, Controls, 7 | Forms, StdCtrls, ExtCtrls, ComCtrls, Menus, Dialogs, 8 | TBx2, TBx2_Toolbar, TBx2_Button, 9 | GR32_Image; 10 | 11 | type 12 | TDemoForm = class(TForm) 13 | Memo: TMemo; 14 | ToolbarPopupMenu: TPopupMenu; 15 | TopDock: TDockX2; 16 | MainMenu: TMainMenu; 17 | FMenu: TMenuItem; 18 | VMenu: TMenuItem; 19 | EditToolbar: TToolbarX2; 20 | BottomDock: TDockX2; 21 | StatusBar: TStatusBar; 22 | LeftButton: TToolbarButtonX2; 23 | CenterButton: TToolbarButtonX2; 24 | RightButton: TToolbarButtonX2; 25 | VToolbars: TMenuItem; 26 | VTMain: TMenuItem; 27 | VTEdit: TMenuItem; 28 | TPMain: TMenuItem; 29 | TPEdit: TMenuItem; 30 | FExit: TMenuItem; 31 | LeftDock: TDockX2; 32 | RightDock: TDockX2; 33 | MainToolbar: TToolbarX2; 34 | FontButton: TToolbarButtonX2; 35 | VStatusBar: TMenuItem; 36 | EditSep1: TToolbarSepX2; 37 | SampleToolbar: TToolbarX2; 38 | SampleEdit1: TEditX2; 39 | SampleEdit2: TEditX2; 40 | TPSample: TMenuItem; 41 | VTSample: TMenuItem; 42 | SampleSep1: TToolbarSepX2; 43 | DropdownButton: TToolbarButtonX2; 44 | DropPopupMenu: TPopupMenu; 45 | Sample1: TMenuItem; 46 | dropdown1: TMenuItem; 47 | menu1: TMenuItem; 48 | UndoButton: TToolbarButtonX2; 49 | RedoButton: TToolbarButtonX2; 50 | SampleSep2: TToolbarSepX2; 51 | ToolWinButton: TToolbarButtonX2; 52 | cbbFont: TComboBox; 53 | ToolbarX21: TToolbarX2; 54 | ToolbarButtonX21: TToolbarButtonX2; 55 | ToolbarButtonX22: TToolbarButtonX2; 56 | ToolbarButtonX23: TToolbarButtonX2; 57 | ToolbarSepX21: TToolbarSepX2; 58 | ToolbarButtonX24: TToolbarButtonX2; 59 | ToolbarButtonX25: TToolbarButtonX2; 60 | ToolbarSepX22: TToolbarSepX2; 61 | ToolbarButtonX26: TToolbarButtonX2; 62 | ToolbarButtonX27: TToolbarButtonX2; 63 | ToolbarButtonX28: TToolbarButtonX2; 64 | procedure FExitClick(Sender: TObject); 65 | procedure VTMainClick(Sender: TObject); 66 | procedure VTEditClick(Sender: TObject); 67 | procedure FormCreate(Sender: TObject); 68 | procedure FontButtonClick(Sender: TObject); 69 | procedure VStatusBarClick(Sender: TObject); 70 | procedure VMenuClick(Sender: TObject); 71 | procedure VTSampleClick(Sender: TObject); 72 | procedure ToolbarPopupMenuPopup(Sender: TObject); 73 | procedure AddButtonClick(Sender: TObject); 74 | procedure ListBoxClick(Sender: TObject); 75 | procedure DeleteButtonClick(Sender: TObject); 76 | procedure SampleToolWindowVisibleChanged(Sender: TObject); 77 | procedure ToolWinButtonClick(Sender: TObject); 78 | private 79 | { Private declarations } 80 | public 81 | { Public declarations } 82 | end; 83 | 84 | var 85 | DemoForm: TDemoForm; 86 | 87 | implementation 88 | 89 | {$R *.DFM} 90 | 91 | procedure TDemoForm.FormCreate(Sender: TObject); 92 | begin 93 | Memo.WordWrap := True; 94 | 95 | { Use the SetSlaveControl method of a TToolbar97 to configure a separate 96 | top/bottom docked and left/right docked version of a control. 97 | Please see the Toolbar97 documentation for more info on slave controls. 98 | 99 | The line below tells it that FontCombo is the top/bottom docked version, 100 | and FontButton is the left/right docked version. } 101 | EditToolbar.SetSlaveControl (cbbFont, FontButton); 102 | end; 103 | 104 | procedure TDemoForm.FExitClick(Sender: TObject); 105 | begin 106 | Close; 107 | end; 108 | 109 | procedure TDemoForm.ToolbarPopupMenuPopup(Sender: TObject); 110 | begin 111 | TPMain.Checked := MainToolbar.Visible; 112 | TPEdit.Checked := EditToolbar.Visible; 113 | TPSample.Checked := SampleToolbar.Visible; 114 | end; 115 | 116 | procedure TDemoForm.VMenuClick(Sender: TObject); 117 | begin 118 | VStatusBar.Checked := StatusBar.Visible; 119 | VTMain.Checked := MainToolbar.Visible; 120 | VTEdit.Checked := EditToolbar.Visible; 121 | VTSample.Checked := SampleToolbar.Visible; 122 | end; 123 | 124 | procedure TDemoForm.VTMainClick(Sender: TObject); 125 | begin 126 | MainToolbar.Visible := not MainToolbar.Visible; 127 | end; 128 | procedure TDemoForm.VTEditClick(Sender: TObject); 129 | begin 130 | EditToolbar.Visible := not EditToolbar.Visible; 131 | end; 132 | procedure TDemoForm.VTSampleClick(Sender: TObject); 133 | begin 134 | SampleToolbar.Visible := not SampleToolbar.Visible; 135 | end; 136 | 137 | procedure TDemoForm.VStatusBarClick(Sender: TObject); 138 | begin 139 | { Force the StatusBar to always be at the bottom of the form. Without this 140 | line of code, the status bar sometimes may appear above the bottom dock. 141 | This is not a bug in Toolbar97, but rather is due to the design of the 142 | VCL's alignment system. } 143 | StatusBar.Top := ClientHeight; 144 | 145 | { Toggle the status bar's visibility } 146 | StatusBar.Visible := not StatusBar.Visible; 147 | end; 148 | 149 | procedure TDemoForm.FontButtonClick(Sender: TObject); 150 | begin 151 | ShowMessage ('A font dialog could come up here.'); 152 | end; 153 | 154 | procedure TDemoForm.ToolWinButtonClick(Sender: TObject); 155 | begin 156 | // SampleToolWindow.Visible := ToolWinButton.Down; 157 | end; 158 | 159 | procedure TDemoForm.SampleToolWindowVisibleChanged(Sender: TObject); 160 | begin 161 | // ToolWinButton.Down := SampleToolWindow.Visible; 162 | end; 163 | 164 | procedure TDemoForm.ListBoxClick(Sender: TObject); 165 | begin 166 | // DeleteButton.Enabled := ListBox.ItemIndex <> -1; 167 | end; 168 | 169 | procedure TDemoForm.AddButtonClick(Sender: TObject); 170 | begin 171 | // ListBox.Items.Add (IntToStr(Random(10000))); 172 | end; 173 | 174 | procedure TDemoForm.DeleteButtonClick(Sender: TObject); 175 | var 176 | SaveItemIndex: Integer; 177 | begin 178 | { SaveItemIndex := ListBox.ItemIndex; 179 | ListBox.Items.Delete (ListBox.ItemIndex); 180 | ListBox.ItemIndex := SaveItemIndex; 181 | DeleteButton.Enabled := ListBox.ItemIndex <> -1;} 182 | 183 | end; 184 | 185 | end. 186 | -------------------------------------------------------------------------------- /Demo (Lazarus)/Demo1.pas: -------------------------------------------------------------------------------- 1 | unit Demo1; 2 | 3 | {$IFDEF FPC} 4 | {$MODE Delphi} 5 | {$ENDIF} 6 | 7 | interface 8 | 9 | uses 10 | {$IFNDEF FPC} 11 | Windows, 12 | {$ELSE} 13 | LCLIntf, LCLType, LMessages, 14 | {$ENDIF} 15 | SysUtils, Messages, Classes, Graphics, Controls, 16 | Forms, StdCtrls, ExtCtrls, ComCtrls, Menus, Dialogs, 17 | TBx2, TBx2_Toolbar, TBx2_Button 18 | {,GR32_Image}; 19 | 20 | type 21 | 22 | { TDemoForm } 23 | 24 | TDemoForm = class(TForm) 25 | Memo: TMemo; 26 | MenuItem1: TMenuItem; 27 | ToolbarPopupMenu: TPopupMenu; 28 | TopDock: TDockX2; 29 | MainMenu: TMainMenu; 30 | FMenu: TMenuItem; 31 | VMenu: TMenuItem; 32 | EditToolbar: TToolbarX2; 33 | BottomDock: TDockX2; 34 | StatusBar: TStatusBar; 35 | LeftButton: TToolbarButtonX2; 36 | CenterButton: TToolbarButtonX2; 37 | RightButton: TToolbarButtonX2; 38 | VToolbars: TMenuItem; 39 | VTMain: TMenuItem; 40 | VTEdit: TMenuItem; 41 | TPMain: TMenuItem; 42 | TPEdit: TMenuItem; 43 | FExit: TMenuItem; 44 | LeftDock: TDockX2; 45 | RightDock: TDockX2; 46 | MainToolbar: TToolbarX2; 47 | FontButton: TToolbarButtonX2; 48 | VStatusBar: TMenuItem; 49 | EditSep1: TToolbarSepX2; 50 | SampleToolbar: TToolbarX2; 51 | SampleEdit1: TEditX2; 52 | SampleEdit2: TEditX2; 53 | TPSample: TMenuItem; 54 | VTSample: TMenuItem; 55 | SampleSep1: TToolbarSepX2; 56 | DropdownButton: TToolbarButtonX2; 57 | DropPopupMenu: TPopupMenu; 58 | Sample1: TMenuItem; 59 | dropdown1: TMenuItem; 60 | menu1: TMenuItem; 61 | UndoButton: TToolbarButtonX2; 62 | RedoButton: TToolbarButtonX2; 63 | SampleSep2: TToolbarSepX2; 64 | ToolWinButton: TToolbarButtonX2; 65 | cbbFont: TComboBox; 66 | ToolbarX21: TToolbarX2; 67 | ToolbarButtonX21: TToolbarButtonX2; 68 | ToolbarButtonX22: TToolbarButtonX2; 69 | ToolbarButtonX23: TToolbarButtonX2; 70 | ToolbarSepX21: TToolbarSepX2; 71 | ToolbarButtonX24: TToolbarButtonX2; 72 | ToolbarButtonX25: TToolbarButtonX2; 73 | ToolbarSepX22: TToolbarSepX2; 74 | ToolbarButtonX26: TToolbarButtonX2; 75 | ToolbarButtonX27: TToolbarButtonX2; 76 | ToolbarButtonX28: TToolbarButtonX2; 77 | procedure FExitClick(Sender: TObject); 78 | procedure MenuItem1Click(Sender: TObject); 79 | procedure VTMainClick(Sender: TObject); 80 | procedure VTEditClick(Sender: TObject); 81 | procedure FormCreate(Sender: TObject); 82 | procedure FontButtonClick(Sender: TObject); 83 | procedure VStatusBarClick(Sender: TObject); 84 | procedure VMenuClick(Sender: TObject); 85 | procedure VTSampleClick(Sender: TObject); 86 | procedure ToolbarPopupMenuPopup(Sender: TObject); 87 | procedure AddButtonClick(Sender: TObject); 88 | procedure ListBoxClick(Sender: TObject); 89 | procedure DeleteButtonClick(Sender: TObject); 90 | procedure SampleToolWindowVisibleChanged(Sender: TObject); 91 | procedure ToolWinButtonClick(Sender: TObject); 92 | private 93 | { Private declarations } 94 | public 95 | { Public declarations } 96 | end; 97 | 98 | var 99 | DemoForm: TDemoForm; 100 | 101 | implementation 102 | 103 | {$R *.dfm} 104 | 105 | procedure TDemoForm.FormCreate(Sender: TObject); 106 | begin 107 | Memo.WordWrap := True; 108 | 109 | { Use the SetSlaveControl method of a TToolbar97 to configure a separate 110 | top/bottom docked and left/right docked version of a control. 111 | Please see the Toolbar97 documentation for more info on slave controls. 112 | 113 | The line below tells it that FontCombo is the top/bottom docked version, 114 | and FontButton is the left/right docked version. } 115 | EditToolbar.SetSlaveControl (cbbFont, FontButton); 116 | end; 117 | 118 | procedure TDemoForm.FExitClick(Sender: TObject); 119 | begin 120 | Close; 121 | end; 122 | 123 | procedure TDemoForm.MenuItem1Click(Sender: TObject); 124 | var S : TStringList; 125 | 126 | procedure Dump(C: TWinControl; Level:integer=0); 127 | var i : integer; 128 | sep : string; 129 | begin 130 | sep := ''; 131 | for i := 0 to level -1 do 132 | begin 133 | sep := sep + ' '; 134 | end; 135 | S.Add(format('%s%s : %s',[sep,C.Name, C.ClassName])); 136 | for i := 0 to C.ControlCount - 1 do 137 | begin 138 | if C.Controls[i] is TWinControl then 139 | Dump(TWinControl(C.Controls[i]), Level +1); 140 | end; 141 | end; 142 | 143 | begin 144 | S := TStringList.Create; 145 | Dump(self); 146 | self.Memo.Lines.Assign(s); 147 | s.free; 148 | end; 149 | 150 | procedure TDemoForm.ToolbarPopupMenuPopup(Sender: TObject); 151 | begin 152 | TPMain.Checked := MainToolbar.Visible; 153 | TPEdit.Checked := EditToolbar.Visible; 154 | TPSample.Checked := SampleToolbar.Visible; 155 | end; 156 | 157 | procedure TDemoForm.VMenuClick(Sender: TObject); 158 | begin 159 | VStatusBar.Checked := StatusBar.Visible; 160 | VTMain.Checked := MainToolbar.Visible; 161 | VTEdit.Checked := EditToolbar.Visible; 162 | VTSample.Checked := SampleToolbar.Visible; 163 | end; 164 | 165 | procedure TDemoForm.VTMainClick(Sender: TObject); 166 | begin 167 | MainToolbar.Visible := not MainToolbar.Visible; 168 | end; 169 | procedure TDemoForm.VTEditClick(Sender: TObject); 170 | begin 171 | EditToolbar.Visible := not EditToolbar.Visible; 172 | end; 173 | procedure TDemoForm.VTSampleClick(Sender: TObject); 174 | begin 175 | SampleToolbar.Visible := not SampleToolbar.Visible; 176 | end; 177 | 178 | procedure TDemoForm.VStatusBarClick(Sender: TObject); 179 | begin 180 | { Force the StatusBar to always be at the bottom of the form. Without this 181 | line of code, the status bar sometimes may appear above the bottom dock. 182 | This is not a bug in Toolbar97, but rather is due to the design of the 183 | VCL's alignment system. } 184 | StatusBar.Top := ClientHeight; 185 | 186 | { Toggle the status bar's visibility } 187 | StatusBar.Visible := not StatusBar.Visible; 188 | end; 189 | 190 | procedure TDemoForm.FontButtonClick(Sender: TObject); 191 | begin 192 | ShowMessage ('A font dialog could come up here.'); 193 | end; 194 | 195 | procedure TDemoForm.ToolWinButtonClick(Sender: TObject); 196 | begin 197 | // SampleToolWindow.Visible := ToolWinButton.Down; 198 | end; 199 | 200 | procedure TDemoForm.SampleToolWindowVisibleChanged(Sender: TObject); 201 | begin 202 | // ToolWinButton.Down := SampleToolWindow.Visible; 203 | end; 204 | 205 | procedure TDemoForm.ListBoxClick(Sender: TObject); 206 | begin 207 | // DeleteButton.Enabled := ListBox.ItemIndex <> -1; 208 | end; 209 | 210 | procedure TDemoForm.AddButtonClick(Sender: TObject); 211 | begin 212 | // ListBox.Items.Add (IntToStr(Random(10000))); 213 | end; 214 | 215 | procedure TDemoForm.DeleteButtonClick(Sender: TObject); 216 | var 217 | SaveItemIndex: Integer; 218 | begin 219 | { SaveItemIndex := ListBox.ItemIndex; 220 | ListBox.Items.Delete (ListBox.ItemIndex); 221 | ListBox.ItemIndex := SaveItemIndex; 222 | DeleteButton.Enabled := ListBox.ItemIndex <> -1;} 223 | 224 | end; 225 | 226 | end. 227 | -------------------------------------------------------------------------------- /Demo (Delphi)/Demo1.pas: -------------------------------------------------------------------------------- 1 | unit Demo1; 2 | 3 | interface 4 | 5 | uses 6 | Windows, SysUtils, Messages, Classes, Graphics, Controls, 7 | Forms, StdCtrls, ExtCtrls, ComCtrls, Menus, Dialogs, 8 | TBx2, TBx2_Toolbar, TBx2_Button, 9 | ToolWin, Buttons, ImgList; 10 | 11 | type 12 | TDemoForm = class(TForm) 13 | Memo: TMemo; 14 | ToolbarPopupMenu: TPopupMenu; 15 | TopDock: TDockX2; 16 | MainMenu: TMainMenu; 17 | FMenu: TMenuItem; 18 | VMenu: TMenuItem; 19 | EditToolbar: TToolbarX2; 20 | BottomDock: TDockX2; 21 | StatusBar: TStatusBar; 22 | LeftButton: TToolbarButtonX2; 23 | CenterButton: TToolbarButtonX2; 24 | RightButton: TToolbarButtonX2; 25 | VToolbars: TMenuItem; 26 | VTMain: TMenuItem; 27 | VTEdit: TMenuItem; 28 | TPMain: TMenuItem; 29 | TPEdit: TMenuItem; 30 | FExit: TMenuItem; 31 | LeftDock: TDockX2; 32 | RightDock: TDockX2; 33 | MainToolbar: TToolbarX2; 34 | FontButton: TToolbarButtonX2; 35 | VStatusBar: TMenuItem; 36 | EditSep1: TToolbarSepX2; 37 | SampleToolbar: TToolbarX2; 38 | SampleEdit1: TEditX2; 39 | SampleEdit2: TEditX2; 40 | TPSample: TMenuItem; 41 | VTSample: TMenuItem; 42 | SampleSep1: TToolbarSepX2; 43 | DropdownButton: TToolbarButtonX2; 44 | DropPopupMenu: TPopupMenu; 45 | Sample1: TMenuItem; 46 | dropdown1: TMenuItem; 47 | menu1: TMenuItem; 48 | UndoButton: TToolbarButtonX2; 49 | RedoButton: TToolbarButtonX2; 50 | SampleSep2: TToolbarSepX2; 51 | ToolWinButton: TToolbarButtonX2; 52 | cbbFont: TComboBox; 53 | ToolbarX21: TToolbarX2; 54 | ToolbarButtonX21: TToolbarButtonX2; 55 | ToolbarButtonX22: TToolbarButtonX2; 56 | ToolbarButtonX23: TToolbarButtonX2; 57 | ToolbarSepX21: TToolbarSepX2; 58 | ToolbarButtonX24: TToolbarButtonX2; 59 | ToolbarButtonX25: TToolbarButtonX2; 60 | ToolbarSepX22: TToolbarSepX2; 61 | ToolbarButtonX26: TToolbarButtonX2; 62 | ToolbarButtonX27: TToolbarButtonX2; 63 | ToolbarButtonX28: TToolbarButtonX2; 64 | ilMenus: TImageList; 65 | ToolbarButtonX29: TToolbarButtonX2; 66 | ToolbarX22: TToolbarX2; 67 | ToolbarButtonX210: TToolbarButtonX2; 68 | ToolbarButtonX211: TToolbarButtonX2; 69 | ToolbarButtonX212: TToolbarButtonX2; 70 | ToolbarX23: TToolbarX2; 71 | ToolbarButtonX213: TToolbarButtonX2; 72 | ToolbarButtonX214: TToolbarButtonX2; 73 | ToolbarButtonX215: TToolbarButtonX2; 74 | ToolbarX24: TToolbarX2; 75 | ToolbarButtonX216: TToolbarButtonX2; 76 | ToolbarButtonX217: TToolbarButtonX2; 77 | ToolbarButtonX218: TToolbarButtonX2; 78 | ToolbarX25: TToolbarX2; 79 | ToolbarButtonX219: TToolbarButtonX2; 80 | ToolbarButtonX220: TToolbarButtonX2; 81 | ToolbarSepX23: TToolbarSepX2; 82 | ToolbarButtonX222: TToolbarButtonX2; 83 | ToolbarButtonX223: TToolbarButtonX2; 84 | ToolbarSepX24: TToolbarSepX2; 85 | ToolbarButtonX226: TToolbarButtonX2; 86 | Dump1: TMenuItem; 87 | procedure FExitClick(Sender: TObject); 88 | procedure VTMainClick(Sender: TObject); 89 | procedure VTEditClick(Sender: TObject); 90 | procedure FormCreate(Sender: TObject); 91 | procedure FontButtonClick(Sender: TObject); 92 | procedure VStatusBarClick(Sender: TObject); 93 | procedure VMenuClick(Sender: TObject); 94 | procedure VTSampleClick(Sender: TObject); 95 | procedure ToolbarPopupMenuPopup(Sender: TObject); 96 | procedure AddButtonClick(Sender: TObject); 97 | procedure ListBoxClick(Sender: TObject); 98 | procedure DeleteButtonClick(Sender: TObject); 99 | procedure SampleToolWindowVisibleChanged(Sender: TObject); 100 | procedure ToolWinButtonClick(Sender: TObject); 101 | procedure Dump1Click(Sender: TObject); 102 | private 103 | { Private declarations } 104 | public 105 | { Public declarations } 106 | end; 107 | 108 | var 109 | DemoForm: TDemoForm; 110 | 111 | implementation 112 | 113 | {$R *.DFM} 114 | 115 | procedure TDemoForm.FormCreate(Sender: TObject); 116 | begin 117 | Memo.WordWrap := True; 118 | 119 | { Use the SetSlaveControl method of a TToolbar97 to configure a separate 120 | top/bottom docked and left/right docked version of a control. 121 | Please see the Toolbar97 documentation for more info on slave controls. 122 | 123 | The line below tells it that FontCombo is the top/bottom docked version, 124 | and FontButton is the left/right docked version. } 125 | EditToolbar.SetSlaveControl (cbbFont, FontButton); 126 | end; 127 | 128 | procedure TDemoForm.FExitClick(Sender: TObject); 129 | begin 130 | Close; 131 | end; 132 | 133 | procedure TDemoForm.ToolbarPopupMenuPopup(Sender: TObject); 134 | begin 135 | TPMain.Checked := MainToolbar.Visible; 136 | TPEdit.Checked := EditToolbar.Visible; 137 | TPSample.Checked := SampleToolbar.Visible; 138 | end; 139 | 140 | procedure TDemoForm.VMenuClick(Sender: TObject); 141 | begin 142 | VStatusBar.Checked := StatusBar.Visible; 143 | VTMain.Checked := MainToolbar.Visible; 144 | VTEdit.Checked := EditToolbar.Visible; 145 | VTSample.Checked := SampleToolbar.Visible; 146 | end; 147 | 148 | procedure TDemoForm.VTMainClick(Sender: TObject); 149 | begin 150 | MainToolbar.Visible := not MainToolbar.Visible; 151 | end; 152 | procedure TDemoForm.VTEditClick(Sender: TObject); 153 | begin 154 | EditToolbar.Visible := not EditToolbar.Visible; 155 | end; 156 | procedure TDemoForm.VTSampleClick(Sender: TObject); 157 | begin 158 | SampleToolbar.Visible := not SampleToolbar.Visible; 159 | end; 160 | 161 | procedure TDemoForm.VStatusBarClick(Sender: TObject); 162 | begin 163 | { Force the StatusBar to always be at the bottom of the form. Without this 164 | line of code, the status bar sometimes may appear above the bottom dock. 165 | This is not a bug in Toolbar97, but rather is due to the design of the 166 | VCL's alignment system. } 167 | StatusBar.Top := ClientHeight; 168 | 169 | { Toggle the status bar's visibility } 170 | StatusBar.Visible := not StatusBar.Visible; 171 | end; 172 | 173 | procedure TDemoForm.FontButtonClick(Sender: TObject); 174 | begin 175 | ShowMessage ('A font dialog could come up here.'); 176 | end; 177 | 178 | procedure TDemoForm.ToolWinButtonClick(Sender: TObject); 179 | begin 180 | // SampleToolWindow.Visible := ToolWinButton.Down; 181 | end; 182 | 183 | procedure TDemoForm.SampleToolWindowVisibleChanged(Sender: TObject); 184 | begin 185 | // ToolWinButton.Down := SampleToolWindow.Visible; 186 | end; 187 | 188 | procedure TDemoForm.ListBoxClick(Sender: TObject); 189 | begin 190 | // DeleteButton.Enabled := ListBox.ItemIndex <> -1; 191 | end; 192 | 193 | procedure TDemoForm.AddButtonClick(Sender: TObject); 194 | begin 195 | // ListBox.Items.Add (IntToStr(Random(10000))); 196 | end; 197 | 198 | procedure TDemoForm.DeleteButtonClick(Sender: TObject); 199 | var 200 | SaveItemIndex: Integer; 201 | begin 202 | { SaveItemIndex := ListBox.ItemIndex; 203 | ListBox.Items.Delete (ListBox.ItemIndex); 204 | ListBox.ItemIndex := SaveItemIndex; 205 | DeleteButton.Enabled := ListBox.ItemIndex <> -1;} 206 | 207 | end; 208 | 209 | procedure TDemoForm.Dump1Click(Sender: TObject); 210 | var S : TStringList; 211 | 212 | procedure Dump(C: TWinControl; Level:integer=0); 213 | var i : integer; 214 | sep : string; 215 | begin 216 | sep := ''; 217 | for i := 0 to level -1 do 218 | begin 219 | sep := sep + ' '; 220 | end; 221 | S.Add(format('%s%s : %s',[sep,C.Name, C.ClassName])); 222 | for i := 0 to C.ControlCount - 1 do 223 | begin 224 | if C.Controls[i] is TWinControl then 225 | Dump(TWinControl(C.Controls[i]), Level +1); 226 | end; 227 | end; 228 | 229 | begin 230 | S := TStringList.Create; 231 | Dump(self); 232 | self.Memo.Lines.Assign(s); 233 | s.free; 234 | 235 | end; 236 | 237 | end. 238 | -------------------------------------------------------------------------------- /AquaToolbar/Demo/Unit1.dfm: -------------------------------------------------------------------------------- 1 | object Form1: TForm1 2 | Left = 438 3 | Height = 353 4 | Top = 187 5 | Width = 384 6 | Caption = 'Form1' 7 | ClientHeight = 353 8 | ClientWidth = 384 9 | Color = clBtnFace 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'MS Sans Serif' 13 | LCLVersion = '1.7' 14 | object LzDock1: TLzDock 15 | Left = 0 16 | Height = 9 17 | Top = 0 18 | Width = 384 19 | Color = clSilver 20 | DockSite = True 21 | UseDockManager = True 22 | object LzToolbar1: TLzToolbar 23 | Cursor = crSizeAll 24 | Left = 64 25 | Height = 41 26 | Top = 0 27 | Width = 185 28 | DragKind = dkDock 29 | DragMode = dmAutomatic 30 | Caption = 'LzToolbar1' 31 | Color = clBtnFace 32 | CloseButtonWhenDocked = True 33 | DockPos = 0 34 | Images = ImageList1 35 | TabOrder = 0 36 | end 37 | object LzToolbar2: TLzToolbar 38 | Cursor = crSizeAll 39 | Left = 280 40 | Height = 41 41 | Top = -3 42 | Width = 185 43 | DragKind = dkDock 44 | DragMode = dmAutomatic 45 | Caption = 'LzToolbar2' 46 | Color = clBtnFace 47 | CloseButton = False 48 | Images = ImageList1 49 | TabOrder = 1 50 | end 51 | object LzToolbar3: TLzToolbar 52 | Cursor = crSizeAll 53 | Left = 40 54 | Height = 41 55 | Top = 40 56 | Width = 185 57 | DragKind = dkDock 58 | DragMode = dmAutomatic 59 | Caption = 'LzToolbar3' 60 | Color = clBtnFace 61 | CloseButton = False 62 | TabOrder = 2 63 | end 64 | end 65 | object ImageList1: TImageList 66 | left = 306 67 | top = 102 68 | Bitmap = { 69 | 4C6903000000100000001000000004040400040404460404048AAA550099AA55 70 | 0099AA550099AA550099AA550099AA550099AA550099AA550099AA550099AA55 71 | 0073AA55000055552B0054542A00040404000404048ABCBCABFFC1C1B1FFC7C7 72 | B9FFCFCFC3FFD7D7CDFFDFDFD7FFE8E8E2FFEFEFECFFF7F7F4FFFCFCFCFF5555 73 | 2B6655552B0055552B0054542A0001010100010101AC555555FFCC9966FFCC99 74 | 66FFCC9966FFCC9966FFCC9966FFCC9966FFCC9966FFCC9966FFCC9966FFAA55 75 | 009A55552B6655552B4D54542A0001010100010101AE808080FFEAB784FFE5B2 76 | 7FFFE5B27FFFE5B27FFFE5B27FFFE5B27FFFE5B27FFFE5B27FFFEAB784FFCA97 77 | 65FFFEFEFDFF54542A6754542A0001010100010101B07E7E7EFFE4B17EFFDAA8 78 | 75FFD7A573FFD3A271FFD2A170FFD2A170FFD6A472FFDAA775FFE4B17EFFC995 79 | 63FFF5F5EEFF3D3D16673D3D160001010100010101B27C7C7CFFE1AE7BFFD4A2 80 | 70FFE2C09FFFFFEEDDFFFFEEDDFFFFEEDDFFF2D9C0FFD19F6FFFE0AD7BFFC793 81 | 61FFEBEBDDFF272702662727020001010100010101B5797979FFDBA976FFDFBD 82 | 9BFFFBEAD9FFC69767FFC69667FFC39566FFEDD5BDFFEED6BDFFD9A776FFC490 83 | 5FFF272702663A3A13343A3A130001010100010101B8757575FFD3A271FFF7E6 84 | D5FFC39465FFD2A982FFF7E6D5FFF7E6D5FFC09263FFF7E6D5FFD3A271FFC18E 85 | 5DFFFEFEFDFF4C4C236A4C4C230001010100010101BB727272FFCF9E6DFFF2E1 86 | D0FFC09162FFF2E1D0FFBA8C5FFFF2E1D0FFBE8F60FFF2E1D0FFCF9E6DFFBE8A 87 | 5AFFF5F5EEFF393912683939120001010100010101BE6E6E6EFFCB9B6AFFEDDC 88 | CBFFBC8D5EFFEDDCCBFFB7895BFFEDDCCBFFB7895BFFEDDCCBFFCD9B6AFFBB87 89 | 58FFEBEBDDFF272702662727020001010100010101C16B6B6BFFC99867FFE8D7 90 | C6FFB98A5BFFC79F77FFE8D7C6FFD0B090FFE8D7C6FFD0AE8CFFCD9B69FFB884 91 | 55FF2727026635350F3535350E0001010100010101C5676767FFC99866FFCBA9 92 | 88FFE3D2C1FFB68757FFB78858FFBB8B5AFFBE8D5CFFC18F5DFFCD9A67FFB481 93 | 52FFFEFEFDFF41411A6E41411A0001010100010101C9646464FFCA9764FFBC8B 94 | 59FFC8A684FFDFCEBDFFDFCEBDFFCDAC8BFFC08D5BFFC18E5BFFCA9764FFB07C 95 | 4FFFF5F5EEFF3E3E176F3E3E170001010100010101CE626262FFC89562FFBF8C 96 | 59FFBC8958FFB88756FFB78655FFBB8957FFBF8C59FFBF8C59FFC89562FFAC78 97 | 4BFFEBEBDDFF35350F7328280C000000001A000000DB606060FFCA9764FFC592 98 | 5FFFC5925FFFC5925FFFC5925FFFC5925FFFC5925FFFC5925FFFCA9764FF7C36 99 | 00BE2C2C077622220662000000090000000000000080000000E7702E00C7702E 100 | 00C7702E00C7702E00C7702E00C7702E00C7702E00C7702E00C7702E00C75523 101 | 00A2000000000000002C0000001202376E0002376E0002376E0002376E000237 102 | 6E1502376E5402376E7002376E7502376E6602376E4F02376E2102376D030235 103 | 6A0002356900023466000233650002376E0002376E0002376E0002376E151446 104 | 7A757C9EC2C4ABC5E0F3AFC8E3FAA2BEDBE97E9FC2CA3662919602366C6F0235 105 | 6A4002356983023466650233650002376E0002376E0002376E0002376E547C9E 106 | C2C4ACC5DFFFAAC3DDFF98B1CBFFAAC3DDFFA9C2DCFFA6BFD9FC7596B8CB1343 107 | 748CAAC3DDFF032C57A3032C560002376E0002376E0002376E0002376E70ABC5 108 | E1F3AAC3DDFF91AAC4FFBBD4EEFFA8C1DBFF94ADC7FFB4CDE7FFAFC8E2FF95AE 109 | C8FF113B679F032B5554032A5300004095000040950000409533004095CC4675 110 | A5FF517BA6FF8AAACBFFA6BFDAFF8EA7C1FFB4CDE7FF90A9C3FF7D96B0FF9DB6 111 | D0FF5B7B9DD202316083022F5D030040950000409519004095CC235EAEDD5588 112 | C9FF487BB8FF396CA2FF45719FFF86A3C2FF90A9C3FF7891ABFF9CB5CFFF7790 113 | AAFF92ABC5FD254D76AE032D582C0040950D004095A63871BCE85A8DD1FF5588 114 | CCFF4E81C5FF4477BAFF3264A2FF28528AFF577499FF9CB5CFFF7790AAFF92AB 115 | C5FF819AB4FF5B7999DB03294F740040955A235EADDD5A8DD1FF5588CCFF4E81 116 | C5FF4477BBFF386BAFFF2A5DA1FF18478AFF0E3171FF637D9FFF92ABC5FF8099 117 | B3FF869FB9FF7893AEF30326499F003D91A14A7FC7F35588CCFF4E81C5FF4477 118 | BBFF386BAFFF2A5DA1FF1A4D91FF124589FF0D387CFF1D407BFF7D97B2FF869F 119 | B9FF7C95AFFF859EB8FD032548B800388BC3588BCFFD4E81C5FF4477BBFF386B 120 | AFFF2A5DA1FF1A4D91FF124589FF1D4E90FF215396FF093A7EFF6282A7FF7891 121 | ABFF92ABC5FF7F98B3FA032548B0003384C35386CAFD4477BBFF386BAFFF2A5D 122 | A1FF1A4D91FF124589FF285795FF305F9EFF3364A5FF1E5195FF275287FF88A1 123 | BBFF88A1BBFF54708EE303254884002D7CA14072B8F3386BAFFF2A5DA1FF1A4D 124 | 91FF124589FF35619BFF406CA6FF3D6CAAFF3366AAFF2B5EA2FF154482FF7F98 125 | B3F954708EE30D2E50B0032548200027745A1C458FDD3265A9FF1A4D91FF1245 126 | 89FF426BA2FF5178ADFF4975AFFF3366AAFF3366AAFF12296CDD000749CC0325 127 | 48B00325488403254820032548000019510D001B63A61D4388E81A4D91FF1447 128 | 8BFF4B74ABFF557EB4FF3366AAFF3366AAFF1D3B7DE8000141CC000131330213 129 | 240002132400021324000000000000062837000C50CC000949AB0E2366DD1E47 130 | 8AF32C5DA1FD3263A6FD295194F3122465DD00003DAB00001032000000180000 131 | 00130000000C0000000600000001000212000001125600010A3B000029720000 132 | 3DA7000040C3000040C300003DA70000297200000A3B000000330000002F0000 133 | 0025000000180000000B0000000204040400040404460404048A1975BABD1975 134 | BABD1975BABD1975BABD1975BABD1975BABD1975BABD1975BABD1975BABD1975 135 | BA8E1975BA0055552B0054542A00040404000404048ABCBCABFFC1C1B1FFC7C7 136 | B9FFCFCFC3FFD7D7CDFFDFDFD7FFE8E8E2FFEFEFECFFF7F7F4FFFCFCFCFF5555 137 | 2B6655552B0055552B0054542A0001010100010101AC555555FF5599CCFF5599 138 | CCFF5599CCFF5599CCFF5599CCFF5599CCFF5599CCFF5599CCFF5599CCFF1975 139 | BABD55552B6655552B4D54542A0001010100010101AE808080FF73B7EAFF6EB2 140 | E5FF6EB2E5FF6EB2E5FF6EB2E5FF6EB2E5FF6EB2E5FF6EB2E5FF73B7EAFF5497 141 | CAFFFEFEFDFF54542A6754542A0001010100010101B07E7E7EFF6DB1E4FF64A8 142 | DAFF63A5D7FF60A2D3FF60A1D2FF60A1D2FF61A4D6FF64A7DAFF6DB1E4FF5395 143 | C8FFF5F5EEFF3D3D16673D3D160001010100010101B27C7C7CFF6AAEE1FF60A2 144 | D4FF96C0E2FFDDEEFFFFDDEEFFFFDDEEFFFFBCD9F2FF5E9FD1FF6AADE0FF5193 145 | C6FFEBEBDDFF272702662727020001010100010101B5797979FF66A9DBFF93BD 146 | DFFFD9EAFBFF5897C6FF5896C6FF5695C3FFB9D5EDFFB9D6EEFF65A7D9FF5090 147 | C3FF272702663A3A13343A3A130001010100010101B8757575FF60A2D3FFD5E6 148 | F7FF5594C3FF76A9D2FFD5E6F7FFD5E6F7FF5492C0FFD5E6F7FF60A2D3FF4F8D 149 | C0FFFEFEFDFF4C4C236A4C4C230001010100010101BB727272FF5D9ECFFFD0E1 150 | F2FF5291C0FFD0E1F2FF508CBAFFD0E1F2FF518FBEFFD0E1F2FF5D9ECFFF4D89 151 | BDFFF5F5EEFF393912683939120001010100010101BE6E6E6EFF599BCBFFCBDC 152 | EDFF4E8DBCFFCBDCEDFF4C89B7FFCBDCEDFF4C89B7FFCBDCEDFF5A9BCDFFA994 153 | 70FFEACFA5FF272702662727020001010100010101C16B6B6BFF5698C9FFC6D7 154 | E8FF4B8AB9FF6B9FC7FFC6D7E8FF88B0D0FFC6D7E8FF83AED0FF589BCDFFC291 155 | 51FFCF8A33E0C5843073D2872E0001010100010101C5676767FF5598C9FF7FA9 156 | CBFFC1D2E3FF4887B6FF4888B7FF9B8866FFB7884BFFB7884CFFB98B4EFFB685 157 | 49FFFFE597FFC4802CE2D0852D5C01010100010101C9646464FF5397CAFF498B 158 | BCFF7CA6C8FFBDCEDFFFBDCEDFFFB78346FFFFE392FFFFD56AFFFFD15DFFFFD1 159 | 5DFFFFD15DFFFFD873FFC37923CC01010100010101CE626262FF5195C8FF488C 160 | BFFF4789BCFF4587B8FF4586B7FF89775AFF9F7039FF9F7039FFA1723BFF9E6C 161 | 35FFFFC538FFA86417E3B76C195C0000001A000000DB606060FF5397CAFF4E92 162 | C5FF4E92C5FF4E92C5FF4E92C5FF4E92C5FF4E92C5FF4E92C5FF5397CAFF8C57 163 | 20F49A570CE45D390994000000090000000000000087000000E7023172CB0231 164 | 72CB023172CB023172CB023172CB023172CB023172CB023172CB023172CB6745 165 | 29E35C30037D0000002C00000012 166 | } 167 | end 168 | end 169 | -------------------------------------------------------------------------------- /Demo (Lazarus)/Demo1.dfm: -------------------------------------------------------------------------------- 1 | object DemoForm: TDemoForm 2 | Left = 630 3 | Height = 337 4 | Top = 194 5 | Width = 453 6 | Caption = 'ToolbarX2 Demo' 7 | ClientHeight = 317 8 | ClientWidth = 453 9 | Color = clBtnFace 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'MS Sans Serif' 13 | Menu = MainMenu 14 | OnCreate = FormCreate 15 | LCLVersion = '1.4.4.0' 16 | object TopDock: TDockX2 17 | Left = 0 18 | Height = 104 19 | Top = 0 20 | Width = 453 21 | object SampleToolbar: TToolbarX2 22 | Cursor = crSizeAll 23 | Left = 137 24 | Height = 26 25 | Top = 26 26 | Width = 316 27 | Caption = 'Sample' 28 | Color = clFuchsia 29 | CloseButtonWhenDocked = True 30 | DockPos = 466 31 | DockRow = 1 32 | ParentShowHint = False 33 | PopupMenu = ToolbarPopupMenu 34 | ShowHint = True 35 | TabOrder = 1 36 | object SampleSep1: TToolbarSepX2 37 | Left = 124 38 | Top = 2 39 | end 40 | object DropdownButton: TToolbarButtonX2 41 | Left = 130 42 | Height = 22 43 | Top = 2 44 | Width = 68 45 | DropdownMenu = DropPopupMenu 46 | Caption = 'Dropdown' 47 | ImageIndex = 0 48 | end 49 | object SampleSep2: TToolbarSepX2 50 | Left = 198 51 | Top = 2 52 | end 53 | object ToolWinButton: TToolbarButtonX2 54 | Left = 204 55 | Height = 22 56 | Top = 2 57 | Width = 110 58 | AllowAllUp = True 59 | GroupIndex = 2 60 | Caption = 'Tool Window Sample' 61 | ImageIndex = 0 62 | OnClick = ToolWinButtonClick 63 | end 64 | object SampleEdit1: TEditX2 65 | Left = 16 66 | Height = 19 67 | Top = 3 68 | Width = 54 69 | TabOrder = 0 70 | Text = 'TEditX2' 71 | end 72 | object SampleEdit2: TEditX2 73 | Left = 70 74 | Height = 19 75 | Top = 3 76 | Width = 54 77 | TabOrder = 1 78 | Text = 'sample' 79 | end 80 | end 81 | object MainToolbar: TToolbarX2 82 | Cursor = crSizeAll 83 | Left = 367 84 | Height = 26 85 | Top = 52 86 | Width = 86 87 | Caption = 'Main' 88 | Color = clYellow 89 | CloseButtonWhenDocked = True 90 | DockPos = 458 91 | DockRow = 2 92 | DragHandleStyle = dhSingle 93 | ParentShowHint = False 94 | PopupMenu = ToolbarPopupMenu 95 | ShowHint = True 96 | TabOrder = 0 97 | object UndoButton: TToolbarButtonX2 98 | Left = 16 99 | Height = 22 100 | Hint = 'Undo' 101 | Top = 2 102 | Width = 34 103 | DropdownCombo = True 104 | DropdownMenu = DropPopupMenu 105 | ImageIndex = 0 106 | end 107 | object RedoButton: TToolbarButtonX2 108 | Left = 50 109 | Height = 22 110 | Hint = 'Redo' 111 | Top = 2 112 | Width = 34 113 | DropdownCombo = True 114 | DropdownMenu = DropPopupMenu 115 | ImageIndex = 0 116 | end 117 | end 118 | object ToolbarX21: TToolbarX2 119 | Cursor = crSizeAll 120 | Left = 0 121 | Height = 26 122 | Top = 0 123 | Width = 208 124 | Caption = 'Main' 125 | Color = clAqua 126 | DockPos = 0 127 | DragHandleStyle = dhSingle 128 | ParentShowHint = False 129 | PopupMenu = ToolbarPopupMenu 130 | Resizable = False 131 | ShowHint = True 132 | TabOrder = 2 133 | object ToolbarButtonX21: TToolbarButtonX2 134 | Left = 10 135 | Height = 22 136 | Hint = 'New' 137 | Top = 2 138 | Width = 23 139 | ImageIndex = 0 140 | end 141 | object ToolbarButtonX22: TToolbarButtonX2 142 | Left = 33 143 | Height = 22 144 | Hint = 'Open' 145 | Top = 2 146 | Width = 23 147 | ImageIndex = 0 148 | end 149 | object ToolbarButtonX23: TToolbarButtonX2 150 | Left = 56 151 | Height = 22 152 | Hint = 'Save' 153 | Top = 2 154 | Width = 23 155 | ImageIndex = 0 156 | end 157 | object ToolbarSepX21: TToolbarSepX2 158 | Left = 79 159 | Top = 2 160 | end 161 | object ToolbarButtonX24: TToolbarButtonX2 162 | Left = 85 163 | Height = 22 164 | Hint = 'Print' 165 | Top = 2 166 | Width = 23 167 | ImageIndex = 0 168 | end 169 | object ToolbarButtonX25: TToolbarButtonX2 170 | Left = 108 171 | Height = 22 172 | Hint = 'Print Preview' 173 | Top = 2 174 | Width = 23 175 | ImageIndex = 0 176 | end 177 | object ToolbarSepX22: TToolbarSepX2 178 | Left = 131 179 | Top = 2 180 | end 181 | object ToolbarButtonX26: TToolbarButtonX2 182 | Left = 137 183 | Height = 22 184 | Hint = 'Cut' 185 | Top = 2 186 | Width = 23 187 | ImageIndex = 0 188 | end 189 | object ToolbarButtonX27: TToolbarButtonX2 190 | Left = 160 191 | Height = 22 192 | Hint = 'Copy' 193 | Top = 2 194 | Width = 23 195 | ImageIndex = 0 196 | end 197 | object ToolbarButtonX28: TToolbarButtonX2 198 | Left = 183 199 | Height = 22 200 | Hint = 'Paste' 201 | Top = 2 202 | Width = 23 203 | ImageIndex = 0 204 | end 205 | end 206 | object EditToolbar: TToolbarX2 207 | Cursor = crSizeAll 208 | Left = 0 209 | Height = 26 210 | Top = 78 211 | Width = 258 212 | Caption = 'Edit' 213 | Color = clLime 214 | DockPos = 0 215 | DockRow = 3 216 | ParentShowHint = False 217 | PopupMenu = ToolbarPopupMenu 218 | ShowHint = True 219 | TabOrder = 3 220 | object FontButton: TToolbarButtonX2 221 | Left = 13 222 | Height = 22 223 | Hint = 'Font' 224 | Top = 2 225 | Width = 23 226 | ImageIndex = 0 227 | OnClick = FontButtonClick 228 | end 229 | object EditSep1: TToolbarSepX2 230 | Left = 181 231 | Top = 2 232 | end 233 | object LeftButton: TToolbarButtonX2 234 | Left = 187 235 | Height = 22 236 | Hint = 'Align Left' 237 | Top = 2 238 | Width = 23 239 | GroupIndex = 1 240 | Down = True 241 | ImageIndex = 0 242 | end 243 | object CenterButton: TToolbarButtonX2 244 | Left = 210 245 | Height = 22 246 | Hint = 'Align Center' 247 | Top = 2 248 | Width = 23 249 | GroupIndex = 1 250 | ImageIndex = 0 251 | end 252 | object RightButton: TToolbarButtonX2 253 | Left = 233 254 | Height = 22 255 | Hint = 'Align Right' 256 | Top = 2 257 | Width = 23 258 | GroupIndex = 1 259 | ImageIndex = 0 260 | end 261 | object cbbFont: TComboBox 262 | Left = 36 263 | Height = 21 264 | Top = 2 265 | Width = 145 266 | ItemHeight = 13 267 | TabOrder = 0 268 | Text = 'cbbFont' 269 | end 270 | end 271 | end 272 | object LeftDock: TDockX2 273 | Left = 0 274 | Height = 181 275 | Top = 104 276 | Width = 9 277 | Position = dpLeft 278 | end 279 | object Memo: TMemo 280 | Left = 9 281 | Height = 181 282 | Top = 104 283 | Width = 435 284 | Align = alClient 285 | Font.Color = clWindowText 286 | Font.Height = -11 287 | Font.Name = 'Arial' 288 | Lines.Strings = ( 289 | 'This is a demonstration of the toolbars, so most of the buttons don''t do anything when clicked. Please see the file "ToolbarX2 Documentation.htm" for information on using the ToolbarX2 components.' 290 | '' 291 | 'Some things to try:' 292 | '? You can drag and resize the toolbars. Dock them to any side of the form or leave them floating. Notice that if you dock the Edit toolbar to the left or right side of the form, a button is used in place of the combo box (the source code shows how this was set up).' 293 | '? Multiple toolbars can lined up side-by-side or in rows.' 294 | '? Click the right button on a toolbar or dock to see its PopupMenu.' 295 | ) 296 | ParentFont = False 297 | ScrollBars = ssVertical 298 | TabOrder = 0 299 | WantTabs = True 300 | WordWrap = False 301 | end 302 | object RightDock: TDockX2 303 | Left = 444 304 | Height = 181 305 | Top = 104 306 | Width = 9 307 | Position = dpRight 308 | end 309 | object BottomDock: TDockX2 310 | Left = 0 311 | Height = 9 312 | Top = 285 313 | Width = 453 314 | Position = dpBottom 315 | end 316 | object StatusBar: TStatusBar 317 | Left = 0 318 | Height = 23 319 | Top = 294 320 | Width = 453 321 | Panels = < 322 | item 323 | Width = 128 324 | end> 325 | end 326 | object ToolbarPopupMenu: TPopupMenu 327 | OnPopup = ToolbarPopupMenuPopup 328 | left = 384 329 | top = 112 330 | object TPMain: TMenuItem 331 | Caption = '&Main' 332 | Checked = True 333 | OnClick = VTMainClick 334 | end 335 | object TPEdit: TMenuItem 336 | Caption = '&Edit' 337 | Checked = True 338 | OnClick = VTEditClick 339 | end 340 | object TPSample: TMenuItem 341 | Caption = '&Sample' 342 | Checked = True 343 | OnClick = VTSampleClick 344 | end 345 | end 346 | object MainMenu: TMainMenu 347 | left = 344 348 | top = 112 349 | object FMenu: TMenuItem 350 | Caption = '&File' 351 | object FExit: TMenuItem 352 | Caption = 'E&xit' 353 | OnClick = FExitClick 354 | end 355 | end 356 | object VMenu: TMenuItem 357 | Caption = '&View' 358 | OnClick = VMenuClick 359 | object VToolbars: TMenuItem 360 | Caption = '&Toolbars' 361 | object VTMain: TMenuItem 362 | Caption = '&Main' 363 | OnClick = VTMainClick 364 | end 365 | object VTEdit: TMenuItem 366 | Caption = '&Edit' 367 | OnClick = VTEditClick 368 | end 369 | object VTSample: TMenuItem 370 | Caption = '&Sample' 371 | OnClick = VTSampleClick 372 | end 373 | end 374 | object VStatusBar: TMenuItem 375 | Caption = '&Status Bar' 376 | OnClick = VStatusBarClick 377 | end 378 | end 379 | object MenuItem1: TMenuItem 380 | Caption = 'Dump!' 381 | OnClick = MenuItem1Click 382 | end 383 | end 384 | object DropPopupMenu: TPopupMenu 385 | left = 320 386 | top = 64 387 | object Sample1: TMenuItem 388 | Caption = 'Sample' 389 | end 390 | object dropdown1: TMenuItem 391 | Caption = 'drop-down' 392 | end 393 | object menu1: TMenuItem 394 | Caption = 'menu' 395 | end 396 | end 397 | end 398 | -------------------------------------------------------------------------------- /Demo (Lazarus)/DemoD.lps: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <CONFIG> 3 | <ProjectSession> 4 | <PathDelim Value="\"/> 5 | <Version Value="9"/> 6 | <BuildModes Active="Default"/> 7 | <Units Count="33"> 8 | <Unit0> 9 | <Filename Value="DemoD.dpr"/> 10 | <IsPartOfProject Value="True"/> 11 | <TopLine Value="5"/> 12 | <CursorPos X="19" Y="14"/> 13 | <UsageCount Value="75"/> 14 | <Loaded Value="True"/> 15 | <DefaultSyntaxHighlighter Value="Delphi"/> 16 | </Unit0> 17 | <Unit1> 18 | <Filename Value="Demo1.pas"/> 19 | <IsPartOfProject Value="True"/> 20 | <ComponentName Value="DemoForm"/> 21 | <HasResources Value="True"/> 22 | <ResourceBaseClass Value="Form"/> 23 | <EditorIndex Value="1"/> 24 | <TopLine Value="16"/> 25 | <CursorPos X="67" Y="21"/> 26 | <UsageCount Value="75"/> 27 | <Loaded Value="True"/> 28 | <LoadedDesigner Value="True"/> 29 | <DefaultSyntaxHighlighter Value="Delphi"/> 30 | </Unit1> 31 | <Unit2> 32 | <Filename Value="..\source\TBx2_Button.pas"/> 33 | <EditorIndex Value="9"/> 34 | <TopLine Value="30"/> 35 | <CursorPos X="21" Y="39"/> 36 | <UsageCount Value="71"/> 37 | <Loaded Value="True"/> 38 | <DefaultSyntaxHighlighter Value="Delphi"/> 39 | </Unit2> 40 | <Unit3> 41 | <Filename Value="..\source\TBx2_Toolbar.pas"/> 42 | <EditorIndex Value="19"/> 43 | <TopLine Value="92"/> 44 | <CursorPos X="24" Y="139"/> 45 | <UsageCount Value="71"/> 46 | <Loaded Value="True"/> 47 | <DefaultSyntaxHighlighter Value="Delphi"/> 48 | </Unit3> 49 | <Unit4> 50 | <Filename Value="..\source\TBx2.pas"/> 51 | <IsVisibleTab Value="True"/> 52 | <EditorIndex Value="2"/> 53 | <TopLine Value="1676"/> 54 | <CursorPos X="19" Y="1694"/> 55 | <UsageCount Value="71"/> 56 | <Bookmarks Count="1"> 57 | <Item0 X="11" Y="1687" ID="9"/> 58 | </Bookmarks> 59 | <Loaded Value="True"/> 60 | <DefaultSyntaxHighlighter Value="Delphi"/> 61 | </Unit4> 62 | <Unit5> 63 | <Filename Value="D:\lazarus\lcl\forms.pp"/> 64 | <UnitName Value="Forms"/> 65 | <EditorIndex Value="-1"/> 66 | <TopLine Value="20"/> 67 | <CursorPos X="44" Y="44"/> 68 | <UsageCount Value="29"/> 69 | </Unit5> 70 | <Unit6> 71 | <Filename Value="..\..\Graph\graphics32-1-9-1-r1581\Graphics32\GR32.pas"/> 72 | <TopLine Value="992"/> 73 | <CursorPos X="63" Y="996"/> 74 | <UsageCount Value="5"/> 75 | <DefaultSyntaxHighlighter Value="Delphi"/> 76 | </Unit6> 77 | <Unit7> 78 | <Filename Value="D:\lazarus\lcl\controls.pp"/> 79 | <UnitName Value="Controls"/> 80 | <EditorIndex Value="-1"/> 81 | <TopLine Value="1271"/> 82 | <CursorPos X="15" Y="1289"/> 83 | <UsageCount Value="29"/> 84 | </Unit7> 85 | <Unit8> 86 | <Filename Value="D:\lazarus\lcl\include\dragobject.inc"/> 87 | <EditorIndex Value="-1"/> 88 | <TopLine Value="62"/> 89 | <CursorPos X="49" Y="62"/> 90 | <UsageCount Value="29"/> 91 | </Unit8> 92 | <Unit9> 93 | <Filename Value="D:\lazarus\lcl\include\dragdock.inc"/> 94 | <EditorIndex Value="-1"/> 95 | <UsageCount Value="29"/> 96 | </Unit9> 97 | <Unit10> 98 | <Filename Value="D:\lazarus\lcl\include\controlsproc.inc"/> 99 | <EditorIndex Value="-1"/> 100 | <UsageCount Value="29"/> 101 | </Unit10> 102 | <Unit11> 103 | <Filename Value="D:\lazarus\lcl\include\dockzone.inc"/> 104 | <EditorIndex Value="-1"/> 105 | <UsageCount Value="29"/> 106 | </Unit11> 107 | <Unit12> 108 | <Filename Value="D:\lazarus\lcl\include\docktree.inc"/> 109 | <EditorIndex Value="-1"/> 110 | <UsageCount Value="29"/> 111 | </Unit12> 112 | <Unit13> 113 | <Filename Value="D:\lazarus\lcl\include\control.inc"/> 114 | <EditorIndex Value="-1"/> 115 | <UsageCount Value="29"/> 116 | <Bookmarks Count="1"> 117 | <Item0 X="24" Y="379" ID="8"/> 118 | </Bookmarks> 119 | </Unit13> 120 | <Unit14> 121 | <Filename Value="D:\lazarus\lcl\include\dragmanager.inc"/> 122 | <WindowIndex Value="1"/> 123 | <TopLine Value="297"/> 124 | <CursorPos X="56" Y="332"/> 125 | <ExtraEditorCount Value="1"/> 126 | <ExtraEditor1> 127 | <EditorIndex Value="-1"/> 128 | <TopLine Value="672"/> 129 | <CursorPos X="40" Y="697"/> 130 | </ExtraEditor1> 131 | <UsageCount Value="29"/> 132 | <Bookmarks Count="2"> 133 | <Item0 X="50" Y="332" ID="9"/> 134 | <Item1 X="43" Y="668" ID="7"/> 135 | </Bookmarks> 136 | </Unit14> 137 | <Unit15> 138 | <Filename Value="D:\lazarus\lcl\include\wincontrol.inc"/> 139 | <EditorIndex Value="-1"/> 140 | <TopLine Value="5429"/> 141 | <CursorPos X="32" Y="5460"/> 142 | <UsageCount Value="29"/> 143 | </Unit15> 144 | <Unit16> 145 | <Filename Value="D:\lazarus\ide\ide.pas"/> 146 | <EditorIndex Value="-1"/> 147 | <WindowIndex Value="-1"/> 148 | <UsageCount Value="9"/> 149 | </Unit16> 150 | <Unit17> 151 | <Filename Value="..\source\TBx2_Ver.inc"/> 152 | <EditorIndex Value="8"/> 153 | <CursorPos X="28" Y="7"/> 154 | <UsageCount Value="17"/> 155 | <Loaded Value="True"/> 156 | <DefaultSyntaxHighlighter Value="Delphi"/> 157 | </Unit17> 158 | <Unit18> 159 | <Filename Value="C:\lazarus_1_4_4\lcl\graphics.pp"/> 160 | <UnitName Value="Graphics"/> 161 | <EditorIndex Value="20"/> 162 | <TopLine Value="1171"/> 163 | <CursorPos X="15" Y="1178"/> 164 | <UsageCount Value="17"/> 165 | <Loaded Value="True"/> 166 | </Unit18> 167 | <Unit19> 168 | <Filename Value="C:\lazarus_1_4_4\components\anchordocking\anchordocking.pas"/> 169 | <UnitName Value="AnchorDocking"/> 170 | <EditorIndex Value="4"/> 171 | <TopLine Value="2306"/> 172 | <CursorPos X="13" Y="2297"/> 173 | <UsageCount Value="17"/> 174 | <Loaded Value="True"/> 175 | </Unit19> 176 | <Unit20> 177 | <Filename Value="C:\lazarus_1_4_4\components\anchordocking\minide\simplefrm.pas"/> 178 | <ComponentName Value="SimpleForm"/> 179 | <HasResources Value="True"/> 180 | <ResourceBaseClass Value="Form"/> 181 | <UnitName Value="SimpleFrm"/> 182 | <EditorIndex Value="6"/> 183 | <TopLine Value="47"/> 184 | <UsageCount Value="17"/> 185 | <Loaded Value="True"/> 186 | <LoadedDesigner Value="True"/> 187 | </Unit20> 188 | <Unit21> 189 | <Filename Value="C:\lazarus_1_4_4\components\anchordocking\minide\unit1.pas"/> 190 | <ComponentName Value="MainIDE"/> 191 | <HasResources Value="True"/> 192 | <ResourceBaseClass Value="Form"/> 193 | <UnitName Value="Unit1"/> 194 | <EditorIndex Value="7"/> 195 | <TopLine Value="94"/> 196 | <CursorPos X="10" Y="160"/> 197 | <UsageCount Value="17"/> 198 | <Loaded Value="True"/> 199 | </Unit21> 200 | <Unit22> 201 | <Filename Value="C:\lazarus_1_4_4\lcl\include\control.inc"/> 202 | <EditorIndex Value="10"/> 203 | <TopLine Value="536"/> 204 | <CursorPos X="16" Y="512"/> 205 | <UsageCount Value="17"/> 206 | <Loaded Value="True"/> 207 | </Unit22> 208 | <Unit23> 209 | <Filename Value="C:\lazarus_1_4_4\lcl\include\wincontrol.inc"/> 210 | <EditorIndex Value="14"/> 211 | <TopLine Value="5363"/> 212 | <CursorPos X="10" Y="5368"/> 213 | <UsageCount Value="17"/> 214 | <Loaded Value="True"/> 215 | </Unit23> 216 | <Unit24> 217 | <Filename Value="C:\lazarus_1_4_4\lcl\controls.pp"/> 218 | <UnitName Value="Controls"/> 219 | <EditorIndex Value="17"/> 220 | <TopLine Value="404"/> 221 | <CursorPos X="3" Y="391"/> 222 | <UsageCount Value="17"/> 223 | <Loaded Value="True"/> 224 | </Unit24> 225 | <Unit25> 226 | <Filename Value="C:\lazarus_1_4_4\lcl\include\customdockform.inc"/> 227 | <EditorIndex Value="15"/> 228 | <TopLine Value="11"/> 229 | <CursorPos Y="23"/> 230 | <UsageCount Value="16"/> 231 | <Loaded Value="True"/> 232 | </Unit25> 233 | <Unit26> 234 | <Filename Value="C:\lazarus_1_4_4\lcl\include\customform.inc"/> 235 | <EditorIndex Value="16"/> 236 | <TopLine Value="482"/> 237 | <CursorPos Y="490"/> 238 | <UsageCount Value="16"/> 239 | <Loaded Value="True"/> 240 | </Unit26> 241 | <Unit27> 242 | <Filename Value="C:\lazarus_1_4_4\lcl\include\dragmanager.inc"/> 243 | <EditorIndex Value="11"/> 244 | <TopLine Value="690"/> 245 | <CursorPos Y="701"/> 246 | <UsageCount Value="16"/> 247 | <Loaded Value="True"/> 248 | </Unit27> 249 | <Unit28> 250 | <Filename Value="C:\lazarus_1_4_4\lcl\lclmessageglue.pas"/> 251 | <UnitName Value="LCLMessageGlue"/> 252 | <EditorIndex Value="12"/> 253 | <TopLine Value="108"/> 254 | <CursorPos Y="123"/> 255 | <UsageCount Value="16"/> 256 | <Loaded Value="True"/> 257 | </Unit28> 258 | <Unit29> 259 | <Filename Value="C:\lazarus_1_4_4\lcl\interfaces\win32\win32callback.inc"/> 260 | <EditorIndex Value="13"/> 261 | <TopLine Value="2600"/> 262 | <CursorPos Y="2609"/> 263 | <UsageCount Value="16"/> 264 | <Loaded Value="True"/> 265 | </Unit29> 266 | <Unit30> 267 | <Filename Value="..\..\branches\ancurdocking\ancurdocking.pas"/> 268 | <UnitName Value="AncurDocking"/> 269 | <EditorIndex Value="5"/> 270 | <TopLine Value="3313"/> 271 | <CursorPos X="10" Y="3336"/> 272 | <UsageCount Value="15"/> 273 | <Loaded Value="True"/> 274 | </Unit30> 275 | <Unit31> 276 | <Filename Value="C:\lazarus_1_4_4\lcl\lmessages.pp"/> 277 | <UnitName Value="LMessages"/> 278 | <EditorIndex Value="18"/> 279 | <TopLine Value="160"/> 280 | <CursorPos X="11" Y="171"/> 281 | <UsageCount Value="14"/> 282 | <Loaded Value="True"/> 283 | </Unit31> 284 | <Unit32> 285 | <Filename Value="..\..\..\..\ui\ToolBar\tb2k-2.2.2\Source\TB2Toolbar.pas"/> 286 | <EditorIndex Value="3"/> 287 | <TopLine Value="61"/> 288 | <CursorPos X="3" Y="64"/> 289 | <UsageCount Value="10"/> 290 | <Loaded Value="True"/> 291 | <DefaultSyntaxHighlighter Value="Delphi"/> 292 | </Unit32> 293 | </Units> 294 | <JumpHistory Count="30" HistoryIndex="29"> 295 | <Position1> 296 | <Filename Value="..\source\TBx2.pas"/> 297 | <Caret Line="131" Column="27" TopLine="112"/> 298 | </Position1> 299 | <Position2> 300 | <Filename Value="..\source\TBx2.pas"/> 301 | <Caret Line="292" Column="27" TopLine="273"/> 302 | </Position2> 303 | <Position3> 304 | <Filename Value="..\source\TBx2.pas"/> 305 | <Caret Line="336" Column="26" TopLine="317"/> 306 | </Position3> 307 | <Position4> 308 | <Filename Value="..\source\TBx2.pas"/> 309 | <Caret Line="1258" Column="25" TopLine="1238"/> 310 | </Position4> 311 | <Position5> 312 | <Filename Value="..\source\TBx2.pas"/> 313 | <Caret Line="1263" Column="23" TopLine="1243"/> 314 | </Position5> 315 | <Position6> 316 | <Filename Value="..\source\TBx2.pas"/> 317 | <Caret Line="1329" Column="23" TopLine="1309"/> 318 | </Position6> 319 | <Position7> 320 | <Filename Value="..\source\TBx2.pas"/> 321 | <Caret Line="1400" Column="30" TopLine="1381"/> 322 | </Position7> 323 | <Position8> 324 | <Filename Value="..\source\TBx2.pas"/> 325 | <Caret Line="2260" Column="90" TopLine="2253"/> 326 | </Position8> 327 | <Position9> 328 | <Filename Value="..\source\TBx2.pas"/> 329 | <Caret Line="2319" Column="25" TopLine="2299"/> 330 | </Position9> 331 | <Position10> 332 | <Filename Value="..\source\TBx2.pas"/> 333 | <Caret Line="2411" Column="24" TopLine="2392"/> 334 | </Position10> 335 | <Position11> 336 | <Filename Value="..\source\TBx2.pas"/> 337 | <Caret Line="2460" Column="22" TopLine="2440"/> 338 | </Position11> 339 | <Position12> 340 | <Filename Value="..\source\TBx2.pas"/> 341 | <Caret Line="2478" Column="17" TopLine="2458"/> 342 | </Position12> 343 | <Position13> 344 | <Filename Value="Demo1.pas"/> 345 | <Caret Line="148" Column="38"/> 346 | </Position13> 347 | <Position14> 348 | <Filename Value="..\source\TBx2_Toolbar.pas"/> 349 | </Position14> 350 | <Position15> 351 | <Filename Value="..\source\TBx2.pas"/> 352 | <Caret Line="2890" Column="15" TopLine="2881"/> 353 | </Position15> 354 | <Position16> 355 | <Filename Value="C:\lazarus_1_4_4\components\anchordocking\anchordocking.pas"/> 356 | <Caret Line="1690" Column="26" TopLine="1683"/> 357 | </Position16> 358 | <Position17> 359 | <Filename Value="C:\lazarus_1_4_4\components\anchordocking\anchordocking.pas"/> 360 | <Caret Line="553" Column="17" TopLine="542"/> 361 | </Position17> 362 | <Position18> 363 | <Filename Value="..\source\TBx2.pas"/> 364 | <Caret Line="3053" Column="21" TopLine="3044"/> 365 | </Position18> 366 | <Position19> 367 | <Filename Value="..\source\TBx2.pas"/> 368 | <Caret Line="34" Column="2" TopLine="28"/> 369 | </Position19> 370 | <Position20> 371 | <Filename Value="..\..\..\..\ui\ToolBar\tb2k-2.2.2\Source\TB2Toolbar.pas"/> 372 | </Position20> 373 | <Position21> 374 | <Filename Value="..\..\..\..\ui\ToolBar\tb2k-2.2.2\Source\TB2Toolbar.pas"/> 375 | <Caret Line="206" Column="3" TopLine="194"/> 376 | </Position21> 377 | <Position22> 378 | <Filename Value="..\source\TBx2.pas"/> 379 | <Caret Line="2500" Column="44" TopLine="2496"/> 380 | </Position22> 381 | <Position23> 382 | <Filename Value="..\source\TBx2.pas"/> 383 | <Caret Line="1965" Column="19" TopLine="1977"/> 384 | </Position23> 385 | <Position24> 386 | <Filename Value="..\source\TBx2.pas"/> 387 | <Caret Line="2261" Column="61" TopLine="2250"/> 388 | </Position24> 389 | <Position25> 390 | <Filename Value="..\source\TBx2.pas"/> 391 | <Caret Line="2267" Column="4" TopLine="2250"/> 392 | </Position25> 393 | <Position26> 394 | <Filename Value="..\source\TBx2.pas"/> 395 | <Caret Line="2363" Column="10" TopLine="2349"/> 396 | </Position26> 397 | <Position27> 398 | <Filename Value="..\source\TBx2.pas"/> 399 | <Caret Line="3032" Column="8" TopLine="3018"/> 400 | </Position27> 401 | <Position28> 402 | <Filename Value="..\source\TBx2.pas"/> 403 | <Caret Line="370" Column="4" TopLine="358"/> 404 | </Position28> 405 | <Position29> 406 | <Filename Value="..\source\TBx2.pas"/> 407 | <Caret Line="1712" Column="26" TopLine="1793"/> 408 | </Position29> 409 | <Position30> 410 | <Filename Value="..\source\TBx2.pas"/> 411 | <Caret Line="34" TopLine="28"/> 412 | </Position30> 413 | </JumpHistory> 414 | </ProjectSession> 415 | </CONFIG> 416 | -------------------------------------------------------------------------------- /AquaToolbar/source/lizard_toolbar.pas: -------------------------------------------------------------------------------- 1 | unit Lizard_Toolbar; 2 | 3 | //{$ifdef fpc}{$mode delphi}{$endif}{$H+} 4 | {$I Lizard_Ver.inc} 5 | 6 | interface 7 | 8 | uses 9 | {$IFDEF FPC} 10 | LCLIntf, LCLType, LMessages, Types, messages, 11 | {$ELSE} 12 | Windows, Messages, 13 | {$ENDIF} 14 | Classes, Controls, SysUtils, Graphics, 15 | Lizard, Lizard_Common; 16 | 17 | type 18 | TToolbarParams = record 19 | InitializeOrderByPosition, DesignOrderByPosition: Boolean; 20 | end; 21 | 22 | { TCustomToolbarX2 } 23 | 24 | TLzCustomToolbar = class(TLzCustomToolWindow) 25 | private 26 | FFloatingRightX: Integer; 27 | FOrderListDirty: Boolean; 28 | 29 | { Lists } 30 | SlaveInfo, { List of slave controls. Items are pointers to TSlaveInfo's } 31 | GroupInfo, { List of the control "groups". List items are pointers to TGroupInfo's } 32 | LineSeps, { List of the Y locations of line separators. Items are casted in TLineSep's } 33 | OrderList: TList; 34 | FToolbarParams: TToolbarParams; { List of the child controls, arranged using the current "OrderIndex" values } 35 | 36 | function ShouldControlBeVisible (const Control: TControl; 37 | const LeftOrRight: Boolean): Boolean; 38 | 39 | { Internal } 40 | procedure CleanOrderList; 41 | 42 | procedure SetControlVisible (const Control: TControl; 43 | const LeftOrRight: Boolean); 44 | procedure FreeGroupInfo (const List: TList); 45 | procedure BuildGroupInfo (const List: TList; const TranslateSlave: Boolean; 46 | const OldDockType, NewDockType: TDockType); 47 | 48 | protected 49 | procedure AdjustClientRect(var Rect: TRect); override; 50 | procedure GetBarSize (var ASize: Integer; const DockType: TDockType); override; 51 | function OrderControls (CanMoveControls: Boolean; PreviousDockType: TDockType; 52 | DockingTo: TLzDock): TPoint; override; 53 | procedure GetToolbarParams (var Params: TToolbarParams); dynamic; 54 | function ChildControlTransparent (Ctl: TControl): Boolean; //override; 55 | procedure GetParams (var Params: TToolWindowParams); override; 56 | procedure InitializeOrdering; override; 57 | 58 | property ToolbarParams: TToolbarParams read FToolbarParams; 59 | 60 | public 61 | constructor Create(AOwner: TComponent); override; 62 | procedure SetSlaveControl (const ATopBottom, ALeftRight: TControl); 63 | 64 | published 65 | end; 66 | 67 | 68 | TLzToolbar = class(TLzCustomToolbar) 69 | published 70 | property Caption; 71 | property Color; 72 | property CloseButton; 73 | property CloseButtonWhenDocked; 74 | //property DefaultDock; 75 | property DockableTo; 76 | property DockedTo; 77 | property DockMode; 78 | property DockPos; 79 | property DockRow; 80 | property DragHandleStyle; 81 | property FloatingMode; 82 | property Font; 83 | property FullSize; 84 | property HideWhenInactive; 85 | property Images; 86 | //property LastDock; 87 | property ParentFont; 88 | property ParentShowHint; 89 | property PopupMenu; 90 | property Resizable; 91 | property RowsMin; 92 | property ShowCaption; 93 | property ShowHint; 94 | property TabOrder; 95 | //property UseLastDock; 96 | //property Version; 97 | property Visible; 98 | 99 | {property OnClose; 100 | property OnCloseQuery; 101 | property OnDragDrop; 102 | property OnDragOver; 103 | property OnMouseDown; 104 | property OnMouseMove; 105 | property OnMouseUp; 106 | property OnMove; 107 | property OnRecreated; 108 | property OnRecreating; 109 | property OnDockChanged; 110 | property OnDockChanging; 111 | property OnDockChangingEx; 112 | property OnDockChangingHidden; 113 | property OnResize; 114 | property OnVisibleChanged;} 115 | 116 | end; 117 | 118 | 119 | { TToolbarSep97 } 120 | 121 | TToolbarSepSize = 1..MaxInt; 122 | 123 | TLzToolbarSep = class(TGraphicControl) 124 | private 125 | FBlank: Boolean; 126 | FSizeHorz, FSizeVert: TToolbarSepSize; 127 | procedure SetBlank (Value: Boolean); 128 | procedure SetSizeHorz (Value: TToolbarSepSize); 129 | procedure SetSizeVert (Value: TToolbarSepSize); 130 | protected 131 | procedure MouseDown (Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; 132 | procedure Paint; override; 133 | procedure SetParent (AParent: TWinControl); override; 134 | public 135 | constructor Create (AOwner: TComponent); override; 136 | published 137 | { These two properties don't need to be stored since it automatically gets 138 | resized based on the setting of SizeHorz and SizeVert } 139 | property Width stored False; 140 | property Height stored False; 141 | property Blank: Boolean read FBlank write SetBlank default False; 142 | property SizeHorz: TToolbarSepSize read FSizeHorz write SetSizeHorz default 6; 143 | property SizeVert: TToolbarSepSize read FSizeVert write SetSizeVert default 6; 144 | property Visible; 145 | end; 146 | 147 | 148 | {$IFOPT J+} 149 | {$DEFINE _TB97_OPT_J} 150 | {$J-} { don't let the following typed constants be modified } 151 | {$ENDIF} 152 | const 153 | tbx2DefaultBarWidthHeight = 8; 154 | 155 | {TODO: Below are obsolete} 156 | tbx2TopMarginFloating = 0; 157 | tbx2TopMarginDocked = 0; 158 | tbx2TopMargin: array[Boolean] of Integer = (tbx2TopMarginFloating, tbx2TopMarginDocked); 159 | tbx2BottomMarginFloating = 0; 160 | tbx2BottomMarginDocked = 0; 161 | tbx2BottomMargin: array[Boolean] of Integer = (tbx2BottomMarginFloating, tbx2BottomMarginDocked); 162 | tbx2LeftMarginFloating = 0; 163 | tbx2LeftMarginDocked = 0; 164 | tbx2LeftMargin: array[Boolean] of Integer = (tbx2LeftMarginFloating, tbx2LeftMarginDocked); 165 | tbx2RightMarginFloating = 0; 166 | tbx2RightMarginDocked = 0; 167 | tbx2RightMargin: array[Boolean] of Integer = (tbx2RightMarginFloating, tbx2RightMarginDocked); 168 | tbx2LineSpacing = 6; 169 | {$IFDEF _TB97_OPT_J} 170 | {$J+} 171 | {$UNDEF _TB97_OPT_J} 172 | {$ENDIF} 173 | 174 | implementation 175 | 176 | { TCustomToolbarX2 } 177 | type 178 | { Used in TCustomToolbar97.GroupInfo lists } 179 | PGroupInfo = ^TGroupInfo; 180 | TGroupInfo = record 181 | GroupWidth, { Width in pixels of the group, if all controls were 182 | lined up left-to-right } 183 | GroupHeight: Integer; { Heights in pixels of the group, if all controls were 184 | lined up top-to-bottom } 185 | Members: TList; 186 | end; 187 | 188 | { Used in TCustomToolbar97.SlaveInfo lists } 189 | PSlaveInfo = ^TSlaveInfo; 190 | TSlaveInfo = record 191 | LeftRight, 192 | TopBottom: TControl; 193 | end; 194 | 195 | { Used in TCustomToolbar97.LineSeps lists } 196 | TLineSep = packed record 197 | Y: SmallInt; 198 | Blank: Boolean; 199 | Unused: Boolean; 200 | end; 201 | 202 | { Use by CompareControls } 203 | PCompareExtra = ^TCompareExtra; 204 | TCompareExtra = record 205 | Toolbar: TLzCustomToolbar; 206 | ComparePositions: Boolean; 207 | CurDockType: TDockType; 208 | end; 209 | 210 | function ControlVisibleOrDesigning (AControl: TControl): Boolean; 211 | begin 212 | Result := AControl.Visible or (csDesigning in AControl.ComponentState); 213 | end; 214 | 215 | function CompareControls (const Item1, Item2, ExtraData: Pointer): Integer; far; 216 | begin 217 | with PCompareExtra(ExtraData)^ do 218 | if ComparePositions then begin 219 | if CurDockType <> dtLeftRight then 220 | Result := TControl(Item1).Left - TControl(Item2).Left 221 | else 222 | Result := TControl(Item1).Top - TControl(Item2).Top; 223 | end 224 | else 225 | with Toolbar.OrderList do 226 | Result := IndexOf(Item1) - IndexOf(Item2); 227 | end; 228 | 229 | 230 | { TLzCustomToolbar } 231 | 232 | procedure TLzCustomToolbar.AdjustClientRect(var Rect: TRect); 233 | var LSize : Integer; 234 | begin 235 | inherited; 236 | { 237 | //InflateRect(Rect, -DockedBorderSize, -DockedBorderSize); 238 | //if Docked then 239 | begin 240 | LSize := DragHandleSizes[CloseButtonWhenDocked, DragHandleStyle]; 241 | if Assigned(DockedTo) and (DockedTo.Position in PositionLeftOrRight) then 242 | Inc(Rect.Top, LSize) //toolbar = vertical 243 | else 244 | //Inc(Rect.Left, LSize); //toolbar = Horizontal 245 | Rect.Left := Rect.Left + 1; 246 | end; 247 | } 248 | end; 249 | 250 | procedure TLzCustomToolbar.BuildGroupInfo(const List: TList; 251 | const TranslateSlave: Boolean; const OldDockType, 252 | NewDockType: TDockType); 253 | var 254 | I: Integer; 255 | GI: PGroupInfo; 256 | Children: TList; {items casted into TControls} 257 | C: TControl; 258 | NewGroup: Boolean; 259 | Extra: TCompareExtra; 260 | begin 261 | FreeGroupInfo (List); 262 | if ControlCount = 0 then Exit; 263 | 264 | Children := TList.Create; 265 | try 266 | for I := 0 to ControlCount-1 do 267 | if (not TranslateSlave and ControlVisibleOrDesigning(Controls[I])) or 268 | (TranslateSlave and ShouldControlBeVisible(Controls[I], NewDockType = dtLeftRight)) then 269 | Children.Add (Controls[I]); 270 | 271 | with Extra do begin 272 | Toolbar := Self; 273 | CurDockType := OldDockType; 274 | ComparePositions := //(csDesigning in ComponentState) and 275 | ToolbarParams.DesignOrderByPosition; 276 | end; 277 | if Extra.ComparePositions then begin 278 | CleanOrderList; 279 | ListSortEx (OrderList, CompareControls, @Extra); 280 | end; 281 | ListSortEx (Children, CompareControls, @Extra); 282 | 283 | GI := nil; 284 | NewGroup := True; 285 | for I := 0 to Children.Count-1 do begin 286 | if NewGroup then begin 287 | NewGroup := False; 288 | GI := AllocMem(SizeOf(TGroupInfo)); 289 | { Note: AllocMem initializes the newly allocated data to zero } 290 | GI^.Members := TList.Create; 291 | List.Add (GI); 292 | end; 293 | C := Children[I]; 294 | GI^.Members.Add (C); 295 | if C is TLzToolbarSep then 296 | NewGroup := True 297 | else begin 298 | with C do begin 299 | Inc (GI^.GroupWidth, Width); 300 | Inc (GI^.GroupHeight, Height); 301 | end; 302 | end; 303 | end; 304 | finally 305 | Children.Free; 306 | end; 307 | end; 308 | 309 | function TLzCustomToolbar.ChildControlTransparent(Ctl: TControl): Boolean; 310 | begin 311 | Result := Ctl is TLzToolbarSep; 312 | end; 313 | 314 | procedure TLzCustomToolbar.CleanOrderList; 315 | { TCustomToolbar97 uses a CM_CONTROLLISTCHANGE handler to detect when new 316 | controls are added to the toolbar. The handler adds the new controls to 317 | OrderList, which can be manipulated by the application using the OrderIndex 318 | property. 319 | The only problem is, the VCL relays CM_CONTROLLISTCHANGE messages 320 | to all parents of a control, not just the immediate parent. In pre-1.76 321 | versions of Toolbar97, OrderList contained not only the immediate children 322 | of the toolbar, but their children too. So this caused the OrderIndex 323 | property to return unexpected results. 324 | What this method does is clear out all controls in OrderList that aren't 325 | immediate children of the toolbar. (A check of Parent can't be put into the 326 | CM_CONTROLLISTCHANGE handler because that message is sent before a new 327 | Parent is assigned.) } 328 | var 329 | I: Integer; 330 | begin 331 | if not FOrderListDirty then 332 | Exit; 333 | I := 0; 334 | while I < OrderList.Count do begin 335 | if TControl(OrderList.List[I]).Parent <> Self then 336 | OrderList.Delete (I) 337 | else 338 | Inc (I); 339 | end; 340 | FOrderListDirty := False; 341 | end; 342 | 343 | constructor TLzCustomToolbar.Create(AOwner: TComponent); 344 | begin 345 | inherited Create(AOwner); 346 | GetToolbarParams (FToolbarParams); 347 | GroupInfo := TList.Create; 348 | SlaveInfo := TList.Create; 349 | LineSeps := TList.Create; 350 | OrderList := TList.Create; 351 | Cursor := crSize; 352 | end; 353 | 354 | procedure TLzCustomToolbar.FreeGroupInfo(const List: TList); 355 | var 356 | I: Integer; 357 | L: PGroupInfo; 358 | begin 359 | if List = nil then Exit; 360 | for I := List.Count-1 downto 0 do begin 361 | L := List.Items[I]; 362 | if Assigned(L) then begin 363 | L^.Members.Free; 364 | FreeMem (L); 365 | end; 366 | List.Delete (I); 367 | end; 368 | end; 369 | 370 | procedure TLzCustomToolbar.GetBarSize(var ASize: Integer; 371 | const DockType: TDockType); 372 | var 373 | I: Integer; 374 | begin 375 | ASize := tbx2DefaultBarWidthHeight * FRowsMin; 376 | for I := 0 to ControlCount-1 do 377 | ///if not(Controls[I] is TToolbarSep97) then 378 | with Controls[I] do begin 379 | if ShouldControlBeVisible(Controls[I], DockType = dtLeftRight) then begin 380 | if DockType = dtLeftRight then begin 381 | if Width > ASize then ASize := Width; 382 | end 383 | else begin 384 | if Height > ASize then ASize := Height; 385 | end; 386 | end; 387 | end; 388 | 389 | 390 | end; 391 | procedure TLzCustomToolbar.GetParams(var Params: TToolWindowParams); 392 | begin 393 | inherited; 394 | with Params do begin 395 | CallAlignControls := False; 396 | ResizeEightCorner := False; 397 | ResizeClipCursor := False; 398 | end; 399 | end; 400 | 401 | procedure TLzCustomToolbar.GetToolbarParams(var Params: TToolbarParams); 402 | begin 403 | with Params do begin 404 | InitializeOrderByPosition := True; 405 | DesignOrderByPosition := True; 406 | end; 407 | end; 408 | 409 | procedure TLzCustomToolbar.InitializeOrdering; 410 | var 411 | Extra: TCompareExtra; 412 | begin 413 | inherited; 414 | { Initialize order of items in OrderList } 415 | if ToolbarParams.InitializeOrderByPosition then begin 416 | with Extra do begin 417 | Toolbar := Self; 418 | ComparePositions := True; 419 | CurDockType := GetDockTypeOf(DockedTo); 420 | end; 421 | CleanOrderList; 422 | ListSortEx (OrderList, CompareControls, @Extra); 423 | end; 424 | end; 425 | 426 | function TLzCustomToolbar.OrderControls(CanMoveControls: Boolean; 427 | PreviousDockType: TDockType; DockingTo: TLzDock): TPoint; 428 | { This arranges the controls on the toolbar } 429 | var 430 | NewDockType: TDockType; 431 | NewDocked: Boolean; 432 | RightX, I: Integer; 433 | CurBarSize, DockRowSize: Integer; 434 | GInfo: TList; 435 | AllowWrap: Boolean; 436 | MinPosPixels, MinRowPixels, CurPosPixel, CurLinePixel, G: Integer; 437 | GoToNewLine: Boolean; 438 | GI: PGroupInfo; 439 | Member: TControl; 440 | MemberIsSep: Boolean; 441 | GroupPosSize, MemberPosSize: Integer; 442 | PreviousSep: TLzToolbarSep; PrevMinPosPixels: Integer; 443 | NewLineSep: TLineSep; 444 | CR : TRect; 445 | label 1; 446 | begin 447 | 448 | Result := Point(32,8);//x2nie 449 | if (csLoading in ComponentState) then 450 | Exit; 451 | NewDockType := GetDockTypeOf(DockingTo); 452 | NewDocked := Assigned(DockingTo); 453 | 454 | RightX := FFloatingRightX; 455 | if (NewDockType <> dtNotDocked) or (RightX = 0) then 456 | RightX := High(RightX) 457 | else begin 458 | { Make sure RightX isn't less than the smallest sized control + margins, 459 | in case one of the *LoadToolbarPositions functions happened to read 460 | a value too small. } 461 | for I := 0 to ControlCount-1 do 462 | if not(Controls[I] is TLzToolbarSep) then 463 | with Controls[I] do 464 | if Width + (tbX2LeftMarginFloating+tbX2RightMarginFloating) > RightX then 465 | RightX := Width + (tbX2LeftMarginFloating+tbX2RightMarginFloating); 466 | end; 467 | 468 | if CanMoveControls and (SlaveInfo.Count <> 0) then 469 | for I := 0 to ControlCount-1 do 470 | if not(Controls[I] is TLzToolbarSep) then 471 | SetControlVisible (Controls[I], NewDockType = dtLeftRight); 472 | 473 | GetBarSize (CurBarSize, NewDockType); 474 | if (DockingTo <> nil) and (DockingTo = DockedTo) then 475 | GetDockRowSize (DockRowSize) 476 | else 477 | DockRowSize := CurBarSize; 478 | 479 | if CanMoveControls then 480 | GInfo := GroupInfo 481 | else 482 | GInfo := TList.Create; 483 | try 484 | BuildGroupInfo (GInfo, not CanMoveControls, PreviousDockType, NewDockType); 485 | 486 | if CanMoveControls then 487 | LineSeps.Clear; 488 | 489 | 490 | CurLinePixel := tbX2TopMargin[NewDocked]; 491 | MinPosPixels := tbX2LeftMargin[NewDocked]; 492 | //x2nie: 493 | CR := Self.ClientRect; 494 | if NewDockType <> dtLeftRight then 495 | begin 496 | Inc(CurLinePixel, CR.Top); 497 | Inc(MinPosPixels, CR.Left); 498 | end 499 | else 500 | begin 501 | Inc(CurLinePixel, CR.Left); 502 | Inc(MinPosPixels, CR.Top); 503 | end; 504 | 505 | 506 | 507 | //Inc(MinPosPixels, CR.Left); 508 | 509 | if GInfo.Count <> 0 then begin 510 | AllowWrap := not NewDocked; 511 | CurPosPixel := MinPosPixels; 512 | GoToNewLine := False; 513 | PreviousSep := nil; 514 | PrevMinPosPixels := 0; 515 | for G := 0 to GInfo.Count-1 do begin 516 | GI := PGroupInfo(GInfo[G]); 517 | 518 | if NewDockType <> dtLeftRight then 519 | GroupPosSize := GI^.GroupWidth 520 | else 521 | GroupPosSize := GI^.GroupHeight; 522 | if AllowWrap and 523 | (GoToNewLine or (CurPosPixel+GroupPosSize+tbX2RightMargin[NewDocked] > RightX)) then begin 524 | GoToNewLine := False; 525 | {CurPosPixel := tbX2LeftMargin[NewDocked]; 526 | //x2nie: 527 | if NewDockType <> dtLeftRight then 528 | Inc(CurPosPixel, CR.Left)//x2nie 529 | else 530 | Inc(CurPosPixel, CR.Top);//x2nie} 531 | CurPosPixel := MinPosPixels; //x2nie 532 | 533 | if (G <> 0) and (PGroupInfo(GInfo[G-1])^.Members.Count <> 0) then begin 534 | Inc (CurLinePixel, CurBarSize + tbX2LineSpacing); 535 | if Assigned(PreviousSep) then begin 536 | MinPosPixels := PrevMinPosPixels; 537 | if CanMoveControls then begin 538 | PreviousSep.Width := 0; 539 | 540 | LongInt(NewLineSep) := 0; 541 | NewLineSep.Y := CurLinePixel; 542 | NewLineSep.Blank := PreviousSep.Blank; 543 | LineSeps.Add (Pointer(@NewLineSep)); 544 | end; 545 | end; 546 | end; 547 | end; 548 | if CurPosPixel > MinPosPixels 549 | then MinPosPixels := CurPosPixel; 550 | for I := 0 to GI^.Members.Count-1 do begin 551 | Member := TControl(GI^.Members[I]); 552 | MemberIsSep := Member is TLzToolbarSep; 553 | with Member do begin 554 | if not MemberIsSep then begin 555 | if NewDockType <> dtLeftRight then 556 | MemberPosSize := Width 557 | else 558 | MemberPosSize := Height; 559 | end 560 | else begin 561 | if NewDockType <> dtLeftRight then 562 | MemberPosSize := TLzToolbarSep(Member).SizeHorz 563 | else 564 | MemberPosSize := TLzToolbarSep(Member).SizeVert; 565 | end; 566 | { If RightX is passed, proceed to next line } 567 | if AllowWrap and not MemberIsSep and 568 | (CurPosPixel+MemberPosSize+tbX2RightMargin[NewDocked] > RightX) then begin 569 | {CurPosPixel := tbX2LeftMargin[NewDocked]; 570 | //x2nie: 571 | if NewDockType <> dtLeftRight then 572 | Inc(CurPosPixel, CR.Left)//x2nie 573 | else 574 | Inc(CurLinePixel, CR.Top);//x2nie} 575 | CurPosPixel := MinPosPixels; //x2nie 576 | 577 | Inc (CurLinePixel, CurBarSize); 578 | GoToNewLine := True; 579 | end; 580 | if NewDockType <> dtLeftRight then begin 581 | //if GoToNewLine then 582 | //Inc(CurPosPixel, CR.Left);//x2nie: 583 | if not MemberIsSep then begin 584 | if CanMoveControls then 585 | SetBounds (CurPosPixel, CurLinePixel+((DockRowSize-Height) div 2), Width, Height); 586 | Inc (CurPosPixel, Width); 587 | end 588 | else begin 589 | if CanMoveControls then 590 | SetBounds (CurPosPixel, CurLinePixel, TLzToolbarSep(Member).SizeHorz, DockRowSize); 591 | Inc (CurPosPixel, TLzToolbarSep(Member).SizeHorz); 592 | end; 593 | end 594 | else begin 595 | //if GoToNewLine then 596 | //Inc(CurPosPixel, CR.Top);//x2nie: 597 | if not MemberIsSep then begin 598 | if CanMoveControls then 599 | SetBounds (CurLinePixel+((DockRowSize-Width) div 2), CurPosPixel, Width, Height); 600 | Inc (CurPosPixel, Height); 601 | end 602 | else begin 603 | if CanMoveControls then 604 | SetBounds (CurLinePixel, CurPosPixel, DockRowSize, TLzToolbarSep(Member).SizeVert); 605 | Inc (CurPosPixel, TLzToolbarSep(Member).SizeVert); 606 | end; 607 | end; 608 | PrevMinPosPixels := MinPosPixels; 609 | if not MemberIsSep then 610 | PreviousSep := nil 611 | else 612 | PreviousSep := TLzToolbarSep(Member); 613 | if CurPosPixel > MinPosPixels then MinPosPixels := CurPosPixel; 614 | end; 615 | end; 616 | end; 617 | end 618 | else 619 | Inc (MinPosPixels, tbX2DefaultBarWidthHeight); 620 | 621 | if csDesigning in ComponentState then 622 | Invalidate; 623 | finally 624 | if not CanMoveControls then begin 625 | FreeGroupInfo (GInfo); 626 | GInfo.Free; 627 | end; 628 | end; 629 | 630 | Inc (MinPosPixels, tbX2RightMargin[NewDocked]); 631 | MinRowPixels := CurLinePixel + CurBarSize + tbX2BottomMargin[NewDocked]; 632 | if NewDockType <> dtLeftRight then begin 633 | Result.X := MinPosPixels - CR.Left; 634 | Result.Y := MinRowPixels - CR.Top; 635 | end 636 | else begin 637 | Result.X := MinRowPixels - CR.Left; 638 | Result.Y := MinPosPixels - CR.Top; 639 | end; 640 | 641 | end; 642 | 643 | 644 | procedure TLzCustomToolbar.SetControlVisible(const Control: TControl; 645 | const LeftOrRight: Boolean); 646 | { If Control is a master or slave control, it automatically adjusts the 647 | Visible properties of both the master and slave control based on the value 648 | of LeftOrRight } 649 | var 650 | I: Integer; 651 | begin 652 | for I := 0 to SlaveInfo.Count-1 do 653 | with PSlaveInfo(SlaveInfo[I])^ do 654 | if (TopBottom = Control) or (LeftRight = Control) then begin 655 | if Assigned(TopBottom) then TopBottom.Visible := not LeftOrRight; 656 | if Assigned(LeftRight) then LeftRight.Visible := LeftOrRight; 657 | Exit; 658 | end; 659 | 660 | end; 661 | 662 | procedure TLzCustomToolbar.SetSlaveControl(const ATopBottom, 663 | ALeftRight: TControl); 664 | var 665 | NewVersion: PSlaveInfo; 666 | begin 667 | GetMem (NewVersion, SizeOf(TSlaveInfo)); 668 | with NewVersion^ do begin 669 | TopBottom := ATopBottom; 670 | LeftRight := ALeftRight; 671 | end; 672 | SlaveInfo.Add (NewVersion); 673 | ArrangeControls; 674 | 675 | end; 676 | 677 | function TLzCustomToolbar.ShouldControlBeVisible(const Control: TControl; 678 | const LeftOrRight: Boolean): Boolean; 679 | { If Control is a master or slave control, it returns the appropriate visibility 680 | setting based on the value of LeftOrRight, otherwise it simply returns the 681 | current Visible setting } 682 | var 683 | I: Integer; 684 | begin 685 | for I := 0 to SlaveInfo.Count-1 do 686 | with PSlaveInfo(SlaveInfo[I])^ do 687 | if TopBottom = Control then begin 688 | Result := not LeftOrRight; 689 | Exit; 690 | end 691 | else 692 | if LeftRight = Control then begin 693 | Result := LeftOrRight; 694 | Exit; 695 | end; 696 | Result := ControlVisibleOrDesigning(Control); 697 | end; 698 | 699 | { TToolbarSep97 } 700 | 701 | constructor TLzToolbarSep.Create (AOwner: TComponent); 702 | begin 703 | inherited; 704 | FSizeHorz := 6; 705 | FSizeVert := 6; 706 | ControlStyle := ControlStyle - [csOpaque, csCaptureMouse]; 707 | end; 708 | 709 | procedure TLzToolbarSep.SetParent (AParent: TWinControl); 710 | begin 711 | if (AParent <> nil) and not(AParent is TLzCustomToolbar) then 712 | raise EInvalidOperation.Create('ParentNotAllowed'); 713 | inherited; 714 | end; 715 | 716 | procedure TLzToolbarSep.SetBlank (Value: Boolean); 717 | begin 718 | if FBlank <> Value then begin 719 | FBlank := Value; 720 | Invalidate; 721 | end; 722 | end; 723 | 724 | procedure TLzToolbarSep.SetSizeHorz (Value: TToolbarSepSize); 725 | begin 726 | if FSizeHorz <> Value then begin 727 | FSizeHorz := Value; 728 | if Parent is TLzCustomToolbar then 729 | TLzCustomToolbar(Parent).ArrangeControls; 730 | end; 731 | end; 732 | 733 | procedure TLzToolbarSep.SetSizeVert (Value: TToolbarSepSize); 734 | begin 735 | if FSizeVert <> Value then begin 736 | FSizeVert := Value; 737 | if Parent is TLzCustomToolbar then 738 | TLzCustomToolbar(Parent).ArrangeControls; 739 | end; 740 | end; 741 | 742 | procedure TLzToolbarSep.Paint; 743 | var 744 | R: TRect; 745 | Z: Integer; 746 | begin 747 | inherited; 748 | if not(Parent is TLzCustomToolbar) then Exit; 749 | 750 | with Canvas do begin 751 | { Draw dotted border in design mode } 752 | if csDesigning in ComponentState then begin 753 | Pen.Style := psDot; 754 | Pen.Color := clBtnShadow; 755 | Brush.Style := bsClear; 756 | R := ClientRect; 757 | Rectangle (R.Left, R.Top, R.Right, R.Bottom); 758 | Pen.Style := psSolid; 759 | end; 760 | 761 | if not FBlank then 762 | if GetDockTypeOf(TLzCustomToolbar(Parent).DockedTo) <> dtLeftRight then begin 763 | Z := Width div 2; 764 | Pen.Color := clBtnShadow; 765 | MoveTo (Z-1, 0); LineTo (Z-1, Height); 766 | Pen.Color := clBtnHighlight; 767 | MoveTo (Z, 0); LineTo (Z, Height); 768 | end 769 | else begin 770 | Z := Height div 2; 771 | Pen.Color := clBtnShadow; 772 | MoveTo (0, Z-1); LineTo (Width, Z-1); 773 | Pen.Color := clBtnHighlight; 774 | MoveTo (0, Z); LineTo (Width, Z); 775 | end; 776 | end; 777 | end; 778 | 779 | procedure TLzToolbarSep.MouseDown (Button: TMouseButton; Shift: TShiftState; X, Y: Integer); 780 | var 781 | P: TPoint; 782 | begin 783 | inherited; 784 | if not(Parent is TLzCustomToolbar) then Exit; 785 | 786 | { Relay the message to the parent toolbar } 787 | P := Parent.ScreenToClient(ClientToScreen(Point(X, Y))); 788 | TLzCustomToolbar(Parent).MouseDown (Button, Shift, P.X, P.Y); 789 | end; 790 | 791 | 792 | 793 | end. 794 | 795 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | (This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.) 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | {description} 474 | Copyright (C) {year} {fullname} 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 489 | USA 490 | 491 | Also add information on how to contact you by electronic and paper mail. 492 | 493 | You should also get your employer (if you work as a programmer) or your 494 | school, if any, to sign a "copyright disclaimer" for the library, if 495 | necessary. Here is a sample; alter the names: 496 | 497 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 498 | library `Frob' (a library for tweaking knobs) written by James Random 499 | Hacker. 500 | 501 | {signature of Ty Coon}, 1 April 1990 502 | Ty Coon, President of Vice 503 | 504 | That's all there is to it! 505 | 506 | -------------------------------------------------------------------------------- /Demo (Lazarus)/ConverterBackup/TBx2_Toolbar.pas: -------------------------------------------------------------------------------- 1 | unit TBx2_Toolbar; 2 | { 3 | ToolBench X2 4 | Copyright (c) 2013 by x2nie 5 | a custom UI based on Toolbar97 6 | 7 | ------------------------------------------- 8 | Toolbar97 9 | Copyright (C) 1998-2004 by Jordan Russell 10 | http://www.jrsoftware.org/ 11 | 12 | This software is provided 'as-is', without any express or implied 13 | warranty. In no event will the authors be held liable for any damages 14 | arising from the use of this software. 15 | 16 | Permission is granted to anyone to use this software for any purpose, 17 | including commercial applications, and to alter it and redistribute it 18 | freely, subject to the following restrictions: 19 | 20 | 1. The origin of this software must not be misrepresented; you must not 21 | claim that you wrote the original software. If you use this software 22 | in a product, an acknowledgment in the product documentation would be 23 | appreciated but is not required. 24 | 2. Altered source versions must be plainly marked as such, and must not be 25 | misrepresented as being the original software. 26 | 3. This notice may not be removed or altered from any source distribution. 27 | } 28 | 29 | 30 | interface 31 | 32 | uses 33 | {$IFDEF FPC} 34 | LCLIntf, LCLType, LMessages, Types, messages, 35 | {$ELSE} 36 | Windows, Messages, 37 | {$ENDIF} 38 | Classes, Controls, SysUtils, Graphics, 39 | GR32, GR32_Image, 40 | TBx2, tbx2_common, TBx2_Const 41 | ; 42 | 43 | 44 | type 45 | TToolbarParams = record 46 | InitializeOrderByPosition, DesignOrderByPosition: Boolean; 47 | end; 48 | 49 | TCustomToolbarX2 = class(TCustomToolWindowX2) 50 | private 51 | FFloatingRightX: Integer; 52 | FOrderListDirty: Boolean; 53 | 54 | { Lists } 55 | SlaveInfo, { List of slave controls. Items are pointers to TSlaveInfo's } 56 | GroupInfo, { List of the control "groups". List items are pointers to TGroupInfo's } 57 | LineSeps, { List of the Y locations of line separators. Items are casted in TLineSep's } 58 | OrderList: TList; 59 | FToolbarParams: TToolbarParams; { List of the child controls, arranged using the current "OrderIndex" values } 60 | 61 | function ShouldControlBeVisible (const Control: TControl; 62 | const LeftOrRight: Boolean): Boolean; 63 | 64 | { Internal } 65 | procedure CleanOrderList; 66 | 67 | procedure SetControlVisible (const Control: TControl; 68 | const LeftOrRight: Boolean); 69 | procedure FreeGroupInfo (const List: TList); 70 | procedure BuildGroupInfo (const List: TList; const TranslateSlave: Boolean; 71 | const OldDockType, NewDockType: TDockType); 72 | 73 | protected 74 | procedure AdjustClientRect(var Rect: TRect); override; 75 | procedure DoPaintBuffer; override; 76 | //function AdjustedClientArea: TRect; virtual; //client area 77 | procedure GetBarSize (var ASize: Integer; const DockType: TDockType); override; 78 | function OrderControls (CanMoveControls: Boolean; PreviousDockType: TDockType; 79 | DockingTo: TDockX2): TPoint; override; 80 | procedure GetToolbarParams (var Params: TToolbarParams); dynamic; 81 | function ChildControlTransparent (Ctl: TControl): Boolean; override; 82 | procedure GetParams (var Params: TToolWindowParams); override; 83 | procedure InitializeOrdering; override; 84 | 85 | property ToolbarParams: TToolbarParams read FToolbarParams; 86 | 87 | public 88 | constructor Create(AOwner: TComponent); override; 89 | procedure SetSlaveControl (const ATopBottom, ALeftRight: TControl); 90 | 91 | published 92 | end; 93 | 94 | TToolbarX2 = class(TCustomToolbarX2) 95 | published 96 | //property ActivateParent; 97 | property BorderStyle; 98 | property Caption; 99 | property Color; 100 | property CloseButton; 101 | property CloseButtonWhenDocked; 102 | //property DefaultDock; 103 | property DockableTo; 104 | property DockedTo; 105 | property DockMode; 106 | property DockPos; 107 | property DockRow; 108 | property DragHandleStyle; 109 | property FloatingMode; 110 | property Font; 111 | property FullSize; 112 | property HideWhenInactive; 113 | property LastDock; 114 | property ParentFont; 115 | property ParentShowHint; 116 | property PopupMenu; 117 | property Resizable; 118 | property ShowCaption; 119 | property ShowHint; 120 | property TabOrder; 121 | //property UseLastDock; 122 | //property Version; 123 | property Visible; 124 | 125 | {property OnClose; 126 | property OnCloseQuery; 127 | property OnDragDrop; 128 | property OnDragOver; 129 | property OnMouseDown; 130 | property OnMouseMove; 131 | property OnMouseUp; 132 | property OnMove; 133 | property OnRecreated; 134 | property OnRecreating; 135 | property OnDockChanged; 136 | property OnDockChanging; 137 | property OnDockChangingEx; 138 | property OnDockChangingHidden; 139 | property OnResize; 140 | property OnVisibleChanged;} 141 | 142 | end; 143 | 144 | 145 | { TToolbarSep97 } 146 | 147 | TToolbarSepSize = 1..MaxInt; 148 | 149 | TToolbarSepX2 = class(TGraphicControl) 150 | private 151 | FBlank: Boolean; 152 | FSizeHorz, FSizeVert: TToolbarSepSize; 153 | procedure SetBlank (Value: Boolean); 154 | procedure SetSizeHorz (Value: TToolbarSepSize); 155 | procedure SetSizeVert (Value: TToolbarSepSize); 156 | protected 157 | procedure MouseDown (Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; 158 | procedure Paint; override; 159 | procedure SetParent (AParent: TWinControl); override; 160 | public 161 | constructor Create (AOwner: TComponent); override; 162 | published 163 | { These two properties don't need to be stored since it automatically gets 164 | resized based on the setting of SizeHorz and SizeVert } 165 | property Width stored False; 166 | property Height stored False; 167 | property Blank: Boolean read FBlank write SetBlank default False; 168 | property SizeHorz: TToolbarSepSize read FSizeHorz write SetSizeHorz default 6; 169 | property SizeVert: TToolbarSepSize read FSizeVert write SetSizeVert default 6; 170 | property Visible; 171 | end; 172 | 173 | 174 | {$IFOPT J+} 175 | {$DEFINE _TB97_OPT_J} 176 | {$J-} { don't let the following typed constants be modified } 177 | {$ENDIF} 178 | const 179 | tbx2DefaultBarWidthHeight = 8; 180 | 181 | tbx2TopMarginFloating = 2; 182 | tbx2TopMarginDocked = 0; 183 | tbx2TopMargin: array[Boolean] of Integer = (tbx2TopMarginFloating, tbx2TopMarginDocked); 184 | tbx2BottomMarginFloating = 1; 185 | tbx2BottomMarginDocked = 0; 186 | tbx2BottomMargin: array[Boolean] of Integer = (tbx2BottomMarginFloating, tbx2BottomMarginDocked); 187 | tbx2LeftMarginFloating = 4; 188 | tbx2LeftMarginDocked = 0; 189 | tbx2LeftMargin: array[Boolean] of Integer = (tbx2LeftMarginFloating, tbx2LeftMarginDocked); 190 | tbx2RightMarginFloating = 4; 191 | tbx2RightMarginDocked = 0; 192 | tbx2RightMargin: array[Boolean] of Integer = (tbx2RightMarginFloating, tbx2RightMarginDocked); 193 | tbx2LineSpacing = 6; 194 | {$IFDEF _TB97_OPT_J} 195 | {$J+} 196 | {$UNDEF _TB97_OPT_J} 197 | {$ENDIF} 198 | 199 | implementation 200 | 201 | const 202 | { Constants for registry values. Do not localize! } 203 | { TCustomToolbar97 specific } 204 | rvFloatRightX = 'FloatRightX'; 205 | 206 | type 207 | { Used internally by the TCustomToolbar97.Resize* procedures } 208 | PToolbar97SizeData = ^TToolbar97SizeData; 209 | TToolbar97SizeData = record 210 | SizeHandle: TToolWindowSizeHandle; 211 | //NewSizes: TList; { List of valid new sizes. Items are casted into TSmallPoints } 212 | NewSizes : TArrayOfTSmallPoint; 213 | CurRightX: Integer; 214 | DisableSensCheck, OpSide: Boolean; 215 | SizeSens: Integer; 216 | end; 217 | 218 | { Used in TCustomToolbar97.GroupInfo lists } 219 | PGroupInfo = ^TGroupInfo; 220 | TGroupInfo = record 221 | GroupWidth, { Width in pixels of the group, if all controls were 222 | lined up left-to-right } 223 | GroupHeight: Integer; { Heights in pixels of the group, if all controls were 224 | lined up top-to-bottom } 225 | Members: TList; 226 | end; 227 | 228 | { Used in TCustomToolbar97.SlaveInfo lists } 229 | PSlaveInfo = ^TSlaveInfo; 230 | TSlaveInfo = record 231 | LeftRight, 232 | TopBottom: TControl; 233 | end; 234 | 235 | { Used in TCustomToolbar97.LineSeps lists } 236 | TLineSep = packed record 237 | Y: SmallInt; 238 | Blank: Boolean; 239 | Unused: Boolean; 240 | end; 241 | 242 | { Use by CompareControls } 243 | PCompareExtra = ^TCompareExtra; 244 | TCompareExtra = record 245 | Toolbar: TCustomToolbarX2; 246 | ComparePositions: Boolean; 247 | CurDockType: TDockType; 248 | end; 249 | 250 | function ControlVisibleOrDesigning (AControl: TControl): Boolean; 251 | begin 252 | Result := AControl.Visible or (csDesigning in AControl.ComponentState); 253 | end; 254 | 255 | function CompareControls (const Item1, Item2, ExtraData: Pointer): Integer; far; 256 | begin 257 | with PCompareExtra(ExtraData)^ do 258 | if ComparePositions then begin 259 | if CurDockType <> dtLeftRight then 260 | Result := TControl(Item1).Left - TControl(Item2).Left 261 | else 262 | Result := TControl(Item1).Top - TControl(Item2).Top; 263 | end 264 | else 265 | with Toolbar.OrderList do 266 | Result := IndexOf(Item1) - IndexOf(Item2); 267 | end; 268 | 269 | 270 | { TCustomToolbarX2 } 271 | 272 | procedure TCustomToolbarX2.AdjustClientRect(var Rect: TRect); 273 | var LSize : Integer; 274 | begin 275 | inherited; 276 | { InflateRect(Rect, -DockedBorderSize, -DockedBorderSize); 277 | if Docked then 278 | begin 279 | LSize := DragHandleSizes[CloseButtonWhenDocked, DragHandleStyle]; 280 | if DockedTo.Position in PositionLeftOrRight then 281 | Inc(Rect.Top, LSize) //toolbar = vertical 282 | else 283 | Inc(Rect.Left, LSize); //toolbar = Horizontal 284 | 285 | end;} 286 | 287 | end; 288 | 289 | procedure TCustomToolbarX2.BuildGroupInfo(const List: TList; 290 | const TranslateSlave: Boolean; const OldDockType, 291 | NewDockType: TDockType); 292 | var 293 | I: Integer; 294 | GI: PGroupInfo; 295 | Children: TList; {items casted into TControls} 296 | C: TControl; 297 | NewGroup: Boolean; 298 | Extra: TCompareExtra; 299 | begin 300 | FreeGroupInfo (List); 301 | if ControlCount = 0 then Exit; 302 | 303 | Children := TList.Create; 304 | try 305 | for I := 0 to ControlCount-1 do 306 | if (not TranslateSlave and ControlVisibleOrDesigning(Controls[I])) or 307 | (TranslateSlave and ShouldControlBeVisible(Controls[I], NewDockType = dtLeftRight)) then 308 | Children.Add (Controls[I]); 309 | 310 | with Extra do begin 311 | Toolbar := Self; 312 | CurDockType := OldDockType; 313 | ComparePositions := //(csDesigning in ComponentState) and 314 | ToolbarParams.DesignOrderByPosition; 315 | end; 316 | if Extra.ComparePositions then begin 317 | CleanOrderList; 318 | ListSortEx (OrderList, CompareControls, @Extra); 319 | end; 320 | ListSortEx (Children, CompareControls, @Extra); 321 | 322 | GI := nil; 323 | NewGroup := True; 324 | for I := 0 to Children.Count-1 do begin 325 | if NewGroup then begin 326 | NewGroup := False; 327 | GI := AllocMem(SizeOf(TGroupInfo)); 328 | { Note: AllocMem initializes the newly allocated data to zero } 329 | GI^.Members := TList.Create; 330 | List.Add (GI); 331 | end; 332 | C := Children[I]; 333 | GI^.Members.Add (C); 334 | if C is TToolbarSepX2 then 335 | NewGroup := True 336 | else begin 337 | with C do begin 338 | Inc (GI^.GroupWidth, Width); 339 | Inc (GI^.GroupHeight, Height); 340 | end; 341 | end; 342 | end; 343 | finally 344 | Children.Free; 345 | end; 346 | end; 347 | 348 | function TCustomToolbarX2.ChildControlTransparent(Ctl: TControl): Boolean; 349 | begin 350 | Result := Ctl is TToolbarSepX2; 351 | end; 352 | 353 | procedure TCustomToolbarX2.CleanOrderList; 354 | { TCustomToolbar97 uses a CM_CONTROLLISTCHANGE handler to detect when new 355 | controls are added to the toolbar. The handler adds the new controls to 356 | OrderList, which can be manipulated by the application using the OrderIndex 357 | property. 358 | The only problem is, the VCL relays CM_CONTROLLISTCHANGE messages 359 | to all parents of a control, not just the immediate parent. In pre-1.76 360 | versions of Toolbar97, OrderList contained not only the immediate children 361 | of the toolbar, but their children too. So this caused the OrderIndex 362 | property to return unexpected results. 363 | What this method does is clear out all controls in OrderList that aren't 364 | immediate children of the toolbar. (A check of Parent can't be put into the 365 | CM_CONTROLLISTCHANGE handler because that message is sent before a new 366 | Parent is assigned.) } 367 | var 368 | I: Integer; 369 | begin 370 | if not FOrderListDirty then 371 | Exit; 372 | I := 0; 373 | while I < OrderList.Count do begin 374 | if TControl(OrderList.List[I]).Parent <> Self then 375 | OrderList.Delete (I) 376 | else 377 | Inc (I); 378 | end; 379 | FOrderListDirty := False; 380 | end; 381 | 382 | constructor TCustomToolbarX2.Create(AOwner: TComponent); 383 | begin 384 | inherited; 385 | GetToolbarParams (FToolbarParams); 386 | GroupInfo := TList.Create; 387 | SlaveInfo := TList.Create; 388 | LineSeps := TList.Create; 389 | OrderList := TList.Create; 390 | 391 | Options := [pboAutoFocus, pboWantArrowKeys]; 392 | Cursor := crSize; 393 | end; 394 | 395 | procedure TCustomToolbarX2.DoPaintBuffer; 396 | var r : TRect; 397 | begin 398 | inherited; 399 | R := BoundsRect; 400 | Buffer.FrameRectS(R, clTrGreen32); 401 | 402 | //Buffer.FrameRectS(AdjustedClientArea, clRed32); 403 | R := ClientRect; 404 | //AdjustClientRect(R); 405 | Buffer.FrameRectS(R, clTrRed32); 406 | end; 407 | 408 | procedure TCustomToolbarX2.FreeGroupInfo(const List: TList); 409 | var 410 | I: Integer; 411 | L: PGroupInfo; 412 | begin 413 | if List = nil then Exit; 414 | for I := List.Count-1 downto 0 do begin 415 | L := List.Items[I]; 416 | if Assigned(L) then begin 417 | L^.Members.Free; 418 | FreeMem (L); 419 | end; 420 | List.Delete (I); 421 | end; 422 | end; 423 | 424 | procedure TCustomToolbarX2.GetBarSize(var ASize: Integer; 425 | const DockType: TDockType); 426 | var 427 | I: Integer; 428 | begin 429 | ASize := tbx2DefaultBarWidthHeight; 430 | for I := 0 to ControlCount-1 do 431 | ///if not(Controls[I] is TToolbarSep97) then 432 | with Controls[I] do begin 433 | if ShouldControlBeVisible(Controls[I], DockType = dtLeftRight) then begin 434 | if DockType = dtLeftRight then begin 435 | if Width > ASize then ASize := Width; 436 | end 437 | else begin 438 | if Height > ASize then ASize := Height; 439 | end; 440 | end; 441 | end; 442 | 443 | 444 | end; 445 | 446 | procedure TCustomToolbarX2.GetParams(var Params: TToolWindowParams); 447 | begin 448 | inherited; 449 | with Params do begin 450 | CallAlignControls := False; 451 | ResizeEightCorner := False; 452 | ResizeClipCursor := False; 453 | end; 454 | end; 455 | 456 | procedure TCustomToolbarX2.GetToolbarParams(var Params: TToolbarParams); 457 | begin 458 | with Params do begin 459 | InitializeOrderByPosition := True; 460 | DesignOrderByPosition := True; 461 | end; 462 | end; 463 | 464 | procedure TCustomToolbarX2.InitializeOrdering; 465 | var 466 | Extra: TCompareExtra; 467 | begin 468 | inherited; 469 | { Initialize order of items in OrderList } 470 | if ToolbarParams.InitializeOrderByPosition then begin 471 | with Extra do begin 472 | Toolbar := Self; 473 | ComparePositions := True; 474 | CurDockType := GetDockTypeOf(DockedTo); 475 | end; 476 | CleanOrderList; 477 | ListSortEx (OrderList, CompareControls, @Extra); 478 | end; 479 | end; 480 | 481 | function TCustomToolbarX2.OrderControls(CanMoveControls: Boolean; 482 | PreviousDockType: TDockType; DockingTo: TDockX2): TPoint; 483 | { This arranges the controls on the toolbar } 484 | var 485 | NewDockType: TDockType; 486 | NewDocked: Boolean; 487 | RightX, I: Integer; 488 | CurBarSize, DockRowSize: Integer; 489 | GInfo: TList; 490 | AllowWrap: Boolean; 491 | MinPosPixels, MinRowPixels, CurPosPixel, CurLinePixel, G: Integer; 492 | GoToNewLine: Boolean; 493 | GI: PGroupInfo; 494 | Member: TControl; 495 | MemberIsSep: Boolean; 496 | GroupPosSize, MemberPosSize: Integer; 497 | PreviousSep: TToolbarSepX2; PrevMinPosPixels: Integer; 498 | NewLineSep: TLineSep; 499 | CR : TRect; 500 | label 1; 501 | begin 502 | 503 | Result := Point(32,8);//x2nie 504 | if (csLoading in ComponentState) then 505 | Exit; 506 | NewDockType := GetDockTypeOf(DockingTo); 507 | NewDocked := Assigned(DockingTo); 508 | 509 | RightX := FFloatingRightX; 510 | if (NewDockType <> dtNotDocked) or (RightX = 0) then 511 | RightX := High(RightX) 512 | else begin 513 | { Make sure RightX isn't less than the smallest sized control + margins, 514 | in case one of the *LoadToolbarPositions functions happened to read 515 | a value too small. } 516 | for I := 0 to ControlCount-1 do 517 | if not(Controls[I] is TToolbarSepX2) then 518 | with Controls[I] do 519 | if Width + (tbX2LeftMarginFloating+tbX2RightMarginFloating) > RightX then 520 | RightX := Width + (tbX2LeftMarginFloating+tbX2RightMarginFloating); 521 | end; 522 | 523 | if CanMoveControls and (SlaveInfo.Count <> 0) then 524 | for I := 0 to ControlCount-1 do 525 | if not(Controls[I] is TToolbarSepX2) then 526 | SetControlVisible (Controls[I], NewDockType = dtLeftRight); 527 | 528 | GetBarSize (CurBarSize, NewDockType); 529 | if (DockingTo <> nil) and (DockingTo = DockedTo) then 530 | GetDockRowSize (DockRowSize) 531 | else 532 | DockRowSize := CurBarSize; 533 | 534 | if CanMoveControls then 535 | GInfo := GroupInfo 536 | else 537 | GInfo := TList.Create; 538 | try 539 | BuildGroupInfo (GInfo, not CanMoveControls, PreviousDockType, NewDockType); 540 | 541 | if CanMoveControls then 542 | LineSeps.Clear; 543 | 544 | 545 | CurLinePixel := tbX2TopMargin[NewDocked]; 546 | MinPosPixels := tbX2LeftMargin[NewDocked]; 547 | //x2nie: 548 | CR := Self.ClientRect; 549 | if NewDockType <> dtLeftRight then 550 | begin 551 | Inc(CurLinePixel, CR.Top); 552 | Inc(MinPosPixels, CR.Left); 553 | end 554 | else 555 | begin 556 | Inc(CurLinePixel, CR.Left); 557 | Inc(MinPosPixels, CR.Top); 558 | end; 559 | 560 | 561 | 562 | //Inc(MinPosPixels, CR.Left); 563 | 564 | if GInfo.Count <> 0 then begin 565 | AllowWrap := not NewDocked; 566 | CurPosPixel := MinPosPixels; 567 | GoToNewLine := False; 568 | PreviousSep := nil; 569 | PrevMinPosPixels := 0; 570 | for G := 0 to GInfo.Count-1 do begin 571 | GI := PGroupInfo(GInfo[G]); 572 | 573 | if NewDockType <> dtLeftRight then 574 | GroupPosSize := GI^.GroupWidth 575 | else 576 | GroupPosSize := GI^.GroupHeight; 577 | if AllowWrap and 578 | (GoToNewLine or (CurPosPixel+GroupPosSize+tbX2RightMargin[NewDocked] > RightX)) then begin 579 | GoToNewLine := False; 580 | {CurPosPixel := tbX2LeftMargin[NewDocked]; 581 | //x2nie: 582 | if NewDockType <> dtLeftRight then 583 | Inc(CurPosPixel, CR.Left)//x2nie 584 | else 585 | Inc(CurPosPixel, CR.Top);//x2nie} 586 | CurPosPixel := MinPosPixels; //x2nie 587 | 588 | if (G <> 0) and (PGroupInfo(GInfo[G-1])^.Members.Count <> 0) then begin 589 | Inc (CurLinePixel, CurBarSize + tbX2LineSpacing); 590 | if Assigned(PreviousSep) then begin 591 | MinPosPixels := PrevMinPosPixels; 592 | if CanMoveControls then begin 593 | PreviousSep.Width := 0; 594 | 595 | LongInt(NewLineSep) := 0; 596 | NewLineSep.Y := CurLinePixel; 597 | NewLineSep.Blank := PreviousSep.Blank; 598 | LineSeps.Add (Pointer(@NewLineSep)); 599 | end; 600 | end; 601 | end; 602 | end; 603 | if CurPosPixel > MinPosPixels 604 | then MinPosPixels := CurPosPixel; 605 | for I := 0 to GI^.Members.Count-1 do begin 606 | Member := TControl(GI^.Members[I]); 607 | MemberIsSep := Member is TToolbarSepX2; 608 | with Member do begin 609 | if not MemberIsSep then begin 610 | if NewDockType <> dtLeftRight then 611 | MemberPosSize := Width 612 | else 613 | MemberPosSize := Height; 614 | end 615 | else begin 616 | if NewDockType <> dtLeftRight then 617 | MemberPosSize := TToolbarSepX2(Member).SizeHorz 618 | else 619 | MemberPosSize := TToolbarSepX2(Member).SizeVert; 620 | end; 621 | { If RightX is passed, proceed to next line } 622 | if AllowWrap and not MemberIsSep and 623 | (CurPosPixel+MemberPosSize+tbX2RightMargin[NewDocked] > RightX) then begin 624 | {CurPosPixel := tbX2LeftMargin[NewDocked]; 625 | //x2nie: 626 | if NewDockType <> dtLeftRight then 627 | Inc(CurPosPixel, CR.Left)//x2nie 628 | else 629 | Inc(CurLinePixel, CR.Top);//x2nie} 630 | CurPosPixel := MinPosPixels; //x2nie 631 | 632 | Inc (CurLinePixel, CurBarSize); 633 | GoToNewLine := True; 634 | end; 635 | if NewDockType <> dtLeftRight then begin 636 | //if GoToNewLine then 637 | //Inc(CurPosPixel, CR.Left);//x2nie: 638 | if not MemberIsSep then begin 639 | if CanMoveControls then 640 | SetBounds (CurPosPixel, CurLinePixel+((DockRowSize-Height) div 2), Width, Height); 641 | Inc (CurPosPixel, Width); 642 | end 643 | else begin 644 | if CanMoveControls then 645 | SetBounds (CurPosPixel, CurLinePixel, TToolbarSepX2(Member).SizeHorz, DockRowSize); 646 | Inc (CurPosPixel, TToolbarSepX2(Member).SizeHorz); 647 | end; 648 | end 649 | else begin 650 | //if GoToNewLine then 651 | //Inc(CurPosPixel, CR.Top);//x2nie: 652 | if not MemberIsSep then begin 653 | if CanMoveControls then 654 | SetBounds (CurLinePixel+((DockRowSize-Width) div 2), CurPosPixel, Width, Height); 655 | Inc (CurPosPixel, Height); 656 | end 657 | else begin 658 | if CanMoveControls then 659 | SetBounds (CurLinePixel, CurPosPixel, DockRowSize, TToolbarSepX2(Member).SizeVert); 660 | Inc (CurPosPixel, TToolbarSepX2(Member).SizeVert); 661 | end; 662 | end; 663 | PrevMinPosPixels := MinPosPixels; 664 | if not MemberIsSep then 665 | PreviousSep := nil 666 | else 667 | PreviousSep := TToolbarSepX2(Member); 668 | if CurPosPixel > MinPosPixels then MinPosPixels := CurPosPixel; 669 | end; 670 | end; 671 | end; 672 | end 673 | else 674 | Inc (MinPosPixels, tbX2DefaultBarWidthHeight); 675 | 676 | if csDesigning in ComponentState then 677 | Invalidate; 678 | finally 679 | if not CanMoveControls then begin 680 | FreeGroupInfo (GInfo); 681 | GInfo.Free; 682 | end; 683 | end; 684 | 685 | Inc (MinPosPixels, tbX2RightMargin[NewDocked]); 686 | MinRowPixels := CurLinePixel + CurBarSize + tbX2BottomMargin[NewDocked]; 687 | if NewDockType <> dtLeftRight then begin 688 | Result.X := MinPosPixels - CR.Left; 689 | Result.Y := MinRowPixels - CR.Top; 690 | end 691 | else begin 692 | Result.X := MinRowPixels - CR.Left; 693 | Result.Y := MinPosPixels - CR.Top; 694 | end; 695 | 696 | end; 697 | 698 | 699 | procedure TCustomToolbarX2.SetControlVisible(const Control: TControl; 700 | const LeftOrRight: Boolean); 701 | { If Control is a master or slave control, it automatically adjusts the 702 | Visible properties of both the master and slave control based on the value 703 | of LeftOrRight } 704 | var 705 | I: Integer; 706 | begin 707 | for I := 0 to SlaveInfo.Count-1 do 708 | with PSlaveInfo(SlaveInfo[I])^ do 709 | if (TopBottom = Control) or (LeftRight = Control) then begin 710 | if Assigned(TopBottom) then TopBottom.Visible := not LeftOrRight; 711 | if Assigned(LeftRight) then LeftRight.Visible := LeftOrRight; 712 | Exit; 713 | end; 714 | 715 | end; 716 | 717 | procedure TCustomToolbarX2.SetSlaveControl(const ATopBottom, 718 | ALeftRight: TControl); 719 | var 720 | NewVersion: PSlaveInfo; 721 | begin 722 | GetMem (NewVersion, SizeOf(TSlaveInfo)); 723 | with NewVersion^ do begin 724 | TopBottom := ATopBottom; 725 | LeftRight := ALeftRight; 726 | end; 727 | SlaveInfo.Add (NewVersion); 728 | ArrangeControls; 729 | 730 | end; 731 | 732 | function TCustomToolbarX2.ShouldControlBeVisible(const Control: TControl; 733 | const LeftOrRight: Boolean): Boolean; 734 | { If Control is a master or slave control, it returns the appropriate visibility 735 | setting based on the value of LeftOrRight, otherwise it simply returns the 736 | current Visible setting } 737 | var 738 | I: Integer; 739 | begin 740 | for I := 0 to SlaveInfo.Count-1 do 741 | with PSlaveInfo(SlaveInfo[I])^ do 742 | if TopBottom = Control then begin 743 | Result := not LeftOrRight; 744 | Exit; 745 | end 746 | else 747 | if LeftRight = Control then begin 748 | Result := LeftOrRight; 749 | Exit; 750 | end; 751 | Result := ControlVisibleOrDesigning(Control); 752 | end; 753 | 754 | { TToolbarSep97 } 755 | 756 | constructor TToolbarSepX2.Create (AOwner: TComponent); 757 | begin 758 | inherited; 759 | FSizeHorz := 6; 760 | FSizeVert := 6; 761 | ControlStyle := ControlStyle - [csOpaque, csCaptureMouse]; 762 | end; 763 | 764 | procedure TToolbarSepX2.SetParent (AParent: TWinControl); 765 | begin 766 | if (AParent <> nil) and not(AParent is TCustomToolbarX2) then 767 | raise EInvalidOperation.Create(STBX2SepParentNotAllowed); 768 | inherited; 769 | end; 770 | 771 | procedure TToolbarSepX2.SetBlank (Value: Boolean); 772 | begin 773 | if FBlank <> Value then begin 774 | FBlank := Value; 775 | Invalidate; 776 | end; 777 | end; 778 | 779 | procedure TToolbarSepX2.SetSizeHorz (Value: TToolbarSepSize); 780 | begin 781 | if FSizeHorz <> Value then begin 782 | FSizeHorz := Value; 783 | if Parent is TCustomToolbarX2 then 784 | TCustomToolbarX2(Parent).ArrangeControls; 785 | end; 786 | end; 787 | 788 | procedure TToolbarSepX2.SetSizeVert (Value: TToolbarSepSize); 789 | begin 790 | if FSizeVert <> Value then begin 791 | FSizeVert := Value; 792 | if Parent is TCustomToolbarX2 then 793 | TCustomToolbarX2(Parent).ArrangeControls; 794 | end; 795 | end; 796 | 797 | procedure TToolbarSepX2.Paint; 798 | var 799 | R: TRect; 800 | Z: Integer; 801 | begin 802 | inherited; 803 | if not(Parent is TCustomToolbarX2) then Exit; 804 | 805 | with Canvas do begin 806 | { Draw dotted border in design mode } 807 | if csDesigning in ComponentState then begin 808 | Pen.Style := psDot; 809 | Pen.Color := clBtnShadow; 810 | Brush.Style := bsClear; 811 | R := ClientRect; 812 | Rectangle (R.Left, R.Top, R.Right, R.Bottom); 813 | Pen.Style := psSolid; 814 | end; 815 | 816 | if not FBlank then 817 | if GetDockTypeOf(TCustomToolbarX2(Parent).DockedTo) <> dtLeftRight then begin 818 | Z := Width div 2; 819 | Pen.Color := clBtnShadow; 820 | MoveTo (Z-1, 0); LineTo (Z-1, Height); 821 | Pen.Color := clBtnHighlight; 822 | MoveTo (Z, 0); LineTo (Z, Height); 823 | end 824 | else begin 825 | Z := Height div 2; 826 | Pen.Color := clBtnShadow; 827 | MoveTo (0, Z-1); LineTo (Width, Z-1); 828 | Pen.Color := clBtnHighlight; 829 | MoveTo (0, Z); LineTo (Width, Z); 830 | end; 831 | end; 832 | end; 833 | 834 | procedure TToolbarSepX2.MouseDown (Button: TMouseButton; Shift: TShiftState; X, Y: Integer); 835 | var 836 | P: TPoint; 837 | begin 838 | inherited; 839 | if not(Parent is TCustomToolbarX2) then Exit; 840 | 841 | { Relay the message to the parent toolbar } 842 | P := Parent.ScreenToClient(ClientToScreen(Point(X, Y))); 843 | TCustomToolbarX2(Parent).MouseDown (Button, Shift, P.X, P.Y); 844 | end; 845 | 846 | end. 847 | --------------------------------------------------------------------------------