How Can I Drag a Button with mouse?

BlitzMax Forums/MaxGUI Module/How Can I Drag a Button with mouse?

Hardcoal(Posted 2013) [#1]
can any one submit some code for that


matibee(Posted 2013) [#2]
Have you played with LogicZone? http://jsp.logiczone.de/

The reason I ask is because you should take a cue from the way this editor works. You don't edit or draw actual buttons, just graphical representations of them. If resizing buttons was simple I'm sure JSP would have done it.


Derron(Posted 2013) [#3]
Just try something "simplier" first.

like "sending a notification (notify) as a user presses a button" as gui movement is somewhat different.

But what should do it:
on button creation, store the handle in a variable
save "mouse down on button"-state to a variable
as long as mousemove-events are generated you will have to move the button (there are some functions concerning position and size of an element).

But remember: current days are using guis which fit to the clientsize a user sets up not your application, so to say: relative positioning/sizing rather than absolute one.


bye
Ron


Captain Wicker (crazy hillbilly)(Posted 2013) [#4]
not in a code-writing mood right now, but it should be something like..
[bbcode]
if mousedown(left) then button_x|button_y = mousex()|mousey()
[/bbcode]
sorry for not being too detailed, but I am just lazy atm ;P