forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem getting a Window at MAXIMUM Useable Screen Size
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
John-Silver



Joined: 30 Jul 2013
Posts: 404

PostPosted: Thu May 07, 2015 9:26 am    Post subject: Reply with quote

Paul thanks for your input.
Firstly, I'm NOT using a scroll bar/child window in the example I give above, it's just with a single main window.
I did this the 'simplify' and not introduce the further complexity.
The example is just a standard example from the manuals (Text Editor example) and I've just modded to define the window as I described.

I've further modded it to include the CALL ShowWindow(hdl_mainwin, SW_SHOWMAXIMIZED) as you suggested (I hadn't seen that routine in my travels through the API manuals and my Googling so I'm advancing in my knowledge)
I did this by initially adding an additional button to the winio call after the last button previously, with a callback to a function which simply executes that command.

This works fine ! tick V.G.
No big surprise as it's just another MAXIMISE button after all.

The only problem is that I would like it to OPEN the window in that state.
Where do I need to put the command for it to do that ?

This is effectively what the FTN95 %ww MAXIMISE option does isn't it so it must be logically just after that statement, via what mechanism to call it ? where to define the callback and how to make it automatic ?

Later for the code to introduce scroll bars, which uses a child window and %ps :
a) why is it not possible just to use MAXIMISE option, why is it necessary to have a %sz ?
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1539
Location: Yateley, Hants, UK

PostPosted: Thu May 07, 2015 9:48 am    Post subject: Reply with quote

John,

Put it in the callback to %sc. This is where everything you want done after the window is created should go. You can't put it inline with the WINIO@s because it has to be called after the window is created.

You have to pass the window handle to the callback, which I do via COMMON, and you might do by making the callback function CONTAINSed somewhere or other.

The callback to %sc is where you might also do the initial graphics (we discussed that) and handle the command line to see if the program was invoked by clicking on an associated file - if you do that before you open the main window then your startup may be slowed, plus, if you have to handle any errors, they look odd before your program main window has opened.

Eddie
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 404

PostPosted: Thu May 07, 2015 1:18 pm    Post subject: Reply with quote

Already done Eddie !
Managed to work it out after I posted - works a treat (thanks again Paul for digging that out for me).
Opens lots of interesting future possibilities I think.

I'll post the code when I've tidied it up a bit and taken out all my higgeldy-piggeldy commented out lines.
Nothing special but worth posting for reference in the future.

I'll try it out on a PS sheet example too that I put together to test out Dan's biggy spreadsheet scrolling.

Oh, and I think the cut-off CAption and MIN/MAX/_CLOSE buttons might be because MAXimise doesn't just take 8 pixels (in my case) off the top and bottom, it takes 4 off each side of the caption 'window' or it takes 4 off the top and then reduces the height of the caption window by another 4, or something like that.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1539
Location: Yateley, Hants, UK

PostPosted: Thu May 07, 2015 2:08 pm    Post subject: Reply with quote

That's the frame or border or something.

For what it's worth, I spread my master window WINIO@s across a set of subroutines so that not one of them is too large. The WINIO@s for menus and toolbars in particular can get very long and intricate. If you get a bug, it's easier to find if it isn't the 132nd continuation!

Perhaps we need an option sub-maximise to show the frame. I'd like one for %gr which would be 'fill the whole remaining client area'.

Eddie
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1539
Location: Yateley, Hants, UK

PostPosted: Sat Aug 22, 2015 7:05 pm    Post subject: Reply with quote

One of my computers has updated itself to Windows 10, and I note that this appears to have no frame round an application, or perhaps it is 1 pixel.
I have been coping with different screen resolutions and versions of Windows AND different font settings (logical dpi) by keeping a database of sizes to set my %gr area, in order to make it fill the maximum usable size of window after allowing for the caption and menu bars, my toolbars, the frame and the taskbar. Windows 10 lies about the width/height of frame, saying it is 8 pixels when it is not. Windows also lies about the screen resolution using :
Code:

       IXT=GetSystemMetrics(SM_CXFULLSCREEN)
       IYT=GetSystemMetrics(SM_CYFULLSCREEN)


if the logical dpi setting is changed.

Faced with producing a number of revisions to the database, something snapped inside. I set about working out what size Clearwin+ chooses for a window once all the controls are placed. Using a %gd grid I found that the width of the client area selected by Clearwin+ is always an integral number of multiples of the standard cell size obtained using:

Code:
       KXT = CLEARWIN_INFO@('PIXELS_PER_H_UNIT')


plus one pixel.

As this is typically 8 pixels per H UNIT, the reason why some values don't work nicely became clear: if I sized my %gr a little smaller, then I would get a bit of 'border' to the right of it, and if I made it larger than would actually fit (relying on a %ww[maximise] to reduce it to fit the screen), then the %gr size reported with 'GRAPHICS_WIDTH' would always be too small, i.e. be reported smaller than it actually is during a RESIZE event! The former is an aesthetic issue, but the latter affected the rulers I drew on the screen.

Clearwin+ does not seem nearly so fussy about setting the overall height of a window.

Eddie
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 404

PostPosted: Fri Sep 04, 2015 3:17 am    Post subject: Reply with quote

Concerning the 8-pixel width of frames, this seems to be a default like that for window-frames.
In my question early on in this thread :
Quote:
Why do I get top left position of the window as -8,-8 ! ?

I asked because I couldn't find documented anywhere in the MS API docum. why it puts the origin there, ealthough it's obviously to 'hide' an 8 pixel WindowFrame.
Where are all these things documented I wonder ?
I was expecting to find a schematic description somewhere (a picture paints a thousand words and all that), but nothing, zilch.
Well not exactly zilch, I came across an image someone had done privately, but it was far from clear/complete.

As for windows 10 having no border, is that on ALL wndows ?
It brings an interesting question as to how is Clearwin have to be modified to bring the 'style' of windows into line with the new OS (if at all) ? Or is it all taken car of in the washing up ?
I'd imagine Clrwin just follows Windows defaults where applicable so I think any shortfalls are probably not FTN95's fault ? ... especially when it's apparentley reporting false values as you say Eddie.

Also, another question which springs to mind is: are there new API's specifically for Win10 and where are they documented ?

I suspect cross-OS compatible apps might just have got a tad complicated maybe.
Has anyone yet run existing apps to see how they work unmoddified on Win 10 ?
Maybe there ought to be a dedicated thread created for that to gather things as they might (or might not) occur ?
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1539
Location: Yateley, Hants, UK

PostPosted: Fri Sep 11, 2015 11:55 am    Post subject: Reply with quote

Once Windows 10 had completely installed, I have had (so far) no problem running anything, although to be fair I don't stress FTN95's applications much.

Buttons etc have gone back to being square-cornered as in Win95. Toolbars with %ib and %tb are the same as before, although toolbars made from %bb grey-out better than before (I use the variant where the icon remains coloured even when the button is greyed. The variant where the icon greys too turns a lot of icons into 'blobs'. This happens in %ib too, although there are ways of getting round it, they take a lot of work). The' button-press' illusion in %ib is not the normal paradigm in Windows 10 (and I'm beginning to forget Windows 8.1!), and even my icons in %tb form are too '3D' to match properly. However, the application that uses them most has 27 toolbar options, with 4 states to draw for each button (up, down, selected, greyed) making over a 100 drawings to do for each variant (normal, large font blah blah blah).

As the caption bar is the same colour as the top level menu names, they aren't differentiated well, but for Microsoft applications with a 'ribbon' this is less obvious because those top-level menu names are surrounded with a line that gives the illusion of being a tab.

Eddie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group