source: trunk/Packages/CoolDocking/Demo/Testing/UMainForm.pas

Last change on this file was 73, checked in by chronos, 12 years ago
  • Modified: Packages are now stored as uncomporessed and are linked with relative path to project.
File size: 3.5 KB
Line 
1unit UMainForm;
2
3{$mode Delphi}{$H+}
4
5interface
6
7uses
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
13type
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
51var
52 MainForm: TMainForm;
53
54implementation
55
56{$R *.lfm}
57
58{ TMainForm }
59
60procedure TMainForm.FormCreate(Sender: TObject);
61begin
62 DockForms := TList.Create;
63end;
64
65procedure TMainForm.FormDestroy(Sender: TObject);
66begin
67 DockForms.Free;
68end;
69
70procedure TMainForm.FormShow(Sender: TObject);
71var
72 ConjoinedDockForm1: TCDConjoinForm;
73 ConjoinedDockForm2: TCDConjoinForm;
74begin
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; *)
90end;
91
92procedure TMainForm.MenuItem2Click(Sender: TObject);
93begin
94 CoolDockCustomize1.Execute;
95end;
96
97procedure TMainForm.MenuItem4Click(Sender: TObject);
98begin
99 CoolDockWindowList1.Execute;
100end;
101
102procedure TMainForm.PageControl1Change(Sender: TObject);
103begin
104
105end;
106
107function TMainForm.NewDockForm: TDockForm;
108begin
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);
122end;
123
124procedure TMainForm.Button1Click(Sender: TObject);
125begin
126 NewDockForm;
127end;
128
129procedure TMainForm.Button2Click(Sender: TObject);
130begin
131 ComponentTree.Show;
132end;
133
134end.
135
Note: See TracBrowser for help on using the repository browser.