Changeset 185 for Docking/CoolDocking/Demo/IDE/UMainForm.pas
- Timestamp:
- Mar 10, 2011, 11:20:08 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/Demo/IDE/UMainForm.pas
r184 r185 127 127 procedure TMainForm.ComboBox1Select(Sender: TObject); 128 128 begin 129 if ComboBox1.ItemIndex <> - 1then129 if (ComboBox1.ItemIndex <> - 1) and (ComboBox1.ItemIndex < CoolDockLayoutList1.Items.Count) then 130 130 TCoolDockLayout(CoolDockLayoutList1.Items[ComboBox1.ItemIndex]).Restore; 131 131 end; … … 217 217 NewLayout: TCoolDockLayout; 218 218 begin 219 if ComboBox1.Items.IndexOf(ComboBox1.Text) = -1 then begin 220 NewLayout := TCoolDockLayout.Create; 221 NewLayout.Name := ComboBox1.Text; 222 NewLayout.Store; 223 CoolDockLayoutList1.Items.Add(NewLayout); 224 end else 225 TCoolDockLayout(CoolDockLayoutList1.Items[ComboBox1.Items.IndexOf(ComboBox1.Text)]).Store; 226 CoolDockLayoutList1.SaveToFile(DockLayoutFileName); 227 CoolDockLayoutList1.PopulateStringList(ComboBox1.Items); 219 if ComboBox1.Text <> '' then begin 220 if ComboBox1.Items.IndexOf(ComboBox1.Text) = -1 then begin 221 NewLayout := TCoolDockLayout.Create; 222 NewLayout.Name := ComboBox1.Text; 223 NewLayout.Store; 224 CoolDockLayoutList1.Items.Add(NewLayout); 225 end else 226 TCoolDockLayout(CoolDockLayoutList1.Items[ComboBox1.Items.IndexOf(ComboBox1.Text)]).Store; 227 CoolDockLayoutList1.SaveToFile(DockLayoutFileName); 228 CoolDockLayoutList1.PopulateStringList(ComboBox1.Items); 229 end else ShowMessage('Enter layout name'); 228 230 end; 229 231
Note:
See TracChangeset
for help on using the changeset viewer.