From 71c6cf7c04d4a8fec1d87c9833b2030f56a9c7f8 Mon Sep 17 00:00:00 2001 From: paul Date: Sun, 30 Sep 2007 06:13:28 +0000 Subject: [PATCH] lcl: fix formatting a bit git-svn-id: trunk@12250 - --- lcl/include/customform.inc | 26 ++++++++++++++------------ lcl/interfaces/win32/win32winapi.inc | 6 +++--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index ac14c618f1..07a23f7bd3 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -867,7 +867,7 @@ end; {------------------------------------------------------------------------------ TCustomForm WndProc ------------------------------------------------------------------------------} -procedure TCustomForm.WndProc(Var TheMessage : TLMessage); +procedure TCustomForm.WndProc(var TheMessage : TLMessage); var FocusHandle : HWND; MenuItem : TMenuItem; @@ -876,16 +876,18 @@ begin case Msg of LM_ACTIVATE, LM_SETFOCUS, LM_KILLFOCUS: begin - if not FocusMessages then Exit; - if (Msg = LM_SetFocus) and not (csDesigning in ComponentState) - then begin + if not FocusMessages then + Exit; + if (Msg = LM_SETFOCUS) and not (csDesigning in ComponentState) then + begin FocusHandle := 0; - if FormStyle = fsMDIFORM - then begin + if FormStyle = fsMDIFORM then + begin // ToDo end - else begin + else + begin if (FActiveControl <> nil) and (FActiveControl <> Self) and FActiveControl.Visible and FActiveControl.Enabled and ([csLoading,csDestroying]*ComponentState=[]) @@ -1589,7 +1591,6 @@ var ParentForm: TCustomForm; begin Result := False; - if (csDestroying in Control.ComponentState) then exit; if (Parent<>nil) then begin @@ -1937,7 +1938,7 @@ Function TCustomForm.ShowModal: Integer; var //WindowList: Pointer; - SaveFocusCount: Integer; + SavedFocusState: TFocusState; //SaveCursor: TCursor; //SaveCount: Integer; ActiveWindow: HWnd; @@ -1960,7 +1961,7 @@ begin Include(FFormState, fsModal); ActiveWindow := GetActiveWindow; - SaveFocusCount := FocusCount; + SavedFocusState := SaveFocusState; Screen.FSaveFocusedList.Insert(0, Screen.FFocusedForm); Screen.FFocusedForm := Self; Screen.MoveFormToFocusFront(Self); @@ -2012,9 +2013,10 @@ begin end else Screen.FFocusedForm := nil; Exclude(FFormState, fsModal); - FocusCount := SaveFocusCount; + RestoreFocusState(SavedFocusState); //DebugLn('TCustomForm.ShowModal ',dbgs(ActiveWindow)); - if ActiveWindow <> 0 then SetActiveWindow(ActiveWindow); + if ActiveWindow <> 0 then + SetActiveWindow(ActiveWindow); end; end; diff --git a/lcl/interfaces/win32/win32winapi.inc b/lcl/interfaces/win32/win32winapi.inc index 517ea1378e..c514acff48 100644 --- a/lcl/interfaces/win32/win32winapi.inc +++ b/lcl/interfaces/win32/win32winapi.inc @@ -2970,10 +2970,10 @@ end; The SetFocus function sets the keyboard focus to the specified window ------------------------------------------------------------------------------} -Function TWin32WidgetSet.SetFocus(HWnd: HWND): HWND; -Begin +function TWin32WidgetSet.SetFocus(HWnd: HWND): HWND; +begin Result := Windows.SetFocus(HWnd); -End; +end; {------------------------------------------------------------------------------ Method: SetForegroundWindow