Jump to content

Create slider on toolbar?


braddewald
 Share

Recommended Posts

Something like this should get you there:

 

try destroyDialog sliderTest catch()
rollout sliderTest "Test"
(
   slider sldSwitcher "" pos:[7,5] orient:#vertical ticks:4 range:[1,5,5] type:#integer
   listBox lbxPresets "" pos:[47,10] width:104 height:5 items:#("320x240", "640x480", "800x600", "1024x768", "1280x960")

   fn changeRenderSize str =
   (
       local tokens = filterString str "x"
       renderWidth = tokens[1] as integer
       renderHeight = tokens[2] as integer
   )

   on sldSwitcher changed index do
       changeRenderSize lbxPresets.items[1+5-index]
)
createDialog sliderTest

Link to comment
Share on other sites

Well, cui.RegisterDialogBar will just register a new toolbar, and you can only dock toolbars, not add one to another (and I think you already know how to do the docking).

 

There might be a way to do that using style:#(), resizing the toolbar programmatically and making the rollout dialog its child - but I'm not sure if that's really worth the effort.

 

If you don't need to dynamically add/remove toolbar buttons, would it work for you if you made a toolbar look-alike in a rollout form, added that cui.RegisterDialogBar rolloutName line and treated it as a toolbar?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...