Ignore:
Timestamp:
Mar 9, 2011, 2:11:40 PM (14 years ago)
Author:
george
Message:
  • Added: Default layout initialization in Demo IDE.
  • Fixed: Tab position switching through popup menu.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/Demo/IDE/UMainForm.pas

    r181 r182  
    9595    procedure FormShow(Sender: TObject);
    9696  public
     97    procedure InitDefaultDockLayout;
    9798  end;
    9899
     
    137138    if FileExistsUTF8(DockLayoutFileName) then
    138139      LoadFromFile(DockLayoutFileName);
     140    InitDefaultDockLayout;
    139141    PopulateStringList(ComboBox1.Items);
     142  end;
     143end;
     144
     145procedure TMainForm.InitDefaultDockLayout;
     146const
     147  DefaultLayoutName = 'Default Layout';
     148var
     149  NewContainer1: TCoolDockConjoinForm;
     150  NewContainer2: TCoolDockConjoinForm;
     151  DefaultLayout: TCoolDockLayout;
     152begin
     153  DefaultLayout := CoolDockLayoutList1.FindByName(DefaultLayoutName);
     154  if not Assigned(DefaultLayout) then begin
     155    NewContainer1 := TCoolDockConjoinForm.Create(nil);
     156    NewContainer1.Show;
     157
     158    StructureForm.ManualDock(NewContainer1.Panel, nil, alTop);
     159    StructureForm.Show;
     160    ObjectInspectorForm.ManualDock(NewContainer1.Panel, nil, alTop);
     161    ObjectInspectorForm.Show;
     162
     163    NewContainer2 := TCoolDockConjoinForm.Create(nil);
     164    NewContainer2.Show;
     165    ProjectManagerForm.ManualDock(NewContainer2.Panel, nil, alTop);
     166    ProjectManagerForm.Show;
     167    ToolPaletteForm.ManualDock(NewContainer2.Panel, nil, alTop);
     168    ToolPaletteForm.Show;
     169
     170    NewContainer1.ManualDock(Panel1);
     171    SourceEditorForm.ManualDock(Panel1);
     172    SourceEditorForm.Show;
     173    NewContainer2.ManualDock(Panel1);
     174
     175    DefaultLayout := TCoolDockLayout.Create;
     176    DefaultLayout.Name := DefaultLayoutName;
     177    CoolDockLayoutList1.Items.Add(DefaultLayout);
     178    DefaultLayout.Store;
    140179  end;
    141180end;
Note: See TracChangeset for help on using the changeset viewer.