SketchUcation Premium Membership

 

 

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 ?
NewOne
 
Posts: 329
Joined: Thu Oct 23, 2008 6:21 pm
Location: Maramures, Romania

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 ...)>
DIEGO-RODRIGUEZ
Banned
 
Posts: 272
Joined: Sat Jan 10, 2009 6:20 pm
Location: Argentina - Mar del plata
Name: diego

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?
NewOne
 
Posts: 329
Joined: Thu Oct 23, 2008 6:21 pm
Location: Maramures, Romania

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.
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.
MartinRinehart
 
Posts: 762
Joined: Mon Jul 27, 2009 1:13 pm
Name: Martin Rinehart

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 !
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4102
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

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   }

User avatar
chrisglasier
 
Posts: 1014
Joined: Tue Jun 03, 2008 9:11 am
Location: Hong Kong/Zhuhai
Name: Chris Glasier
Operating system: Windows
SketchUp version: 8
License type: Free/Make
SketchUp use: other
Level of SketchUp: Intermediate

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
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4102
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

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.
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.
MartinRinehart
 
Posts: 762
Joined: Mon Jul 27, 2009 1:13 pm
Name: Martin Rinehart

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
Please, register (free) to access all the attachments on the forums.
User avatar
chrisglasier
 
Posts: 1014
Joined: Tue Jun 03, 2008 9:11 am
Location: Hong Kong/Zhuhai
Name: Chris Glasier
Operating system: Windows
SketchUp version: 8
License type: Free/Make
SketchUp use: other
Level of SketchUp: Intermediate

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">
NewOne
 
Posts: 329
Joined: Thu Oct 23, 2008 6:21 pm
Location: Maramures, Romania

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.
User avatar
chrisglasier
 
Posts: 1014
Joined: Tue Jun 03, 2008 9:11 am
Location: Hong Kong/Zhuhai
Name: Chris Glasier
Operating system: Windows
SketchUp version: 8
License type: Free/Make
SketchUp use: other
Level of SketchUp: Intermediate

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!
Please, register (free) to access all the attachments on the forums.
User avatar
chrisglasier
 
Posts: 1014
Joined: Tue Jun 03, 2008 9:11 am
Location: Hong Kong/Zhuhai
Name: Chris Glasier
Operating system: Windows
SketchUp version: 8
License type: Free/Make
SketchUp use: other
Level of SketchUp: Intermediate

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:
NewOne
 
Posts: 329
Joined: Thu Oct 23, 2008 6:21 pm
Location: Maramures, Romania

Re: WebDialog help - hide scrollbars

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

Is there a single, simple answer to this?
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

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.
NewOne
 
Posts: 329
Joined: Thu Oct 23, 2008 6:21 pm
Location: Maramures, Romania

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.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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.
User avatar
chrisglasier
 
Posts: 1014
Joined: Tue Jun 03, 2008 9:11 am
Location: Hong Kong/Zhuhai
Name: Chris Glasier
Operating system: Windows
SketchUp version: 8
License type: Free/Make
SketchUp use: other
Level of SketchUp: Intermediate

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.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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
User avatar
chrisglasier
 
Posts: 1014
Joined: Tue Jun 03, 2008 9:11 am
Location: Hong Kong/Zhuhai
Name: Chris Glasier
Operating system: Windows
SketchUp version: 8
License type: Free/Make
SketchUp use: other
Level of SketchUp: Intermediate

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?
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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!
User avatar
chrisglasier
 
Posts: 1014
Joined: Tue Jun 03, 2008 9:11 am
Location: Hong Kong/Zhuhai
Name: Chris Glasier
Operating system: Windows
SketchUp version: 8
License type: Free/Make
SketchUp use: other
Level of SketchUp: Intermediate

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
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: WebDialog help - hide scrollbars

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

Good and noted! And used here.
User avatar
chrisglasier
 
Posts: 1014
Joined: Tue Jun 03, 2008 9:11 am
Location: Hong Kong/Zhuhai
Name: Chris Glasier
Operating system: Windows
SketchUp version: 8
License type: Free/Make
SketchUp use: other
Level of SketchUp: Intermediate

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.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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
Please, register (free) to access all the attachments on the forums.
NewOne
 
Posts: 329
Joined: Thu Oct 23, 2008 6:21 pm
Location: Maramures, Romania

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
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: WebDialog help - hide scrollbars

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

If so, why does it renders buttons so old-way? :(
NewOne
 
Posts: 329
Joined: Thu Oct 23, 2008 6:21 pm
Location: Maramures, Romania

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.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Keyframe Animation plugin - animate your SketchUp model by adding movement to any object.

Premium Members get 20% discount!

Ad Machine
Robot
 
Posts: 2012

Next

Return to Developers' Forum

cron

Who is online

Users browsing this forum: ammo111, tictactoe and 5 guests