From f3288b80b45d10872ffc5965cc0d6d9747841b83 Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 9 Feb 2002 01:48:21 +0000 Subject: [PATCH] added Timer patch from Vincent Snijders git-svn-id: trunk@1374 - --- lcl/include/application.inc | 8 +++++--- lcl/include/interfacebase.inc | 14 +++----------- lcl/interfacebase.pp | 8 ++++++-- lcl/interfaces/gtk/gtkproc.inc | 22 +++------------------- 4 files changed, 17 insertions(+), 35 deletions(-) diff --git a/lcl/include/application.inc b/lcl/include/application.inc index 421a4c3488..cc9808b207 100644 --- a/lcl/include/application.inc +++ b/lcl/include/application.inc @@ -603,7 +603,7 @@ end; procedure TApplication.HandleMessage; begin InterfaceObject.HandleEvents; // process all events - Idle; + if not FTerminate then Idle; end; {------------------------------------------------------------------------------ @@ -647,8 +647,7 @@ procedure TApplication.Run; begin if FMainForm <> nil then FMainForm.Show; - - repeat + repeat HandleMessage; if Assigned(FMainForm) and (FMainForm.ModalResult = mrCancel) then Terminate; @@ -850,6 +849,9 @@ end; { ============================================================================= $Log$ + Revision 1.39 2002/11/23 13:48:43 mattias + added Timer patch from Vincent Snijders + Revision 1.38 2002/11/21 18:49:52 mattias started OnMouseEnter and OnMouseLeave diff --git a/lcl/include/interfacebase.inc b/lcl/include/interfacebase.inc index 97fa81e89c..7f52d5cc42 100644 --- a/lcl/include/interfacebase.inc +++ b/lcl/include/interfacebase.inc @@ -968,11 +968,6 @@ begin Result := false; end; -function TInterfaceBase.KillTimer (hWnd : HWND; uIDEvent : cardinal) : boolean; -begin - Result := false; -end; - function TInterfaceBase.LineTo(DC: HDC; X, Y: Integer): Boolean; begin Result := False; @@ -1395,12 +1390,6 @@ begin Result := CLR_INVALID; end; -function TInterfaceBase.SetTimer(hWnd: HWND; nIDEvent, uElapse: integer; - lpTimerFunc: TFNTimerProc) : integer; -begin - Result := 0; -end; - function TInterfacebase.SetWindowLong(Handle: HWND; Idx: Integer; NewLong : Longint): LongInt; begin @@ -1471,6 +1460,9 @@ end; { ============================================================================= $Log$ + Revision 1.68 2002/11/23 13:48:44 mattias + added Timer patch from Vincent Snijders + Revision 1.67 2002/11/12 10:16:16 lazarus MG: fixed TMainMenu creation diff --git a/lcl/interfacebase.pp b/lcl/interfacebase.pp index 95584881b2..0a2001ee6e 100644 --- a/lcl/interfacebase.pp +++ b/lcl/interfacebase.pp @@ -63,7 +63,6 @@ type constructor Create; destructor Destroy; override; procedure AppTerminate; virtual; abstract; - procedure DoEvents; virtual; abstract; procedure HandleEvents; virtual; abstract; procedure WaitMessage; virtual; abstract; procedure Init; virtual; abstract; @@ -72,7 +71,9 @@ type function UpdateHint(Sender: TObject): Integer; virtual; abstract; function RecreateWnd(Sender: TObject): Integer; virtual; abstract; - + function CreateTimer(Interval: integer; TimerFunc: TFNTimerProc) : integer; virtual; abstract; + function DestroyTimer(TimerHandle: integer) : boolean; virtual; abstract; + {$DEFINE IF_BASE_MEMBER} {$I winapih.inc} {$UNDEF IF_BASE_MEMBER} @@ -115,6 +116,9 @@ end. { $Log$ + Revision 1.25 2002/11/23 13:48:43 mattias + added Timer patch from Vincent Snijders + Revision 1.24 2002/10/26 15:15:46 lazarus MG: broke LCL<->interface circles diff --git a/lcl/interfaces/gtk/gtkproc.inc b/lcl/interfaces/gtk/gtkproc.inc index ecbc7cdd77..5ee36c9caa 100644 --- a/lcl/interfaces/gtk/gtkproc.inc +++ b/lcl/interfaces/gtk/gtkproc.inc @@ -204,25 +204,6 @@ begin SetComboBoxText(ComboWidget,PChar(ComboBox.Items[Index])); end; -{------------------------------------------------------------------------------ - function IndexOfTimer(Handle: HWnd; uIDEvent: integer): integer; -------------------------------------------------------------------------------} -function IndexOfTimer(Handle: HWnd; uIDEvent: integer): integer; -var - PTimerInfo: PGtkITimerinfo; -begin - if (FTimerData<>nil) and (Handle<>0) then begin - Result:=FTimerData.Count-1; - while Result>=0 do begin - PTimerInfo:=PGtkITimerinfo(FTimerData[Result]); - if (PTimerInfo^.Handle=Handle) and (PTimerInfo^.IDEvent=uIDEvent) then - break; - end; - end else begin - Result:=-1; - end; -end; - {------------------------------------------------------------------------------ function GtkPaintMessageToPaintMessage(GtkPaintMsg: TLMGtkPaint): TLMPaint; @@ -3950,6 +3931,9 @@ end; { ============================================================================= $Log$ + Revision 1.150 2002/11/23 13:48:46 mattias + added Timer patch from Vincent Snijders + Revision 1.149 2002/11/09 18:13:35 lazarus MG: fixed gdkwindow checks