• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

[code] Win32 Moving/Showing/Hiding Toolbars and Dialogs

Scheduled Pinned Locked Moved Developers' Forum
91 Posts 8 Posters 15.9k Views 8 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.
  • T Offline
    thomthom
    last edited by Sep 26, 2010, 10:46 AM

    What I wanted to do was work out what flags to change to make a WebDialog into a ToolWindow. You haven't looked into that by any chance?

    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
      Jim
      last edited by Sep 26, 2010, 2:00 PM

      That would be an extended style WS_EX_TOOLWINDOW. I'm not sure that can be changed after run=time, but I will try it.

      Styles:
      http://msdn.microsoft.com/en-us/library/czada357%28VS.80%29.aspx

      Extended Styles:
      http://msdn.microsoft.com/en-us/library/61fe4bte%28VS.71%29.aspx

      Hi

      1 Reply Last reply Reply Quote 0
      • T Offline
        thomthom
        last edited by Sep 26, 2010, 3:45 PM

        It can - I used to do it in Visual Basic when VB didn't offer full control over the windows. You can in fact change any window of any app - as long as you get its handle.

        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
          Jim
          last edited by Sep 26, 2010, 3:50 PM

          Yep, just did it. I'm just wondering of I am not writing a library that has already been written...

          Hi

          1 Reply Last reply Reply Quote 0
          • T Offline
            thomthom
            last edited by Sep 26, 2010, 3:57 PM

            How quickly can you get the window handle when opening webdialogs? Can you avoid a flicker of change?

            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
              Jim
              last edited by Sep 26, 2010, 4:09 PM

              Good question I don't know the answer to, but wouldn't the reliable way be to have the dialog send a message back to ruby when it's ready?

              Or can you change the dialog to a toolwindow before you .show() it? Will need to test.

              Hi

              1 Reply Last reply Reply Quote 0
              • T Offline
                thomthom
                last edited by Sep 26, 2010, 4:38 PM

                Maybe the .show event of the dialog triggers as it's displayed? But I'm not sure if it wait for the HTML - which you do not want - as that will lag.

                And can you do anything before calling show? You need a handle to the window - how are you getting that at the moment?

                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
                  Jim
                  last edited by Sep 26, 2010, 4:58 PM

                  What does it mean when I get a negative value for a window style? How do I decode it into it's positive representation?

                  Hi

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    thomthom
                    last edited by Sep 26, 2010, 4:59 PM

                    From GetWindowLong?

                    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
                      Jim
                      last edited by Sep 26, 2010, 5:06 PM

                      yeah.

                      s = get_style("Ruby Console") -1798569916

                      Hi

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        thomthom
                        last edited by Sep 26, 2010, 5:14 PM

                        hm....

                        Are you receiving the data in the correct data type?

                        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
                          Jim
                          last edited by Sep 26, 2010, 11:25 PM

                          Turns out the negative return value is not a problem - I just wasn't using it right.

                          Hi

                          1 Reply Last reply Reply Quote 0
                          • J Offline
                            Jim
                            last edited by Sep 26, 2010, 11:41 PM

                            @thomthom said:

                            Maybe the .show event of the dialog triggers as it's displayed? But I'm not sure if it wait for the HTML - which you do not want - as that will lag.

                            And can you do anything before calling show? You need a handle to the window - how are you getting that at the moment?

                            Using FindWindow - which is a basic search by window name and class.

                            Hi

                            1 Reply Last reply Reply Quote 0
                            • J Offline
                              Jim
                              last edited by Sep 27, 2010, 5:41 PM

                              For a WebDialog, I couldn't find a handle until it was shown. I used EnumWindows and EnumChildWidows to locate it.

                              But I didn't see a lag when applying the ToolWIndow class immediately after .showing the webdialog.

                              Hi

                              1 Reply Last reply Reply Quote 0
                              • T Offline
                                thomthom
                                last edited by Sep 27, 2010, 8:17 PM

                                Neat! 😄

                                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
                                  Jim
                                  last edited by Sep 27, 2010, 9:25 PM

                                  The Win32API.so file does not support the use of callbacks needed by EnumWindows and EnumChildWindows. So I have had to move to win32/api.so, which does support callbacks. But this will also allow more interesting things to be done, such as finding resizing Sketchup by its drawing area, and sending values to the Measurements box via a plugin.

                                  Hi

                                  1 Reply Last reply Reply Quote 0
                                  • T Offline
                                    thomthom
                                    last edited by Sep 29, 2010, 1:38 PM

                                    When there is multiple SketchUp windows open - how do you find the one you want?

                                    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
                                      Jim
                                      last edited by Sep 29, 2010, 1:52 PM

                                      Hopefully, the window titles are different. If not, I'm not sure.

                                      Hi

                                      1 Reply Last reply Reply Quote 0
                                      • T Offline
                                        thomthom
                                        last edited by Sep 29, 2010, 1:55 PM

                                        So you look for windows with "<filename> - SketchUp (Pro)"

                                        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
                                          Jim
                                          last edited by Sep 29, 2010, 1:57 PM

                                          Too fast... here's how to get the exact name. (But is_pro? is for windows 7+)

                                          
                                          def su_window_name
                                              pro = Sketchup.is_pro? ? " Pro" ; ""
                                              if ((title = Sketchup.active_model.title).empty?)
                                                  return ("Untitled - SketchUp" + pro)
                                              else
                                                  return (title += ".skp - SketchUp" + pro)
                                              end
                                          end
                                          
                                          

                                          Hi

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 3
                                          • 4
                                          • 5
                                          • 1 / 5
                                          1 / 5
                                          • First post
                                            11/91
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement