lcl: fix formatting a bit

git-svn-id: trunk@12250 -
This commit is contained in:
paul 2007-09-30 06:13:28 +00:00
parent 2ea337b331
commit 71c6cf7c04
2 changed files with 17 additions and 15 deletions

View File

@ -867,7 +867,7 @@ end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
TCustomForm WndProc TCustomForm WndProc
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TCustomForm.WndProc(Var TheMessage : TLMessage); procedure TCustomForm.WndProc(var TheMessage : TLMessage);
var var
FocusHandle : HWND; FocusHandle : HWND;
MenuItem : TMenuItem; MenuItem : TMenuItem;
@ -876,16 +876,18 @@ begin
case Msg of case Msg of
LM_ACTIVATE, LM_SETFOCUS, LM_KILLFOCUS: LM_ACTIVATE, LM_SETFOCUS, LM_KILLFOCUS:
begin begin
if not FocusMessages then Exit; if not FocusMessages then
if (Msg = LM_SetFocus) and not (csDesigning in ComponentState) Exit;
then begin if (Msg = LM_SETFOCUS) and not (csDesigning in ComponentState) then
begin
FocusHandle := 0; FocusHandle := 0;
if FormStyle = fsMDIFORM if FormStyle = fsMDIFORM then
then begin begin
// ToDo // ToDo
end end
else begin else
begin
if (FActiveControl <> nil) and (FActiveControl <> Self) if (FActiveControl <> nil) and (FActiveControl <> Self)
and FActiveControl.Visible and FActiveControl.Enabled and FActiveControl.Visible and FActiveControl.Enabled
and ([csLoading,csDestroying]*ComponentState=[]) and ([csLoading,csDestroying]*ComponentState=[])
@ -1589,7 +1591,6 @@ var
ParentForm: TCustomForm; ParentForm: TCustomForm;
begin begin
Result := False; Result := False;
if (csDestroying in Control.ComponentState) then exit; if (csDestroying in Control.ComponentState) then exit;
if (Parent<>nil) then begin if (Parent<>nil) then begin
@ -1937,7 +1938,7 @@ Function TCustomForm.ShowModal: Integer;
var var
//WindowList: Pointer; //WindowList: Pointer;
SaveFocusCount: Integer; SavedFocusState: TFocusState;
//SaveCursor: TCursor; //SaveCursor: TCursor;
//SaveCount: Integer; //SaveCount: Integer;
ActiveWindow: HWnd; ActiveWindow: HWnd;
@ -1960,7 +1961,7 @@ begin
Include(FFormState, fsModal); Include(FFormState, fsModal);
ActiveWindow := GetActiveWindow; ActiveWindow := GetActiveWindow;
SaveFocusCount := FocusCount; SavedFocusState := SaveFocusState;
Screen.FSaveFocusedList.Insert(0, Screen.FFocusedForm); Screen.FSaveFocusedList.Insert(0, Screen.FFocusedForm);
Screen.FFocusedForm := Self; Screen.FFocusedForm := Self;
Screen.MoveFormToFocusFront(Self); Screen.MoveFormToFocusFront(Self);
@ -2012,9 +2013,10 @@ begin
end else end else
Screen.FFocusedForm := nil; Screen.FFocusedForm := nil;
Exclude(FFormState, fsModal); Exclude(FFormState, fsModal);
FocusCount := SaveFocusCount; RestoreFocusState(SavedFocusState);
//DebugLn('TCustomForm.ShowModal ',dbgs(ActiveWindow)); //DebugLn('TCustomForm.ShowModal ',dbgs(ActiveWindow));
if ActiveWindow <> 0 then SetActiveWindow(ActiveWindow); if ActiveWindow <> 0 then
SetActiveWindow(ActiveWindow);
end; end;
end; end;

View File

@ -2970,10 +2970,10 @@ end;
The SetFocus function sets the keyboard focus to the specified window The SetFocus function sets the keyboard focus to the specified window
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
Function TWin32WidgetSet.SetFocus(HWnd: HWND): HWND; function TWin32WidgetSet.SetFocus(HWnd: HWND): HWND;
Begin begin
Result := Windows.SetFocus(HWnd); Result := Windows.SetFocus(HWnd);
End; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
Method: SetForegroundWindow Method: SetForegroundWindow