|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
EKruck
Joined: 09 Jan 2010 Posts: 224 Location: Aalen, Germany
|
Posted: Sun Mar 07, 2010 5:22 pm Post subject: Fontsize in %eb edit box and clearwin window |
|
|
How can I set or change the text font size inside %eb edit boxes and in clerarwin windows ? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Mon Mar 08, 2010 10:07 am Post subject: |
|
|
You can only have one font size for each %eb and %cw.
I think that %ts works for %eb.
%ts should work for %cw if you have the latest release and you add [local_font] to the %cw options. |
|
Back to top |
|
|
EKruck
Joined: 09 Jan 2010 Posts: 224 Location: Aalen, Germany
|
Posted: Mon Mar 08, 2010 4:07 pm Post subject: |
|
|
Thanks Paul,
I tried it as follows:
!-------------------------------------------------------------------------------------------------
winapp
Program SetSize
IMPLICIT NONE
INCLUDE <windows.ins>
INTEGER MA, iBgoFont, iWH, CW_HANDLE
REAL*8 SCALE
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
iBgoFont = CreateFont (16, 7, 0, 0, 700, 0, 0, 0, 0, 1, 2, 2, 34, 'System')
MA = WINIO@ ('%fh&', iBgoFont)
MA = WINIO@ ('%fn[Microsoft Sans Serif]&')
MA = WINIO@ ('%ca[FontSize]%bg[grey]&')
MA = WINIO@ ('%ts&', 1.5D0)
MA = WINIO@ ('Write text on screen%ff&')
MA = WINIO@ ('%ts&', 0.8D0)
MA = WINIO@ ('Write text on screen%ff&')
MA = WINIO@ ('%`bg[white]%22.3eb[vscrollbar,no_hscroll,fixed_font,read_only]&', 'HALLO-1', 7)
MA = WINIO@ ('%ff%2nl&')
MA = WINIO@ ('%ts&', 1.5D0)
MA = WINIO@ ('%`bg[white]%22.3eb[vscrollbar,no_hscroll,fixed_font,read_only]&', 'HALLO-2', 7)
MA = WINIO@ ('%ff%2nl&')
MA = WINIO@ ('%`bg[white]%22.3eb[vscrollbar,no_hscroll,read_only]&', 'HALLO-3', 7)
MA = WINIO@ ('%ts&', 1.0D0)
MA = WINIO@ ('%ffWrite text on screen&')
MA = WINIO@ ('%ff%2nl&')
MA = WINIO@ ('%tc[blue]&')
MA = WINIO@ ('%ts&', 2.0D0)
MA = WINIO@ ('%`bg[white]%22.3cw[vscroll]&', 0)
MA = WINIO@ ('%lw%es', iWH)
write (*,*) 'Text Line 1'
write (*,*) 'Text Line 2'
write (*,*) 'Text Line 3'
write (*,*) 'Text Line 4'
write (*,*) 'Text Line 5'
END
!-------------------------------------------------------------------------------------------------
The text size in the %eb box is only effected, if "fixed_font" is not set. However, the size of the box is in every case effected (a bug?).
Unfortunately I do not have yet the latest compiler version but 5.10. Could you please try your proposal for %cw in my example! If it works, I will buy the latest version.
I need "fixed_font" for both, %eb and %cw boxes.
Regards, Erwin |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Mon Mar 08, 2010 7:50 pm Post subject: |
|
|
I think that you will find the fixed font is not scalable.
You will probably be able to find a font that is similar and is scalable if you want a fixed font with a different size.
Your CreateFont is not really doing anything in this code. Its effect is immediately cancelled by %fn (and %ts).
The size of the edit box is determined by %ts so (if you wish to use fixed_font) then you should restore the default size (1.0) before each %eb.
The old way to set the font for %cw is still available. See set_default_font@ in the help file. |
|
Back to top |
|
|
EKruck
Joined: 09 Jan 2010 Posts: 224 Location: Aalen, Germany
|
Posted: Sat Mar 13, 2010 6:23 pm Post subject: |
|
|
Paul,
did you really run my example? Here a new example using your recommendations:
!-------------------------------------------------------------------------------------------------
winapp
Program SetSize
IMPLICIT NONE
INCLUDE <windows.ins>
INTEGER MA, iBgoFont, iWH
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
iBgoFont = CreateFont (30, 7, 0, 0, 700, 0, 0, 0, 0, 1, 2, 2, 34, 'System')
MA = WINIO@ ('%fh&', iBgoFont)
! MA = WINIO@ ('%fn[Consolas]&')
MA = WINIO@ ('%bg[grey]&')
MA = WINIO@ ('Write text on screen%ff&')
MA = WINIO@ ('Write text on screen%ff&')
MA = WINIO@ ('%`bg[white]%40.3eb[vscrollbar,no_hscroll,read_only]&', 'HALLO-1', 7)
MA = WINIO@ ('%ff%2nl&')
MA = WINIO@ ('%`bg[white]%40.3eb[vscrollbar,no_hscroll,fixed_font,read_only]&', 'HALLO-2', 7)
MA = WINIO@ ('%ffWrite text on screen&')
MA = WINIO@ ('%ff%2nl&')
CALL SET_DEFAULT_FONT (iBgoFont)
MA = WINIO@ ('%`bg[white]%40.10cw[vscroll,local_font]&', 0)
MA = WINIO@ ('%lw%es', iWH)
write (*,*) 'all asterisks *'
write (*,*) 'should *'
write (*,*) 'be *'
write (*,*) 'below each other *'
END
!-------------------------------------------------------------------------------------------------
If you remove the "!" in front of %fn, the font size defined in CreateFont will activated but not cancelled! The font handling seems to have several bugs.
In a personal email to me you mentioned that I am not under maintenance. I AM since about 18 to 20 years through Joerg Kuthe.
Erwin |
|
Back to top |
|
|
EKruck
Joined: 09 Jan 2010 Posts: 224 Location: Aalen, Germany
|
Posted: Sun Mar 14, 2010 9:22 am Post subject: |
|
|
Changing the font name in CreateFont to e.g. MyFont provides a different result (with and without %fn), but not the expected one in size of the boxes.
%40.10eb and %40.10cv provide diffent results in width of the boxes. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Mon Mar 15, 2010 2:11 pm Post subject: |
|
|
I think that you may be right. There is something odd happening with the use %fh in this context.
However, the only effect of %fh is to set the font size because you immediately change the font name to something else. It is more direct to use %ts to set the font size.
You can certainly use CreateFont with set_default_font@ for %cw until you get the latest download where you have the option %cw[local_font].
If you still have a problem with the size of your edit boxes then you could explore using %di. This allows you to use a dialog resource in order to set the size of the boxes directly. See the help file under Win32 Platform->ClearWin+->Using dialog resources. |
|
Back to top |
|
|
|
|
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
|