Silverfrost Forums

Welcome to our forums

Text size in %cw and %ob sliding

1 Nov 2009 4:47 #5294

In this simple code I do not know how to make two things: decrease printed text font size and stop %ob from sliding when resize. Help is as usually appreciated.

   use clrwin
   ioLUN=11
   i=winio@('%ww[no_border]%mn[Exit]%ac[Esc]%nd%nr&','exit','exit')
   i=winio@('%2.1ob[shaded,raised]&')
   i=winio@('%tt[Button1]&')
   i=winio@('%cb&')
   i=winio@('%tt[Button2]&')
   i=winio@('%cb%ff&')
   i=winio@('%fn[Courier]%ts%pv%40.12cw[hscroll,vscroll]%lw',0.8d0,ioLun,ilw)
   write(11,*) (1234567,i=1,30)
   end
1 Nov 2009 5:41 #5295

Dan,

Why have you got boxes anyway? If you delete them the controls can still be made to line up anyway. Most windows that have buttons probably aren't resizable.

Regards

Eddie

1 Nov 2009 6:12 #5296

That was shortest snippet, just an illustration example to understand better what's wrong. Boxes are extremely useful for grouping when there is many pictures, buttons, radiobuttons, inputs and outputs. OK, here is same but a bit larger snippet if you do not like first one. Try to resize whole window - everything turns into disaster, %nr and %nd do not work on %ob/%cb or i do something wrong.

Note also, that %ts changes contols text size but not printed text size and font. And %tc changes %cw text color while %bg changes %cw background. So i can do a lot of things with %cw but by some reason not a changing text font and text size

   use clrwin 
   ioLUN=11
   i=winio@('%ww[no_border]&') 
   i=winio@('%mn[Exit]%ac[Esc]&','exit','exit') 
   i=winio@('%nd%nr&') 
   i=winio@('%sf%ts&',0.8d0) 
   i=winio@('%3.1ob[shaded]&') 
   i=winio@('%cn%rb[var1] %ff&',i0) 
   i=winio@('%rd A %ff&',i1) 
   i=winio@('%rd B %ff&',i2) 
   i=winio@('%rd C %ff&',i3) 
   i=winio@('%tt[Button1]&') 
   i=winio@('%cb&') 
   i=winio@('%cn%rb[var2] %ff&',ii0) 
   i=winio@('%rd X %ff&',ii1) 
   i=winio@('%rd Y %ff&',ii2) 
   i=winio@('%rd Z %ff&',ii3) 
   i=winio@('%tt[Button2]&') 
   i=winio@('%cb&') 
   i=winio@('%cn%rb[var3] %ff&',iii0) 
   i=winio@('%rd I %ff&',iii1) 
   i=winio@('%rd J %ff&',iii2) 
   i=winio@('%rd K %ff&',iii3) 
   i=winio@('%tt[Button3]&') 
   i=winio@('%cb%ff %nl&') 

   i=winio@('%fn[Courier]%ts%tc%`bg%pv%42.12cw[hscroll,vscroll]%lw',0.8d0,rgb@(0,0,255),rgb@(255,222,222), ioLun,ilw) 
   write(11,*) (1234567,i=1,30) 
   end
2 Nov 2009 1:19 #5301

The way to change the font in a %cw window is described in the help file under Win32 Platform->ClearWin+->ClearWin Windows->Text output to ClearWin windows. Admittedly this could be made easier.

If this is not sufficient then there is another method using add_text_descriptor@ but I have assumed that this method is now redundant.

Given time I could probably add an option to %cw to say 'use the current %fn and %ts'.

Please note that the routine set_default_font@ only works for %cw windows. It is an old routine that predates winio@.

2 Nov 2009 9:29 #5310

Thanks, yea, it is not as easy as 2x2 but great that it is possible, will try to figure out how to do that quick.

Also, about %ob/cb when resize the window - is this fixable ?

4 Nov 2009 4:09 #5341

I have now added a new option to %cw called [local_font] that applies the current %fn and %ts to %cw.

4 Nov 2009 6:58 #5342

You could use %bx as in the following sample. The sample also shows how the new %cw option will work when you get the next salflibc.dll.

   WINAPP
   use clrwin 
   ioLUN=11 
   i=winio@('%ww[no_border]%mn[Exit]%ac[Esc]%nd%nr&','exit','exit') 
   i=winio@('%tt[Button1]&') 
   i=winio@('%tt[Button2]&') 
   i=winio@('%bx&', 1.0d0) 
   i=winio@('%fn[Tahoma]%ts%pv%40.12cw[hscroll,vscroll,local_font]%lw',1.1d0,ioLun,ilw) 
   write(11,*) (1234567,i=1,30) 
   end
5 Nov 2009 7:42 #5344

Cool trick with %bx! I'd also suggest for you to add it with small picture or even avi file for demonstration into %ob description in the Help file, this will save somebodys hears from losing ! And thanks also for fonts in %cw

Please login to reply.