From b437ff2c8d568d4919b853588c083762e77ed3e8 Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 23 Apr 2004 11:18:28 +0000 Subject: [PATCH] fixed unsetting csFocusing git-svn-id: trunk@5425 - --- lcl/include/customform.inc | 6 +++++- lcl/include/wincontrol.inc | 14 ++++++++++++-- lcl/interfaces/gtk/gtkcallback.inc | 7 +++---- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index 6cc0042893..ba4f3489e0 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -1302,12 +1302,13 @@ begin Result:=true; if not (csFocusing in Control.ControlState) then begin + // prevent looping Control.ControlState := Control.ControlState + [csFocusing]; try // change focus finally - Control.ControlState := Control.ControlState + [csFocusing]; + Control.ControlState := Control.ControlState - [csFocusing]; end; end; @@ -1601,6 +1602,9 @@ end; { ============================================================================= $Log$ + Revision 1.134 2004/04/23 11:18:28 mattias + fixed unsetting csFocusing + Revision 1.133 2004/04/10 17:58:57 mattias implemented mainunit hints for include files diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index ea1085c377..c449023bf5 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -1768,7 +1768,7 @@ Begin Assert(False, Format('Trace:[TWinControl.WndPRoc] %s --> LM_SETFOCUS', [ClassName])); Form := GetParentForm(Self); {$IFDEF VerboseFocus} - writeln('TWinControl.WndProc A ',Name,':',ClassName); + writeln('TWinControl.WndProc LM_SetFocus ',Name,':',ClassName); {$ENDIF} if (Form <> nil) and not Form.SetFocusedControl(Self) then Exit; Message.Result:=0; @@ -1777,7 +1777,12 @@ Begin LM_KILLFOCUS: begin Assert(False, Format('Trace:[TWinControl.WndPRoc] %s --> _KILLFOCUS', [ClassName])); - if csFocusing in ControlState then Exit; + if csFocusing in ControlState then begin + {$IFDEF VerboseFocus} + writeln('TWinControl.WndProc LM_KillFocus during focusing ',Name,':',ClassName); + {$ENDIF} + Exit; + end; Message.Result:=0; end; @@ -2603,6 +2608,7 @@ end; ------------------------------------------------------------------------------} Procedure TWinControl.WMSetFocus(var Message: TLMSetFocus); Begin + //writeln('TWinControl.WMSetFocus A ',Name,':',ClassName); Assert(False, Format('Trace: %s', [ClassName])); DoEnter; end; @@ -2616,6 +2622,7 @@ end; ------------------------------------------------------------------------------} procedure TWinControl.WMKillFocus(var Message: TLMKillFocus); begin + //writeln('TWinControl.WMKillFocus A ',Name,':',ClassName); Assert(False, Format('Trace: %s', [ClassName])); DoExit; end; @@ -3471,6 +3478,9 @@ end; { ============================================================================= $Log$ + Revision 1.221 2004/04/23 11:18:28 mattias + fixed unsetting csFocusing + Revision 1.220 2004/04/20 23:39:01 marc * Fixed setting of TWincontrol.Text during load diff --git a/lcl/interfaces/gtk/gtkcallback.inc b/lcl/interfaces/gtk/gtkcallback.inc index 3e3d76d0b0..14cbf2420d 100644 --- a/lcl/interfaces/gtk/gtkcallback.inc +++ b/lcl/interfaces/gtk/gtkcallback.inc @@ -863,7 +863,6 @@ begin //TODO: fill in old focus FillChar(Mess,SizeOf(Mess),0); Mess.msg := LM_SETFOCUS; - Assert(False, Format('Trace:TODO: [gtkfocusCB] %s finish', [TObject(Data).ClassName])); DeliverMessage(Data, Mess); Result:=true; @@ -957,7 +956,6 @@ begin FillChar(Mess,SizeOf(Mess),0); Mess.msg := LM_KILLFOCUS; - //TODO: fill in new focus Assert(False, Format('Trace:TODO: [gtkkillfocusCB] %s finish', [TObject(Data).ClassName])); DeliverMessage(Data, Mess); @@ -1995,11 +1993,9 @@ var LCLComponent: TObject; begin if (Data=nil) then ; - BeginGDKErrorTrap; gdk_window_set_events(GetControlWindow(Widget), gdk_window_get_events(GetControlWindow(Widget)) or GDK_KEY_RELEASE_MASK or GDK_KEY_PRESS_MASK); - EndGDKErrorTrap; LCLComponent:=GetLCLObject(Widget); if LCLComponent is TCommonDialog then TCommonDialog(LCLComponent).DoShow; @@ -3070,6 +3066,9 @@ end; { ============================================================================= $Log$ + Revision 1.228 2004/04/23 11:18:28 mattias + fixed unsetting csFocusing + Revision 1.227 2004/04/19 10:06:56 mattias fixed illegal ancestor search