[code] Win32 Moving/Showing/Hiding Toolbars and Dialogs
-
hi Dan, Thom, Jim, all
I've been trying all sorts of things to %(#FF0000)['avoid'] giving the WebDialog %(#FF0000)['focus'] while still having it %(#008000)[send] actions.
this is what happens with SU native %(#0040FF)[NSPanels] (used for SU toolbars) and also for %(#FF0000)[some] of the %(#0040FF)[NSWindows] used for different preferences and the %(#0040FF)[NS(WebView)Window] used by Instructor, but not the %(#0040FF)[NS(WebView)Window] used by WebDialog.holding down the "cmd"(apple) key, invokes this behavior (%(#FF0000)[no focus], %(#008000)[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
-
-
Hey John ... you talk about NS windows made me think of the 9th arg to WebDialog.new
%(#BF0040)[: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 %(#BF0040)[:preferences_key] not '%(#BF0040)[key]'
You should also use %(#BF0040)[Symbol] keys not %(#BF0040)[String] keys, as the %(#800040)[Hash] argument is cranky.
-
@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...
-
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
-
@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: %(#BF0000)[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.
-
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.)
-
@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.
-
@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 %(#BF0000)[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 %(#BF0000)[include HotCocoa] (or some other mixin module,) that brings that %(#BF0000)[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 %(#BF0000)[window()] method in my namespace that returns the instance handle to the window object (%(#BF0000)[@win],) so I'd think most times it's not really that convenient to %(#BF0000)[include] entire complex libraries, into a custom namespace.
-
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
-
@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
Advertisement