Project: Floating Input Box (for developers)
-
Hi,
Seeing as how most ruby developers are hesitant to make the plunge to using Webdialogs, I thought I might try creating a simple API that allows developers to easily add a floating inputbox to a tool that they created. The inputbox would provide an interface for the tool options while keeping the tool active.
Here is what the initialization code looks like (should be familiar )
prompts=["Style","Color"] values=["LINE","Black"] dropdowns=["CLINE|LINE","Black|Blue|Red|Orange"] title="Linetool Options" @dlg=UI.floating_inputbox(prompts,values,dropdowns,title)
Values can be set or read from the dialog using a very simple interface as well.
It's not ready to release yet but here's a screenshot of the output.
-
Hi Whaat,
I have some code already that is a similar effort. My inputbox class can use the standard UI, or a WebDialog, has accessors for the input fields, and has persistent storage abilities.
http://forums.sketchucation.com/viewtopic.php?f=314&t=19493&p=163076&hilit=inputbox#p163076
Inputbox class
The Inputbox class makes it easy to create user input dialogs by providing a consistent interface to UI.inputbox for text fields and drop-do...
(sketchuptips.blogspot.com)
-
Does the normal
UI.inputbox
break an active tool? -
@thomthom said:
Does the normal
UI.inputbox
break an active tool?No, the tool will resume right where it left off.
-
@jim said:
Hi Whaat,
I have some code already that is a similar effort. My inputbox class can use the standard UI, or a WebDialog, has accessors for the input fields, and has persistent storage abilities.
http://forums.sketchucation.com/viewtopic.php?f=314&t=19493&p=163076&hilit=inputbox#p163076
Inputbox class
The Inputbox class makes it easy to create user input dialogs by providing a consistent interface to UI.inputbox for text fields and drop-do...
(sketchuptips.blogspot.com)
Hi Jim,
I was not aware that you are adding webdialog support to your inputbox class. Have you released the code yet?
I think our goals are slightly different so I might keep working on my little project. One of my goals is to make the interface as similar as possible to the existing UI.inputbox class, thus increasing the liklihood that it will be used.
-
@whaat said:
I think our goals are slightly different so I might keep working on my little project. One of my goals is to make the interface as similar as possible to the existing UI.inputbox class, thus increasing the liklihood that it will be used.
hmm... I don't find the UI.input class to be that user friendly. It doesn't scale well when you start adding more elements.
I don't think it's the look at makes it the most used, but rather that it's much quicker to implement than a webdialog.
What if this alternative class would support nested hashes of input fields. Each root hash element would mean a tab in the window that appear..? -
@whaat said:
Have you released the code yet?
I thought I did, but I guess I haven't. I will review it and let you know where it is.
@thomthom said:
I don't find the UI.input class to be that user friendly. It doesn't scale well when you start adding more elements.
@whaat said:
One of my goals is to make the interface as similar as possible to the existing UI.inputbox class, thus increasing the liklihood that it will be used.
Simplicity of use by the script-writer was my primary goal for creating my inputbox class - I could never remember how to construct a dropdown. So I made a single method to add a prompt - named 'add'. Then inputbox creates the appropriate type of input based on the arguments given.
Have a look at the example code on the inputbox page. it shows how it turns an Array into a dropdown automatically, amongst other features.
Advertisement