sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    UI.messagebox "beep"

    Scheduled Pinned Locked Moved Developers' Forum
    20 Posts 5 Posters 980 Views 5 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.
    • J Offline
      Jim
      last edited by

      There are other series of icons for the messagebox. The default series shows when you use the MB_ type constants:

      ["MB_OK", "MB_OKCANCEL", "MB_ABORTRETRYIGNORE", "MB_YESNOCANCEL", "MB_YESNO", "MB_RETRYCANCEL", "MB_MULTILINE"]

      But if add some constant value to these (excluding MB_MULTILINE), you can get a series of messageboxes using different icons. Here are the constants and the icon series you get:

      tmpimg.png

      Hi

      1 Reply Last reply Reply Quote 0
      • honoluludesktopH Offline
        honoluludesktop
        last edited by

        Jim, that looks good. Not in the API?

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          @honoluludesktop said:

          Jim, that looks good. Not in the API?

          It's there.
          http://code.google.com/apis/sketchup/docs/ourdoc/ui.html#messagebox

          But the return value constant isn't. See the comments at the bottom of the page.

          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

            The API doesn't mention anything about being able to use a certain icon series by adding a values to the MB constants.

            I wonder if the return values are still the same in this case?

            Hi

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              Ah, yea I see now what you mean. Yea - these should be mapped. I had been wishing for such control - similar to what I had in VB and C#.

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

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                thomthom
                last edited by

                What would probably make it easier to map out was to print out the binary value so we can see which bits are turned on.

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

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  32.to_s(2) 100000 48.to_s(2) 110000 64.to_s(2) 1000000 80.to_s(2) 1010000 272.to_s(2) 100010000

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

                  1 Reply Last reply Reply Quote 0
                  • honoluludesktopH Offline
                    honoluludesktop
                    last edited by

                    How do I "add some constant value" to the following?
                    UI:messagebox "my text "+variable, MB_OK

                    1 Reply Last reply Reply Quote 0
                    • thomthomT Offline
                      thomthom
                      last edited by

                      Use the bitwise And operator to combine flags:
                      Messagebox with Yes/No button and question mark icon:
                      UI.messagebox('Hello World', MB_YESNO | 32)

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

                      1 Reply Last reply Reply Quote 0
                      • honoluludesktopH Offline
                        honoluludesktop
                        last edited by

                        WOW


                        temp04.jpg

                        1 Reply Last reply Reply Quote 0
                        • thomthomT Offline
                          thomthom
                          last edited by

                          The Win32 API docs helped:

                          http://msdn.microsoft.com/en-us/library/ms645505%28VS.85%29.aspx

                          Stop: 0x00000010 = 16
                          Question: 0x00000020 = 32
                          Explaination (Yellow Alert Triangle): 0x00000030 = 48
                          Information (Blue Info Circle): 0x00000040 = 64

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

                          1 Reply Last reply Reply Quote 0
                          • thomthomT Offline
                            thomthom
                            last edited by

                            [16,32,48,64,80].each { |i| puts i.to_s(2).rjust(8,'0') } 00010000 00100000 00110000 01000000 01010000

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

                            1 Reply Last reply Reply Quote 0
                            • Dan RathbunD Offline
                              Dan Rathbun
                              last edited by

                              I went thru this a fee months ago or so:

                              It's a Win only thing so far as I know, but I'd like to see what happens on the Mac.

                              Here's a text report of all the integers and the resultant button styles you get. (I believe some of the icons are deprected, specifically the question icon.)

                              UI_messagebox.txt

                              I'm not here much anymore.

                              1 Reply Last reply Reply Quote 0
                              • RunnerPackR Offline
                                RunnerPack
                                last edited by

                                @thomthom said:

                                Use the bitwise And operator to combine flags:
                                Messagebox with Yes/No button and question mark icon:
                                UI.messagebox('Hello World', MB_YESNO | 32)

                                That's actually the Or operator... but you knew that 😉

                                Sorry... pedantic mode, off! 😄

                                @Dan: I've also always wondered what all the obviously-Win32-API-based things did on the Mac version... I always assumed they just translated stuff to the appropriate Mac system-calls/constants, but it would be nice to know for sure.

                                You might have noticed... I'm a bit of a ferpectionist.

                                1 Reply Last reply Reply Quote 0
                                • thomthomT Offline
                                  thomthom
                                  last edited by

                                  @runnerpack said:

                                  @thomthom said:

                                  Use the bitwise And operator to combine flags:
                                  Messagebox with Yes/No button and question mark icon:
                                  UI.messagebox('Hello World', MB_YESNO | 32)

                                  That's actually the Or operator... but you knew that 😉

                                  Doh! 😳 I swear there's a little brain-gnome that intercepts and swaps words before they reach the hands...

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

                                  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