Jump to content

More IndirectUI controls (OptionBasedEffects)


Recommended Posts

I'm commenting this from the Codelab thread to avoid off topic discussions there.


Hey, I don't know if you're taking requests or if this is even possible with Indirect UI, but I was wondering if you could add a simple separator as a gui option. And I was hoping (because it's probably not possible) if you could have tabs (please with sugar)


CodeLab derives the Effect from PropertyBasedEffect which combines properties used in the token with IndirectUi to visualize the properties.


If you get more experienced with this interface you can do a little bit more by using a Visual c# and include your Render code in a template. But still you are limited to the existing properties.


At some point you may switch to OptionBasedEffect class and its library. This class is as easy to use as the PropertyBasedEffect class but provides much more gui elements including several types of panels (or you may define your own OptionControls if the existing set does not provide what you need).


One important thing is that OptionBasedEffects keep the look and feel of PropertyBasedEffects and do not provide a completely different Ui as some other plugins do.


As an example see how the 'Print It' plugin defines its OptionControls especially tabs.

        protected override OptionControlList OnSetupOptions(OptionContext optContext)
            OptionControlList options = new OptionControlList
                new OptionPanelPagesAsTabs(OptionNames.Tabs, optContext, defaultPagesIndex)
                    new OptionPanelPage(OptionNames.TabPrinter, optContext)
                        new OptionPrinterDevice(OptionNames.PrinterSelector, optContext, _vpd)
                          // user-defined OptionControl not in the OptionBasedLibrary
                    new OptionPanelPage(OptionNames.TabLayout, optContext)

No idea what kind of sugar you like to get on tabs. The OptionBasedEffect ones can add images and tooltips.




  • Upvote 1

midoras signature.gif

Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...

BoltBait asked about OptionBasedLibrary.


In the moment there is v0.8 on the way and I'm just updating all published and internal effects and filetypes to replace all current set of plugins.


Time is limited because there is a feature freeze - mid of november - for some commercial software. Time to market period is getting smaller year by year and companies in Switzerland are in trouble because of the strong currency. No idea how long we are able to play this kind of game.


So I'm not really able to spend much time on this in the moment. Still the plan is that 1.0 will be open source with a git repository.


There is not a big difference in using OptionBasedEffects compared to PropertyBased ones.

You may start with a PropertyBasedTemplate and replace the base class of the effect with OptionBasedEffect.

To use it you just have to add a reference to the OptionBasedLibrary in your Visual C# Solution and using directives to OptionBased.Effects and OptionControls.

If you derive a class from OptionBasedEffect the compiler will complain about the stuff you have to override.

You override OnSetupOptions to define your dialog controls and OnSetRenderInfo to get the control infos for the next render loop.

In a next step you can derive your own option controls or dialogs from the base class to build more complex UIs.

If OptionBasedLibrary.pdb is available IntelliSense will support your development.


Together with the v0.8 update I like to publish a small 'How To' plus example.

  • Upvote 3

midoras signature.gif

Link to comment
Share on other sites

  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...