sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Project: Floating Input Box (for developers)

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 3 Posters 445 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W Offline
      Whaat
      last edited by

      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.


      FloatingInputBox.jpg

      SketchUp Plugins for Professionals

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by

        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

        http://sketchuptips.blogspot.com/2008/03/inputbox-class.html

        Hi

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          Does the normal UI.inputbox break an active tool?

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jim
            last edited by

            @thomthom said:

            Does the normal UI.inputbox break an active tool?

            No, the tool will resume right where it left off.

            Hi

            1 Reply Last reply Reply Quote 0
            • W Offline
              Whaat
              last edited by

              @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

              http://sketchuptips.blogspot.com/2008/03/inputbox-class.html

              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.

              SketchUp Plugins for Professionals

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                thomthom
                last edited by

                @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..?

                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • J Offline
                  Jim
                  last edited by

                  @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.

                  Hi

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement