@TSK
I checked the SDK and don't see any obvious way to get those settings. I'm not sure how useful they could be since the user can change them at any time and your program might be opened on some other public screen.
The only way I can see to tell what the toolbar settings are is to check ENV:Sys/workbench.prefs, which change whenever those toolbar settings are changed by the user.
EDIT: Now that I think of it, the user might be using Dopus5 in Workbench replacement mode; in which case Workbench wouldn't even be present.
For example, a taskbar-like program may want to decide whether it should display its GUI over or below the WB title bar (AmiDock has such a setting AFAIR).
@trixie
O.K. That makes sense. However, those Workbench titlebar settings (Visible,Hidden,Automatic) don't actually affect the WorkBench screen titlebar. They only affect the Workbench backdrop window. If you disable (uncheck) the Workbench/BackDrop window then the screen titlebar is present regardless of the titlebar settings in Workbench prefs. In addition, AmiDock is an OS4 system commodity and probably has access to private internal Workbench settings. Since nobody has pointed out any 'legal' way to determine if there is a screen titlebar visible and there are numerous user settings and customization that can affect the Workbench titlebar display, I don't see any way for TSK to get the status of the screen titlebar.
@jabirulo
You have the right idea; the problem is an error in the GetScreenAttr() autodoc that has this line: " SA_Quiet - (BOOL) see ShowTitle().". The autodoc doesn't mention the SA_ShowTitle tag but that's the tag that should say "see ShowTitle()". The SA_ShowTitle tag works. Here is a short program I used to test it:
Thanks a lot ! I didn't realize there's the SA_ShowTitle tag.
I'm using this in FuelGauge to adjust positioning of the gauges automatically if the WB titlebar is visible or not because WB moves the volume icons depending on the titlebar but it doesn't change the snapshot coordinates in the icons themselves. Unfortunately when setting the titlebar to Auto then the icons are repositioned only once but not when the user hovers the mouse cursor on top to reveal the titlebar. So I added a new tooltype to FuelGauge to take care of the Auto mode.
FuelGauge works only when Workbench is in backdrop mode. There's no feature in Intuition to make a window to stay always in front of a particular window but always behind every other window. So it's impossible to make it to work in non-backdrop mode of the Workbench. I take everything GUI related stuff into account already. (The gauges are related to CurrentY of the struct DiskObject.)
There's no feature in Intuition to make a window to stay always in front of a particular window but always behind every other window. So it's impossible to make it to work in non-backdrop mode of the Workbench.
DefaultPubScreen=IIntuition->LockPubScreen(NULL);
TopEdge=DefaultPubScreen->BarHeight;
If TopEdge is 0, it is disabled?
No, BarHeight has a value always. What I meant is the setting in Workbench prefs to set the titlebar: visible, disabled or auto.
@TSK
I checked the SDK and don't see any obvious way to get those settings. I'm not sure how useful they could be since the user can change them at any time and your program might be opened on some other public screen.
The only way I can see to tell what the toolbar settings are is to check ENV:Sys/workbench.prefs, which change whenever those toolbar settings are changed by the user.
EDIT: Now that I think of it, the user might be using Dopus5 in Workbench replacement mode; in which case Workbench wouldn't even be present.
X1000 - OS 4.1FE
@xenic
For example, a taskbar-like program may want to decide whether it should display its GUI over or below the WB title bar (AmiDock has such a setting AFAIR).
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
@trixie
O.K. That makes sense. However, those Workbench titlebar settings (Visible,Hidden,Automatic) don't actually affect the WorkBench screen titlebar. They only affect the Workbench backdrop window. If you disable (uncheck) the Workbench/BackDrop window then the screen titlebar is present regardless of the titlebar settings in Workbench prefs. In addition, AmiDock is an OS4 system commodity and probably has access to private internal Workbench settings. Since nobody has pointed out any 'legal' way to determine if there is a screen titlebar visible and there are numerous user settings and customization that can affect the Workbench titlebar display, I don't see any way for TSK to get the status of the screen titlebar.
X1000 - OS 4.1FE
Not sure if using intuition.library's'GetScreenAttr()' and looking in 'SA_Quiet - (BOOL) see ShowTitle()' will help.
ShowTitle -- Set the screen title bar display mode.
ULONG scr_has_title;, SA_Quiet, &scr_has_title, TAG_DONE);
GetScreenAttrs(
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P
@jabirulo
You have the right idea; the problem is an error in the GetScreenAttr() autodoc that has this line: " SA_Quiet - (BOOL) see ShowTitle().". The autodoc doesn't mention the SA_ShowTitle tag but that's the tag that should say "see ShowTitle()". The SA_ShowTitle tag works. Here is a short program I used to test it:
The program returns a Mode of 1 if the titlebar is visible and 0 if it's hidden.
Hopefully, TSK hasn't given up on this topic and sees our posts.
X1000 - OS 4.1FE
Thanks a lot ! I didn't realize there's the SA_ShowTitle tag.
I'm using this in FuelGauge to adjust positioning of the gauges automatically if the WB titlebar is visible or not because WB moves the volume icons depending on the titlebar but it doesn't change the snapshot coordinates in the icons themselves. Unfortunately when setting the titlebar to Auto then the icons are repositioned only once but not when the user hovers the mouse cursor on top to reveal the titlebar. So I added a new tooltype to FuelGauge to take care of the Auto mode.
Given your usage case, an alternative might be to positiion your fuelguage gadget/windows realative to the Workbench wincow and not the screen?
What happens if the user leaves workbench back drop mode?
FuelGauge works only when Workbench is in backdrop mode. There's no feature in Intuition to make a window to stay always in front of a particular window but always behind every other window. So it's impossible to make it to work in non-backdrop mode of the Workbench. I take everything GUI related stuff into account already. (The gauges are related to CurrentY of the struct DiskObject.)
OS4 introduced WA_StayTop attribute. Check intuition.library/OpenWindow autodocs.
"WA_StayTop (WA_Dummy + 0x45)
/* (BOOL) Make this window to always stay in front of all
* others. V50."
It makes the window to stay in front of ** all ** other windows not in front of any particular one.
You all have to believe I tested everything I could find from AmigaOS autodocs, header files and beyond many many years ago already.
And maybe is too much (re)work, but adding the gauge inside the disk icon/image?
Don't know if it's doable "in real time".
I use something alike on mixer docky icon, in the image (speaker) I show the % of volume:
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P