sketchucation logo sketchucation
    • 登入
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

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

    已排程 已置頂 已鎖定 已移動 Developers' Forum
    91 貼文 8 Posters 17.2k 瀏覽 8 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • D 離線
      driven
      最後由 編輯

      hi Dan, Thom, Jim, all

      I've been trying all sorts of things to 'avoid' giving the WebDialog 'focus' while still having it send actions.
      this is what happens with SU native NSPanels (used for SU toolbars) and also for some of the NSWindows used for different preferences and the NS(WebView)Window used by Instructor, but not the NS(WebView)Window used by WebDialog.

      holding down the "cmd"(apple) key, invokes this behavior (no focus, but active) on any window/panel inside

      so far the best/simplest way I've come up with is add to an 'aid memoir', using background colours and text..... but I'll keep trying

      john
      for now??

      learn from the mistakes of others, you may not live long enough to make them all yourself...

      1 條回覆 最後回覆 回覆 引用 0
      • Dan RathbunD 離線
        Dan Rathbun
        最後由 編輯

        @thomthom said:

        @jim said:

        <body onMouseOut ="window.blur()">
        On Windows, it sends the main SU window and everything else to the back.

        How odd...

        yea I tried with a modified test dialog John sent me (I added buttons and some key displays.)

        SelectionInfo.zip

        I'm not here much anymore.

        1 條回覆 最後回覆 回覆 引用 0
        • Dan RathbunD 離線
          Dan Rathbun
          最後由 編輯

          Hey John ... you talk about NS windows made me think of the 9th arg to WebDialog.new
          :mac_only_use_nswindow

          You might need to use a settings Hash to use it. If you do, the key for the 3rd arg is :preferences_key not 'key'

          You should also use Symbol keys not String keys, as the Hash argument is cranky.

          I'm not here much anymore.

          1 條回覆 最後回覆 回覆 引用 0
          • thomthomT 離線
            thomthom
            最後由 編輯

            @dan rathbun said:

            it DOES on Win32 w/ IE 7

            Yea but windows doesn't have the click-through issue. I was thinking since click events would not register under OSX until the window had gotten focus, then maybe mouse events would not trigger either.

            ...I really need to find that box with my Mac... ...ugh, the hurdles of moving...

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

            1 條回覆 最後回覆 回覆 引用 0
            • D 離線
              driven
              最後由 編輯

              an update,

              holding the cmb key down is great for tool swaps and input button clicks, but locking it down means you can't use numerical input boxes...

              I didn't realise that cmd 1,2,3,4,5,6,7,8,9,0 are all shortcut keys, so holding down the key manually is the best option....

              john

              learn from the mistakes of others, you may not live long enough to make them all yourself...

              1 條回覆 最後回覆 回覆 引用 0
              • Dan RathbunD 離線
                Dan Rathbun
                最後由 編輯

                @thomthom said:

                I've been searching for ways to manipulate windows under OSX like one can do under Windows with the Win32 API - but I never find anything. 😞

                RubyCocoa
                it's included with OSX since v10.5 “Leopard” ??

                EDIT: Here's the RubyCocoa SourceForge page.

                I've seen Ruby scripts that had: require 'Cocoa' or similar at the top.

                There is a potential pitfall looming for Sketchup cross-platform scripting, in that Apple intends to replace MRI Ruby, with MacRuby. It would not be bad if we had all the same UI classes in a "WinRuby" that MacRuby has.

                I'm not here much anymore.

                1 條回覆 最後回覆 回覆 引用 0
                • thomthomT 離線
                  thomthom
                  最後由 編輯

                  Ok - something to look into. I hope that allows you to modify existing windows, not sure create your own. (Though creating your own would be cool too.)

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

                  1 條回覆 最後回覆 回覆 引用 0
                  • thomthomT 離線
                    thomthom
                    最後由 編輯

                    @dan rathbun said:

                    There is a potential pitfall looming for Sketchup cross-platform scripting, in that Apple intends to replace MRI Ruby, with MacRuby. It would not be bad if we had all the same UI classes in a "WinRuby" that MacRuby has.

                    mhm - some wrapper to bridge it all.

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

                    1 條回覆 最後回覆 回覆 引用 0
                    • Dan RathbunD 離線
                      Dan Rathbun
                      最後由 編輯

                      @thomthom said:

                      @dan rathbun said:

                      There is a potential pitfall looming for Sketchup cross-platform scripting, in that Apple intends to replace MRI Ruby, with MacRuby. It would not be bad if we had all the same UI classes in a "WinRuby" that MacRuby has.

                      mhm - some wrapper to bridge it all.

                      Yes the 'wrappings' would need to follow (as closely as possible,) those defined in HotCocoa for MacRuby.

                      Note that in the example on the HotCocoa introduction page, they are showing the use of a window() constructor method. What they don't actually show is that farther up at the beginning of the Ruby module block, is that there must be an include HotCocoa (or some other mixin module,) that brings that window() method into the current namespace. I usually don't like to do this, instead prefering to call the method using fullnamespace qualification. Less chance then of an accidental override of methods that are imported into your namespace. In this example, I would probably wish to have a window() method in my namespace that returns the instance handle to the window object (@win,) so I'd think most times it's not really that convenient to include entire complex libraries, into a custom namespace.

                      I'm not here much anymore.

                      1 條回覆 最後回覆 回覆 引用 0
                      • P 離線
                        pcarret
                        最後由 編輯

                        Everything is fine under MS-Windows, but :

                        Is it possible to do hide minimize, maximize andclose buttonon Mac OS ?

                        I found NSMiniaturizableWindowMaskbut I don't know how to access system API under Mac OS

                        Remark under windows : WS_MINIMIZEBOX and WS_MAXIMIZEBOX can't work separately

                        simplified working code is (must have hwnd handle, constant and win32 method declaration) :

                        style = GetWindowLong.call(hwnd, GWL_STYLE)
                        style = style & ~WS_MINIMIZEBOX
                        style = style & ~WS_MAXIMIZEBOX
                        result = SetWindowLong.call(hwnd, GWL_STYLE,  style)
                        

                        Thanks for any answer.

                        Philippe

                        1 條回覆 最後回覆 回覆 引用 0
                        • D 離線
                          driven
                          最後由 編輯

                          @pcarret said:

                          ...Is it possible to do hide minimize, maximize andclose buttonon Mac OS ?

                          possibly, but not easily.

                          I'm not entirely sure what your wanting to achieve...

                          What exactly do you want to minimise/maximise?

                          is it purely for yourself or do you want to use it in a Plugin?

                          Some things can be done from Rudy, others by using AppleScript or by modifying the nib files...

                          Outline what you want to do and I'll try and help...

                          john

                          learn from the mistakes of others, you may not live long enough to make them all yourself...

                          1 條回覆 最後回覆 回覆 引用 0
                          • 1
                          • 2
                          • 3
                          • 4
                          • 5
                          • 5 / 5
                          • 第一個貼文
                            最後的貼文
                          Buy SketchPlus
                          Buy SUbD
                          Buy WrapR
                          Buy eBook
                          Buy Modelur
                          Buy Vertex Tools
                          Buy SketchCuisine
                          Buy FormFonts

                          Advertisement