- formatting, cosmetic changes and cleanup

git-svn-id: trunk@13774 -
This commit is contained in:
paul 2008-01-16 04:05:34 +00:00
parent e913ee236f
commit 6974762fd6
5 changed files with 20 additions and 57 deletions

View File

@ -402,7 +402,6 @@ type
function IsForm : Boolean;
function IsHelpFileStored: boolean;
function IsIconStored: Boolean;
procedure ClientWndProc(var Message: TLMessage);
procedure CloseModal;
procedure IconChanged(Sender: TObject);
function IsKeyPreviewStored: boolean;
@ -1393,7 +1392,6 @@ uses
WSForms; // Widgetset uses circle is allowed
var
FocusMessages: Boolean=True;
FocusCount: Integer=0;
HandlingException: boolean=False;
HaltingProgram: boolean=False;

View File

@ -86,7 +86,6 @@ end;
------------------------------------------------------------------------------}
constructor TApplication.Create(AOwner: TComponent);
begin
Focusmessages := True;
LCLProc.SendApplicationMessageFunction:=@SendApplicationMsg;
FMainForm := nil;

View File

@ -22,38 +22,6 @@
{ TCustomForm }
{------------------------------------------------------------------------------
TCustomForm ClientWndProc
------------------------------------------------------------------------------}
Procedure TCustomForm.ClientWndProc(var Message: TLMessage);
procedure CallDefault;
begin
{
with Message do
Result := CallWindowProc(FDefClientProc, ClientHandle, Msg, wParam, lParam);
}
end;
begin
with Message do
case Msg of
LM_NCHITTEST:
begin
CallDefault;
if Result = HTCLIENT then Result := HTTRANSPARENT;
end;
LM_ERASEBKGND:
begin
// Not sure if this will work real good.
//Canvas.FillRect(ClientRect);
Result := 1;
end;
else
CallDefault;
end;
end;
{------------------------------------------------------------------------------
procedure TCustomForm.CloseModal;
------------------------------------------------------------------------------}
@ -132,14 +100,15 @@ end;
Params: None
Returns: Nothing
------------------------------------------------------------------------------}
Procedure TCustomForm.FocusControl(WinControl : TWinControl);
procedure TCustomForm.FocusControl(WinControl : TWinControl);
var
WasActive: Boolean;
begin
WasActive := FActive;
SetActiveControl(WinControl);
if not WasActive then SetFocus;
End;
if not WasActive then
SetFocus;
end;
{------------------------------------------------------------------------------
Method: TCustomForm.Notification
@ -293,7 +262,7 @@ end;
{------------------------------------------------------------------------------
Method: TCustomForm.SetFocus
------------------------------------------------------------------------------}
Procedure TCustomForm.SetFocus;
procedure TCustomForm.SetFocus;
procedure RaiseCannotFocus;
var
@ -307,7 +276,7 @@ Procedure TCustomForm.SetFocus;
{$ENDIF}
end;
Begin
begin
{$IFDEF VerboseFocus}
DebugLn('TCustomForm.SetFocus ',Name,':',ClassName);
{$ENDIF}
@ -437,8 +406,8 @@ begin
DebugLn('TCustomForm.WMActivate A ',Name,':',ClassName,' Msg.Active=',dbgs(Message.Active));
{$ENDIF}
if (FormStyle <> fsMDIForm) or (csDesigning in ComponentState) then
SetActive(Message.Active {<> WA_INACTIVE});
FActive:=true;
SetActive(Message.Active);
Activate;
if Application<>nil then Application.Activate;
end;
@ -675,13 +644,10 @@ end;
procedure TCustomForm.SetActive(AValue: Boolean);
begin
FActive := AValue;
//if FActiveOleControl <> nil then
// FActiveOleControl.Perform(CM_DOCWINDOWACTIVATE, WParam(Ord(Value)), 0);
if FActive then
begin
if (ActiveControl = nil) and not (csDesigning in ComponentState) then
ActiveControl := FindDefaultForActiveControl;
//MergeMenu(True);
SetWindowFocus;
end;
end;
@ -898,8 +864,6 @@ 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
//DebugLn(['TCustomForm.WndProc ',DbgSName(Self),' FActiveControl=',DbgSName(FActiveControl)]);
@ -1280,8 +1244,8 @@ end;
{------------------------------------------------------------------------------
TCustomForm SetActiveControl
------------------------------------------------------------------------------}
Procedure TCustomForm.SetActiveControl(AWinControl: TWinControl);
Begin
procedure TCustomForm.SetActiveControl(AWinControl: TWinControl);
begin
if FActiveControl <> AWinControl then
begin
if (AWinControl<>nil) then begin

View File

@ -45,7 +45,7 @@ const
Enumerates and removes properties for the target window
-----------------------------------------------------------------------------}
Function PropEnumProc(Window: Hwnd; Str: PChar; Data: Handle): LongBool; StdCall;
function PropEnumProc(Window: Hwnd; Str: PChar; Data: Handle): LongBool; StdCall;
begin
Result:=false;
if PtrUInt(Str) <= $FFFF then exit; // global atom handle
@ -1800,13 +1800,15 @@ begin
end;
WM_NCHITTEST:
begin
if (lWinControl <> nil) then begin
if (lWinControl <> nil) then
begin
if (lWinControl.FCompStyle = csHintWindow) then
begin
LMessage.Result := HTTRANSPARENT;
WinProcess := false;
end
else if (lWinControl is TCustomGroupBox) then
else
if (lWinControl is TCustomGroupBox) then
begin
LMessage.Result := HTCLIENT;
WinProcess := false;
@ -1999,7 +2001,7 @@ begin
MouseDownFocusWindow := Window;
end;
LMessage.Msg := LM_SETFOCUS;
if (lWinControl <> nil) and (lWinControl.FCompStyle = csEdit) then
if (lWinControl <> nil) and (lWinControl is TCustomEdit) then
Windows.SendMessage(Window, EM_SETSEL, 0, -1);
// RadioButton functionality
if (lWinControl <> nil) and (lWinControl is TRadioButton) then

View File

@ -603,16 +603,16 @@ end;
Generic function which calls the WindowProc if defined, otherwise the
dispatcher
------------------------------------------------------------------------------}
function DeliverMessage(Const Target: TObject; Var Message: TLMessage): Integer;
function DeliverMessage(const Target: TObject; var Message: TLMessage): Integer;
begin
If Target = Nil Then
if Target = nil Then
begin
DebugLn('[DeliverMessage (Target: TObject)] Nil');
Exit;
end;
If Target Is TControl Then
if Target is TControl Then
TControl(Target).WindowProc(Message)
Else
else
Target.Dispatch(Message);
Result := Message.Result;
end;