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 

Text size in %cw and %ob sliding

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
DanRRight



Joined: 10 Mar 2008
Posts: 2814
Location: South Pole, Antarctica

PostPosted: Sun Nov 01, 2009 5:47 pm    Post subject: Text size in %cw and %ob sliding Reply with quote

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.
Code:
   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
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Sun Nov 01, 2009 6:41 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2814
Location: South Pole, Antarctica

PostPosted: Sun Nov 01, 2009 7:12 pm    Post subject: Reply with quote

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
Code:

   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
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7923
Location: Salford, UK

PostPosted: Mon Nov 02, 2009 2:19 pm    Post subject: Reply with quote

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@.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2814
Location: South Pole, Antarctica

PostPosted: Mon Nov 02, 2009 10:29 pm    Post subject: Reply with quote

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 ?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7923
Location: Salford, UK

PostPosted: Wed Nov 04, 2009 5:09 pm    Post subject: Reply with quote

I have now added a new option to %cw called [local_font] that applies the current %fn and %ts to %cw.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7923
Location: Salford, UK

PostPosted: Wed Nov 04, 2009 7:58 pm    Post subject: Reply with quote

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.

Code:
   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
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2814
Location: South Pole, Antarctica

PostPosted: Thu Nov 05, 2009 8:42 pm    Post subject: Reply with quote

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
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
Page 1 of 1

 
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