1 | unit UMainForm;
|
---|
2 |
|
---|
3 | {$mode Delphi}{$H+}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
---|
9 | ComCtrls, ExtCtrls, Buttons, Menus, UCDMaster, UCDCustomize, UCDClient,
|
---|
10 | UDockForm, UComponentTree, UCDWindowList, UCDConjoinForm, UCDManager,
|
---|
11 | UCDCommon;
|
---|
12 |
|
---|
13 | type
|
---|
14 |
|
---|
15 | { TMainForm }
|
---|
16 |
|
---|
17 | TMainForm = class(TForm)
|
---|
18 | Button1: TButton;
|
---|
19 | Button2: TButton;
|
---|
20 | CoolDockClient1: TCDClient;
|
---|
21 | CoolDockCustomize1: TCDCustomize;
|
---|
22 | CoolDockMaster1: TCDMaster;
|
---|
23 | CoolDockWindowList1: TCDWindowList;
|
---|
24 | MainMenu1: TMainMenu;
|
---|
25 | MenuItem1: TMenuItem;
|
---|
26 | MenuItem2: TMenuItem;
|
---|
27 | MenuItem3: TMenuItem;
|
---|
28 | MenuItem4: TMenuItem;
|
---|
29 | PageControl1: TPageControl;
|
---|
30 | Panel1: TPanel;
|
---|
31 | TabControl1: TTabControl;
|
---|
32 | TabSheet1: TTabSheet;
|
---|
33 | TabSheet2: TTabSheet;
|
---|
34 | TabSheet3: TTabSheet;
|
---|
35 | TabSheet4: TTabSheet;
|
---|
36 | procedure Button1Click(Sender: TObject);
|
---|
37 | procedure Button2Click(Sender: TObject);
|
---|
38 | procedure FormCreate(Sender: TObject);
|
---|
39 | procedure FormDestroy(Sender: TObject);
|
---|
40 | procedure FormShow(Sender: TObject);
|
---|
41 | procedure MenuItem2Click(Sender: TObject);
|
---|
42 | procedure MenuItem4Click(Sender: TObject);
|
---|
43 | procedure PageControl1Change(Sender: TObject);
|
---|
44 | private
|
---|
45 | public
|
---|
46 | FormIndex: Integer;
|
---|
47 | DockForms: TList;
|
---|
48 | function NewDockForm: TDockForm;
|
---|
49 | end;
|
---|
50 |
|
---|
51 | var
|
---|
52 | MainForm: TMainForm;
|
---|
53 |
|
---|
54 | implementation
|
---|
55 |
|
---|
56 | {$R *.lfm}
|
---|
57 |
|
---|
58 | { TMainForm }
|
---|
59 |
|
---|
60 | procedure TMainForm.FormCreate(Sender: TObject);
|
---|
61 | begin
|
---|
62 | DockForms := TList.Create;
|
---|
63 | end;
|
---|
64 |
|
---|
65 | procedure TMainForm.FormDestroy(Sender: TObject);
|
---|
66 | begin
|
---|
67 | DockForms.Free;
|
---|
68 | end;
|
---|
69 |
|
---|
70 | procedure TMainForm.FormShow(Sender: TObject);
|
---|
71 | var
|
---|
72 | ConjoinedDockForm1: TCDConjoinForm;
|
---|
73 | ConjoinedDockForm2: TCDConjoinForm;
|
---|
74 | begin
|
---|
75 | NewDockForm.ManualDock(Panel1);
|
---|
76 | NewDockForm.ManualDock(Panel1);
|
---|
77 | (* ConjoinedDockForm1 := TCDManager(Panel1.DockManager).CreateConjoinForm;
|
---|
78 | ConjoinedDockForm1.Name := 'Model';;
|
---|
79 | ConjoinedDockForm1.Show;
|
---|
80 | //TCoolDockManager(ConjoinedDockForm1.Panel.DockManager).TabsPos := hpLeft;
|
---|
81 | ConjoinedDockForm1.ManualDock(Panel1);
|
---|
82 | //TCDManager(ConjoinedDockForm1.DockManager).DockStyle := dsTabs;
|
---|
83 | NewDockForm.ManualDock(ConjoinedDockForm1);
|
---|
84 | NewDockForm.ManualDock(ConjoinedDockForm1);
|
---|
85 | //NewDockForm.ManualDock(ConjoinedDockForm1);
|
---|
86 | //NewDockForm.ManualDock(TForm(DockForms[0]));
|
---|
87 | //NewDockForm.ManualDock(TForm(DockForms[0]));
|
---|
88 | //NewDockForm.ManualDock(TForm(DockForms[0]));
|
---|
89 | //TCustomDockManager(TDockForm(DockForms[0]).DockManager).DockStyle := dsTabs; *)
|
---|
90 | end;
|
---|
91 |
|
---|
92 | procedure TMainForm.MenuItem2Click(Sender: TObject);
|
---|
93 | begin
|
---|
94 | CoolDockCustomize1.Execute;
|
---|
95 | end;
|
---|
96 |
|
---|
97 | procedure TMainForm.MenuItem4Click(Sender: TObject);
|
---|
98 | begin
|
---|
99 | CoolDockWindowList1.Execute;
|
---|
100 | end;
|
---|
101 |
|
---|
102 | procedure TMainForm.PageControl1Change(Sender: TObject);
|
---|
103 | begin
|
---|
104 |
|
---|
105 | end;
|
---|
106 |
|
---|
107 | function TMainForm.NewDockForm: TDockForm;
|
---|
108 | begin
|
---|
109 | Application.CreateForm(TDockForm, Result);
|
---|
110 | // Result := TDockForm.Create(Self);
|
---|
111 | Result.Name := 'Form' + IntToStr(FormIndex);
|
---|
112 | Result.CoolDockClient1.Name := 'CoolDockClient' + IntToStr(FormIndex);
|
---|
113 | Result.Caption := Result.Name;
|
---|
114 | Result.Memo1.Text := Result.Name;
|
---|
115 | //Result.DragKind := dkDock;
|
---|
116 | //Result.DragMode := dmAutomatic;
|
---|
117 | //Result.DockSite := True;
|
---|
118 | //Result.UseDockManager := True;
|
---|
119 | Inc(FormIndex);
|
---|
120 | Result.Show;
|
---|
121 | DockForms.Add(Result);
|
---|
122 | end;
|
---|
123 |
|
---|
124 | procedure TMainForm.Button1Click(Sender: TObject);
|
---|
125 | begin
|
---|
126 | NewDockForm;
|
---|
127 | end;
|
---|
128 |
|
---|
129 | procedure TMainForm.Button2Click(Sender: TObject);
|
---|
130 | begin
|
---|
131 | ComponentTree.Show;
|
---|
132 | end;
|
---|
133 |
|
---|
134 | end.
|
---|
135 |
|
---|