Is there a SEND_COMMAND to move or resize a button?
Joe Hebert
Posts: 2,159
Is it possible to move or resize a G4 touch panel button dynamically? There is an abundance of properties we have access to at run-time with SEND_COMMANDs but I don?t see anything for left, top, height, and width. Maybe I?m not looking in the right place in software history?
TIA
TIA
0
Comments
I think this should position a general button 34, in both states to top/left 20/30, width 100 height 50
SEND_COMMAND dvPanel,'^BMF-,34,0,%R20,30,100,50'
I remember one of the developers sharing at a training session how it got the "BMF" name: "Big Mother-F'ing" command.
If you used dynamic images you wouldn't even need bitmaps on the panel file.
Wouldn't that confuse someone trying to steal your panel file!
Has anyone actually done that?
It'd be useful for creating games (for the programmer who doesn't think making a living is important).
'%R',<left>,<top>,<right>,<bottom>' Set Rectangle.
Following your example, to position button 34 to top/left 20/30, width 100 and height 50 it looks like the following needs to be sent:
SEND_COMMAND dvPanel, ?^BMF-34,0,%R30,20,130,70?
There are situations where it would be more straight forward if we had the option to set top, left, width, and height as individual properties (feature request?) but the %R embedded code gets the job done.
Thanks, Marc.
I just wanted to see if have read the manual :rolleyes: (typical excuse of a trainer )
I was wondering though, if there was a way of retrieving the button position.
(so i can do a relative move)
OK, where the F is R !
I can't find it in either Software History or PI.
The ^BMF is very useful for example to size frames around buttons. If the buttons are sometimes hidden and sometimes visible you can size the frame depending to the visible buttons. For screensavers and fast graphic effects i would like to have real hardware accelerated graphic-chips in the G4 panels ... ;-)
Nope, still don't see it.
Release Notes..: Software History 2 Application
Program Version: V2.1.0.25
Content Version: 5.9
Date...........: 05/26/06
Web Update doesn't list a newer version or a need to update.
Any idea on retrieving the position and size yet?
I can't even find the "R". I think I recall looking for this capability a while back and ran into a dead end. If I had found the "R" back when I may have been able to do what I was attempting to do, what ever that was.
The only thing I would suggest is to use the elusive "R" embedded command and initialize the buttons you want x/y coordinates for at start up and just track the last "R" data values sent.
It would be nice if this were simplified with a query command and then change the postion in the same simple manner that you change hide and show effects x/y positon. It does seem a little odd that effect positon change is directly supported but the actual button postion isn't.
It works pretty well as I used it to build a simple web browser on Modero Touch panels, but some first generation Moderos are not very efficient to draw on fly buttons
Don't forget everything you do with BMF commands is not stored in panels so each time you cycle power everything is lost !
Vinc