braddewald Posted February 5, 2013 Share Posted February 5, 2013 I'm trying to create a simple, unlabeled, vertical slider on a toolbar with 5 notches that set the renderWidth/renderHeight values to some preset ones that I have. I'm not finding much info. Any ideas? Link to comment Share on other sites More sharing options...
vojtechcada Posted February 6, 2013 Share Posted February 6, 2013 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 More sharing options...
braddewald Posted February 6, 2013 Author Share Posted February 6, 2013 Thanks! That's way simpler than what I had... But my problem is that I'm trying to dock the slider to a toolbar I have. Any ideas? Link to comment Share on other sites More sharing options...
braddewald Posted February 7, 2013 Author Share Posted February 7, 2013 I know it has to do with the cui.RegisterDialogBar method but I don't know how to correctly implement it. Link to comment Share on other sites More sharing options...
vojtechcada Posted February 7, 2013 Share Posted February 7, 2013 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 More sharing options...
braddewald Posted February 7, 2013 Author Share Posted February 7, 2013 Well I'm trying to do it as seamlessly as possible. That's why opening a dialogue isn't good for me. I think that the next best thing would be just a regular macroscript button that cycles through the preset resolutions. Thanks for all your help by the way! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now