sketchucation logo sketchucation
    • Login
    šŸ¤‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    WebDialog on Mac - problems with height

    Scheduled Pinned Locked Moved Developers' Forum
    9 Posts 3 Posters 949 Views 3 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.
    • A Offline
      azuby
      last edited by

      Hey folks,

      I don't use Sketchup on Mac, but Burkhard told me problems concerning WebDialogs in Sketchup for Mac. We have written a very simple HTML page, which correctly displays in Sketchup for Windows. But for Mac the content does not seem to use the whole hight of the window. Any ideas?

      <html>
      	<head>
      		<title>TITLE</title>
      	</head>
      	<body link="#00ff00" alink="#00ff00" vlink="#00ff00" style="border;none; margin;0; padding;0; background-color;#000; color;#0f0; font-family;Courier">
      		<div style="border;none; margin;0; padding;0;width;100%;text-align;center">
      			<h1 style="border;none; margin;0; padding;0">
      				<span style="font-variant;small-caps;font-weight;bolder">...</span>
      			</h1>
      			<h2><span style="font-variant;small-caps;font-weight;bolder">Version</span></h2>
      			<!-- VERSION //-->
      			<hr width="50%" noshade="noshade" style="color;#0f0;background-color;#0f0; height;1px">
      			<h2><span style="font-variant;small-caps;font-weight;bolder">Credits</span></h2>
      			Foo Bar, <a href="http://errorinitus.de/" target="_blank">error initus</a>
      		</div>
      	</body>
      </html>
      

      azuby

      *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

      Bad English? PM me, correct me. :smile:**

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

        If I wasn't so lazy, I would:

        1. cut and paste your html into a file on my computer and save it in a folder that was convenient for a ruby script to point to
        2. create a new webdialog ruby script and use your example html to observe it's behavior.

        But, as it is, I'm lazy. 😮

        If you want to create some Ruby console command sequences or post a webdialog shell, I'll be happy to run it for you.

        Todd

        1 Reply Last reply Reply Quote 0
        • A Offline
          azuby
          last edited by

          Download the attached file, put it into your Plugins / Tools folder, run Sketchup, type "zzz_show" (without the "") into the Ruby Console. And please tell me, whether you ran it on Mac or Windows and whether the whole hight of the window is used (should be black). Thanks a lot! ā˜€

          azuby


          zzz_show.rb

          *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

          Bad English? PM me, correct me. :smile:**

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

            It (the whole dialog) BARELY even shows up on the screen. It's like it's taking up a pixel.

            I can look more into this later tonight. Mac / Tiger.

            Thanks for putting the "lazy man" package together!

            Todd

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

              A couple things.

              First, and most importantly, your screen coords and dialog size were reversed. It was showing up as a 10 x 10 pixel web page.

              Second, I added several semi-colons in your inline styles. Safari is pretty intolerant of loose inline styles. It now shows up correct.

              Finally, on a mac, set the last parm to true in the WebDialog.new line or you'll have issues.

              Todd

              
              def zzz_show
                d = UI;;WebDialog.new "ZZZ", false, nil, 640, 480, 10, 10, true
                s = <<-HTML
                  <html>
                     <head>
                        <title>TITLE</title>
                     </head>
                     <body link="#00ff00" alink="#00ff00" vlink="#00ff00" style="border;none; margin;0; padding;0; 
                     		background-color;#000; color;#0f0; font-family;Courier;">
                        <div style="border;none; margin;0; padding;0;width;100%;text-align;center;">
                           <h1 style="border;none; margin;0; padding;0;">
                              <span style="font-variant;small-caps;font-weight;bolder;">...</span>
                           </h1>
                           <h2><span style="font-variant;small-caps;font-weight;bolder;">Version</span></h2>
                           <!-- VERSION //-->
                           <hr width="50%" noshade="noshade" style="color;#0f0;background-color;#0f0; height;1px;">
                           <h2><span style="font-variant;small-caps;font-weight;bolder;">Credits</span></h2>
                           Foo Bar, <a href="http://errorinitus.de/" target="_blank">error initus</a>
                        </div>
                     </body>
                  </html>
              HTML
                d.set_html s
                d.show()
              end
              

              SketchUp001.png

              1 Reply Last reply Reply Quote 0
              • A Offline
                azuby
                last edited by

                Oh my god, the CSS things feel like Python ^^, anyway, thanks. And for the wrong initialization, well - I looked into the documentation, which confuses me (a bit) - have a look on your own for the described syntax for the WebDialog constructor:
                http://download.sketchup.com/OnlineDoc/gsu6_ruby/Docs/ruby-webdialog.html
                Next time I should scroll down a bit more šŸ˜‰ But at the end I can't imagine, why a parameter called "resizable" resizes the content of the window if set to false. Seems to be one of the big mysteries of Sketchup ...

                azuby

                *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

                Bad English? PM me, correct me. :smile:**

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

                  Yes, that doc is wrong. This doc is better: http://groups.google.com/group/SketchUp-Plugins-Dev?hl=en

                  Todd

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

                    Todd, while you're on the subject, some of those pages' links have the the word 'edit' in the url, presumably a link for owners to edit the page. For the rest of us, it just produces an error. See the WebDialog page as an example. I believe instead of edit, it should be 'web'

                    Hi

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

                      Yes, I've seen that too. Thanks for the reminder.

                      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