Jump to content


Photo

Vertical Slider and Buddies


  • Please log in to reply
3 replies to this topic

#1 kapege.de

kapege.de
  • Members
  • 192 posts

Posted 05 March 2006 - 01:32 PM

It seems to be a bug. If I do this:
gui, add, Button, vM1, 100`%
gui, add, slider, h201 Range1-90 TickInterval10 ToolTip Center Vertical Buddy1M1 Buddy2M2
gui, add, Button, vM2, 0`%
gui, show
return

GuiEscape:
ExitApp

It seems that Buddy 2 is not aligned to the slider.

If I do that:
gui, add, Button, vM1, 100`%
gui, add, Button, vM2, 0`%
gui, add, slider, h201 Range1-90 TickInterval10 ToolTip Center Vertical Buddy1M1 Buddy2M2
gui, show
return

GuiEscape:
ExitApp

The Gui gets messed up, because the 2nd button that was initially at the top is drawn downwards by the Buddy. So at the top is a gap, at the bottom the Gui is too short.

Or am I wrong?

#2 corrupt

corrupt
  • Members
  • 2558 posts

Posted 05 March 2006 - 06:04 PM

Buddy2 does not get assigned to the slider as M2 has not been created until the next line. If you create the second button before creating the slider it will draw the button on the form before drawing the slider and cause the slider to appear further down. There are a couple ways to solve this. You could either use absolute positions for the controls so that they stay where you put them and create the buttons before creating the slider or you can assign the buddy properties after creating the controls:

gui, add, Button, vM1, 100`% 
gui, add, slider, h201 vsl1 Range1-90 TickInterval10 ToolTip Center Vertical 
gui, add, Button, vM2, 0`% 
GuiControl, +Buddy1M1 +Buddy2M2, sl1 
gui, show
return 

GuiEscape: 
ExitApp


#3 Chris

Chris
  • Administrators
  • 10727 posts

Posted 05 March 2006 - 09:24 PM

As you've demonstrated, the slider-buddying process causes problems with relatively positioned controls. I'll look into it further. Thanks.

#4 kapege.de

kapege.de
  • Members
  • 192 posts

Posted 06 March 2006 - 09:07 AM

@ corrupt: Thanks for your workaround!

@ Chris: Thanks for updating!