by driven » Sat Jan 28, 2012 3:56 am
Dan Rathbun wrote:The location of the Sketchup application window, and it's size, IS stored in the registry, when SU closes. But it's only good, until the user moves or resizes the app window. The settings are not updated "live", which is why we use Win32API calls instead.
All the positions of all current windows are stored by the System Window Server. You have to query it in a very specific fashion to get the normally hidden details. AppleScript uses it to get a 'restricted' amount of information, but you can get a bit more. I actually got Ruby Console and a WebDialogs 'live' positions out earlier, but I accidently deleted the script and can't reproduce it now... john
-
driven
- Top SketchUcator
-
- Posts: 1409
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dan Rathbun » Mon Jan 30, 2012 9:48 pm
Well deleting the poll, did not help. It still was marked (in the topic list,) that this thread had new posts, and that the last poster was driven, even tho, it was me that was the last poster.
Let's see if, by me posting this message, if the forum topic lister PHP, gets things set back to normal.
EDIT: Hey looks like it worked !!
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4074
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by driven » Mon Jan 30, 2012 11:10 pm
So, it was you that broke it then... I had to get Gai to remove the poll, I don't have the delete button, it may be admin only...
I made some progress on doing this sensibly.
I currently write a dat file to user prefs folder that holds both Desktop's and SU's current position and overall size, I collect that in ruby, factor in the view.center, height and width and set the default MUI.message_box to match SU's current UI.message_box dims and position.
the option hash would be a percentage increase in height and/or width, 0-100 being default to full-viewport.
If an author wanted total Monitor Screen they can write directly to the utility as a separate operation.
By approaching it this way, the initial installation of the utility could be added by users as a standalone mac enhancement that replaces the standard annoying UI.message_box's [message-only that have to be clicked for no reason], rather than part of any particular plugin.
Once installed, MUI module, 'bht' utility and the positions dat file could then be accessed by any author for any purpose.
thoughts welcome
john
-
driven
- Top SketchUcator
-
- Posts: 1409
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dan Rathbun » Tue Jan 31, 2012 12:43 am
1) What does MUI stand for ?
2) What happens if the user resizes the Sketchup application window, after the module is loaded ?
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4074
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by driven » Tue Jan 31, 2012 1:36 am
Dan Rathbun wrote:1) What does MUI stand for ?
mac UI, you had used GUI in your template and I just change it to MUI, for now at least. 2) What happens if the user resizes the Sketchup application window, after the module is loaded ?
It's dynamic, it updates the prefs file with changes then modifies shell script before running. The dat file is a list of 8 items so it's quick and has very little overhead, compared to the normal applescript methods. I still need to read/write some back in ruby, but I'm trying to limit that to a minimum. john
-
driven
- Top SketchUcator
-
- Posts: 1409
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dan Rathbun » Tue Jan 31, 2012 4:12 am
driven wrote:Dan Rathbun wrote:1) What does MUI stand for ?
mac UI, you had used GUI in your template and I just change it to MUI, for now at least.
Well I think the ultimate goal, is to have a cross-platform UI module: example: - Code: Select all
module SKX::GUI
MAC =( RUBY_PLATFORM =~ /(darwin)/ ? true : false ) WIN =( not MAC )
if MAC def self.timed_splash( *args ) # code calling Applescript, etc. end else # it's Windows def self.timed_splash( *args ) # code using Win32API calls end end # if MAC
end # module In practice actually, there would be a loader that determines the platform, and it would require one of two files: skx_gui_mac.rb or skx_gui_win.rb This is how Wx::Windows is setup when it loads. Anyhow, within any author's nested plugin module or class, they can create a pointer to the actual GUI module, using anyname they wish (since it's local to their namespace.) Ex: - Code: Select all
module Driven module Util class ExportWidget MUI = SKX::GUI MUI.timed_splash("John's Export Widget",10) # more code ... end # class end end
The pointer can be a local constant, or a local var, a class var, doesn't matter. All references in Ruby just point at objects. A class or module name is just a constant that points at the instance objects of class Class and class Module, respectively.
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4074
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by driven » Sun Feb 05, 2012 11:19 pm
An update for those interested, After following up on Dan's old suggestion to TIG, about using Thread.new for mac shell running, I have a non-freezing applescript/shell test that runs from a button in SU. The problem I was having with the shell/SU blocking has gone... yeh. At the moment I've made a proof of principle/demo, to show that the 'threading' works and speed is useable. It dynamically resizes SU to a number of random sizes, based on host Monitor size. For each, in turn, it dynamically creates a 'centered' random sized message-box based on the new windows size. [min-max preset as %] The messages are also random, as are the font, shadow and background colors. It takes SU full screen at the end. What I need next is confirmation of it working the same on other macs, before adding all the other bits that already work separately, but not yet combined. There's no reason to think it won't as it uses all mac, SU and Ruby 1.8.5 standard functions. but.... I'll try and make a small enough screen-cast to post this demo here for none mac watchers. here's a zipped dmg for any willing mac owners... please. GoogleSketchUP_X_instal.dmg.zip john
Please, register (free) to access all the attachments on the forums.
-
driven
- Top SketchUcator
-
- Posts: 1409
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by driven » Mon Feb 06, 2012 2:27 am
For some reason i can't upload to YouTube, so I put a movie up here http://gallery.me.com/johnboundy#100086the movies quite compact at 1.2MB, but a small, crap animated giff version comes in at 12MB... I don't follow that. macMsg3078.gif
Please, register (free) to access all the attachments on the forums.
-
driven
- Top SketchUcator
-
- Posts: 1409
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dan Rathbun » Mon Feb 06, 2012 5:25 am
Bummer.. it a QT movie. Cannot install anything else right now. (Getting the old "System part of the Resgistry has reached it's limit..." messagesboxes.)
Perhaps someone else can convert it WMV or AVI or something that YouTube likes ?
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4074
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by driven » Mon Feb 06, 2012 5:34 am
Can you not view it online?
I can make and upload to youTube normally, just not at the moment... I'll try tomorrow. john
-
driven
- Top SketchUcator
-
- Posts: 1409
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by driven » Mon Feb 06, 2012 5:42 am
Dan, could you try to stick this on YouTube? macmsg_1.zip
Please, register (free) to access all the attachments on the forums.
-
driven
- Top SketchUcator
-
- Posts: 1409
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dan Rathbun » Mon Feb 06, 2012 6:19 am
It would not run on my Windows Media Player (mesagebox saying wrong format or you don't have the correct codec.)
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4074
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by TIG » Mon Feb 06, 2012 11:51 am
Runs OK for me on VLC or WMPlayer... but then I probably have every codec known to man...
TIG
-

TIG
- Global Moderator
-
- Posts: 13987
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by driven » Mon Feb 06, 2012 11:58 am
I have most, but selecting what to use for windows eludes me. Stream: macmsg_1.wmv Path: /Applications/GoogleSketchUp_X/macmsg_1.wmv Duration: 0:00:04 Data Size: 2.27 MB Bit Rate: 3.94 Mbps Video Tracks: Windows Media Video 9 Standard, 960 × 540, 25 fps, 3.94 Mbps macmsg_1 2.zip john
Please, register (free) to access all the attachments on the forums.
-
driven
- Top SketchUcator
-
- Posts: 1409
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dan Rathbun » Mon Feb 06, 2012 12:44 pm
OK the second works fine for me. Had to adjust the play speed to slow.
What do you call this kind of "popup" ??
It's not really a splash window (that usually has a graphic background.) Not a "messagebox", as that term is taken (although I would have called them "queryboxes", myself.)
It is similar to the icon bubble notification boxes on XP, both system and app (though they popup in the lower right corner of the screen.) Calendar "reminder" apps and AV/Firewalls are the biggest consumers of these "bubble" notice windows. Anyway, these kind of windows, are timed and close or shrink away after an interval with no user interaction.
Anyone have an idea if there is a standard generic name for this type of window ?
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4074
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by driven » Mon Feb 06, 2012 1:40 pm
The original is referred to as a DisplayMessage and uses com.apple.ScreenMessage to run, with a full screen base size, on targeted computers in a mac network.
I believe 'Growl' uses something similar for it's 'placable' Screen Notifications.
Which is a bit like Chrome has for webkit- Event Target: Notification
in Cocoa... maybe - (void) somethingHappened:(NSNotification*):notification {...}
I guess it's more of a bodged Target[ed]:Application_DisplayMessage, but, as it has the ability to return a user response?
I can't find a Ruby equivalent, although MacRuby may have something along these lines, being app centric. john
maybe
-
driven
- Top SketchUcator
-
- Posts: 1409
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Aerilius » Mon Feb 06, 2012 9:52 pm
I've seen it often called as "OSD" or on-screen-display (similar to HUD, head-up-display) or OSD notification.
-
Aerilius
- Top SketchUcator
-
- Posts: 1128
- Joined: Tue Dec 23, 2008 11:00 pm
- Location: Kaiserslautern
by driven » Mon Feb 06, 2012 10:12 pm
This Message, which shows, in the reply section, it's appearing in time slot for when I posted it ????
Re: mac UI.messagebox - hud and timeout by driven on Mon Feb 06, 2012 1:40 pm
The original is referred to as a DisplayMessage and uses com.apple.ScreenMessage to run, with a full screen base size, on targeted computers in a mac network.
I believe 'Growl' uses something similar for it's 'placable' Screen Notifications.
Which is a bit like Chrome has for webkit- Event Target: Notification
in Cocoa... maybe - (void) somethingHappened:(NSNotification*):notification {...}
I guess it's more of a bodged Target[ed]:Application_DisplayMessage, but, as it has the ability to return a user response?
I can't find a Ruby equivalent, although MacRuby may have something along these lines, being app centric. john
maybe
-
driven
- Top SketchUcator
-
- Posts: 1409
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dan Rathbun » Sat Feb 11, 2012 6:58 am
driven wrote:I can't find a Ruby equivalent, ...
Likely any Ruby equiv. would be a class in the GTK or Wx (or similar toolkit modules.) Name: OK.. it looks like "Display" and "Notify/Notification" may be the buzz words, for this. "On-Screen" seems a bit 'obvious' (although, I suppose, one can have an Audio notification, as well.) "Display" is too vague. I'd prefer: GUI.notify_box( message, timeout, [opts_hash] ) with the (dismissal) return value true || falseIf the timeout arg != 0 and the box times out and closes, false is returned. If the user dismisses the box before it times out, true is returned. If the timeout arg == 0, then the user MUST manually dismiss the box, and true is ALWAYS returned, in this case. Of course the timeout arg can have a default, say 5 secs ? The hash_opts (3rd arg,) can be specified without braces, in the method call, but Ruby should collect them (automatically,) into a internal hash argument.
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4074
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Sat Feb 11, 2012 7:01 am
driven wrote:This Message, which shows, in the reply section, it's appearing in time slot for when I posted it ????
Yep... deleting the poll, did not fix the phpBB bug (looks like.) It seemed to be OK for a few days, until someone else posted again. I was never aware that Aerilius posted. It did not show in the right column where the most recent post & poster goes. (It always showed the OP's name.)
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4074
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Sat Feb 11, 2012 7:35 am
driven wrote:I've been distracted by almost having a WebDialog do the same things as my macMessage video shows. [but it's an 'almost' standard webdialog].
Certainly this approach would be easier to implement (on both platforms.) Jim, ThomThom and I, have all played around with changing a WebDialog's window styles, just after calling it's show method. On Win32 we can change it's border style to a ToolWindow, or even turn off all the borders entirely. I suppose we could also make the background semi-transparent. We do these via Win32API system calls. I'm not sure if the WebBrowser control can see the parent window object as implemented in the WebDialog class, via HTML,CSS or Js. Seems like I recall us trying, and getting a Js error. (We discussed this awhile back, on the subject of making WebDialog that acted just like floating toolbars, and switching window focus to the SU main app window, when a WebDialog control was clicked.) Anyway ... I suspect we cannot change the WebDialog window's borders (and so forth,) FROM the Javascript running IN the WebDialog. (I'd love to be proven wrong on this.)
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4074
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Fri Feb 17, 2012 2:50 am
Playing around with this idea a bit... I realized we cannot have the method return a value from the notifypanel because the method creating it would have to wait.. and that would cause SU blocking. (possibly ghost-window "whiteout".)
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4074
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by driven » Fri Feb 17, 2012 3:00 am
That's what was happening here, the block bit, until I put it in it's own thread.
@bht= Thread.new { Thread.current["name"] = "BHT"; system("bht_su"); Thread.exit}
john
-
driven
- Top SketchUcator
-
- Posts: 1409
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
Return to Developers' Forum
|