Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   FMX TGrid hat keine onMousexxx events? (https://www.delphipraxis.net/216757-fmx-tgrid-hat-keine-onmousexxx-events.html)

softtouch 25. Feb 2025 14:50

FMX TGrid hat keine onMousexxx events?
 
Delphi 12.2: Laut help file sollte das TGrid/TStringGrid von FireMonkey events wie onMouseDown, onMouseMovbe etc. haben, aber ich habe diese nicht, und kann nicht glauben, das es keine gibt. Was ist denn nun falsch, meine Installation oder das help file?

Bernhard Geyer 25. Feb 2025 16:22

AW: FMX TGrid hat keine onMousexxx events?
 
Schon mal auf Smartphone/Tablets eine Maus gehabt?
Ein Lib für Mobilgeräte muss nicht unbedingt noch Erweiterung für Mouse-Bedienung haben.
(Bei Checks von Online-Anwendungen werden solche Events mittlerweile als Problem markiert)

Uwe Raabe 25. Feb 2025 16:34

AW: FMX TGrid hat keine onMousexxx events?
 
Laut Doku sind die Properties public und sind so auch vorhanden (in TControl deklariert):
Code:
OnMouseDown    public   Occurs when a mouse button is pressed over a control.
OnMouseEnter   public   Occurs when the mouse cursor enters the area of the control.
OnMouseLeave   public   Occurs when the mouse cursor leaves the control area.
OnMouseMove    public   Occurs when the mouse cursor moves while over the control area.
OnMouseUp      public   Occurs when the mouse button that was pressed over the control is released.
OnMouseWheel   public   Occurs when the mouse wheel moves while the control has focus.
Es ist also durchaus möglich, die entsprechenden Events im Code zuzuweisen.

Harry Stahl 25. Feb 2025 17:46

AW: FMX TGrid hat keine onMousexxx events?
 
Bis Delphi Seattle inklusive waren die Events nahezu alle im Object-Inspector zugänglich, danach wurden sie stark dezimiert. Warum, ist mir letztlich auch nicht klar. Gut, für Mobile Plattformen haben die Mouse-Events keine Relevanz, aber unter den Desktop-Plattformen werden Sie doch schon mal benötigt.

Aber wie Uwe schon erwähnte, kann man ein Event manuell zur Laufzeit zuweisen.

Also zB. im Oncreate des Formulars:

Delphi-Quellcode:
grid1.OnMouseMove := grid1MouseMove;
Und zuvor manuell in der Form-Deklaration selber ergänzen:

Delphi-Quellcode:
procedure grid1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single);

dummzeuch 25. Feb 2025 18:08

AW: FMX TGrid hat keine onMousexxx events?
 
Es gab durchaus mal Smartphones, die sowas wie einen Mauszeiger hatten, z.B. mein Google Nexus 1.
Das kam dann allerdings schnell aus der Mode.

Und dann gab es die Convertibles auf Android-Basis. Meine Frau hatte mal eines als Notebook-Ersatz, auch das hatte eine Maus bzw. ein Touchpad also auch einen Mauszeiger. Gibt's die noch?

Und zuletzt: Da Google dabei ist, Android und ChromeOS zusammenzuführen, könnte es durchaus sein, dass auch da der Mauszeiger wieder kommt.

softtouch 25. Feb 2025 21:38

AW: FMX TGrid hat keine onMousexxx events?
 
Zitat:

Zitat von Uwe Raabe (Beitrag 1546550)
Laut Doku sind die Properties public und sind so auch vorhanden (in TControl deklariert):
Code:
OnMouseDown    public   Occurs when a mouse button is pressed over a control.
OnMouseEnter   public   Occurs when the mouse cursor enters the area of the control.
OnMouseLeave   public   Occurs when the mouse cursor leaves the control area.
OnMouseMove    public   Occurs when the mouse cursor moves while over the control area.
OnMouseUp      public   Occurs when the mouse button that was pressed over the control is released.
OnMouseWheel   public   Occurs when the mouse wheel moves while the control has focus.
Es ist also durchaus möglich, die entsprechenden Events im Code zuzuweisen.

Ja, das funktioniert nun einwandfrei. Danke.


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:06 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz