Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Blue Gui dragging a panel with mouse help

Author
Message
Vector ScOpE
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: middle world UK
Posted: 12th Dec 2005 12:55 Edited at: 12th Dec 2005 13:00
Any way to make a panel in Blue Gui where you can drag it around the screen, as im making an interface and i need all the screen area i can get.
cant use menus as they get in the way and i wanted to be able to move a panel around so a user could move it out of the way
i was looking at the events but im not sure there is a paneldrag event ?

Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 14th Dec 2005 02:59
Quote: "i was looking at the events but im not sure there is a paneldrag event ?"


There are events for when the user presses the mouse down (LEFTBUTTON_DOWN), moves the mouse (MOUSE_MOVE) and releases the mouse (LEFTBUTTON_UP or MOUSE_CLICK) though. Essentially, the steps are as follows:

- When the user presses the mouse down, and the mouse is over the panel, enable dragging (by setting a variable somewhere) and store the location of the mouse relative to the gadget (using mousePosX( gadget ) and mousePosY( gadget ) )
- When the user moves the mouse, check to see if dragging is enabled, and if it is, reposition the panel based on the current mouse position, taking the original offset into account (positionGadget gadget,mousePosX(panelsParentGadget)-offsetX,mousePosY(panelsParentGadget)-offsetY)
- When the user releases the mouse, disable dragging.


The code then might be something like (off the top of my head, my laptop is in for repair so I cannot test it)




BlueGUI Windows Plugin
Vector ScOpE
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: middle world UK
Posted: 14th Dec 2005 07:02
Thanks Rob thats sorted it

Login to post a reply

Server time is: 2024-11-24 06:18:39
Your offset time is: 2024-11-24 06:18:39