From fed331360c7da53712c514fb6e36f1111a6f3c0a Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 19 Jun 2015 02:38:41 +0200 Subject: [PATCH] fix docking issues - editor cant be disassociated from the menu - a fix exists for the 3rd part component, but will be only applied if it's accepted by the people in charge (to consider when building CE from source). - the fix will be applied in the next CE binary release (even if not officially cherry merged to the Lazarus components). fix #13 fix #4 waiting for that a widget must not undocked (right click) before getting closed. --- src/ce_editor.lfm | 1 + src/ce_editor.pas | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/ce_editor.lfm b/src/ce_editor.lfm index 313e05e3..0ff9cf26 100644 --- a/src/ce_editor.lfm +++ b/src/ce_editor.lfm @@ -6,6 +6,7 @@ inherited CEEditorWidget: TCEEditorWidget Caption = 'Source editor' ClientHeight = 406 ClientWidth = 465 + OnCloseQuery = FormCloseQuery inherited Back: TPanel Height = 406 Width = 465 diff --git a/src/ce_editor.pas b/src/ce_editor.pas index 9088da8a..3bfd9445 100644 --- a/src/ce_editor.pas +++ b/src/ce_editor.pas @@ -34,6 +34,7 @@ type macRecorder: TSynMacroRecorder; editorStatus: TStatusBar; mnuEditor: TPopupMenu; + procedure FormCloseQuery(Sender: TObject; var CanClose: boolean); procedure mnuedCopyClick(Sender: TObject); procedure mnuedCutClick(Sender: TObject); procedure mnuEditorPopup(Sender: TObject); @@ -139,6 +140,13 @@ begin fErrList.Free; inherited; end; + +procedure TCEEditorWidget.FormCloseQuery(Sender: TObject; var CanClose: boolean); +begin + // grants the window not to be undocked. + // additional fix, depend on of http://bugs.freepascal.org/view.php?id=28325 + CanClose := Parent = nil; +end; {$ENDREGION} {$REGION ICEMultiDocObserver ---------------------------------------------------}