View previous topic :: View next topic |
Author |
Message |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Sat Apr 01, 2017 10:48 am Post subject: Font and font size |
|
|
Beginning with the main program, I use %fn[MS SANS SERIF]%ts with .96D0 (size, argument for %ts) in any winio@ window, which means dozens of times within one single program. My question is, whether there is a way to define font and font size once at the beginning of the code, for all subsequent windows?
Thanks in advance
Wilfried |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Sat Apr 01, 2017 11:19 am Post subject: |
|
|
You can use %gf after the first time, storing the result as a font HANDLE. This will be a 64 bit integer in 64 bit applications.
Then use %fh to set the font using the saved font HANDLE afterwards.
But the font HANDLE will probably be destroyed when the first window closes so this may only work if the handle is created in a main window that remains open. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Sat Apr 01, 2017 11:39 am Post subject: |
|
|
Paul knows better than me how Clearwin+ works best, but I have a subroutine that sets up all the window attributes, font and font size, background colour etc etc, which I call each time I open a new window. The subroutine contains nothing but the associated winio@ calls, which as you know, can be strung out over several routines.
As the system font is different in various versions of Windows, especially with large font settings, it takes care of all that too.
Eddie |
|
Back to top |
|
|
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Sat Apr 01, 2017 11:42 am Post subject: |
|
|
Thank you, but that is not really the solution I was looking for:
Instead of each time using %fn[MS SANS SERIF]%ts with an argument for %ts, I then would need each time %fh with an argument, coming from an additional common block or module�
I am looking for a solution similar to set_clearwin_float@("rf_exp_limit",0.001D0) with which I once for all suppress exponential writing of double precision values in %rf. This is one single statement at the beginning of the main program.
Regards - Wilfried |
|
Back to top |
|
|
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Sat Apr 01, 2017 11:49 am Post subject: |
|
|
Sorry Eddie, my previous post was an answer to Paul's remarks. Your way with a subroutine for all general settings is another interesting alternative.
Wilfried |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1891
|
Posted: Sat Apr 01, 2017 12:38 pm Post subject: |
|
|
Wilfried, your post reminded me once more about a shortcoming of the Silverfrost forum setup (phpBB): there is no convenient way of referring to a particular post in a thread. We can reply to what we think of as the "most recent" post, but another reader may post while I am composing, and as a result what I post has to be edited (if I catch the problem).
I can count from the top and say "#4", but that will give wrong information to another reader who may hav a different setting for the order of presentation, and is too irksome to use in threads with dozens of posts.
I can quote the time/date of the post, but the times/dates that different readers see are different for any given post. I have now two browser tabs, one of which goes through a VPN filter and the other straight. I see 4:49 AM for your most recent post in one tab, and 11:49 AM for the same post in the other tab.
Paul, please make it possible to add a serial number to each of the posts in a thread. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Sat Apr 01, 2017 12:56 pm Post subject: |
|
|
Wilfried
I can't find anything better than Eddie's suggestion but it would be a fairly simple matter to add something to ClearWin+ so that you could set a default font for all subsequent Windows created via winio@. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Sat Apr 01, 2017 1:27 pm Post subject: |
|
|
I just had a look, and I see that for XP and earlier, I have used MS Sans Serif, with scaling factors 0.8 for y pixels less than 1000, 0.9 for bigger vertical pixel counts, but for Vista and later, the scaling factors are 0.9 and 1.0. I'm using CALL GET_OS_VER@(ID_Platform, MAJOR, MINOR) to decide which version of Windows it runs on.
Interestingly, I only use scaling factors 0.8 (XP & earlier) and 0.9 (Vista and later) with the relevant fonts for dialog boxes that just pop up with warnings.
Using Segoe UI means installing it on a Vista machine. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Sat Apr 01, 2017 2:05 pm Post subject: |
|
|
I have added a new routine CLEARWIN_DEFAULT_FONT@(hfont) and will aim to upload a new set of DLLs early next week.
If it works then you will be able to call this routine after (say) using %gf in the first Window to be opened at run time. |
|
Back to top |
|
|
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Sat Apr 01, 2017 5:53 pm Post subject: |
|
|
Thanks again, Paul and Eddie!
I modified one of my programs according to Eddie's suggestion, with good results. Next time I will try Paul's new routine.
Have a nice weekend!
Wilfried |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Sun Apr 02, 2017 8:08 am Post subject: |
|
|
On reflection, I might be able to provide something more useful instead.
I am thinking of a function winstyle@ that would work like winio@ but only for certain format codes such as %fn, %ts, %bf, %tc and %bg. This would create a predefined window style for all subsequent calls to winio@. Basically it would automatically store an accumulated format string that would be applied on the first call to winio@ for any subsequent window.
I am assuming that this format string would be internal to ClearWin+ but I suppose that it might even be in a user buffer that the user could then store and change but maybe that would be a bridge too far.
If we take this approach then it will take a little longer to implement. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Sun Apr 02, 2017 11:26 am Post subject: |
|
|
Paul,
It's a generous offer, but at the risk of sounding ungrateful, isn't this something that can be supplied by a user using standard existing Clearwin+ and Fortran?
When launching any user interaction window, raw execution speed ceases to be a problem as most computers (including my Windows tablet) are effectively instantaneous. It therefore isn't a problem to nest a few extra subroutine calls - and they shouldn't affect the stack much because they involve few parameters.
Hence, surely the best short term solution is to provide some way of illustrating what can be done by way of a sample subroutine or two?
Eddie |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2826 Location: South Pole, Antarctica
|
Posted: Sun Apr 02, 2017 9:37 pm Post subject: |
|
|
Windows style, Linux rubber Windows style, tablet style, Apple or Android phone style, night style, etc would be ultimately great final touch of Clearwin. We all see how many great looking styles of sliders, buttons and radio buttons, backgrounds exist...Would be great to refresh our programs with new nice looks... Beauty and ugly difference is the matter of few microns color layer and its shape. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Mon Apr 03, 2017 8:08 am Post subject: |
|
|
Eddie
Thanks for your concern. I think that your approach is simple and very effective. What I am planning is just a nice little diverting exercise for me that I will offer free of charge. |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Wed Apr 05, 2017 6:10 am Post subject: |
|
|
Dan ... maybe we should adopt this as the Silverfrost theme-tune ?
... with Paul on banjo pulling all the strings of course ?
https://www.youtube.com/watch?v=TW9KUeMaJRQ |
|
Back to top |
|
|
|