Changeset 179 for Docking/CoolDocking/Demo/IDE/UMainForm.pas
- Timestamp:
- Mar 8, 2011, 12:58:28 PM (14 years ago)
- Location:
- Docking/CoolDocking/Demo/IDE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/Demo/IDE
- Property svn:ignore
-
old new 1 1 IDE.exe 2 2 lib 3 Layout.xml
-
- Property svn:ignore
-
Docking/CoolDocking/Demo/IDE/UMainForm.pas
r178 r179 12 12 UWatchListForm, UThreadStatusForm, USourceEditorForm; 13 13 14 const 15 DockLayoutFileName = 'Layout.xml'; 16 14 17 type 15 18 … … 18 21 TMainForm = class(TForm) 19 22 published 23 AExit: TAction; 20 24 ANewFile: TAction; 21 25 ACustomizeDocking: TAction; … … 53 57 MenuItem22: TMenuItem; 54 58 MenuItem23: TMenuItem; 59 MenuItem24: TMenuItem; 55 60 MenuItem9: TMenuItem; 56 61 MenuItem8: TMenuItem; … … 69 74 procedure ACustomizeDockingExecute(Sender: TObject); 70 75 procedure ADesktopSaveExecute(Sender: TObject); 76 procedure AExitExecute(Sender: TObject); 71 77 procedure ANewFileExecute(Sender: TObject); 72 78 procedure AViewThreadStatusExecute(Sender: TObject); … … 81 87 procedure AViewWatchListExecute(Sender: TObject); 82 88 procedure AViewWindowListExecute(Sender: TObject); 89 procedure ComboBox1Select(Sender: TObject); 90 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 91 procedure FormShow(Sender: TObject); 83 92 public 84 { public declarations } 85 end; 93 end; 86 94 87 95 var … … 109 117 end; 110 118 119 procedure TMainForm.ComboBox1Select(Sender: TObject); 120 begin 121 if ComboBox1.ItemIndex <> - 1 then 122 TCoolDockLayout(CoolDockLayoutList1.Items[ComboBox1.ItemIndex]).Restore; 123 end; 124 125 procedure TMainForm.FormClose(Sender: TObject; var CloseAction: TCloseAction); 126 begin 127 CoolDockLayoutList1.SaveToFile(DockLayoutFileName); 128 end; 129 130 procedure TMainForm.FormShow(Sender: TObject); 131 begin 132 with CoolDockLayoutList1 do begin 133 if FileExistsUTF8(DockLayoutFileName) then 134 LoadFromFile(DockLayoutFileName); 135 PopulateStringList(ComboBox1.Items); 136 end; 137 end; 138 111 139 procedure TMainForm.AViewProjectManagerExecute(Sender: TObject); 112 140 begin … … 140 168 141 169 procedure TMainForm.ADesktopSaveExecute(Sender: TObject); 142 begin 143 170 var 171 NewLayout: TCoolDockLayout; 172 begin 173 if ComboBox1.Items.IndexOf(ComboBox1.Text) = -1 then begin 174 NewLayout := TCoolDockLayout.Create; 175 NewLayout.Name := ComboBox1.Text; 176 NewLayout.Store; 177 CoolDockLayoutList1.Items.Add(NewLayout); 178 end else 179 TCoolDockLayout(CoolDockLayoutList1.Items[ComboBox1.ItemIndex]).Store; 180 CoolDockLayoutList1.PopulateStringList(ComboBox1.Items); 181 end; 182 183 procedure TMainForm.AExitExecute(Sender: TObject); 184 begin 185 Close; 144 186 end; 145 187
Note:
See TracChangeset
for help on using the changeset viewer.