summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-08-31 10:09:44 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-08-31 10:09:44 +0000
commit052d28c91a70678b264fb7772096da6fb6803dc3 (patch)
treea85abf936ba6f95bffcaae00b431121c305c032a /src/gui
parent13bdc0b2269cfc49d605a057f24b0ba83c37b1b4 (diff)
downloadfpGUI-052d28c91a70678b264fb7772096da6fb6803dc3.tar.xz
* Made some changes to the Hint Help under Windows. Microsoft strikes
again with it's weird behaviour. Windows sends fake MouseMove messages when a windows is shown, hidden or moved. The backend had to filter out those fake messages. For more details on this see the following link. http://blogs.msdn.com/oldnewthing/archive/2003/10/01/55108.aspx
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui_edit.pas25
-rw-r--r--src/gui/gui_hint.pas21
2 files changed, 22 insertions, 24 deletions
diff --git a/src/gui/gui_edit.pas b/src/gui/gui_edit.pas
index c732c9fd..71565fdc 100644
--- a/src/gui/gui_edit.pas
+++ b/src/gui/gui_edit.pas
@@ -713,6 +713,8 @@ var
begin
hasChanged := False;
+ FHintTimer.Enabled := False;
+
Consumed := True;
case CheckClipBoardKey(keycode, shiftstate) of
@@ -844,24 +846,10 @@ begin
end;
procedure TfpgBaseEdit.HandleLMouseDown(x, y: integer; shiftstate: TShiftState);
-{var
- cp: integer;}
begin
+ FHintTimer.Enabled := False;
inherited HandleLMouseDown(x, y, shiftstate);
- {cp := PointToCharPos(x, y);
- FMouseDragPos := cp;
- FCursorPos := cp;
- if (ssShift in shiftstate) then
- FSelOffset := FCursorPos - FSelStart
- else
- begin
- FSelStart := cp;
- FSelOffset := 0;
- end;
- Adjust;
- Repaint;}
-
FCursorPx := x;
AdjustTextOffset(True);
FMouseDragPos := FCursorPos;
@@ -895,12 +883,11 @@ begin
if FShowHint then
begin
if FHintTimer.Enabled then
- FHintTimer.Reset // keep reseting while mouse is moving to prevent hint from showing
+ FHintTimer.Reset // keep reseting to prevent hint from showing
else
HideHint;
- end
- else
- Exit; //==>
+ end;
+ Exit; //==>
end;
cp := FCursorPos;
diff --git a/src/gui/gui_hint.pas b/src/gui/gui_hint.pas
index 12acf034..e106f7f3 100644
--- a/src/gui/gui_hint.pas
+++ b/src/gui/gui_hint.pas
@@ -2,6 +2,8 @@ unit gui_hint;
{$mode objfpc}{$H+}
+{.$Define Debug}
+
interface
uses
@@ -40,7 +42,7 @@ type
property LTextColor: TfpgColor write SetLTextColor default clBlack;
property LBackgroundColor: TfpgColor write SetLBackgroundColor default clHintWindow;
property ShadowColor: TfpgColor write SetShadowColor default clGray;
- property Time: Integer write SetTime default 2000;
+ property Time: Integer write SetTime default 5000;
end;
@@ -64,6 +66,9 @@ implementation
procedure DisplayHint(Pt: TPoint; AHint: string);
begin
+ {$IFDEF DEBUG}
+ writeln('DisplayHint');
+ {$ENDIF}
if Assigned(F_Hint) and F_Hint.Visible then
Exit; //==> Nothing to do
@@ -85,6 +90,9 @@ end;
procedure HideHint;
begin
+ {$IFDEF DEBUG}
+ writeln('HideHint');
+ {$ENDIF}
if Assigned(F_Hint) and F_Hint.Visible then
F_Hint.Hide;
end;
@@ -99,13 +107,16 @@ end;
procedure TF_Hint.FormHide(Sender: TObject);
begin
+ T_Chrono.Enabled := False;
if Assigned(F_Shadow) then
F_Shadow.Hide;
end;
procedure TF_Hint.T_ChronoFini(Sender: TObject);
begin
- T_Chrono.Enabled:= False;
+ {$IFDEF DEBUG}
+ writeln('TF_Hint.T_ChronoFini timer fired');
+ {$ENDIF}
Hide;
end;
@@ -124,10 +135,10 @@ end;
procedure TF_Hint.SetTime(AValue: Integer);
begin
if FTime <> AValue then
- begin
+ begin
FTime := AValue;
T_Chrono.Interval := FTime;
- end;
+ end;
end;
procedure TF_Hint.SetLTextColor(AValue: Tfpgcolor);
@@ -162,7 +173,7 @@ begin
FMargin := 3;
FBorder := 1;
FShadow := 5;
- FTime := 2000;
+ FTime := 5000;
L_Hint := CreateLabel(Self, FBorder, FBorder, '', Width - FBorder * 2, Height - FBorder * 2, taCenter, tlCenter);
L_Hint.BackgroundColor := clHintWindow;
L_Hint.OnClick := @T_ChronoFini;