Inno SetupコントロールのOnMouseHover
イベント(マウスがいくつかのInno Setupコントロール上にあるときに関数を呼び出す)をシミュレートすることはできますか?Inno Setup:OnHoverイベント
1
A
答えて
1
あなたはでそれを実装することができます
- 非常に頻繁にタイマーをスケジュールタイマーがトリガされたInnoCallback DLL
- を使用して(50ミリ秒と言う)、カーソルが位置する上でコントロールを見つけます変更を確認してください。
次の例は次のように、ラベル上に上カーソルでコントロールの名前を表示します。
版を微調整し、非公式(ロシア語/中国語)(=サポートされていない)である拡張[Files]
Source: InnoCallback.dll; Flags: dontcopy
[Code]
var
HoverLabel:TLabel;
LastMouse: TPoint;
LastHoverControl: TControl;
type
TTimerProc = procedure(H: LongWord; Msg: LongWord; IdEvent: LongWord; Time: LongWord);
function GetCursorPos(var lpPoint: TPoint): BOOL;
external '[email protected] stdcall';
function SetTimer(hWnd: longword; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord):
LongWord; external '[email protected] stdcall';
function ScreenToClient(hWnd: HWND; var lpPoint: TPoint): BOOL;
external '[email protected] stdcall';
function ClientToScreen(hWnd: HWND; var lpPoint: TPoint): BOOL;
external '[email protected] stdcall';
function WrapTimerProc(Callback: TTimerProc; ParamCount: Integer): LongWord;
external '[email protected]:innocallback.dll stdcall';
function FindControl(Parent: TWinControl; P: TPoint): TControl;
var
Control: TControl;
WinControl: TWinControl;
I: Integer;
P2: TPoint;
begin
for I := 0 to Parent.ControlCount - 1 do
begin
Control := Parent.Controls[I];
if Control.Visible and
(Control.Left <= P.X) and (P.X < Control.Left + Control.Width) and
(Control.Top <= P.Y) and (P.Y < Control.Top + Control.Height) then
begin
if Control is TWinControl then
begin
P2 := P;
ClientToScreen(Parent.Handle, P2);
WinControl := TWinControl(Control);
ScreenToClient(WinControl.Handle, P2);
Result := FindControl(WinControl, P2);
if Result <> nil then Exit;
end;
Result := Control;
Exit;
end;
end;
Result := nil;
end;
procedure HoverControlChanged(Control: TControl);
begin
if Control = nil then
begin
HoverLabel.Caption := 'no control';
end
else
begin
HoverLabel.Caption := Control.Name;
end;
end;
procedure HoverTimerProc(H: LongWord; Msg: LongWord; IdEvent: LongWord; Time: LongWord);
var
P: TPoint;
Control: TControl;
begin
GetCursorPos(P);
if P <> LastMouse then { just optimization }
begin
LastMouse := P;
ScreenToClient(WizardForm.Handle, P);
if (P.X < 0) or (P.Y < 0) or
(P.X > WizardForm.ClientWidth) or (P.Y > WizardForm.ClientHeight) then
begin
Control := nil;
end
else
begin
Control := FindControl(WizardForm, P);
end;
if Control <> LastHoverControl then
begin
HoverControlChanged(Control);
LastHoverControl := Control;
end;
end;
end;
procedure InitializeWizard();
var
HoverTimerCallback: LongWord;
begin
HoverTimerCallback := WrapTimerProc(@HoverTimerProc, 4);
SetTimer(0, 0, 50, HoverTimerCallback);
HoverLabel := TLabel.Create(WizardForm);
HoverLabel.Left := ScaleX(8);
HoverLabel.Top := WizardForm.ClientHeight - ScaleY(32);
HoverLabel.Parent := WizardForm;
HoverLabel.Caption := 'starting';
end;
0
次のコードはInno Unicode Enhanced Ver。のドキュメントにあります。 OnMouseEnter & OnMouseLeave関数が表示されているので、それらを使用してOnHover関数を実装できます。
TButton = class(TButtonControl)
procedure Click;
property OnMouseEnter: TNotifyEvent; read write;
property OnMouseLeave: TNotifyEvent; read write;
end;
関連する問題
- 1. Inno Setup ComponentsList OnClickイベント
- 2. Innoセットアップのアンインストールプログレスバーの変更イベント
- 3. Innoセットアップレジストリ
- 4. Innoセットアップカスタムページ
- 5. Innoセットアップフォルダ
- 6. Innoセットアップモジュラーインストール
- 7. Innoの非同期WMIクエリ
- 8. Inno Setupの:別のコントロール
- 9. Inno Setup [ファイル]セクション
- 10. InnoスクリプトダウンロードファイルAsync
- 11. Inno setup postinstallチェックボックス
- 12. Inno Setup:カスタムクラス
- 13. Inno Setupの:
- 14. inno setupのレジストリ
- 15. Inno Setup for .msi
- 16. Inno setup quotes problem
- 17. Inno Setup:TInputQueryWizardPageのコンボボックス
- 18. Inno Setup/SUPPRESSMSGBOXESカスタマイズ
- 19. Inno Setup - UrlCreateFromPath
- 20. Inno Setup - [code]
- 21. Inno Setup RegAsm.exeエラー
- 22. InnoセットアップTasksList.OnClickCheckイベントで変更されたタスク/アイテムを検出しました
- 23. Inno SetupのMySQLクエリ
- 24. Inno Setup Query- [レジストリ]セクション
- 25. 検索Inno Setupの
- 26. Inno Setupでのカスタムディスクスパン
- 27. Innoセットアップ構文エラー
- 28. Inno Setup - インストールページのカスタマイズ
- 29. inno setupアンインストーラのラジオボタンページ
- 30. inno setup first startコンポーネント
Innoセットアップのバージョン?? – Slappy
私はこれを約5年間使ってきました。それはより良い機能性とその英語を持っている:D –