From 837d6ef5259b48a86af26d551a611285f6fffa38 Mon Sep 17 00:00:00 2001 From: graemeg Date: Wed, 4 Feb 2009 13:09:58 +0000 Subject: * added a custom user message constant. * prevent AV when tooltip owner window is released. * language update --- src/corelib/fpg_base.pas | 4 ++-- src/corelib/fpg_main.pas | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas index 979ac61a..15270468 100644 --- a/src/corelib/fpg_base.pas +++ b/src/corelib/fpg_base.pas @@ -81,6 +81,7 @@ const FPGM_MOVE = 16; FPGM_POPUPCLOSE = 17; FPGM_HINTTIMER = 18; + FPGM_CUSTOM = 50000; FPGM_KILLME = High(Integer); // The special keys, based on the well-known keyboard scan codes @@ -1145,8 +1146,7 @@ begin DoMoveWindow(x, y); end; -function TfpgWindowBase.WindowToScreen(ASource: TfpgWindowBase; - const AScreenPos: TPoint): TPoint; +function TfpgWindowBase.WindowToScreen(ASource: TfpgWindowBase; const AScreenPos: TPoint): TPoint; begin Result := DoWindowToScreen(ASource, AScreenPos); end; diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index 883c56c7..0bbb35f7 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -231,7 +231,7 @@ type procedure InternalMsgHintTimer(var msg: TfpgMessageRec); message FPGM_HINTTIMER; procedure CreateHintWindow; procedure HintTimerFired(Sender: TObject); - procedure SetShowHint(const AValue: boolean); + procedure SetShowHint(const AValue: boolean); protected FDisplayParams: string; FScreenWidth: integer; @@ -1075,8 +1075,15 @@ begin w := nil; // writeln('HintTimerFired...'); w := TfpgWidget(FHintWidget); - if Assigned(w) then - ActivateHint(w.WindowToScreen(w, FHintPos), w.Hint); + try + if Assigned(w) then + ActivateHint(w.WindowToScreen(w, FHintPos), w.Hint); + except + // silence it! + { TODO : FHintWidget probably went out of scope just as timer fired. Try + and detect such cases better! } + end; + FHintTimer.Enabled := False; end; -- cgit v1.2.3-70-g09d2