WebDialog help - hide scrollbars

WebDialog help - hide scrollbars

Postby NewOne » Mon Oct 05, 2009 11:11 am

How can I hide scrollbars in webdialog?
I tried with CSS overflow:auto; , but this works just if I don't use !DOCTYPE, but I need !DOCTYPE (Transitional) to enable :focus css pseudoelement.
The vertical scrollbar is there, grayed-oud and taking my pixels abusive. I need that little space :(
:idea:

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 ?
0

NewOne 
 

Re: WebDialog help - hide scrollbars

Postby DIEGO-RODRIGUEZ » Mon Oct 05, 2009 11:37 am

try >

in html, body properties

<body scroll="no" (l add here other property "color" etc ...)>
0

DIEGO-RODRIGUEZ 
Banned
 

Re: WebDialog help - hide scrollbars

Postby NewOne » Mon Oct 05, 2009 11:48 am

elcorto wrote:try >

in html, body properties

<body scroll="no" (l add here other property "color" etc ...)>

Thanks elcorto, the option is working. :berserk:

Maybe someone can explain why element.selected = true; doesn't work properly in native SU installation, but after updating IE from 6 to 7 on Windows machine, it is fixed. Is there some JS update? can it be applied without updating IE?
0

NewOne 
 

Re: WebDialog help - hide scrollbars

Postby MartinRinehart » Tue Oct 06, 2009 6:26 pm

The second parameter to WebDialog.new, "scrollable" (show scroll bars if true), works correctly for Mac, but does nothing on PC where you get scrollbars unless your HTML/CSS/JavaScript eliminates them.
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: WebDialog help - hide scrollbars

Postby Dan Rathbun » Wed Oct 07, 2009 12:56 pm

NewOne, and all ... I found this article on virtuosimedia very informative
Ultimate IE6 Cheatsheet: How To Fix 25+ Internet Explorer 6 Bugs

.. in addition the author recommends always using !DOCTYPE, and makes a good case.
.. other good tips, ie: the CSS Reset Rule.

have a read y'all !
0
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    Re: WebDialog help - hide scrollbars

    Postby chrisglasier » Wed Oct 07, 2009 3:16 pm

    NewOne wrote:How can I hide scrollbars in webdialog?

    Code: Select all

    css ...

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

    0
    With JSON machines we can analyse what is to be achieved so that IT can help with automation to achieve it.
    User avatar
    chrisglasier 
    PluginStore Author
    PluginStore Author
     

    Re: WebDialog help - hide scrollbars

    Postby Dan Rathbun » Wed Oct 07, 2009 5:39 pm

    CSS Attribute overflow:
    With Internet Explorer 6 and later, when you use the !DOCTYPE declaration to specify standards-compliant mode, this property (overflow ) applies to the html object.
    1. MSDN Library / CSS Reference: overflow Attribute | overflow Property
    0
      I'm not here much anymore. But a PM will fire email notifications.
      User avatar
      Dan Rathbun 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby MartinRinehart » Wed Oct 07, 2009 6:54 pm

      Dan Rathbun wrote:NewOne, and all ... I found this article ... very informative


      Thanks, Dan.

      So informative, in fact, that it would be nice if you posted a new topic re IE6 Cheat Sheet, or something similar so Google will find it for us.
      0
      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

      MartinRinehart 
       

      Re: WebDialog help - hide scrollbars

      Postby chrisglasier » Thu Oct 08, 2009 2:07 am

      chrisglasier wrote:
      NewOne wrote:How can I hide scrollbars in webdialog?

      Code: Select all

      css ...

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



      Sorry forgot the pic
      cgScenes no scroll.png
      0
      With JSON machines we can analyse what is to be achieved so that IT can help with automation to achieve it.
      User avatar
      chrisglasier 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby NewOne » Thu Oct 08, 2009 8:50 am

      chrisglasier wrote:
      Code: Select all

      css ...

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




      But you don't use !DOCTYPE, right? :mrgreen: Paste this on the top of your Html page and tell me if overflow works for you. Also your window border...
      Code: Select all
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      0

      NewOne 
       

      Re: WebDialog help - hide scrollbars

      Postby chrisglasier » Thu Oct 08, 2009 11:07 am

      NewOne wrote:
      But you don't use !DOCTYPE, right? :mrgreen: Paste this on the top of your Html page and tell me if overflow works for you. Also your window border...
      Code: Select all
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


      My top:
      Code: Select all

      <!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.
      0
      With JSON machines we can analyse what is to be achieved so that IT can help with automation to achieve it.
      User avatar
      chrisglasier 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby chrisglasier » Thu Oct 08, 2009 11:18 am

      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!
      0
      With JSON machines we can analyse what is to be achieved so that IT can help with automation to achieve it.
      User avatar
      chrisglasier 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby NewOne » Thu Oct 08, 2009 11:39 am

      chrisglasier wrote: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!

      Same thing happens to me. So, I used your version of !DOCTYPE :mrgreen:
      0

      NewOne 
       

      Re: WebDialog help - hide scrollbars

      Postby Jim » Sun Oct 18, 2009 7:01 pm

      Is there a single, simple answer to this?
      0
      Hi

      Jim 
      Global Moderator
       

      Re: WebDialog help - hide scrollbars

      Postby NewOne » Sun Oct 18, 2009 7:07 pm

      Jim wrote: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.
      0

      NewOne 
       

      Re: WebDialog help - hide scrollbars

      Postby thomthom » Sun Oct 18, 2009 7:15 pm

      I use STRICT doctype and <body scroll="no">. Since this is for an application I don't care that it's not standard.
      0
      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund
      User avatar
      thomthom 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby chrisglasier » Mon Oct 19, 2009 2:44 am

      thomthom wrote: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.
      0
      With JSON machines we can analyse what is to be achieved so that IT can help with automation to achieve it.
      User avatar
      chrisglasier 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby thomthom » Mon Oct 19, 2009 7:36 am

      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.
      0
      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund
      User avatar
      thomthom 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby chrisglasier » Mon Oct 19, 2009 8:54 am

      thomthom wrote: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:

      Code: Select all
      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
      0
      With JSON machines we can analyse what is to be achieved so that IT can help with automation to achieve it.
      User avatar
      chrisglasier 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby thomthom » Mon Oct 19, 2009 9:20 am

      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 wrote: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?
      0
      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund
      User avatar
      thomthom 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby chrisglasier » Mon Oct 19, 2009 9:38 am

      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!
      0
      With JSON machines we can analyse what is to be achieved so that IT can help with automation to achieve it.
      User avatar
      chrisglasier 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby thomthom » Mon Oct 19, 2009 9:45 am

      chrisglasier wrote: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
      0
      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund
      User avatar
      thomthom 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby thomthom » Mon Oct 19, 2009 9:51 am

      Ah!
      There is a standard conformant way!

      Code: Select all
      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.
      0
      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund
      User avatar
      thomthom 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby chrisglasier » Mon Oct 19, 2009 10:20 am

      Good and noted! And used here.
      0
      With JSON machines we can analyse what is to be achieved so that IT can help with automation to achieve it.
      User avatar
      chrisglasier 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby thomthom » Mon Oct 19, 2009 10:33 am

      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.
      0
      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund
      User avatar
      thomthom 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby thomthom » Mon Oct 19, 2009 11:44 am

      NewOne wrote: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.
      0
      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund
      User avatar
      thomthom 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby NewOne » Mon Oct 19, 2009 12:46 pm

      thomthom wrote: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.
      Code: Select all
      @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
      0

      NewOne 
       

      Re: WebDialog help - hide scrollbars

      Postby thomthom » Mon Oct 19, 2009 1:13 pm

      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

      http://www.quirksmode.org/js/detect.html
      0
      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund
      User avatar
      thomthom 
      PluginStore Author
      PluginStore Author
       

      Re: WebDialog help - hide scrollbars

      Postby NewOne » Mon Oct 19, 2009 5:13 pm

      If so, why does it renders buttons so old-way? :(
      0

      NewOne 
       

      Re: WebDialog help - hide scrollbars

      Postby thomthom » Mon Oct 19, 2009 5:18 pm

      IE is quick to do weird stuff to form control. In general - form controls in any browser is unpredictable.

      If it'd been rendering like IE4 it would be permanently stuck in Quicks mode. Standard mode in IE wasn't introduced until IE6.
      0
      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund
      User avatar
      thomthom 
      PluginStore Author
      PluginStore Author
       

      SketchUcation One-Liner Adverts

      by Ad Machine » 5 minutes ago



      Ad Machine 
      Robot
       

      Next


       

      Return to Developers' Forum

      cron

      Who is online

      Users browsing this forum: No registered users and 7 guests

      Visit our sponsors: