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

    Keep WebDialog in front on XP/Vista?

    Scheduled Pinned Locked Moved Developers' Forum
    10 Posts 6 Posters 306 Views 6 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.
    • J Offline
      jeemang
      last edited by

      Very simple question: does anyone know how to keep a WebDialog in front of the other Sketchup windows on XP/Vista? I know this can be accomplished in OSX using WebDialog.show_modal, but I'm not aware of a good way to accomplish this on other platforms.

      Any help would be much appreciated.

      Josh

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        dlg.show_modal{code_block}
        should work on PC

        TIG

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

          @jeemang said:

          Very simple question: does anyone know how to keep a WebDialog in front of the other Sketchup windows on XP/Vista? I know this can be accomplished in OSX using WebDialog.show_modal, but I'm not aware of a good way to accomplish this on other platforms.

          Any help would be much appreciated.

          Josh

          Just using .show should work. Under windows WebDialogs are always on top of it's owner Sketchup window.

          .show_modal is really for making modal windows, but under osx it doesn't work properly. But OSX has the quirk that WebDialogs doesn't normally stay on top if you use .show - but it will stay on top when you use .show_modal.

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

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            On a PC dlg.show{} and dlg.show_modal{} will both produce a dialog in front of the Sketchup window... BUT on a PC the 'show' version although it stays 'on top' it lets you deactivate and/or minimize it and activate the SKP window and work on that instead; whereas the 'modal' version demands that you enter data and OK/Close before returning to the SKP window as it becomes the active front window that cannot be deactivated, but only closed.

            TIG

            1 Reply Last reply Reply Quote 0
            • Dan RathbunD Offline
              Dan Rathbun
              last edited by

              Given your WebDialog instance var as dlg

              one-liner:

              <span class="syntaxdefault">RUBY_PLATFORM</span><span class="syntaxkeyword">.include?(</span><span class="syntaxstring">'darwin'</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">?</span><span class="syntaxdefault"> dlg</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">show_modal</span><span class="syntaxkeyword">()</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> dlg</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">show</span><span class="syntaxkeyword">()</span><span class="syntaxdefault"> </span>
              

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • T Offline
                todd burch
                last edited by

                In my tools, I use this:

                
                if !@wd.visible?    # get the dialog back 
                	@wd.show()
                else 
                	@wd.bring_to_front()
                end 
                
                
                1 Reply Last reply Reply Quote 0
                • D Offline
                  driven
                  last edited by

                  morning,

                  I'm just wondering, can you have a conditional .show{} in your loader tool button, so that the first time you click, it creates the WD but subsequent clicks will just bring it forward i.e. show_modal..

                  occasionally, I end up with 5 or 6 copies of the same WD under my drawing...

                  and if you can do that, could you use it with a modify key to switch between show or show_modal... rather than closing something thats in the way, eg. WedConsole

                  maybe with a conditional tooltip...

                  probably only useful on a mac....

                  ADD: or maybe a version of Todd's would work?

                  john

                  learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                    @unknownuser said:

                    In my tools, I use this:

                    I use something similar:

                    <span class="syntaxdefault">def self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">show_window</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> window </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">  if window</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">visible<br />    window</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">bring_to_front<br />  else<br />    if RUBY_PLATFORM</span><span class="syntaxkeyword">.include?(</span><span class="syntaxstring">'darwin'</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">      window</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">show_modal </span><span class="syntaxcomment"># To keep window on top of SU on OSX<br /></span><span class="syntaxdefault">    else<br />      window</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">show<br />    end<br />  end<br />end </span><span class="syntaxcomment"># def&nbsp;</span><span class="syntaxdefault"></span>
                    

                    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

                      I'm using a wrapper over WebDialog - subclassed it. http://www.thomthom.net/software/sketchup/tt_lib2/doc/TT/GUI/Window.html

                      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
                        jeemang
                        last edited by

                        Wowsers, thanks for all the responses. Question answered!

                        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