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

    Float toolbar on creation?

    Scheduled Pinned Locked Moved Developers' Forum
    45 Posts 7 Posters 1.2k Views 7 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.
    • thomthomT Offline
      thomthom
      last edited by

      Ok - made some progress. Got code working on both Windows and OSX 10.4 (SU7.1). Other systems and versions untested.

      Note that there are still issues. This code needs to be tested more.

      • On Windows it require registry.rb and Win32API from a normal ruby installation. Not sure how to bundle this - in terms of license and general practicability.
      • On OSX it appears that toolbar names only appears in the plist if it has previously been shown at some point. If it hasn't then there isn't any trace of it. Looking for other source for the names.
      • I'm not familiar with how to get OSX data - so it's a bit of hacky brute force approach. Might be a better method to get the data. Certainly needs testing.

      Work In Progress

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

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

        The Win version will list old toolbar names - toolbars that are no longer present, but still got remains in the registry.

        Was thinking of running a loop testing against UI.toolbar - but it will create a new toolbar if given the name of a non-existent toolbar. Acts like UI::Toolbar.new.

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

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

          For Windows - I'm wondering if it'd be an option to use the Win32 API to read the menu items from the Toolbar menu...

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

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

            A new Windows solution. It uses the Win32 API to read the menu items under View->Toolbars. This should allow the list returned to be up to date at any point - even after new toolbars has been created. And it won't list old names.

            Only thing is that I'm not sure how to get the SU window handle...

            Wonder if similar can be done under OSX...


            New Windows Solution

            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

              What I was thinking (somebody stop me) was hiding all toolbars before creating the new toolbar. Then the user can un-dock it. Finally, unhide all the hidden toolbars. But it's a terrible hack.

              Hi

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

                Does that avoid the shifting of toolbars? It seems to be that the toolbars shift when the Toolbar object is created - even before the toolbar is ever shown.

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

                1 Reply Last reply Reply Quote 0
                • X Offline
                  xrok1
                  last edited by

                  have you guys considered making a dialog window the first time a new plug runs that asks if you would like to run the plug (after all the existing toolbars are loaded) then insert the new toolbar. that way the old toolbars will be in place already, avoiding the startup scramble? (if its possible?)

                  “There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

                  http://www.Twilightrender.com try it!

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

                    That won't avoid the scramble either. Even if you add toolbars after all the other ones are added it still inserts itself randomly between toolbars.

                    Selection Toys has a function where the user has to enable to toolbar before it can be accessible. Doesn't prevent the mess though.

                    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

                      So to sum-up this thread, the API methods for managing Toolbars is either broken or lacks functionality in order to be effective?

                      Hi

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

                        It sure is a mess. It does seem it's possible to enumerate the Ruby toolbar names.
                        But if the purpose is to prevent toolbars shifting about - then it's a fail. 😞

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

                        1 Reply Last reply Reply Quote 0
                        • X Offline
                          xrok1
                          last edited by

                          does anyone even know how they organise themslves when they jumble? is it alphabetically, native tools first...?
                          would it be exactly the same if you had 2 computers with same layout then installed same new plug?

                          “There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

                          http://www.Twilightrender.com try it!

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

                            I've not been able to notice any patterns.

                            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

                              I could never find a pattern - it's just chaos. Sometimes they have absolute positions (x, y), but others appear to use the equivalent of -1 as a coordinate and these seem to float inside the toolbar area.

                              Hi

                              1 Reply Last reply Reply Quote 0
                              • X Offline
                                xrok1
                                last edited by

                                its not even possible to be totally random on a computer is it?
                                has anyone ever tried on 2 machines to see if its the same?

                                “There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

                                http://www.Twilightrender.com try it!

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

                                  And I've never seen any other application where the toolbar behaves like this. No idea what kind of implementation it is.

                                  Been using WinDowse to try to find some hints - but with no luck.

                                  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

                                    I'm don't want to put any more time into trying to reverse engineer them.

                                    The conclusion I keep coming to is that a WebDialog-based User Interface Manager is the solution. But I'm not sure what that would look like.

                                    Hi

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

                                      You mean a webdialog instead of the toolbars?

                                      I just came to think of this thread, http://forums.sketchucation.com/viewtopic.php?f=15&t=25676, where did guy have managed to embed the SU tool windows into the native SU frame.
                                      What would be interesting would be to embedd a Webdialog like that and use that as a blank canvas.

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

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

                                        @jim said:

                                        The conclusion I keep coming to is that a WebDialog-based User Interface Manager is the solution. But I'm not sure what that would look like.

                                        One idea I've been playing with recently: a tool that launches other tools.
                                        Then you could hide all toolbars. When you want to switch tool, you hit a shortcut that activates the tool that brings up a set of toolbars drawn on the viewport - like Fredo's tools.

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

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

                                        Advertisement