Kjow schreef:
Hi all,

I need to create an "advanced" function that manages mouse events, so
I need to know when/which a button is pressed and so, when no button
is pressed.
I saw that in TMouseButton (row 142 of Controls unit) there isn't
mbNone, so I simply edited that row:

TMouseButton = (mbNone, mbLeft, mbRight, mbMiddle, mbExtra1, mbExtra2);

Now I can see when no buttons are pressed; I simply manage it with

MouseButtonPressed:=Button; //OnMouseDown

MouseButtonPressed:=mbNone; //OnMouseUp

Now the question: there is a better way to do this whitout modify the
Lazarus source code? It is a bug/missing feature or this is a feature?


What about:

type
  TMouseButtons = set of TMouseButton; // if it doesn't exist yet

var
  MouseButtonPressed: TMouseButtons;


> MouseButtonPressed:=MouseButtonPressed + Button; //OnMouseDown

Your mbNone becomes:
> MouseButtonPressed:=[];

Vincent

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to