Changeset 36 for trunk/Forms
- Timestamp:
- Mar 8, 2012, 7:51:16 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 5 5 chronis.exe 6 6 DebugLog.txt 7 chronis.lps
-
- Property svn:ignore
-
trunk/Forms/UItemList.pas
r32 r36 87 87 NewItemViewForm.SelectedItemId := Integer(ListView1.Selected.Data); 88 88 NewItemViewForm.Caption := NewItemViewForm.Caption + ' ' + SelectedObject.Name; 89 MainForm. AddTabForm(NewItemViewForm);89 MainForm.SetMainPanelForm(NewItemViewForm); 90 90 end; 91 91 end; … … 120 120 NewItemEditForm.SelectedItemId := Integer(ListView1.Selected.Data); 121 121 NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name; 122 MainForm. AddTabForm(NewItemEditForm);122 MainForm.SetMainPanelForm(NewItemEditForm); 123 123 end; 124 124 end; … … 132 132 NewItemAddForm.SelectedItemId := Integer(ListView1.Selected.Data); 133 133 NewItemAddForm.Caption := NewItemAddForm.Caption + ' ' + SelectedObject.Name; 134 MainForm. AddTabForm(NewItemAddForm);134 MainForm.SetMainPanelForm(NewItemAddForm); 135 135 end; 136 136 -
trunk/Forms/UItemView.pas
r32 r36 111 111 NewItemEditForm.SelectedItemId := SelectedItemId; 112 112 NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name; 113 MainForm. AddTabForm(NewItemEditForm);113 MainForm.SetMainPanelForm(NewItemEditForm); 114 114 end; 115 115 -
trunk/Forms/UMainForm.lfm
r31 r36 4 4 Top = 126 5 5 Width = 640 6 ActiveControl = Panel 16 ActiveControl = PanelMenu 7 7 Caption = 'ChronIS' 8 8 ClientHeight = 427 … … 151 151 OnShow = FormShow 152 152 LCLVersion = '0.9.31' 153 object Panel 1: TPanel153 object PanelMenu: TPanel 154 154 Left = 0 155 Height = 4 27155 Height = 407 156 156 Top = 0 157 157 Width = 184 158 158 Align = alLeft 159 159 BevelOuter = bvNone 160 ClientHeight = 4 27160 ClientHeight = 407 161 161 ClientWidth = 184 162 162 TabOrder = 0 … … 171 171 object TreeView1: TTreeView 172 172 Left = 4 173 Height = 403173 Height = 383 174 174 Top = 19 175 175 Width = 180 … … 184 184 end 185 185 end 186 object Panel 2: TPanel186 object PanelData: TPanel 187 187 Left = 189 188 Height = 4 27188 Height = 407 189 189 Top = 0 190 190 Width = 451 191 191 Align = alClient 192 192 BevelOuter = bvNone 193 ClientHeight = 427194 ClientWidth = 451195 193 TabOrder = 1 196 object PageControl1: TPageControl197 Left = 0198 Height = 427199 Top = 0200 Width = 451201 Align = alClient202 TabOrder = 0203 end204 194 end 205 195 object Splitter1: TSplitter 206 196 Left = 184 207 Height = 4 27197 Height = 407 208 198 Top = 0 209 199 Width = 5 200 end 201 object StatusBar1: TStatusBar 202 Left = 0 203 Height = 20 204 Top = 407 205 Width = 640 206 Panels = < 207 item 208 Width = 150 209 end 210 item 211 Width = 150 212 end 213 item 214 Width = 150 215 end> 216 SimplePanel = False 210 217 end 211 218 object ActionListItem: TActionList -
trunk/Forms/UMainForm.pas
r35 r36 9 9 StdCtrls, ActnList, Menus, ExtCtrls, USqlDatabase, DOM, XMLRead, XMLWrite, 10 10 UPersistentForm, UTreeState, SpecializedList, SpecializedDictionary, 11 URegistry, USystem ;11 URegistry, USystem, UItemList; 12 12 13 13 type … … 54 54 MenuItem8: TMenuItem; 55 55 MenuItem9: TMenuItem; 56 PageControl1: TPageControl; 57 Panel1: TPanel; 58 Panel2: TPanel; 56 PanelMenu: TPanel; 57 PanelData: TPanel; 59 58 PopupMenuObjectGroup: TPopupMenu; 60 59 PopupMenuObject: TPopupMenu; 61 60 PopupMenuItem: TPopupMenu; 62 61 Splitter1: TSplitter; 62 StatusBar1: TStatusBar; 63 63 TreeView1: TTreeView; 64 64 procedure AAboutExecute(Sender: TObject); … … 87 87 procedure SaveToRegistry; 88 88 public 89 MainPanelForm: TForm; 89 90 PersistentForm: TPersistentForm; 90 91 TreeState: TTreeState; 91 92 Report: TReport; 92 TabForms: TListObject; // TListObject<TForm>93 93 procedure UpdateInterface; 94 94 procedure LoadTree; 95 procedure AddTabForm(Form: TForm);95 procedure SetMainPanelForm(Form: TForm); 96 96 end; 97 97 … … 112 112 UItemView, UItemEdit, UItemAdd, ULoginForm, USettingForm, UApplicationInfo, 113 113 UCore, UImportStructureForm, UAboutForm, ULoginProfileForm, UChronisClientDirect, 114 U ItemList, UChronisClient;114 UChronisClient; 115 115 116 116 {$R *.lfm} … … 124 124 RootKey := Core.RegistryRootKey; 125 125 OpenKey(Core.RegistryKey, True); 126 Panel 1.Width := ReadIntegerWithDefault('GroupTreeWidth', 200);126 PanelMenu.Width := ReadIntegerWithDefault('GroupTreeWidth', 200); 127 127 with Core.CoolTranslator1 do 128 128 Language := Languages.SearchByCode(ReadStringWithDefault('LanguageCode', '')); … … 138 138 RootKey := Core.RegistryRootKey; 139 139 OpenKey(Core.RegistryKey, True); 140 WriteInteger('GroupTreeWidth', Panel 1.Width);140 WriteInteger('GroupTreeWidth', PanelMenu.Width); 141 141 with Core.CoolTranslator1 do 142 142 WriteString('LanguageCode', Language.Code); … … 151 151 AConnect.Enabled := not Core.System.Database.Connected; 152 152 AImportStructure.Enabled := Core.System.Database.Connected; 153 if Assigned(MainPanelForm) then 154 Caption := MainPanelForm.Caption + ' - ' + ApplicationInfo.Name 155 else Caption := ApplicationInfo.Name; 156 if Assigned(Core.System.Client) then 157 with Core.System.Client do 158 StatusBar1.Panels[0].Text := User + '@' + Host + ':' + IntToStr(Port) + '/' + Schema; 153 159 end; 154 160 155 161 procedure TMainForm.FormCreate(Sender: TObject); 156 162 begin 157 TabForms := TListObject.Create;158 TabForms.OwnsObjects := False;159 163 TreeState := TTreeState.Create; 160 164 Report := TReport.Create; … … 169 173 TreeState.Free; 170 174 PersistentForm.Free; 171 TabForms.Free;172 175 end; 173 176 … … 204 207 procedure TMainForm.ASettingsExecute(Sender: TObject); 205 208 begin 206 SettingForm.ShowModal; 209 try 210 SettingForm := TSettingForm.Create(nil); 211 SettingForm.ShowModal; 212 finally 213 SettingForm.Free; 214 end; 207 215 end; 208 216 … … 311 319 if TreeView1.Selected.ImageIndex = 0 then begin 312 320 TreeView1.PopupMenu := PopupMenuObjectGroup; 313 Pa geControl1.Visible := False;321 PanelData.Visible := False; 314 322 end; 315 323 if TreeView1.Selected.ImageIndex = 1 then begin … … 327 335 NewItemListForm := TItemListForm.Create(Self); 328 336 NewItemListForm.SelectedObject.Load(Integer(TreeView1.Selected.Data)); 329 NewItemListForm.Caption := NewItemListForm. Caption + ' ' + NewItemListForm.SelectedObject.Name;330 AddTabForm(NewItemListForm);337 NewItemListForm.Caption := NewItemListForm.SelectedObject.Name; 338 SetMainPanelForm(NewItemListForm); 331 339 end; 332 340 end; … … 387 395 end; 388 396 389 procedure TMainForm.AddTabForm(Form: TForm); 390 var 391 NewTabSheet: TTabSheet; 392 begin 393 TabForms.Add(Form); 394 NewTabSheet := PageControl1.AddTabSheet; 395 NewTabSheet.DockSite := True; 396 NewTabSheet.UseDockManager := True; 397 NewTabSheet.Caption := Form.Caption; 398 PageControl1.TabIndex := PageControl1.PageCount - 1; 399 Form.DragKind := dkDock; 400 Form.DragMode := dmAutomatic; 401 Form.ManualDock(NewTabSheet); 402 Form.Show; 403 404 // Workaround for not showing content of first tab after docking 405 NewTabSheet.Visible := False; 406 NewTabSheet.Visible := True; 397 procedure TMainForm.SetMainPanelForm(Form: TForm); 398 begin 399 MainPanelForm.Free; 400 MainPanelForm := Form; 401 MainPanelForm.ManualDock(PanelData, nil, alClient); 402 MainPanelForm.Align := alClient; 403 MainPanelForm.Show; 404 UpdateInterface; 407 405 end; 408 406
Note:
See TracChangeset
for help on using the changeset viewer.