Hi: 2007/10/3, Víctor R. Ruiz <[EMAIL PROTECTED]>: > I'm still working on the whole IDE docking. The lastest code I have > is cleaner than the one I previously sent.
Here is the patch. Greetings, -- Víctor R. Ruiz <[EMAIL PROTECTED]> | - Todos estos momentos se perderán http://rvr.blogalia.com/ | como lágrimas en la lluvia
Index: ide/main.pp =================================================================== --- ide/main.pp (revisión: 12034) +++ ide/main.pp (copia de trabajo) @@ -535,6 +535,8 @@ procedure SetupHelpMenu; override; procedure LoadMenuShortCuts; override; procedure ConnectMainBarEvents; + procedure SetupPanels; + procedure SetupDockedIDE; procedure SetupSpeedButtons; procedure SetupDialogs; procedure SetupComponentNoteBook; @@ -894,6 +896,7 @@ SkipAutoLoadingLastProject: boolean = false; StartedByStartLazarus: boolean = false; EnableRemoteControl: boolean = false; + DockedIDE: boolean = true; //============================================================================== @@ -1088,13 +1091,14 @@ Application.CreateForm(TMainIDEBar,MainIDEBar); MainIDEBar.OnDestroy:[EMAIL PROTECTED]; {$IFNDEF IDEDocking} - MainIDEBar.Constraints.MaxHeight:=110; + // MainIDEBar.Constraints.MaxHeight:=110; {$ENDIF} MainIDEBar.Name := NonModalIDEWindowNames[nmiwMainIDEName]; EnvironmentOptions.IDEWindowLayoutList.Apply(MainIDEBar,MainIDEBar.Name); HiddenWindowsOnRun:=TList.Create; // menu + SetupPanels; SetupStandardIDEMenuItems; SetupMainMenu; SetupSpeedButtons; @@ -1119,6 +1123,10 @@ SetupObjectInspector; SetupFormEditor; SetupSourceNotebook; + if (DockedIDE) then begin + CreateOftenUsedForms; + SetupDockedIDE; + end; SetupControlSelection; SetupTextConverters; @@ -1143,7 +1151,7 @@ Application.AddOnKeyDownHandler(@OnApplicationKeyDown); Screen.AddHandlerRemoveForm(@OnScreenRemoveForm); SetupHints; - + // Now load a project SetupStartProject; @@ -1222,8 +1230,8 @@ procedure TMainIDE.CreateOftenUsedForms; begin - MessagesView:=TMessagesView.Create(nil); - LazFindReplaceDialog:=TLazFindReplaceDialog.Create(nil); + if (MessagesView = nil) then MessagesView:=TMessagesView.Create(nil); + if (LazFindReplaceDialog = nil) then LazFindReplaceDialog:=TLazFindReplaceDialog.Create(nil); end; procedure TMainIDE.CreateSearchResultWindow; @@ -1423,7 +1431,7 @@ MainIDEBar.pnlSpeedButtons := TPanel.Create(OwningComponent); with MainIDEBar.pnlSpeedButtons do begin Name := 'pnlSpeedButtons'; - Parent:= MainIDEBar; + Parent:= MainIDEBar.pnlMenu; Align := alLeft; Top := 0; Left:= 0; @@ -1481,12 +1489,93 @@ IDEQuestionDialog:[EMAIL PROTECTED]; end; +procedure TMainIDE.SetupPanels; +begin + MainIDEBar.pnlMenu := TPanel.Create(OwningComponent); + with MainIDEBar.pnlMenu do begin + Name := 'pnlMenu'; + Parent := MainIDEBar; + Align := alTop; + Height := 60; + Caption := ''; + BevelInner := bvNone; + BevelOuter := bvNone; + end; + MainIDEBar.pnlSpace := TPanel.Create(OwningComponent); + with MainIDEBar.pnlSpace do begin + Name := 'pnlSpace'; + Parent := MainIDEBar; + Align := alClient; + Caption := ''; + Visible := DockedIDE; + BevelInner := bvNone; + BevelOuter := bvNone; + end; +end; + +procedure TMainIDE.SetupDockedIDE; +var + pnlTop: TPanel; + pnlMessagesView, pnlObjectInspector, pnlSourceNotebook: TGroupBox; + SplitterHorizontal, SplitterVertical: TSplitter; + +begin + pnlTop := TPanel.Create(OwningComponent); // Top + pnlMessagesView := TGroupBox.Create(OwningComponent); // Bottom + pnlObjectInspector := TGroupBox.Create(OwningComponent); // Top Left + pnlSourceNotebook := TGroupBox.Create(OwningComponent); // Top Right + SplitterHorizontal := TSplitter.Create(OwningComponent); // Top - Bottom + SplitterVertical := TSplitter.Create(OwningComponent); // Left - Right + + pnlMessagesView.Height := 150; + pnlObjectInspector.Width := 250; + + pnlTop.Parent := MainIDEBar.pnlSpace; + pnlTop.Align := alClient; + pnlTop.BevelInner := bvNone; + pnlTop.BevelOuter := bvNone; + + SplitterHorizontal.Parent := MainIDEBar.pnlSpace; + SplitterHorizontal.Align := alBottom; + + pnlMessagesView.Parent := MainIDEBar.pnlSpace; + pnlMessagesView.Align := alBottom; + pnlMessagesView.Caption := 'Messages'; + + pnlObjectInspector.Parent := pnlTop; + pnlObjectInspector.Align := alLeft; + pnlObjectInspector.Caption := 'Object Inspector'; + + SplitterVertical.Parent := pnlTop; + SplitterVertical.Align := alLeft; + + pnlSourceNotebook.Parent := pnlTop; + pnlSourceNotebook.Align := alClient; + pnlSourceNotebook.Caption := 'Editor'; + + if (ObjectInspector1<>nil) then begin + ObjectInspector1.Parent := pnlObjectInspector; + ObjectInspector1.Align := alClient; + ObjectInspector1.Show; + end; + if (SourceNotebook<>nil) then begin + SourceNotebook.Parent := pnlSourceNotebook; + SourceNotebook.Align := alClient; + SourceNotebook.Show; + end; + if (MessagesView<>nil) then begin + MessagesView.Parent := pnlMessagesView; + MessagesView.Align := alClient; + MessagesView.Show; + end; +end; + procedure TMainIDE.SetupComponentNoteBook; begin // Component Notebook MainIDEBar.ComponentNotebook := TNotebook.Create(OwningComponent); with MainIDEBar.ComponentNotebook do begin - Parent := MainIDEBar; + Parent := MainIDEBar.pnlMenu; Name := 'ComponentNotebook'; Align := alClient; Left := MainIDEBar.pnlSpeedButtons.Left + MainIDEBar.pnlSpeedButtons.Width; @@ -9583,7 +9672,7 @@ procedure ShowInspector; begin if ObjectInspector1=nil then exit; - ObjectInspector1.ShowOnTop; + if (DockedIDE=false) then ObjectInspector1.ShowOnTop; FDisplayState:= Succ(FDisplayState); end; @@ -9903,6 +9992,7 @@ WasVisible: boolean; ALayout: TIDEWindowLayout; begin + if (DockedIDE) then exit; //debugln('TMainIDE.DoShowMessagesView'); WasVisible:=MessagesView.Visible; MessagesView.Visible:=true; Index: ide/mainbar.pas =================================================================== --- ide/mainbar.pas (revisión: 12034) +++ ide/mainbar.pas (copia de trabajo) @@ -48,6 +48,8 @@ TMainIDEBar = class(TForm) // the speedbuttons panel for frequently used IDE functions + pnlMenu : TPanel; + pnlSpace : TPanel; pnlSpeedButtons : TPanel; ViewUnitsSpeedBtn : TSpeedButton; ViewFormsSpeedBtn : TSpeedButton; Index: lcl/include/customform.inc =================================================================== --- lcl/include/customform.inc (revisión: 12034) +++ lcl/include/customform.inc (copia de trabajo) @@ -1221,7 +1221,7 @@ {$IFDEF VerboseFocus} RaiseGDBException(SCannotFocus); {$ELSE} - raise EInvalidOperation.Create(SCannotFocus); + // raise EInvalidOperation.Create(SCannotFocus); {$ENDIF} end; end;