Autor Beitrag
FriFra
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 557

Win XP Prof, Win XP Home,Win Server 2003,Win 98SE,Win 2000,Win NT4,Win 3.11,Suse Linux 7.3 Prof,Suse Linux 8.0 Prof
D2k5 Prof, D7 Prof, D5 Standard, D3 Prof, K3 Prof
BeitragVerfasst: Sa 31.05.03 11:06 
Wie kann ich die Ereignisse OnMousOver / OnMouseOut implementieren?

OnMouseOver ist noch recht simpel, da es ja bereist OnMouseMove gibt, welches man auch dafür verwenden kann.
Schwierig wird es allerdings mit dem Herausfinden, ob die Maus nicht mehr über dem Element liegt... Ich habe schon versucht dafür OnMouseMove des übergeodneten Control zu nutzen, dass klaptt allerdings nicht immer. Wenn man die Maus sehr schnell aus dem Form herausführt "merkt" das übergeordnete Control manchmal nicht, dass gerade die Maus drüber geführt wurde...

_________________
Michael
(principal certified lotus professional - developer)
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Sa 31.05.03 11:12 
Mit ´nem Timer!

Aber wenn ich mich recht erinnere haben manche Controls schon die Ereignisse OnMouseEnter und OnMouseExit.

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
FriFra Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 557

Win XP Prof, Win XP Home,Win Server 2003,Win 98SE,Win 2000,Win NT4,Win 3.11,Suse Linux 7.3 Prof,Suse Linux 8.0 Prof
D2k5 Prof, D7 Prof, D5 Standard, D3 Prof, K3 Prof
BeitragVerfasst: Sa 31.05.03 11:24 
An einen Timer habe ich auch schon gedacht, aber wenn ich die Mausposition abfrage bekomme ich ja die Screenkoordinazten. Wie bekomme ich nun sicher heraus an welcher absoluten Position sich das entspr. Control auf dem Screen befindet?
Man könnte meinen die Position wäre Form.Left+Form.Borderwidth+MyControl.Left (linker Rand) und Form.Top+Form.Borderwidth+MyControl.Top (Oberkante), aber schon bei der Oberkante tritt das Problem auf, dass ich nicht weis wie hoch die Titlebar ist (kann je nach Theme varieren)... :roll:

_________________
Michael
(principal certified lotus professional - developer)
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Sa 31.05.03 11:27 
hallo,

du musst folgende nachrichten abfangen
ausblenden Delphi-Quelltext
1:
2:
procedure CMMouseEnter(var msg: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var msg: TMessage); message CM_MOUSELEAVE;


Gruß
Ken
FriFra Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 557

Win XP Prof, Win XP Home,Win Server 2003,Win 98SE,Win 2000,Win NT4,Win 3.11,Suse Linux 7.3 Prof,Suse Linux 8.0 Prof
D2k5 Prof, D7 Prof, D5 Standard, D3 Prof, K3 Prof
BeitragVerfasst: Sa 31.05.03 11:55 
Wie binde ich dieses Messagehandling so ein, dass ich z.B. herausfinde das die Maus auf Edit1 bzw. aus Edit1 bewegt wird?

_________________
Michael
(principal certified lotus professional - developer)
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: So 01.06.03 11:45 
hallo,

also, ich glaube, du musst eine eigene komponente ableiten. Und dann in der neuen Edit komponente im private teil die beiden oben erwähnten prozeduren einbinden und dann kannst du dort halt den zugriff auf ein event realisieren...

zb
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
private
  FMouseEnter: TNotifyEvent;
protected
  procedure DoMouseEnter();
published
  property OnMouseEnter: TNotifyEvent read F...
...

procedure TMeinEdit.CMMouseEnter(var msg: TMessage); message CM_MOUSEENTER; 
begin
  DoMouseEnter;
end;
...
procedure TMeinEdit.DoMouseEnter();
begin
  if assigned(FMouseEnter) then
    FMouseEnter(Self);
end;