mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 00:09:17 +02:00
dockmanager example: try fViewWindow in fFloatingSite, using dock-icon
git-svn-id: trunk@22541 -
This commit is contained in:
parent
5ba985389f
commit
ed43453baf
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -2773,6 +2773,9 @@ examples/dockmanager/easytree/ftree.pas svneol=native#text/plain
|
||||
examples/dockmanager/elasticsite/SiteTest.lpi svneol=native#text/plain
|
||||
examples/dockmanager/elasticsite/SiteTest.lpr svneol=native#text/plain
|
||||
examples/dockmanager/elasticsite/SiteTest.lrs svneol=native#text/plain
|
||||
examples/dockmanager/elasticsite/fclientform.lfm svneol=native#text/plain
|
||||
examples/dockmanager/elasticsite/fclientform.lrs svneol=native#text/plain
|
||||
examples/dockmanager/elasticsite/fclientform.pas svneol=native#text/pascal
|
||||
examples/dockmanager/elasticsite/fdockclient.lfm svneol=native#text/plain
|
||||
examples/dockmanager/elasticsite/fdockclient.lrs svneol=native#text/plain
|
||||
examples/dockmanager/elasticsite/fdockclient.pas svneol=native#text/pascal
|
||||
@ -2793,6 +2796,7 @@ examples/dockmanager/package/felasticsite.pas svneol=native#text/pascal
|
||||
examples/dockmanager/package/ffloatingsite.lfm svneol=native#text/plain
|
||||
examples/dockmanager/package/ffloatingsite.lrs svneol=native#text/plain
|
||||
examples/dockmanager/package/ffloatingsite.pas svneol=native#text/pascal
|
||||
examples/dockmanager/package/pen.ico -text
|
||||
examples/dockmanager/package/zoneheader.inc svneol=native#text/pascal
|
||||
examples/dockmanager/patches/FloatHostDockable.patch svneol=native#text/pascal
|
||||
examples/dockmanager/patches/NewClients.patch svneol=native#text/pascal
|
||||
|
@ -11,7 +11,7 @@ object EasyDockMain: TEasyDockMain
|
||||
Font.Name = 'MS Sans Serif'
|
||||
OnCreate = FormCreate
|
||||
ShowHint = True
|
||||
LCLVersion = '0.9.27'
|
||||
LCLVersion = '0.9.29'
|
||||
object sb: TStatusBar
|
||||
Left = 0
|
||||
Height = 20
|
||||
@ -85,7 +85,7 @@ object EasyDockMain: TEasyDockMain
|
||||
end
|
||||
object edDock: TEdit
|
||||
Left = 327
|
||||
Height = 23
|
||||
Height = 21
|
||||
Top = 2
|
||||
Width = 56
|
||||
DragKind = dkDock
|
||||
|
@ -5,7 +5,7 @@ LazarusResources.Add('TEasyDockMain','FORMDATA',[
|
||||
+'op'#2'{'#5'Width'#3#254#1#13'ActiveControl'#7#6'buDump'#7'Caption'#6#12'Eas'
|
||||
+'yDockMain'#12'ClientHeight'#3#29#1#11'ClientWidth'#3#254#1#11'Font.Height'#2
|
||||
+#245#9'Font.Name'#6#13'MS Sans Serif'#8'OnCreate'#7#10'FormCreate'#8'ShowHin'
|
||||
+'t'#9#10'LCLVersion'#6#6'0.9.27'#0#10'TStatusBar'#2'sb'#4'Left'#2#0#6'Height'
|
||||
+'t'#9#10'LCLVersion'#6#6'0.9.29'#0#10'TStatusBar'#2'sb'#4'Left'#2#0#6'Height'
|
||||
+#2#20#3'Top'#3#9#1#5'Width'#3#254#1#6'Panels'#14#0#0#0#8'TToolBar'#8'ToolBar'
|
||||
+'1'#4'Left'#2#0#6'Height'#2#29#3'Top'#2#0#5'Width'#3#254#1#7'Caption'#6#8'To'
|
||||
+'olBar1'#8'TabOrder'#2#1#0#6'TShape'#6'Shape1'#4'Left'#2#1#6'Height'#2#22#4
|
||||
@ -23,16 +23,16 @@ LazarusResources.Add('TEasyDockMain','FORMDATA',[
|
||||
+'Kind'#7#6'dkDock'#8'DragMode'#7#11'dmAutomatic'#11'ParentColor'#8#0#0#7'TBu'
|
||||
+'tton'#6'buDump'#4'Left'#3#155#0#6'Height'#2#22#3'Top'#2#2#5'Width'#2':'#7'C'
|
||||
+'aption'#6#4'Dump'#7'OnClick'#7#11'buDumpClick'#8'TabOrder'#2#0#0#0#5'TEdit'
|
||||
+#6'edDock'#4'Left'#3'G'#1#6'Height'#2#23#3'Top'#2#2#5'Width'#2'8'#8'DragKind'
|
||||
+#6'edDock'#4'Left'#3'G'#1#6'Height'#2#21#3'Top'#2#2#5'Width'#2'8'#8'DragKind'
|
||||
+#7#6'dkDock'#8'TabOrder'#2#1#4'Text'#6#8'Drag Me!'#0#0#7'TButton'#9'buManDoc'
|
||||
+'k'#4'Left'#3''#1#6'Height'#2#22#3'Top'#2#2#5'Width'#2'K'#7'Caption'#6#9'bu'
|
||||
+'ManDock'#7'OnClick'#7#14'buManDockClick'#8'TabOrder'#2#2#0#0#9'TCheckBox'#10
|
||||
+'swCaptions'#4'Left'#2'^'#6'Height'#2#17#4'Hint'#6#16'Show zone names?'#3'To'
|
||||
+'p'#2#2#5'Width'#2'='#7'Caption'#6#8'Captions'#8'OnChange'#7#16'swCaptionsCh'
|
||||
+'ange'#8'TabOrder'#2#3#0#0#7'TButton'#10'buDockEdit'#4'Left'#3'6'#1#6'Height'
|
||||
+#2#22#3'Top'#2#2#5'Width'#2#17#7'Caption'#6#2'->'#11'OnMouseDown'#7#19'buDoc'
|
||||
+'kEditMouseDown'#8'TabOrder'#2#4#0#0#0#6'TPanel'#9'pnlDocker'#4'Left'#2#0#6
|
||||
+'Height'#3#236#0#3'Top'#2#29#5'Width'#3#254#1#5'Align'#7#8'alClient'#7'Capti'
|
||||
+'on'#6#10'Dock here!'#8'TabOrder'#2#2#14'UseDockManager'#8#10'OnDockOver'#7
|
||||
+'k'#4'Left'#3#127#1#6'Height'#2#22#3'Top'#2#2#5'Width'#2'K'#7'Caption'#6#9'b'
|
||||
+'uManDock'#7'OnClick'#7#14'buManDockClick'#8'TabOrder'#2#2#0#0#9'TCheckBox'
|
||||
+#10'swCaptions'#4'Left'#2'^'#6'Height'#2#17#4'Hint'#6#16'Show zone names?'#3
|
||||
+'Top'#2#2#5'Width'#2'='#7'Caption'#6#8'Captions'#8'OnChange'#7#16'swCaptions'
|
||||
+'Change'#8'TabOrder'#2#3#0#0#7'TButton'#10'buDockEdit'#4'Left'#3'6'#1#6'Heig'
|
||||
+'ht'#2#22#3'Top'#2#2#5'Width'#2#17#7'Caption'#6#2'->'#11'OnMouseDown'#7#19'b'
|
||||
+'uDockEditMouseDown'#8'TabOrder'#2#4#0#0#0#6'TPanel'#9'pnlDocker'#4'Left'#2#0
|
||||
+#6'Height'#3#236#0#3'Top'#2#29#5'Width'#3#254#1#5'Align'#7#8'alClient'#7'Cap'
|
||||
+'tion'#6#10'Dock here!'#8'TabOrder'#2#2#14'UseDockManager'#8#10'OnDockOver'#7
|
||||
+#14'DockerDockOver'#0#0#0
|
||||
]);
|
||||
|
@ -36,7 +36,7 @@
|
||||
<PackageName Value="LCL"/>
|
||||
</Item3>
|
||||
</RequiredPackages>
|
||||
<Units Count="3">
|
||||
<Units Count="4">
|
||||
<Unit0>
|
||||
<Filename Value="SiteTest.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -57,6 +57,13 @@
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="fEditBook"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="fclientform.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="ViewWindow"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="fClientForm"/>
|
||||
</Unit3>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
@ -7,13 +7,14 @@ uses
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, EasyDockMgr, fEditorSite, fEditBook;
|
||||
Forms, EasyDockMgr, fEditorSite, fEditBook, fClientForm;
|
||||
|
||||
{$IFDEF WINDOWS}{$R SiteTest.rc}{$ENDIF}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TEditorSite, EditorSite);
|
||||
Application.CreateForm(TViewWindow, ViewWindow);
|
||||
Application.Run;
|
||||
end.
|
||||
|
||||
|
46
examples/dockmanager/elasticsite/fclientform.lfm
Normal file
46
examples/dockmanager/elasticsite/fclientform.lfm
Normal file
@ -0,0 +1,46 @@
|
||||
object ViewWindow: TViewWindow
|
||||
Left = 321
|
||||
Height = 300
|
||||
Top = 332
|
||||
Width = 400
|
||||
Caption = 'ViewWindow'
|
||||
ClientHeight = 300
|
||||
ClientWidth = 400
|
||||
DragKind = dkDock
|
||||
DragMode = dmAutomatic
|
||||
OnEndDock = FormEndDock
|
||||
LCLVersion = '0.9.29'
|
||||
object Label1: TLabel
|
||||
Left = 16
|
||||
Height = 14
|
||||
Top = 8
|
||||
Width = 142
|
||||
AutoSize = False
|
||||
Caption = 'Label1'
|
||||
DragKind = dkDock
|
||||
DragMode = dmAutomatic
|
||||
ParentColor = False
|
||||
end
|
||||
object Image1: TImage
|
||||
Left = 384
|
||||
Height = 16
|
||||
Top = 0
|
||||
Width = 16
|
||||
Anchors = [akTop, akRight]
|
||||
AutoSize = True
|
||||
OnMouseMove = Image1MouseMove
|
||||
Picture.Data = {
|
||||
055449636F6E3E01000000000100010010101000000000002801000016000000
|
||||
2800000010000000200000000100040000000000C00000000000000000000000
|
||||
0000000000000000000000000000800000800000008080008000000080008000
|
||||
8080000080808000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00
|
||||
FFFF0000FFFFFF00000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000990000000000009999990000000000999999000000000999999990
|
||||
0000000999999990000000009999990000000000999999000000000000990000
|
||||
00000000000000007FFF0000BFFF0000DFFF0000EFFF0000F7FF0000FBFF0000
|
||||
FDCF0000FE030000FE010000FE010000FC000000FC000000FE010000FE010000
|
||||
FF030000FFCF0000
|
||||
}
|
||||
end
|
||||
end
|
24
examples/dockmanager/elasticsite/fclientform.lrs
Normal file
24
examples/dockmanager/elasticsite/fclientform.lrs
Normal file
@ -0,0 +1,24 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TViewWindow','FORMDATA',[
|
||||
'TPF0'#11'TViewWindow'#10'ViewWindow'#4'Left'#3'A'#1#6'Height'#3','#1#3'Top'#3
|
||||
+'L'#1#5'Width'#3#144#1#7'Caption'#6#10'ViewWindow'#12'ClientHeight'#3','#1#11
|
||||
+'ClientWidth'#3#144#1#8'DragKind'#7#6'dkDock'#8'DragMode'#7#11'dmAutomatic'#9
|
||||
+'OnEndDock'#7#11'FormEndDock'#10'LCLVersion'#6#6'0.9.29'#0#6'TLabel'#6'Label'
|
||||
+'1'#4'Left'#2#16#6'Height'#2#14#3'Top'#2#8#5'Width'#3#142#0#8'AutoSize'#8#7
|
||||
+'Caption'#6#6'Label1'#8'DragKind'#7#6'dkDock'#8'DragMode'#7#11'dmAutomatic'
|
||||
+#11'ParentColor'#8#0#0#6'TImage'#6'Image1'#4'Left'#3#128#1#6'Height'#2#16#3
|
||||
+'Top'#2#0#5'Width'#2#16#7'Anchors'#11#5'akTop'#7'akRight'#0#8'AutoSize'#9#11
|
||||
+'OnMouseMove'#7#15'Image1MouseMove'#12'Picture.Data'#10'H'#1#0#0#5'TIcon>'#1
|
||||
+#0#0#0#0#1#0#1#0#16#16#16#0#0#0#0#0'('#1#0#0#22#0#0#0'('#0#0#0#16#0#0#0' '#0
|
||||
+#0#0#1#0#4#0#0#0#0#0#192#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
|
||||
+#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0#128#128#128#0
|
||||
+#192#192#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0#255#0#255#255
|
||||
+#0#0#255#255#255#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
|
||||
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#153#0#0#0#0
|
||||
+#0#0#153#153#153#0#0#0#0#0#153#153#153#0#0#0#0#9#153#153#153#144#0#0#0#9#153
|
||||
+#153#153#144#0#0#0#0#153#153#153#0#0#0#0#0#153#153#153#0#0#0#0#0#0#153#0#0#0
|
||||
+#0#0#0#0#0#0#0#127#255#0#0#191#255#0#0#223#255#0#0#239#255#0#0#247#255#0#0
|
||||
+#251#255#0#0#253#207#0#0#254#3#0#0#254#1#0#0#254#1#0#0#252#0#0#0#252#0#0#0
|
||||
+#254#1#0#0#254#1#0#0#255#3#0#0#255#207#0#0#0#0#0
|
||||
]);
|
59
examples/dockmanager/elasticsite/fclientform.pas
Normal file
59
examples/dockmanager/elasticsite/fclientform.pas
Normal file
@ -0,0 +1,59 @@
|
||||
unit fClientForm;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||
StdCtrls, ExtCtrls;
|
||||
|
||||
type
|
||||
TViewWindow = class(TForm)
|
||||
Image1: TImage;
|
||||
Label1: TLabel;
|
||||
procedure FormEndDock(Sender, Target: TObject; X, Y: Integer);
|
||||
procedure Image1MouseMove(Sender: TObject; Shift: TShiftState;
|
||||
X, Y: Integer);
|
||||
private
|
||||
{ private declarations }
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
ViewWindow: TViewWindow;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
LCLProc, fFloatingSite;
|
||||
|
||||
{ TViewWindow }
|
||||
|
||||
procedure TViewWindow.FormEndDock(Sender, Target: TObject; X, Y: Integer);
|
||||
var
|
||||
Site: TFloatingSite;
|
||||
begin
|
||||
if HostDockSite = nil then begin
|
||||
DebugLn('--- floating');
|
||||
Site := TFloatingSite.Create(Application);
|
||||
Site.BoundsRect := self.BoundsRect;
|
||||
ManualDock(Site);
|
||||
end else
|
||||
DebugLn('--- in ' + HostDockSite.Name);
|
||||
end;
|
||||
|
||||
procedure TViewWindow.Image1MouseMove(Sender: TObject; Shift: TShiftState;
|
||||
X, Y: Integer);
|
||||
begin
|
||||
if ssLeft in Shift then begin
|
||||
BeginDrag(False);
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I fclientform.lrs}
|
||||
|
||||
end.
|
||||
|
@ -6,7 +6,11 @@ inherited EditorSite: TEditorSite
|
||||
ClientHeight = 281
|
||||
ClientWidth = 400
|
||||
Menu = MainMenu1
|
||||
OnActivate = FormActivate
|
||||
OnCreate = FormCreate
|
||||
OnDeactivate = FormDeactivate
|
||||
OnHide = FormHide
|
||||
OnResize = FormResize
|
||||
ShowInTaskBar = stAlways
|
||||
inherited pnlLeft: TPanel
|
||||
Height = 256
|
||||
|
@ -3,36 +3,38 @@
|
||||
LazarusResources.Add('TEditorSite','FORMDATA',[
|
||||
'TPF0'#241#11'TEditorSite'#10'EditorSite'#4'Left'#3'b'#1#6'Height'#3','#1#5'W'
|
||||
+'idth'#3#144#1#7'Caption'#6#10'EditorSite'#12'ClientHeight'#3#25#1#11'Client'
|
||||
+'Width'#3#144#1#4'Menu'#7#9'MainMenu1'#8'OnCreate'#7#10'FormCreate'#13'ShowI'
|
||||
+'nTaskBar'#7#8'stAlways'#0#241#6'TPanel'#7'pnlLeft'#6'Height'#3#0#1#0#0#241#9
|
||||
+'TSplitter'#9'splitLeft'#6'Height'#3#0#1#0#0#241#6'TPanel'#8'pnlRight'#4'Lef'
|
||||
+'t'#3#144#1#6'Height'#3#0#1#0#0#241#6'TPanel'#9'pnlBottom'#3'Top'#3#4#1#5'Wi'
|
||||
+'dth'#3#144#1#0#0#241#9'TSplitter'#10'splitRight'#4'Left'#3#140#1#6'Height'#3
|
||||
+#0#1#0#0#241#10'TStatusBar'#10'StatusBar1'#3'Top'#3#5#1#5'Width'#3#144#1#0#0
|
||||
+#241#9'TSplitter'#11'splitBottom'#3'Top'#3#0#1#5'Width'#3#144#1#0#0#242#2#7#9
|
||||
+'TMainMenu'#9'MainMenu1'#4'left'#3#240#0#3'top'#2'0'#0#9'TMenuItem'#6'mnFile'
|
||||
+#7'Caption'#6#5'&File'#0#9'TMenuItem'#6'mnOpen'#7'Caption'#6#5'&Open'#7'OnCl'
|
||||
+'ick'#7#11'mnOpenClick'#0#0#9'TMenuItem'#9'MenuItem1'#7'Caption'#6#1'-'#0#0#9
|
||||
+'TMenuItem'#6'mnExit'#7'Caption'#6#5'E&xit'#7'OnClick'#7#11'mnExitClick'#0#0
|
||||
+#0#9'TMenuItem'#6'mnView'#7'Caption'#6#5'&View'#0#9'TMenuItem'#9'MenuItem2'#7
|
||||
+'Caption'#6#16'Object Inspector'#7'OnClick'#7#13'ViewMenuClick'#0#0#9'TMenuI'
|
||||
+'tem'#9'MenuItem3'#7'Caption'#6#8'Messages'#7'OnClick'#7#13'ViewMenuClick'#0
|
||||
+#0#9'TMenuItem'#9'MenuItem4'#7'Caption'#6#13'Code Explorer'#7'OnClick'#7#13
|
||||
+'ViewMenuClick'#0#0#9'TMenuItem'#9'MenuItem5'#7'Caption'#6#9'ToDo List'#7'On'
|
||||
+'Click'#7#13'ViewMenuClick'#0#0#9'TMenuItem'#9'MenuItem6'#7'Caption'#6#13'De'
|
||||
+'bug windows'#0#9'TMenuItem'#9'MenuItem7'#7'Caption'#6#7'Watches'#7'OnClick'
|
||||
+#7#13'ViewMenuClick'#0#0#9'TMenuItem'#9'MenuItem8'#7'Caption'#6#11'BreakPoin'
|
||||
+'ts'#7'OnClick'#7#13'ViewMenuClick'#0#0#9'TMenuItem'#9'MenuItem9'#7'Caption'
|
||||
+#6#15'Local Variables'#7'OnClick'#7#13'ViewMenuClick'#0#0#9'TMenuItem'#10'Me'
|
||||
+'nuItem10'#7'Caption'#6#9'Registers'#7'OnClick'#7#13'ViewMenuClick'#0#0#9'TM'
|
||||
+'enuItem'#10'MenuItem11'#7'Caption'#6#10'Call Stack'#7'OnClick'#7#13'ViewMen'
|
||||
+'uClick'#0#0#9'TMenuItem'#10'MenuItem12'#7'Caption'#6#9'Assembler'#7'OnClick'
|
||||
+#7#13'ViewMenuClick'#0#0#9'TMenuItem'#10'MenuItem13'#7'Caption'#6#12'Debug O'
|
||||
+'utput'#7'OnClick'#7#13'ViewMenuClick'#0#0#0#0#9'TMenuItem'#10'MenuItem14'#7
|
||||
+'Caption'#6#8'&Windows'#0#9'TMenuItem'#12'mnWindowDump'#7'Caption'#6#5'&Dump'
|
||||
+#7'OnClick'#7#17'mnWindowDumpClick'#0#0#9'TMenuItem'#10'mnMinimize'#7'Captio'
|
||||
+'n'#6#12'Minimize all'#7'OnClick'#7#15'mnMinimizeClick'#0#0#9'TMenuItem'#9'm'
|
||||
+'nRestore'#7'Caption'#6#11'Restore all'#7'OnClick'#7#14'mnRestoreClick'#0#0#0
|
||||
+#0#242#2#8#11'TOpenDialog'#11'OpenDialog1'#6'Filter'#6#25'*.pas|*.pas|All Fi'
|
||||
+'les|*.*'#4'left'#3'5'#1#3'top'#2'0'#0#0#0
|
||||
+'Width'#3#144#1#4'Menu'#7#9'MainMenu1'#10'OnActivate'#7#12'FormActivate'#8'O'
|
||||
+'nCreate'#7#10'FormCreate'#12'OnDeactivate'#7#14'FormDeactivate'#6'OnHide'#7
|
||||
+#8'FormHide'#8'OnResize'#7#10'FormResize'#13'ShowInTaskBar'#7#8'stAlways'#0
|
||||
+#241#6'TPanel'#7'pnlLeft'#6'Height'#3#0#1#0#0#241#9'TSplitter'#9'splitLeft'#6
|
||||
+'Height'#3#0#1#0#0#241#6'TPanel'#8'pnlRight'#4'Left'#3#144#1#6'Height'#3#0#1
|
||||
+#0#0#241#6'TPanel'#9'pnlBottom'#3'Top'#3#4#1#5'Width'#3#144#1#0#0#241#9'TSpl'
|
||||
+'itter'#10'splitRight'#4'Left'#3#140#1#6'Height'#3#0#1#0#0#241#10'TStatusBar'
|
||||
+#10'StatusBar1'#3'Top'#3#5#1#5'Width'#3#144#1#0#0#241#9'TSplitter'#11'splitB'
|
||||
+'ottom'#3'Top'#3#0#1#5'Width'#3#144#1#0#0#242#2#7#9'TMainMenu'#9'MainMenu1'#4
|
||||
+'left'#3#240#0#3'top'#2'0'#0#9'TMenuItem'#6'mnFile'#7'Caption'#6#5'&File'#0#9
|
||||
+'TMenuItem'#6'mnOpen'#7'Caption'#6#5'&Open'#7'OnClick'#7#11'mnOpenClick'#0#0
|
||||
+#9'TMenuItem'#9'MenuItem1'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#6'mnExit'#7'Ca'
|
||||
+'ption'#6#5'E&xit'#7'OnClick'#7#11'mnExitClick'#0#0#0#9'TMenuItem'#6'mnView'
|
||||
+#7'Caption'#6#5'&View'#0#9'TMenuItem'#9'MenuItem2'#7'Caption'#6#16'Object In'
|
||||
+'spector'#7'OnClick'#7#13'ViewMenuClick'#0#0#9'TMenuItem'#9'MenuItem3'#7'Cap'
|
||||
+'tion'#6#8'Messages'#7'OnClick'#7#13'ViewMenuClick'#0#0#9'TMenuItem'#9'MenuI'
|
||||
+'tem4'#7'Caption'#6#13'Code Explorer'#7'OnClick'#7#13'ViewMenuClick'#0#0#9'T'
|
||||
+'MenuItem'#9'MenuItem5'#7'Caption'#6#9'ToDo List'#7'OnClick'#7#13'ViewMenuCl'
|
||||
+'ick'#0#0#9'TMenuItem'#9'MenuItem6'#7'Caption'#6#13'Debug windows'#0#9'TMenu'
|
||||
+'Item'#9'MenuItem7'#7'Caption'#6#7'Watches'#7'OnClick'#7#13'ViewMenuClick'#0
|
||||
+#0#9'TMenuItem'#9'MenuItem8'#7'Caption'#6#11'BreakPoints'#7'OnClick'#7#13'Vi'
|
||||
+'ewMenuClick'#0#0#9'TMenuItem'#9'MenuItem9'#7'Caption'#6#15'Local Variables'
|
||||
+#7'OnClick'#7#13'ViewMenuClick'#0#0#9'TMenuItem'#10'MenuItem10'#7'Caption'#6
|
||||
+#9'Registers'#7'OnClick'#7#13'ViewMenuClick'#0#0#9'TMenuItem'#10'MenuItem11'
|
||||
+#7'Caption'#6#10'Call Stack'#7'OnClick'#7#13'ViewMenuClick'#0#0#9'TMenuItem'
|
||||
+#10'MenuItem12'#7'Caption'#6#9'Assembler'#7'OnClick'#7#13'ViewMenuClick'#0#0
|
||||
+#9'TMenuItem'#10'MenuItem13'#7'Caption'#6#12'Debug Output'#7'OnClick'#7#13'V'
|
||||
+'iewMenuClick'#0#0#0#0#9'TMenuItem'#10'MenuItem14'#7'Caption'#6#8'&Windows'#0
|
||||
+#9'TMenuItem'#12'mnWindowDump'#7'Caption'#6#5'&Dump'#7'OnClick'#7#17'mnWindo'
|
||||
+'wDumpClick'#0#0#9'TMenuItem'#10'mnMinimize'#7'Caption'#6#12'Minimize all'#7
|
||||
+'OnClick'#7#15'mnMinimizeClick'#0#0#9'TMenuItem'#9'mnRestore'#7'Caption'#6#11
|
||||
+'Restore all'#7'OnClick'#7#14'mnRestoreClick'#0#0#0#0#242#2#8#11'TOpenDialog'
|
||||
+#11'OpenDialog1'#6'Filter'#6#25'*.pas|*.pas|All Files|*.*'#4'left'#3'5'#1#3
|
||||
+'top'#2'0'#0#0#0
|
||||
]);
|
||||
|
@ -26,6 +26,7 @@ Known bugs:
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
{$DEFINE clientform} //clients are forms?
|
||||
{.$DEFINE stdfloat} //using standard floating host?
|
||||
|
||||
interface
|
||||
@ -60,7 +61,11 @@ type
|
||||
mnExit: TMenuItem;
|
||||
mnOpen: TMenuItem;
|
||||
mnFile: TMenuItem;
|
||||
procedure FormActivate(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDeactivate(Sender: TObject);
|
||||
procedure FormHide(Sender: TObject);
|
||||
procedure FormResize(Sender: TObject);
|
||||
procedure mnMinimizeClick(Sender: TObject);
|
||||
procedure mnRestoreClick(Sender: TObject);
|
||||
procedure mnWindowDumpClick(Sender: TObject);
|
||||
@ -71,7 +76,7 @@ type
|
||||
FEdit: TEditBook; //to become a frame!
|
||||
CurEdit: TEditPage;
|
||||
public
|
||||
function CreateDockable(const cap: string): TPanel;
|
||||
function CreateDockable(const cap: string): TWinControl;
|
||||
function OpenFile(const FileName: string): TObject;
|
||||
end;
|
||||
|
||||
@ -82,6 +87,7 @@ implementation
|
||||
|
||||
uses
|
||||
LCLProc,
|
||||
fClientForm,
|
||||
fFloatingSite;
|
||||
|
||||
{ TEditorSite }
|
||||
@ -100,15 +106,26 @@ begin
|
||||
FAutoExpand := True;
|
||||
end;
|
||||
|
||||
function TEditorSite.CreateDockable(const cap: string): TPanel;
|
||||
function TEditorSite.CreateDockable(const cap: string): TWinControl;
|
||||
var
|
||||
Site: TFloatingSite;
|
||||
Client: TPanel;
|
||||
{$IFDEF clientform}
|
||||
Client: TViewWindow;
|
||||
{$ELSE}
|
||||
Client: TWinControl;
|
||||
{$ENDIF}
|
||||
begin
|
||||
{$IFDEF clientform}
|
||||
Client := TViewWindow.Create(Application);
|
||||
Client.Label1.Caption := cap;
|
||||
Client.Visible := True;
|
||||
//Client.FloatingDockSiteClass := TFloatingSite;
|
||||
{$ELSE}
|
||||
Client := TPanel.Create(self);
|
||||
Client.DragMode := dmAutomatic;
|
||||
Client.DragKind := dkDock;
|
||||
Client.Visible := True;
|
||||
{$ENDIF}
|
||||
//name it
|
||||
Client.Caption := cap;
|
||||
try
|
||||
@ -119,7 +136,7 @@ begin
|
||||
{$IFDEF stdfloat}
|
||||
Client.ManualDock(nil);
|
||||
{$ELSE}
|
||||
Client.FloatingDockSiteClass := TFloatingSite;
|
||||
//Client.FloatingDockSiteClass := TFloatingSite;
|
||||
{$IFDEF old}
|
||||
//ManualFloat doesn't work as expected :-(
|
||||
//Client.Align := alClient; //required for proper docking
|
||||
@ -146,9 +163,40 @@ begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TEditorSite.mnMinimizeClick(Sender: TObject);
|
||||
procedure TEditorSite.FormActivate(Sender: TObject);
|
||||
begin
|
||||
self.WindowState := wsMinimized;
|
||||
//DebugLn('--- Activate');
|
||||
end;
|
||||
|
||||
procedure TEditorSite.FormDeactivate(Sender: TObject);
|
||||
begin
|
||||
//DebugLn('--- Deactivate');
|
||||
end;
|
||||
|
||||
procedure TEditorSite.FormHide(Sender: TObject);
|
||||
begin
|
||||
DebugLn('--- FormHide'); //not when minimized manually (win32)
|
||||
//mnMinimizeClick(Sender);
|
||||
end;
|
||||
|
||||
procedure TEditorSite.FormResize(Sender: TObject);
|
||||
begin
|
||||
DebugLn('--- Resize');
|
||||
end;
|
||||
|
||||
procedure TEditorSite.mnMinimizeClick(Sender: TObject);
|
||||
var
|
||||
i: integer;
|
||||
f: TForm;
|
||||
begin
|
||||
for i := 0 to Screen.FormCount - 1 do begin
|
||||
f := Screen.Forms[i];
|
||||
//if f = self then f.WindowState := wsMinimized else
|
||||
if f.Visible and (f.WindowState = wsNormal) then begin
|
||||
f.Hide;
|
||||
f.WindowState := wsMinimized;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TEditorSite.mnRestoreClick(Sender: TObject);
|
||||
|
@ -1,8 +1,8 @@
|
||||
object FloatingSite: TFloatingSite
|
||||
Left = 431
|
||||
Height = 300
|
||||
Height = 265
|
||||
Top = 498
|
||||
Width = 400
|
||||
Width = 377
|
||||
Caption = 'FloatingSite'
|
||||
DockSite = True
|
||||
OnDockDrop = FormDockDrop
|
||||
|
@ -1,8 +1,8 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TFloatingSite','FORMDATA',[
|
||||
'TPF0'#13'TFloatingSite'#12'FloatingSite'#4'Left'#3#175#1#6'Height'#3','#1#3
|
||||
+'Top'#3#242#1#5'Width'#3#144#1#7'Caption'#6#12'FloatingSite'#8'DockSite'#9#10
|
||||
'TPF0'#13'TFloatingSite'#12'FloatingSite'#4'Left'#3#175#1#6'Height'#3#9#1#3'T'
|
||||
+'op'#3#242#1#5'Width'#3'y'#1#7'Caption'#6#12'FloatingSite'#8'DockSite'#9#10
|
||||
+'OnDockDrop'#7#12'FormDockDrop'#10'OnDockOver'#7#12'FormDockOver'#8'OnUnDock'
|
||||
+#7#10'FormUnDock'#13'ShowInTaskBar'#7#7'stNever'#14'UseDockManager'#9#10'LCL'
|
||||
+'Version'#6#6'0.9.29'#7'Visible'#9#0#0
|
||||
|
@ -83,7 +83,7 @@ When a second control is dragged away, the entire site is moved.
|
||||
if DockClientCount <= 1 then begin
|
||||
if NewTarget = nil then begin
|
||||
Allow := False; //deny
|
||||
//Allow := True; //move form?
|
||||
//Allow := True; //move form - where???
|
||||
end else
|
||||
Release;
|
||||
end else begin
|
||||
@ -91,8 +91,8 @@ When a second control is dragged away, the entire site is moved.
|
||||
(* strange behaviour: client is undocked, but stays in the site.
|
||||
The site is moved to the drop location.
|
||||
*)
|
||||
Allow := NewTarget <> nil; //simply disallow undock to floating state (for now)
|
||||
//Allow := True; //bug!!!
|
||||
//Allow := NewTarget <> nil; //simply disallow undock to floating state (for now)
|
||||
Allow := True; //bug!!!
|
||||
//DragManager. - not helpful - where is the DockObject???
|
||||
end;
|
||||
if Allow then begin
|
||||
|
BIN
examples/dockmanager/package/pen.ico
Normal file
BIN
examples/dockmanager/package/pen.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 318 B |
Loading…
Reference in New Issue
Block a user