Changeset 6 for DockManagement/Demo
- Timestamp:
- Dec 9, 2011, 7:22:16 AM (13 years ago)
- Location:
- DockManagement/Demo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
DockManagement/Demo/UMainForm.dfm
r5 r6 3 3 Top = 0 4 4 Caption = 'DockManagement demo' 5 ClientHeight = 2026 ClientWidth = 3985 ClientHeight = 372 6 ClientWidth = 540 7 7 Color = clBtnFace 8 8 Font.Charset = DEFAULT_CHARSET -
DockManagement/Demo/UMainForm.pas
r5 r6 4 4 5 5 uses 6 Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,7 Vcl. Controls, Vcl.Forms, Vcl.Dialogs, UDockForm, Vcl.Menus, UDockManagement;6 Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, 7 Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, UDockForm, Vcl.Menus, UDockManagement, Generics.Collections; 8 8 9 9 type … … 18 18 private 19 19 RegistryKey: string; 20 function NewDockForm: TDockForm; 20 21 public 22 Forms: TObjectList<TForm>; 21 23 FormCounter: Integer; 22 24 BaseDockPanel: TDBaseDockPanel; … … 38 40 procedure TMainForm.FormCreate(Sender: TObject); 39 41 begin 42 Forms := TObjectList<TForm>.Create; 40 43 CustomDockManager := TDDockManager.Create(Self); 41 44 CustomDockManager.RegistryKey := RegistryKey; … … 54 57 BaseDockPanel.Free; 55 58 CustomDockManager.Free; 59 Forms.Free; 56 60 end; 57 61 58 62 procedure TMainForm.FormShow(Sender: TObject); 63 var 64 I: Integer; 59 65 begin 60 66 // Init dock init list … … 68 74 end; 69 75 //CustomDockManager.LoadFromRegistry 76 for I := 0 to 5 do begin 77 Forms.Add(NewDockForm); 78 end; 79 end; 80 81 function TMainForm.NewDockForm: TDockForm; 82 begin 83 Inc(FormCounter); 84 Result := TDockForm.Create(MainForm); 85 Result.Memo1.Text := 'Form ' + IntToStr(FormCounter); 86 Result.Memo1.Align := alClient; 87 Result.Caption := 'Form ' + IntToStr(FormCounter); 88 Result.Show; 89 CustomDockManager.RegisterDockForm(Result, 200, 200, Result.Name, True); 70 90 end; 71 91 72 92 procedure TMainForm.Newform1Click(Sender: TObject); 73 var74 NewForm: TDockForm;75 93 begin 76 Inc(FormCounter); 77 NewForm := TDockForm.Create(MainForm); 78 NewForm.Caption := 'Form ' + IntToStr(FormCounter); 79 NewForm.Show; 80 CustomDockManager.RegisterDockForm(NewForm, 200, 200, NewForm.Name, True); 94 Forms.Add(NewDockForm); 81 95 end; 82 96
Note:
See TracChangeset
for help on using the changeset viewer.