Statusbar text in model
-
Hi, is there any way to show the text in the status bar on the top left of the modeling window (only when processing)?
that way we could hide the status bar altogether and get some extra room..
-
Moved this into Developers'...
I don't think it can be done, neither manually nor in code. -
that's a pity - takes too much space..
-
@cadfather said:
Hi, is there any way to show the text in the status bar on the top left of the modeling window (only when processing)?
Maybe. (driven is playing with using the
model.add_note()
method. This means the user cannot then use the model's note for anything else, and there is/was a bug, that the note does not show when there are no entities in the model.)"only when processing" is a challenge. There is always some text displayed. What do you mean by this ?
The main problem is that there are no API getter methods to actually get the text from the statusbar, or the VCB label nor VCB value. There are no API observer classes nor callback methods, that watch the statusbar nor VCB.
@cadfather said:
that way we could hide the status bar altogether and get some extra room..
We know how to toggle the statusbar on/off on PC via
Sketchup.send_action(59393)
but not test if it's visible via the API.I do not know if it can be done (or how,) on Mac.
Also, the VCB needs to be undocked from the Statusbar when it's hidden. The VCB also does not have API methods to hide, show or get it's visibility state. (Again we can use Win32API calls only on PC, to tweak this, provided we can get a list of all the various localized language titles for "Measurements".)
-
Dan, thanks for that explanation of the inner workings - very clear.
the only status bar info i really need is the plugins progress and options (like sandbox tools progress or fredo's bezierspline options, etc..). the standard sketchup messages i know them by heart and usually ignore.
though this would also mean that other developers would have to write code specific for such a function, a la 'organizer.rb'.
-
Sketchup always starts with the status-bar showing... [I think!]
So then the lines of code in this 'method':
def status_bar_toggle() Sketchup.send_action(59393) if [PLATFORM].grep(/mswin/)==[PLATFORM] end
run once, either when Sketchup or your tool first opens, will turn the status-bar OFF [PC only !]
Run again it turns the status-bar back ON.
It's a 'toggle'.
So perhaps you need a persistent variable [@/@@ even $ ?] ... and then you do NOT re-toggle if it's set the once, or perhaps only have it run 'OFF' when the tool is active, and reset 'ON' as the tool exits for any reason. -
Yes TIG, if you send 59393 the status toggles on-off (i already use it).
on pc the state is stored in the registry so next session it will be remembered.
-
@cadfather said:
Yes TIG, if you send 59393 the status toggles on-off (i already use it).
on pc the state is stored in the registry so next session it will be remembered.
Where in the registry ? -
HKEY_CURRENT_USER\Software\Google\SketchUp8
-
Because the '.send_action(59393)' is a 'toggle' you don't know if you are turning the status-bar's visibility OFF or ON !
This is OK if you can see the effect, but it's useless inside a 'tool' when you want to switch it 'OFF' - if it's already 'OFF' you'll switch it 'ON' !
The registry entry isn't updated until Sketchup closes, so you can't check that while inside a SKP, BUT you can get it at startup.
Incidentally, if you try 'read_default' for 'Visible' it fails to get it as I suspect it's the wrong sort of key [i.e. not REG_Z] ?
You could make .rb that makes a PC .cmd file and get the appropriate Registry key 'Visible' value, erasing temp-files etc.
This .rb could auto-load at startup... and always set status-bar visibility ON by erasing the 'Visible' key OR set it OFF by adding the 'Visible' key with the right value if it's NOT there...
It seems to be 'ToolbarsUser-Bar14' consistently - i.e. same on mine - presumably the early numbered toolbars are made in order by Sketchup [at least in this version] ? -
@tig said:
So then the lines of code in this 'method':
def status_bar_toggle() Sketchup.send_action(59393) if [PLATFORM].grep(/mswin/)==[PLATFORM] end
DO NOT use
PLATFORM
, it's deprecated (and will be removed sometime.)module Your_UI_Utilities if RUBY_PLATFORM =~ /(mswin|mingw)/ def self.status_bar_toggle() Sketchup.send_action(59393) end else # Mac def self.status_bar_toggle() puts('Windows only method "status_bar_toggle()" called.') end end end #module
-
@tig said:
Where in the registry ?
key:
ToolbarsUser-Bar***nn***
whose attribute: BarID (DWORD) = 0xe801 (59393 decimal)
[ My key happens to be "ToolbarsUser-Bar14" ]and when hidden, also has an attribute:
Visible (DWORD) = 0x00
when shown this attribute is deleted.EDIT: The registry attribute & value only gets updated when Sketchup closes, so cannot be used "live" to get the state of the user's statusbar.
-
@tig said:
The registry entry isn't updated until Sketchup closes, so you can't check that while inside a SKP, BUT you can get it at startup.
Sorry, forgot to note that. (Added a note to my previous post.)
@tig said:
Incidentally, if you try 'read_default' for 'Visible' it fails to get it as I suspect it's the wrong sort of key [i.e. not REG_Z] ?
Yep...
Sketchup.read_default()
still cannot read DWORD values (and also seems not to be able to read even string values in some of the OEM keys, which I never noticed happen in v7.)I use Win32API calls to read entries (of all types) in the OEM keys. (Requires the Win32API.so file.)
Advertisement