Mouseovergadget()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

A command that returns the GadgetNumber if the mouse is located over one. eg:

MouseOverGadget()

Returns: -1 if no gadget is under mouse
values =>0 Gadget

Would make life much easier to apply different context-menus to single Gadgets(Ranges)

What do you think?

Mike

Tranquilizer/ Secretly!
Registred PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> What do you think?

Good idea! It can be done now by checking in a procedure, but it's clumsy to
do it that way. What reason do you need it for, out of curiosity?


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

It woule be very usefull if you have some Lists (eg GadgetListView) on a window visible and want a Contextmenu with different actions applying to the selected items of the lists.

In general a Zone Library would be goot. Eg:

SetZone ZoneNr,x,y,[width,height],[radius]
DeleteZone ZoneNr
result=zone(x,y) returns the zone which is defined at this position

Mike


Tranquilizer/ Secretly!
Registred PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

It's easy to do with the new EventType() command:

If EventType() = #PB_EventType_LeftClick
Debug GetGadgetState()
DisplayPopupMenu()...
EndIf

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

A MouseOverGadget() should work different.

You don't have to click anything, just move your cursor over the gadget and you get an action...

I did once a MouseOver area and it worked well.
If somebody needs it I can search for it...


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.

Edited by - franco on 08 May 2002 17:13:38
Post Reply