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

    WebDialog help - hide scrollbars

    Scheduled Pinned Locked Moved Developers' Forum
    31 Posts 7 Posters 5.7k 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.
    • chrisglasierC Offline
      chrisglasier
      last edited by

      @chrisglasier said:

      @newone said:

      How can I hide scrollbars in webdialog?

      
      > 
      > css ...
      > 
      > body{
      > border;0px; 
      > margin;0px; 
      > overflow;hidden   }
      > 
      > 
      

      Sorry forgot the pic
      cgScenes no scroll.png

      With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

      1 Reply Last reply Reply Quote 0
      • N Offline
        NewOne
        last edited by

        @chrisglasier said:

        
        > 
        > css ...
        > 
        > body{
        > border;0px; 
        > margin;0px; 
        > overflow;hidden   }
        > 
        > 
        

        But you don't use !DOCTYPE, right? πŸ’š Paste this on the top of your Html page and tell me if overflow works for you. Also your window border...

        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
        
        1 Reply Last reply Reply Quote 0
        • chrisglasierC Offline
          chrisglasier
          last edited by

          @newone said:

          But you don't use !DOCTYPE, right? πŸ’š Paste this on the top of your Html page and tell me if overflow works for you. Also your window border...

          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
          

          My top:

          
          
          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
          
          <html>
          
          <!-- Copyright 2007-9 Chris Glasier -->
          
          <!--This follows the Nameset format for easy integration-->
          
          <head>
          
          <title>Scene machine</title>
          
          <LINK href="Scene machine.css" rel="stylesheet" type="text/css">
          
          <script type = "text/javascript" src = "javascript/sceneDevice.js"></script>
          
          </head>
          

          Body css in external file of course.

          With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

          1 Reply Last reply Reply Quote 0
          • chrisglasierC Offline
            chrisglasier
            last edited by

            Adding "http://www.w3.org/TR/html4/loose.dtd" looks like this:

            cgScenes no scroll 002.png

            but the webdialog is on the local drive so I don't see the big deal. But please let me know if there is one!

            With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

            1 Reply Last reply Reply Quote 0
            • N Offline
              NewOne
              last edited by

              @chrisglasier said:

              Adding "http://www.w3.org/TR/html4/loose.dtd" looks like this:

              [attachment=0:1ma73d3a]<!-- ia0 -->cgScenes no scroll 002.png<!-- ia0 -->[/attachment:1ma73d3a]

              but the webdialog is on the local drive so I don't see the big deal. But please let me know if there is one!

              Same thing happens to me. So, I used your version of !DOCTYPE πŸ’š

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

                Is there a single, simple answer to this?

                Hi

                1 Reply Last reply Reply Quote 0
                • N Offline
                  NewOne
                  last edited by

                  @jim said:

                  Is there a single, simple answer to this?

                  Well, I use <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> and <body scroll="no">. This seems to be working in all the cases. Other suggestions are not working if I use !DOCTYPE.

                  I think this is the universal answer.

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

                    I use STRICT doctype and <body scroll="no">. Since this is for an application I don't care that it's not standard.

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

                    1 Reply Last reply Reply Quote 0
                    • chrisglasierC Offline
                      chrisglasier
                      last edited by

                      @thomthom said:

                      I use STRICT doctype and <body scroll="no">. Since this is for an application I don't care that it's not standard.

                      Don't you think in good time such application may well need web connectivity, say, to get or set remote data? Making things comply with today's standards could save future hassles for following generations.

                      With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

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

                        I'm a strong proponent of webstandards. But I'm also pragmatic - this is to work around an SU bug where the scrollbar argument in SU's Webdialog class doesn't take effect.
                        It's not something that will cause problems for future plugins - if future SU corrects the bug, then this little attribute don't do much.

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

                        1 Reply Last reply Reply Quote 0
                        • chrisglasierC Offline
                          chrisglasier
                          last edited by

                          @thomthom said:

                          I'm a strong proponent of webstandards. But I'm also pragmatic - this is to work around an SU bug where the scrollbar argument in SU's Webdialog class doesn't take effect.
                          It's not something that will cause problems for future plugins - if future SU corrects the bug, then this little attribute don't do much.

                          Ok no big deal except I am working on the API webdialog (which will include snippets). It seems there is a conflict between this:

                          
                          body{
                          border;0px; 
                          margin;0px; 
                          overflow;hidden   }
                          

                          and STRICT doctype, so shouldn't the solution be within HTML compliance and standards and not within Sketchup webdialogs?

                          It would be useful for me to understand.

                          Chris

                          With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

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

                            I don't know why the overflow with STRICT doctype within a Webdialog doesn't work - it's how you do it with websites.

                            @chrisglasier said:

                            so shouldn't the solution be within HTML compliance and standards and not within Sketchup webdialogs?

                            Seeing that the Webdialog has a scroll property for it's creating of the ruby class I'd expect that the scrollbars should be set from ruby. I think that the embedded IE control has a scroll property which developers who wish to embed HTML content can set to a fixed override. Why this argument isn't adhered to, I don't know.

                            I wonder if the SU dev team has been made aware of the scrollnar bug.
                            Was it so that this is PC only - that it works as expected on Mac?

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

                            1 Reply Last reply Reply Quote 0
                            • chrisglasierC Offline
                              chrisglasier
                              last edited by

                              Thanks Thomas. BTW I think it therapeutic to use a STRICT doctype then abuse it by doing something non-standard - appeals to cynical Brits like me!

                              With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

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

                                @chrisglasier said:

                                Thanks Thomas. BTW I think it therapeutic to use a STRICT doctype then abuse it by doing something non-standard - appeals to cynical Brits like me!

                                It's make the standard conformant me twitch. x_X

                                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

                                  Ah!
                                  There is a standard conformant way!

                                  html
                                  {
                                    overflow; hidden;
                                  }
                                  

                                  When removing scoll="no" and adding that to the CSS the scrollbars disappeared in STRICT mode.

                                  Armed with that, you could sub-class the Webdialog class and tap into it's .new method and pass on the scroll argument to the webdialog when it's ready. Unless you're fine with just having it defined in the CSS and ignore the Ruby argument.
                                  I was going to make a wrapper for myself, that took care of the matter where the size is only being read the first time it's created. At the moment, if you try to change the size arguments for a non-resizable webdialog they won't take effect unless you purge the saved settings.

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

                                  1 Reply Last reply Reply Quote 0
                                  • chrisglasierC Offline
                                    chrisglasier
                                    last edited by

                                    Good and noted! And used here.

                                    With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

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

                                      I don't know why I didn't try that before. I know that when switching between STRICT and quicks the behaviour of HTML and BODY changes.
                                      Glad we finally worked it out.

                                      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

                                        @newone said:

                                        One more thing: JS statement element.selected = true; did not worked on my native SU instalation. After I updated my Internet Explorer from 6 to 7, it did worked... how is this possible, because in SU I still have IE4 ?

                                        You don't have IE4 in SU. You have whatever is installed on the system.
                                        That's one of the reason I would prefer is SU used a standalone web-frame that isn't linked to the system.

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

                                        1 Reply Last reply Reply Quote 0
                                        • N Offline
                                          NewOne
                                          last edited by

                                          @thomthom said:

                                          You don't have IE4 in SU. You have whatever is installed on the system.
                                          That's one of the reason I would prefer is SU used a standalone web-frame that isn't linked to the system.

                                          Please run this.

                                          
                                          @my_dialog = UI;;WebDialog.new('Check Version', false,"",400, 100, 300, 300, true)
                                          
                                          html = '<html>
                                          <body>
                                          
                                          <script type="text/javascript">
                                          var browser=navigator.appName;
                                          var b_version=navigator.appVersion;
                                          var version=parseFloat(b_version);
                                          
                                          document.write("Browser name; "+ browser);
                                          document.write("<br />");
                                          document.write("Browser version; "+ version);
                                          </script>
                                          
                                          </body>
                                          </html>'
                                          
                                          @my_dialog.set_html(html)
                                          
                                          @my_dialog.show{}
                                          @my_dialog.bring_to_front
                                          
                                          

                                          IE version.png

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

                                            You can't rely on navigator.appVersion. Since IE4 and up it has always reported 4 for legacy support reasons. You must parse the navigator.userAgent string.
                                            http://javascript.gakaa.com/navigator-appversion.aspx

                                            JavaScript - Browser detect

                                            favicon

                                            (www.quirksmode.org)

                                            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
                                            • 2 / 2
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement