[Lazarus] TMouseButton

Martin lazarus at mfriebe.de
Wed Apr 7 16:46:21 CEST 2010


On 07/04/2010 15:35, Kjow wrote:
> 2010/4/7 Kjow<antispammoni at gmail.com>:
>    
>> Error: Incompatible types: got "Empty Set" expected "TMouseButton"
>>      
> Whops, I've mistyped, it works!
> But how to read the values from a function?
>
> e.g.
>
> function ButtonPress(Button: TMouseButtons): string;
> begin
>    case Button of
>      ...: Result:= 'you pressed' ;
>    end;
> end;
>    


Case will not work.

but
mbleft, or mbLeft + any other button
   if mbLeft in Buttons then xxx;

for only mbLeft, no other button:
   if Buttons = [mbLeft] then xxx;

to add / remove ...
Buttons := Buttons + mbLeft;
Include(Buttons, mbLeft);
Buttons := Buttons - mbLeft;
Exclude(Buttons, mbLeft);







More information about the Lazarus mailing list