Changeset 89
- Timestamp:
- Nov 4, 2010, 7:14:07 AM (14 years ago)
- Location:
- Docking/CoolDocking
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/CoolDocking.lpk
r57 r89 25 25 <Description Value="Set of components for docking of windows."/> 26 26 <Version Major="1"/> 27 <Files Count=" 4">27 <Files Count="8"> 28 28 <Item1> 29 29 <Filename Value="UCoolDocking.pas"/> … … 43 43 <UnitName Value="UCoolDockWindowList"/> 44 44 </Item4> 45 <Item5> 46 <Filename Value="UCoolDockStyleTabs.pas"/> 47 <UnitName Value="UCoolDockStyleTabs"/> 48 </Item5> 49 <Item6> 50 <Filename Value="UCoolDockStyleRegions.pas"/> 51 <UnitName Value="UCoolDockStyleRegions"/> 52 </Item6> 53 <Item7> 54 <Filename Value="UCoolDockStylePopupTabs.pas"/> 55 <UnitName Value="UCoolDockStylePopupTabs"/> 56 </Item7> 57 <Item8> 58 <Filename Value="UCoolDockStylePopupRegions.pas"/> 59 <UnitName Value="UCoolDockStylePopupRegions"/> 60 </Item8> 45 61 </Files> 46 62 <i18n> -
Docking/CoolDocking/CoolDocking.pas
r56 r89 8 8 9 9 uses 10 UCoolDocking, UCoolDockCustomize, UCoolDockWindowList, LazarusPackageIntf; 10 UCoolDocking, UCoolDockCustomize, UCoolDockWindowList, UCoolDockStyleTabs, 11 UCoolDockStyleRegions, UCoolDockStylePopupTabs, UCoolDockStylePopupRegions, 12 LazarusPackageIntf; 11 13 12 14 implementation -
Docking/CoolDocking/UCoolDockCustomize.lfm
r60 r89 1 1 object CoolDockCustomizeForm: TCoolDockCustomizeForm 2 Left = 3742 Left = 431 3 3 Height = 323 4 Top = 13 54 Top = 139 5 5 Width = 407 6 6 Caption = 'Customize docking' 7 7 ClientHeight = 323 8 8 ClientWidth = 407 9 OnShow = FormShow 9 10 LCLVersion = '0.9.29' 10 11 object PageControl1: TPageControl … … 30 31 end 31 32 object ComboBox1: TComboBox 32 Left = 1 3233 Left = 164 33 34 Height = 21 34 35 Top = 10 35 36 Width = 100 36 37 ItemHeight = 13 38 Items.Strings = ( 39 'Auto' 40 'Left' 41 'Top' 42 'Right' 43 'Bottom' 44 ) 45 Style = csDropDownList 37 46 TabOrder = 0 38 Text = 'ComboBox1'39 47 end 40 48 object Label2: TLabel … … 47 55 end 48 56 object ComboBox2: TComboBox 49 Left = 1 3257 Left = 164 50 58 Height = 21 51 59 Top = 38 52 60 Width = 100 53 61 ItemHeight = 13 62 Items.Strings = ( 63 'Auto' 64 'Left' 65 'Top' 66 'Right' 67 'Bottom' 68 ) 69 Style = csDropDownList 54 70 TabOrder = 1 55 Text = 'ComboBox1' 71 end 72 object Label3: TLabel 73 Left = 7 74 Height = 14 75 Top = 67 76 Width = 101 77 Caption = 'Hide/unhide duration' 78 ParentColor = False 79 end 80 object SpinEdit1: TSpinEdit 81 Left = 164 82 Height = 21 83 Top = 64 84 Width = 100 85 MaxValue = 10000 86 TabOrder = 2 87 end 88 object Label4: TLabel 89 Left = 270 90 Height = 14 91 Top = 67 92 Width = 14 93 Caption = 'ms' 94 ParentColor = False 56 95 end 57 96 end -
Docking/CoolDocking/UCoolDockCustomize.lrs
r60 r89 2 2 3 3 LazarusResources.Add('TCoolDockCustomizeForm','FORMDATA',[ 4 'TPF0'#22'TCoolDockCustomizeForm'#21'CoolDockCustomizeForm'#4'Left'#3'v'#1#6 5 +'Height'#3'C'#1#3'Top'#3#135#0#5'Width'#3#151#1#7'Caption'#6#17'Customize do' 6 +'cking'#12'ClientHeight'#3'C'#1#11'ClientWidth'#3#151#1#10'LCLVersion'#6#6'0' 7 +'.9.29'#0#12'TPageControl'#12'PageControl1'#4'Left'#2#8#6'Height'#3#22#1#3'T' 8 +'op'#2#8#5'Width'#3#137#1#10'ActivePage'#7#15'TabSheetSetting'#7'Anchors'#11 9 +#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#8'TabIndex'#2#0#8'TabOrder'#2#0 10 +#0#9'TTabSheet'#15'TabSheetSetting'#7'Caption'#6#7'Options'#12'ClientHeight' 11 +#3#252#0#11'ClientWidth'#3#129#1#0#6'TLabel'#6'Label1'#4'Left'#2#7#6'Height' 12 +#2#14#3'Top'#2#13#5'Width'#2'h'#7'Caption'#6#22'Default tabs position:'#11'P' 13 +'arentColor'#8#0#0#9'TComboBox'#9'ComboBox1'#4'Left'#3#132#0#6'Height'#2#21#3 14 +'Top'#2#10#5'Width'#2'd'#10'ItemHeight'#2#13#8'TabOrder'#2#0#4'Text'#6#9'Com' 15 +'boBox1'#0#0#6'TLabel'#6'Label2'#4'Left'#2#7#6'Height'#2#14#3'Top'#2')'#5'Wi' 16 +'dth'#2'u'#7'Caption'#6#24'Default header position:'#11'ParentColor'#8#0#0#9 17 +'TComboBox'#9'ComboBox2'#4'Left'#3#132#0#6'Height'#2#21#3'Top'#2'&'#5'Width' 18 +#2'd'#10'ItemHeight'#2#13#8'TabOrder'#2#1#4'Text'#6#9'ComboBox1'#0#0#0#9'TTa' 19 +'bSheet'#15'TabSheetLayouts'#7'Caption'#6#7'Layouts'#12'ClientHeight'#3#252#0 20 +#11'ClientWidth'#3#129#1#0#8'TListBox'#8'ListBox1'#4'Left'#2#10#6'Height'#3 21 +#231#0#3'Top'#2#11#5'Width'#3#180#0#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBot' 22 +'tom'#0#10'ItemHeight'#2#0#8'TabOrder'#2#0#0#0#0#0#7'TButton'#11'ButtonClose' 23 +#4'Left'#3'D'#1#6'Height'#2#22#3'Top'#3'&'#1#5'Width'#2'K'#7'Anchors'#11#7'a' 24 +'kRight'#8'akBottom'#0#7'Caption'#6#5'Close'#7'OnClick'#7#16'ButtonCloseClic' 25 +'k'#8'TabOrder'#2#1#0#0#0 4 'TPF0'#22'TCoolDockCustomizeForm'#21'CoolDockCustomizeForm'#4'Left'#3#175#1#6 5 +'Height'#3'C'#1#3'Top'#3#139#0#5'Width'#3#151#1#7'Caption'#6#17'Customize do' 6 +'cking'#12'ClientHeight'#3'C'#1#11'ClientWidth'#3#151#1#6'OnShow'#7#8'FormSh' 7 +'ow'#10'LCLVersion'#6#6'0.9.29'#0#12'TPageControl'#12'PageControl1'#4'Left'#2 8 +#8#6'Height'#3#22#1#3'Top'#2#8#5'Width'#3#137#1#10'ActivePage'#7#15'TabSheet' 9 +'Setting'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#8'TabInd' 10 +'ex'#2#0#8'TabOrder'#2#0#0#9'TTabSheet'#15'TabSheetSetting'#7'Caption'#6#7'O' 11 +'ptions'#12'ClientHeight'#3#252#0#11'ClientWidth'#3#129#1#0#6'TLabel'#6'Labe' 12 +'l1'#4'Left'#2#7#6'Height'#2#14#3'Top'#2#13#5'Width'#2'h'#7'Caption'#6#22'De' 13 +'fault tabs position:'#11'ParentColor'#8#0#0#9'TComboBox'#9'ComboBox1'#4'Lef' 14 +'t'#3#164#0#6'Height'#2#21#3'Top'#2#10#5'Width'#2'd'#10'ItemHeight'#2#13#13 15 +'Items.Strings'#1#6#4'Auto'#6#4'Left'#6#3'Top'#6#5'Right'#6#6'Bottom'#0#5'St' 16 +'yle'#7#14'csDropDownList'#8'TabOrder'#2#0#0#0#6'TLabel'#6'Label2'#4'Left'#2 17 +#7#6'Height'#2#14#3'Top'#2')'#5'Width'#2'u'#7'Caption'#6#24'Default header p' 18 +'osition:'#11'ParentColor'#8#0#0#9'TComboBox'#9'ComboBox2'#4'Left'#3#164#0#6 19 +'Height'#2#21#3'Top'#2'&'#5'Width'#2'd'#10'ItemHeight'#2#13#13'Items.Strings' 20 +#1#6#4'Auto'#6#4'Left'#6#3'Top'#6#5'Right'#6#6'Bottom'#0#5'Style'#7#14'csDro' 21 +'pDownList'#8'TabOrder'#2#1#0#0#6'TLabel'#6'Label3'#4'Left'#2#7#6'Height'#2 22 +#14#3'Top'#2'C'#5'Width'#2'e'#7'Caption'#6#20'Hide/unhide duration'#11'Paren' 23 +'tColor'#8#0#0#9'TSpinEdit'#9'SpinEdit1'#4'Left'#3#164#0#6'Height'#2#21#3'To' 24 +'p'#2'@'#5'Width'#2'd'#8'MaxValue'#3#16''''#8'TabOrder'#2#2#0#0#6'TLabel'#6 25 +'Label4'#4'Left'#3#14#1#6'Height'#2#14#3'Top'#2'C'#5'Width'#2#14#7'Caption'#6 26 +#2'ms'#11'ParentColor'#8#0#0#0#9'TTabSheet'#15'TabSheetLayouts'#7'Caption'#6 27 +#7'Layouts'#12'ClientHeight'#3#252#0#11'ClientWidth'#3#129#1#0#8'TListBox'#8 28 +'ListBox1'#4'Left'#2#10#6'Height'#3#231#0#3'Top'#2#11#5'Width'#3#180#0#7'Anc' 29 +'hors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#10'ItemHeight'#2#0#8'TabOrder'#2#0 30 +#0#0#0#0#7'TButton'#11'ButtonClose'#4'Left'#3'D'#1#6'Height'#2#22#3'Top'#3'&' 31 +#1#5'Width'#2'K'#7'Anchors'#11#7'akRight'#8'akBottom'#0#7'Caption'#6#5'Close' 32 +#7'OnClick'#7#16'ButtonCloseClick'#8'TabOrder'#2#1#0#0#0 26 33 ]); -
Docking/CoolDocking/UCoolDockCustomize.lrt
r60 r89 2 2 TCOOLDOCKCUSTOMIZEFORM.TABSHEETSETTING.CAPTION=Options 3 3 TCOOLDOCKCUSTOMIZEFORM.LABEL1.CAPTION=Default tabs position: 4 TCOOLDOCKCUSTOMIZEFORM.COMBOBOX1.TEXT=ComboBox15 4 TCOOLDOCKCUSTOMIZEFORM.LABEL2.CAPTION=Default header position: 6 TCOOLDOCKCUSTOMIZEFORM.COMBOBOX2.TEXT=ComboBox1 5 TCOOLDOCKCUSTOMIZEFORM.LABEL3.CAPTION=Hide/unhide duration 6 TCOOLDOCKCUSTOMIZEFORM.LABEL4.CAPTION=ms 7 7 TCOOLDOCKCUSTOMIZEFORM.TABSHEETLAYOUTS.CAPTION=Layouts 8 8 TCOOLDOCKCUSTOMIZEFORM.BUTTONCLOSE.CAPTION=Close -
Docking/CoolDocking/UCoolDockCustomize.pas
r60 r89 7 7 uses 8 8 Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, 9 ComCtrls, StdCtrls ;9 ComCtrls, StdCtrls, Spin; 10 10 11 11 type … … 19 19 Label1: TLabel; 20 20 Label2: TLabel; 21 Label3: TLabel; 22 Label4: TLabel; 21 23 ListBox1: TListBox; 22 24 PageControl1: TPageControl; 25 SpinEdit1: TSpinEdit; 23 26 TabSheetSetting: TTabSheet; 24 27 TabSheetLayouts: TTabSheet; 25 28 procedure ButtonCloseClick(Sender: TObject); 29 procedure FormShow(Sender: TObject); 26 30 private 27 31 { private declarations } … … 39 43 end; 40 44 45 procedure TCoolDockCustomizeForm.FormShow(Sender: TObject); 46 begin 47 48 end; 49 41 50 initialization 42 51 {$I UCoolDockCustomize.lrs} -
Docking/CoolDocking/UCoolDocking.pas
r64 r89 15 15 const 16 16 GrabberSize = 22; 17 AutoHideStepCount = 20; 17 18 18 19 type … … 52 53 end; 53 54 55 TCoolDockStyle = class 56 end; 57 54 58 { TCoolDockClientPanel } 55 59 … … 59 63 FHeaderPos: THeaderPos; 60 64 FShowHeader: Boolean; 65 function GetAutoHideEnabled: Boolean; 61 66 procedure SetAutoHide(const AValue: Boolean); 67 procedure SetAutoHideEnabled(const AValue: Boolean); 62 68 procedure SetHeaderPos(const AValue: THeaderPos); 63 69 procedure SetShowHeader(const AValue: Boolean); … … 76 82 procedure ResizeExecute(Sender: TObject); 77 83 property ShowHeader: Boolean read FShowHeader write SetShowHeader; 78 property AutoHide: Boolean read FAutoHide write SetAutoHide; 84 property AutoHideEnabled: Boolean read GetAutoHideEnabled 85 write SetAutoHideEnabled; 79 86 property HeaderPos: THeaderPos read FHeaderPos write SetHeaderPos; 87 end; 88 89 { TCoolDockAutoHide } 90 91 TCoolDockAutoHide = class 92 private 93 FDuration: Real; 94 FStepCount: Integer; 95 StartBounds: TRect; 96 procedure SetDuration(const AValue: Real); 97 procedure SetStepCount(const AValue: Integer); 98 procedure UpdateBounds; 99 procedure UpdateTimerInterval; 100 public 101 Position: Real; 102 Direction: Integer; 103 TabPosition: TTabPosition; 104 Enable: Boolean; 105 Timer: TTimer; 106 Control: TControl; 107 ControlVisible: Boolean; 108 procedure Hide; 109 procedure Show; 110 constructor Create; 111 destructor Destroy; override; 112 procedure TimerExecute(Sender: TObject); 113 property Duration: Real read FDuration write SetDuration; 114 property StepCount: Integer read FStepCount write SetStepCount; 80 115 end; 81 116 … … 88 123 MouseDownSkip: Boolean; 89 124 FMaster: TCoolDockMaster; 90 FMoveDuration: Integer;91 125 FTabsPos: THeaderPos; 92 Timer1: TTimer;93 126 PopupMenuTabs: TPopupMenu; 94 127 PopupMenuHeader: TPopupMenu; … … 98 131 FDockDirection: TDockDirection; 99 132 FDockSite: TWinControl; 100 FDockPanels: TObjectList; // of TCoolDockClientPanel 133 FDockPanels: TObjectList; // TObjectList<TCoolDockClientPanel> 134 AutoHide: TCoolDockAutoHide; 101 135 function FindControlInPanels(Control: TControl): TCoolDockClientPanel; 102 136 function GetDockSite: TWinControl; 137 function GetMoveDuration: Integer; 103 138 procedure InsertControlPanel(Control: TControl; InsertAt: TAlign; 104 139 DropCtl: TControl); … … 126 161 procedure PopupMenuUndockClick(Sender: TObject); 127 162 procedure PopupMenuCustomizeClick(Sender: TObject); 128 procedure Timer1Timer(Sender: TObject);129 163 public 130 164 constructor Create(ADockSite: TWinControl); override; … … 154 188 function CreateContainer(InsertAt: TAlign): TCoolDockConjoinForm; 155 189 property DockStyle: TDockStyle read FDockStyle write SetDockStyle; 156 property MoveDuration: Integer read FMoveDuration write SetMoveDuration;190 property MoveDuration: Integer read GetMoveDuration write SetMoveDuration; 157 191 property TabsPos: THeaderPos read FTabsPos write SetTabsPos; 158 192 property Master: TCoolDockMaster read FMaster write SetMaster; … … 166 200 FCoolDockCustomize: TCoolDockCustomize; 167 201 FDefaultHeaderPos: THeaderPos; 202 FDefaultMoveSpeed: Integer; 168 203 FDefaultTabsPos: THeaderPos; 169 204 FShowIcons: Boolean; … … 190 225 property DefaultHeaderPos: THeaderPos read FDefaultHeaderPos 191 226 write FDefaultHeaderPos; 227 property DefaultMoveSpeed: Integer read FDefaultMoveSpeed 228 write FDefaultMoveSpeed; 192 229 property Customize: TCoolDockCustomize read FCoolDockCustomize 193 230 write SetCustomize; … … 250 287 implementation 251 288 289 uses 290 UCoolDockStyleTabs; 291 252 292 resourcestring 253 293 SDockStyle = 'Style'; … … 296 336 end; 297 337 338 function TCoolDockManager.GetMoveDuration: Integer; 339 begin 340 341 end; 342 298 343 procedure TCoolDockManager.TabControlMouseLeave(Sender: TObject); 299 344 begin … … 315 360 FDockPanels := TObjectList.Create; 316 361 317 Timer1 := TTimer.Create(nil); 318 Timer1.Enabled := False; 319 Timer1.OnTimer := Timer1Timer; 362 AutoHide := TCoolDockAutoHide.Create; 320 363 321 364 // Tabs popup … … 476 519 destructor TCoolDockManager.Destroy; 477 520 begin 478 Timer1.Free;479 521 FDockPanels.Free; 480 522 inherited Destroy; … … 716 758 I: Integer; 717 759 begin 718 FDockStyle := AValue; 719 if AValue = dsTabs then begin 720 TabControl.Visible := True; 721 TabControl.Tabs.Clear; 722 TabImageList.Clear; 723 for I := 0 to FDockPanels.Count - 1 do begin 724 TabControl.Tabs.Add(TCoolDockClientPanel(FDockPanels[I]).Control.Caption); 725 TabImageList.Add(TCoolDockClientPanel(FDockPanels[I]).Header.Icon.Picture.Bitmap, nil); 726 if Assigned(TCoolDockClientPanel(FDockPanels[I]).Splitter) then 727 TCoolDockClientPanel(FDockPanels[I]).Splitter.Visible := False; 728 TCoolDockClientPanel(FDockPanels[I]).ClientAreaPanel.Visible := False; 729 TCoolDockClientPanel(FDockPanels[I]).Visible := False; 730 end; 731 TabControlChange(Self); 732 end else 733 if AValue = dsList then begin 734 TabControl.Visible := False; 735 TabControl.Tabs.Clear; 736 for I := 0 to FDockPanels.Count - 1 do begin 737 if Assigned(TCoolDockClientPanel(FDockPanels[I]).Splitter) then 760 if FDockStyle <> AValue then begin 761 FDockStyle := AValue; 762 if AValue = dsTabs then begin 763 TabControl.Visible := True; 764 TabControl.Tabs.Clear; 765 TabImageList.Clear; 766 for I := 0 to FDockPanels.Count - 1 do begin 767 TabControl.Tabs.Add(TCoolDockClientPanel(FDockPanels[I]).Control.Caption); 768 TabImageList.Add(TCoolDockClientPanel(FDockPanels[I]).Header.Icon.Picture.Bitmap, nil); 769 if Assigned(TCoolDockClientPanel(FDockPanels[I]).Splitter) then 770 TCoolDockClientPanel(FDockPanels[I]).Splitter.Visible := False; 771 TCoolDockClientPanel(FDockPanels[I]).ClientAreaPanel.Visible := False; 772 TCoolDockClientPanel(FDockPanels[I]).Visible := False; 773 end; 774 TabControlChange(Self); 775 end else 776 if AValue = dsList then begin 777 TabControl.Visible := False; 778 TabControl.Tabs.Clear; 779 for I := 0 to FDockPanels.Count - 1 do begin 780 if Assigned(TCoolDockClientPanel(FDockPanels[I]).Splitter) then 738 781 TCoolDockClientPanel(FDockPanels[I]).Splitter.Visible := True; 739 TCoolDockClientPanel(FDockPanels[I]).Visible := True; 740 TCoolDockClientPanel(FDockPanels[I]).ClientAreaPanel.Parent := TCoolDockClientPanel(FDockPanels[I]); 741 TCoolDockClientPanel(FDockPanels[I]).ClientAreaPanel.Visible := True; 742 TCoolDockClientPanel(FDockPanels[I]).Control.Visible := True; 782 TCoolDockClientPanel(FDockPanels[I]).Visible := True; 783 TCoolDockClientPanel(FDockPanels[I]).ClientAreaPanel.Parent := TCoolDockClientPanel(FDockPanels[I]); 784 TCoolDockClientPanel(FDockPanels[I]).ClientAreaPanel.Visible := True; 785 TCoolDockClientPanel(FDockPanels[I]).Control.Visible := True; 786 end; 743 787 end; 744 788 end; … … 755 799 procedure TCoolDockManager.SetMoveDuration(const AValue: Integer); 756 800 begin 757 if FMoveDuration=AValue then exit;758 FMoveDuration := AValue;759 //Timer1.Interval := AValue;760 801 end; 761 802 762 803 procedure TCoolDockManager.SetTabsPos(const AValue: THeaderPos); 763 804 begin 764 if FTabsPos =AValue then exit;805 if FTabsPos = AValue then Exit; 765 806 FTabsPos := AValue; 766 807 with TabControl do … … 816 857 I: Integer; 817 858 begin 859 // Hide all clients 818 860 for I := 0 to FDockPanels.Count - 1 do begin 819 861 TCoolDockClientPanel(FDockPanels[I]).ClientAreaPanel.Visible := False; 862 TCoolDockClientPanel(FDockPanels[I]).ClientAreaPanel.Parent := FDockSite; 863 TCoolDockClientPanel(FDockPanels[I]).Control.Align := alClient; 820 864 TCoolDockClientPanel(FDockPanels[I]).Control.Visible := False; 821 865 end; … … 823 867 with TCoolDockClientPanel(FDockPanels[TabControl.TabIndex]), ClientAreaPanel do begin 824 868 Control.Show; 825 if AutoHide then begin 826 Parent := nil; 869 AutoHide.Enable := True; 870 if AutoHide.Enable then begin 871 //Parent := nil; 827 872 Visible := True; 828 Width := 0;829 //TimerMoveForm :=830 //TimerIncrement := 1;831 Timer1.Interval := MoveDuration div 10;832 Timer1.Enabled := True;873 if AutoHide.ControlVisible then begin 874 AutoHide.Hide; 875 end; 876 AutoHide.Control := Control; 877 AutoHide.Show; 833 878 end else begin 834 879 Parent := FDockSite; … … 912 957 end; 913 958 914 procedure TCoolDockManager.Timer1Timer(Sender: TObject);915 begin916 // TimerMoveForm.Width := TimerMoveForm.Width917 end;918 919 959 procedure TCoolDockManager.TabControlMouseDown(Sender: TObject; Button: TMouseButton; 920 960 Shift: TShiftState; X, Y: Integer); … … 942 982 procedure TCoolDockClientPanel.SetShowHeader(const AValue: Boolean); 943 983 begin 944 if FShowHeader =AValue then exit;984 if FShowHeader = AValue then Exit; 945 985 FShowHeader := AValue; 946 986 DockPanelPaint(Self); … … 963 1003 procedure TCoolDockClientPanel.SetAutoHide(const AValue: Boolean); 964 1004 begin 965 if FAutoHide=AValue then exit; 966 FAutoHide:=AValue; 1005 if FAutoHide = AValue then Exit; 1006 FAutoHide := AValue; 1007 end; 1008 1009 function TCoolDockClientPanel.GetAutoHideEnabled: Boolean; 1010 begin 1011 end; 1012 1013 procedure TCoolDockClientPanel.SetAutoHideEnabled(const AValue: Boolean); 1014 begin 1015 967 1016 end; 968 1017 … … 1005 1054 BevelInner := bvNone; 1006 1055 BevelOuter := bvNone; 1007 AutoHide := False;1056 AutoHideEnabled := True; 1008 1057 HeaderPos := hpTop; 1009 1058 end; … … 1082 1131 procedure TCoolDockMaster.SetTabsEnabled(const AValue: Boolean); 1083 1132 begin 1084 if FTabsEnabled =AValue then exit;1085 FTabsEnabled :=AValue;1133 if FTabsEnabled = AValue then Exit; 1134 FTabsEnabled := AValue; 1086 1135 end; 1087 1136 … … 1343 1392 begin 1344 1393 Form := TCoolDockCustomizeForm.Create(Self); 1394 if Assigned(Master) then begin 1395 Form.SpinEdit1.Value := Master.DefaultMoveSpeed; 1396 Form.ComboBox1.ItemIndex := Integer(Master.DefaultTabsPos); 1397 Form.ComboBox2.ItemIndex := Integer(Master.DefaultHeaderPos); 1398 end; 1345 1399 Form.ShowModal; 1400 if Assigned(Master) then begin 1401 Master.DefaultMoveSpeed := Form.SpinEdit1.Value; 1402 Master.DefaultTabsPos := THeaderPos(Form.ComboBox1.ItemIndex); 1403 Master.DefaultHeaderPos := THeaderPos(Form.ComboBox2.ItemIndex); 1404 end; 1346 1405 Form.Free; 1347 1406 Result := True; … … 1464 1523 end; 1465 1524 1525 { TCoolDockAutoHide } 1526 1527 procedure TCoolDockAutoHide.UpdateBounds; 1528 begin 1529 case TabPosition of 1530 tpBottom: begin 1531 Control.Height := Round((StartBounds.Bottom - StartBounds.Top) * Position); 1532 Control.Top := StartBounds.Bottom - Control.Height; 1533 end; 1534 tpTop: begin 1535 Control.Height := Round((StartBounds.Bottom - StartBounds.Top) * Position); 1536 end; 1537 tpRight: begin 1538 Control.Width := Round((StartBounds.Right - StartBounds.Left) * Position); 1539 end; 1540 tpLeft: begin 1541 Control.Width := Round((StartBounds.Right - StartBounds.Left) * Position); 1542 Control.Left := StartBounds.Right - Control.Width; 1543 end; 1544 end; 1545 end; 1546 1547 procedure TCoolDockAutoHide.UpdateTimerInterval; 1548 begin 1549 Timer.Interval := Round(FDuration * 1000 / FStepCount); 1550 end; 1551 1552 procedure TCoolDockAutoHide.SetDuration(const AValue: Real); 1553 begin 1554 if FDuration = AValue then Exit; 1555 FDuration := AValue; 1556 UpdateTimerInterval; 1557 end; 1558 1559 procedure TCoolDockAutoHide.SetStepCount(const AValue: Integer); 1560 begin 1561 if FStepCount = AValue then Exit; 1562 FStepCount := AValue; 1563 UpdateTimerInterval; 1564 end; 1565 1566 procedure TCoolDockAutoHide.Hide; 1567 begin 1568 StartBounds := Control.BoundsRect; 1569 Direction := -1; 1570 Position := 1; 1571 Timer.Enabled := True; 1572 UpdateBounds; 1573 end; 1574 1575 procedure TCoolDockAutoHide.Show; 1576 begin 1577 StartBounds := Control.BoundsRect; 1578 Control.Align := alCustom; 1579 Direction := 1; 1580 Position := 0; 1581 Timer.Enabled := True; 1582 UpdateBounds; 1583 end; 1584 1585 constructor TCoolDockAutoHide.Create; 1586 begin 1587 Timer := TTimer.Create(nil); 1588 Timer.Enabled := False; 1589 Timer.OnTimer := TimerExecute; 1590 StepCount := AutoHideStepCount; 1591 Duration := 0.5; 1592 end; 1593 1594 destructor TCoolDockAutoHide.Destroy; 1595 begin 1596 Timer.Free; 1597 inherited Destroy; 1598 end; 1599 1600 procedure TCoolDockAutoHide.TimerExecute(Sender: TObject); 1601 begin 1602 if Direction = 1 then begin 1603 Position := Position + 1 / StepCount; 1604 if Position > 1 then begin 1605 Position := 1; 1606 Timer.Enabled := False; 1607 ControlVisible := True; 1608 end; 1609 end else 1610 if Direction = -1 then begin 1611 Position := Position - 1 / StepCount; 1612 if Position < 1 then begin 1613 Position := 0; 1614 Timer.Enabled := False; 1615 ControlVisible := False; 1616 end; 1617 end; 1618 UpdateBounds; 1619 end; 1620 1466 1621 end. 1467 1622
Note:
See TracChangeset
for help on using the changeset viewer.