mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 19:00:27 +02:00
Opkman: Hide hint window when SHIFT is released.
git-svn-id: trunk@56810 -
This commit is contained in:
parent
7e8516f91a
commit
2c51aaf235
@ -12,7 +12,7 @@ object ShowHintFrm: TShowHintFrm
|
||||
OnCreate = FormCreate
|
||||
OnDeactivate = FormDeactivate
|
||||
OnDestroy = FormDestroy
|
||||
OnKeyPress = FormKeyPress
|
||||
OnKeyUp = FormKeyUp
|
||||
LCLVersion = '1.9.0.0'
|
||||
object pnBase: TPanel
|
||||
Left = 0
|
||||
@ -37,4 +37,10 @@ object ShowHintFrm: TShowHintFrm
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
object tmWait: TTimer
|
||||
Enabled = False
|
||||
OnTimer = tmWaitTimer
|
||||
left = 7
|
||||
top = 12
|
||||
end
|
||||
end
|
||||
|
@ -29,7 +29,7 @@ unit opkman_showhint;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Menus,
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Menus, LCLType,
|
||||
opkman_virtualtrees, opkman_showhintbase;
|
||||
|
||||
type
|
||||
@ -39,10 +39,12 @@ type
|
||||
TShowHintFrm = class(TForm)
|
||||
pnBase: TPanel;
|
||||
sbLazPackages: TScrollBox;
|
||||
tmWait: TTimer;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDeactivate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormKeyPress(Sender: TObject; var Key: char);
|
||||
procedure FormKeyUp(Sender: TObject; var Key: Word; {%H-}Shift: TShiftState);
|
||||
procedure tmWaitTimer(Sender: TObject);
|
||||
private
|
||||
FFrames: TList;
|
||||
public
|
||||
@ -94,9 +96,19 @@ begin
|
||||
FFrames.Free;
|
||||
end;
|
||||
|
||||
procedure TShowHintFrm.FormKeyPress(Sender: TObject; var Key: char);
|
||||
procedure TShowHintFrm.FormKeyUp(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
if Key = #27 then
|
||||
if Key = VK_ESCAPE then
|
||||
Hide;
|
||||
if Key = VK_SHIFT then
|
||||
tmWait.Enabled := True;
|
||||
end;
|
||||
|
||||
procedure TShowHintFrm.tmWaitTimer(Sender: TObject);
|
||||
begin
|
||||
tmWait.Enabled := False;
|
||||
if not IsMouseOverForm then
|
||||
Hide;
|
||||
end;
|
||||
|
||||
|
@ -126,6 +126,7 @@ type
|
||||
procedure VSTMouseEnter(Sender: TObject);
|
||||
procedure VSTMouseLeave(Sender: TObject);
|
||||
procedure VSTMouseDown(Sender: TObject; Button: TMouseButton; {%H-}Shift: TShiftState; X, Y: Integer);
|
||||
procedure VSTKeyUp(Sender: TObject; var Key: Word; {%H-}Shift: TShiftState);
|
||||
procedure VSTGetHint(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
|
||||
var LineBreakStyle: TVTTooltipLineBreakStyle; var HintText: String);
|
||||
procedure VSTAfterCellPaint(Sender: TBaseVirtualTree; {%H-}TargetCanvas: TCanvas;
|
||||
@ -275,6 +276,7 @@ begin
|
||||
OnMouseLeave := @VSTMouseLeave;
|
||||
OnMouseEnter := @VSTMouseEnter;
|
||||
OnMouseDown := @VSTMouseDown;
|
||||
OnKeyUp := @VSTKeyUp;
|
||||
OnDblClick := @VSTDblClick;
|
||||
OnClick := @VSTClick;
|
||||
OnGetHint := @VSTGetHint;
|
||||
@ -1795,6 +1797,14 @@ begin
|
||||
end
|
||||
end;
|
||||
|
||||
procedure TVisualTree.VSTKeyUp(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
if Key = VK_SHIFT then
|
||||
if Assigned(FShowHintFrm) and FShowHintFrm.Visible then
|
||||
FShowHintFrm.tmWait.Enabled := True;
|
||||
end;
|
||||
|
||||
procedure TVisualTree.VSTGetHint(Sender: TBaseVirtualTree; Node: PVirtualNode;
|
||||
Column: TColumnIndex; var LineBreakStyle: TVTTooltipLineBreakStyle;
|
||||
var HintText: String);
|
||||
|
Loading…
Reference in New Issue
Block a user