View previous topic :: View next topic |
Author |
Message |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: Düsseldorf, Germany
|
Posted: Sat Aug 21, 2010 6:30 am Post subject: Size of status line |
|
|
Just a small question:
I use %ob[status,thin_panelled] and for some applications I need the height of that box in pixels. This value depends on the settings of the OS and (may be) on some other parameters. Is there a simple way to get what I need from within my programme?
Thanks in advance,
Wilfried |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Sat Aug 21, 2010 6:35 am Post subject: |
|
|
If there is a control within the %ob area then you will be able to get its Windows handle and then its size from the handle.
I don't think that there is a control associated with %ob itself.
Let me have a small sample and I can check this out for you. |
|
Back to top |
|
|
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: Düsseldorf, Germany
|
Posted: Sat Aug 21, 2010 11:52 am Post subject: |
|
|
Paul, I use the status line only within the main window of a programme. My code is always more or less like here:
Quote: | WINAPP
OPTIONS(INTL)
PROGRAM UTIL
IMPLICIT NONE
INCLUDE <WINDOWS.INS>
external <cb_functions>
integer*4 j
character*120 statlin
common /status/ statlin
statlin = 'c:\lisa_g\'
j = winio@('%ca[Utilities]%bg[grey]%ww[no_border]%sz%sp&',
* 600,400,200,100)
j = winio@('%mn[&File[option_1,option_2,|,&End]]&',
* 'continue','continue','EXIT')
j = winio@('%1.1ob[status,thin_panelled]%40st%cb',statlin)
end |
Thanks and best regards,
Wilfried |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Sun Aug 22, 2010 9:32 pm Post subject: |
|
|
Wilfried,
Have you tried measuring it under different OS settings? I have often found that the height of various Windows features is remarkably constant. I have used an on-screen pixel ruler called "Ruler by George" to do these measurements (Google search for it. The demo version is free). Another way is to do a screen grab with Shift-PrtSc, paste it into Paint. Then cut the area you are interested in, paste it to a new "document" in Paint (this makes it manageable) and zoom. Then you can count the pixels.
Some things in Windows are scaled in terms of average character cell width and height, but some are scaled in pixels - such as borders. Your status line may be one such.
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Mon Aug 23, 2010 7:32 am Post subject: |
|
|
Here are some thoughts...
If you run the Spy tool from the Plato Tools menu then you will see that %st has its own Windows handle for the "Static" text. So you might find it useful to get the size of this control. However, this may just depend on the size of the font and it is not the same as the surrounding box for %ob. I think that this is just drawn by ClearWin+ on the fly.
If the relevant font size or the size of the "Static" control does not help then I guess the only way forward would be for me to dig this information out of ClearWin+ and give you a clearwin_info@ value to get hold of it. |
|
Back to top |
|
|
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: Düsseldorf, Germany
|
Posted: Mon Aug 23, 2010 8:37 am Post subject: |
|
|
Thank you for your remarks!
I tried a lot this weekend and meanwhile I found some solutions. First of all I start my main window (including the status bar) with %ww[maximise], this works perfectly meaning that the task bar is visible but nothing more. Within this main window I put a graphics area for which I have to define the size in pixels, so I need the size of the task bar and the status bar. The size of the task bar I calculate using GetSystemMetrics(SM_CXSCREEN) – GetSystemMetrics(SM_CXFULLSCREEN) for x and analogue for y. This works for any position of the task bar (left, bottom, …) and for any size of it. Because the dimensions of my graphics area are not critical I set the height of the status bar to 50 pixels, this seems to be OK for all Windows settings. I always use a defined font size and only one line of text within the status bar. Nevertheless I will follow your ideas to make things a bit clearer for me.
Regards,
Wilfried |
|
Back to top |
|
|
|