Is it possible to predict the height of a window's bottomborder (window opened on the frontmost public screen). The screenheight is depending notably if it has a resize gadget or not, and its size van be changed with the screens prefs (GUI)
Can one get acces to this value ?
sc->WBorBottom;
and
wn->BorderBottom
are probably equal if no resize gadget?
Screen->WBor#? is the right place to look for window border dimensions.
To get the dimension of the sizing gadget you can create an object of sysiclass with SYSIA_Which,SIZEIMAGE and read its Width and Height attributes.
If the sizing gadget is included in the border (i.e. WFLG_SIZEBRIGHT and/or WFLG_SIZEBBOTTOM is set), then the size of the respective border is equal to the size of the sizing gadget. Screen->WBorBottom resp. WBorRight is only used when there is no gadget in the border.
Thanks Thomas. I was really stuck here.
I came up with
which compiles ok with -lauto
I do get the result below
6.Datas:Gui4Cli/C> Borderheight
-32766 3
and this is independent of the screen i do position the shell 'Workbench with big borders, or some with very small window borders)
I guess the screen should be defined, locked or something ?
@JosDuchIt
First, where are IA_Width and IA_Height defined?
Second, you are using PrintF(), a DOS function that defaults to 16-bit integers. I suggest changing it to use "%ld" instead. :-)
@Thomas
Thanks, it was a bit more complicated than i thought.
I tested the program starting it from a KCON shell that i could reposition on other screens.
The result was always size 24x24 Those other screens mostly just copied the settings of the "Standard" screen of "screens" preferences and showed rather thin window borders and 'resize' gadget.
Now 24x24 seems to be correct for the Workbench screen from which i started.
Jumping to another screen makes this one the frontmost though, so i can't explain the results.
Hope you can.
If you use my example unchanged you will always get the properties of the Workbench screen because LockPubScreen(NULL) locks the default public screen, not the frontmost one. The default public screen is always Workbench unless an application changes it.
@thomas
So the problem left is to identify the frontmost public screen.
I vaguely remember the frontmost public screen could be set as default public screen. I can't find that info again.
Till now i did not find either where the info is hidden identifying a screen as frontmost. It is not in the stuct Screen. I continue to look but if somebody knows ??
edited:
Seem to have found it :
@all
I am stuck again the only thing that i can get till now is the frontmost
Printf(" %s\n", (((struct IntuitionBase *)IntuitionBase)->FirstScreen)->Title);
This gives me the title of the frontmost public screen. It is not the name of the Screen required with LockPubScreen.
It seems rather (very) strange to me that this name does not appear in struct Screen ???
No, it does not. It gives you the title of the frontmost screen. Not every screen is public. In fact quite a lot of programming effort is necessary to make a screen public. Only a minority of applications make their screen public.
I am not sure what you are trying but I imagine that it is something that is not allowed.
It is possible to find out the frontmost public screen. But this screen is not necessarily visible. It might be hidden by another custom screen.
In order to open on the frontmost screen you might need to use IntuitionBase->FirstScreen without locking it. This is an illegal hack but it is the only way to open on the currently visible screen. It will get you into trouble when the application which owns the screen tries to close it before you closed your window. The owner of a private screen usually does not check for failure of CloseScreen().
Hi Thomas it is really the 'frontmost pubscreen i am after.
I'll take care of other screens in front if needed.
I need it to test how well Gui4Cli windows can be drawn on different public screens.(say with correct inner widths and gadgets that don't change after a redraw )
Simple goal: open a window and know in advance what the borders will look like.
I did find this however and compiled it for OS4 :
http://os4.aminet.net/util/batch/FrontPubScreen.lha
I think together with your code the problem is solved.
@Thomas,
Is it possible using something like this to CHANGE the image used for a Sysiclass gadget ?
Or when you create the object does it only copy the image info from the sysiclass type ?
(See my query about using a different SBARLOGO for an application's publc screen).
GREAT!!!
Such piece of code (added to Mixer) help to show Mixer on frontpubscreen after uniconifying :-) THX
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P
@jabirulo
Programs can only iconify on the Workbench screen. If you uniconify them manually by clicking on the icon, Workbench must be your frontmost screen then. If the program uniconifies upon receiving an ARexx or Application Library message, you are supposed to bring the program's screen to front - so why do you need extra code to ensure Mixer reopens on the frontmost screen? It always will.
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
Mixer has popkey (acts/is a commodity too), thus user can have Mixer on frontscreen (public) he's working/using, change/see seetings and hide/iconify again.
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P