|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
silicondale
Joined: 15 Mar 2007 Posts: 243 Location: Matlock, Derbyshire, UK
|
Posted: Mon May 20, 2013 3:54 pm Post subject: |
|
|
OK, just done the test. Unintended consequences. While the (obsolete) SET_WIN_ESCAPE clears the @-char problem, I now have a different problem elsewhere. I use the COUA@ subroutine to write out a prompt with suppression of the linefeed that normally follows a WRITE, so that user input goes on the same line. Unfortunately, this prompt now goes into another brand new Clearwin window that seems to be opened specially for it! Oh well, I'm sure I'll find another way around this one. It's all one big learning experience.
... 10 minutes later
Problem solved. Opening the lazy CW window with
iwin = Create_Window@ (....)
i = Set_Default_Window@ (...)
call Open_to_Window@ (lun,iwin)
iwin is the handle of the window created. All that is needed then is to add the obsolete function
call Set_Win_Escape (iwin1,'~')
to change the escape character from @ to ~
Job done.
many thanks, Paul, Eddie, John, and all!
- Steve
Last edited by silicondale on Mon May 20, 2013 4:15 pm; edited 1 time in total |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Mon May 20, 2013 4:14 pm Post subject: |
|
|
Steve,
WIN_COUA (p96) has parameters of Window_handle, string, No_of_chars
Is this the one?
Eddie |
|
Back to top |
|
|
silicondale
Joined: 15 Mar 2007 Posts: 243 Location: Matlock, Derbyshire, UK
|
Posted: Mon May 20, 2013 4:21 pm Post subject: |
|
|
Eddie -
Not WIN_COUA (p348 in my edition) but COUA@ (in FTN95.CHM) which takes only one argument, the character string to output. Yes, WIN_COUA would have done the job, as the window handle is one of the arguments. But not needed now (see 2 posts up) - just a call to SET_WIN_ESCAPE for the lazy window does the trick.
-Steve |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Mon May 20, 2013 4:27 pm Post subject: |
|
|
The 'problem solved' section didn't say solved COUA@ !!
So I was just guessing.
However it looks to me that by judicious use of the Escape sequence to change font characteristics you could have prompts and answers in different font style &/or colour too ...
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Mon May 20, 2013 4:40 pm Post subject: |
|
|
I will add to the code for set_win_escape@ so that, when the first argument is zero, the second argument becomes the default escape character.
If you seriously can use the functionality of the escape character, perhaps someone could write a paragraph for me to put in the help file. If I ever knew what it does, I have forgotten. |
|
Back to top |
|
|
silicondale
Joined: 15 Mar 2007 Posts: 243 Location: Matlock, Derbyshire, UK
|
Posted: Mon May 20, 2013 4:46 pm Post subject: |
|
|
Eddie - Now that would be interesting. But as my main priority is just to get the program running properly before doing fancy stuff with the graphics, I think that's an avenue I won't be exploring for a while! Thanks for all your help and encouragement. Things have come a long way since my first Fortran program in 1971 (and my first Algol-60 program in 1967). Though there's actually still some 1972-73 vintage code in the program I'm working on now.
Paul - seems that Eddie might know something of the functionality! As far as I was concerned (the reason for this thread) it was just a nuisance as there seemed no reason for the @ character to behave differently from others! However, I agree, it would be good to document it if there is functionality that nobody is using only because it's supposed to be obsolete.
- Steve |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Tue May 21, 2013 2:42 pm Post subject: |
|
|
Once you know what is possible, it isn't all that difficult. The following was produced with some assistance from that old Clearwin manual.
Code: | WINAPP
PROGRAM AT
COMMON / CLEARWIN_HANDLE/ iCW_Handle
INCLUDE <WINDOWS.INS>
INTEGER, EXTERNAL:: WRITEAT
IA = WINIO@('%ca[Test for embedded CW window]%2nl%pv'//
& '%70.30cw[vscroll,hscroll]%lc&',
& 99, iCW_Handle)
IA=WINIO@('%ww%sc&', WRITEAT)
IA=WINIO@('%ac[F1]&','COPY')
IA=WINIO@('%ff%nl%rj%12bt[STOP]'//
& '%lw', KONTROL)
STOP
END
INTEGER FUNCTION WRITEAT()
COMMON / CLEARWIN_HANDLE/ iCW_Handle
INCLUDE <WINDOWS.INS>
CALL GET_SYSTEM_FONT (LFHEIGHT, LFWIDTH, LFESCAPEMENT,
& LFORIENTATION, LFWEIGHT, LFITALIC,
& LFUNDERLINE, LFSTRIKEOUT, LFCHARSET,
& LFOUTPRECISION, LFCLIPPRECISION, LFQUALITY,
& LFPITCHANDFAMILY, LFFACENAME)
LFITALIC = 1
NEWFONT = CreateFont (LFHEIGHT, LFWIDTH, LFESCAPEMENT,
& LFORIENTATION, LFWEIGHT, LFITALIC,
& LFUNDERLINE, LFSTRIKEOUT, LFCHARSET,
& LFOUTPRECISION, LFCLIPPRECISION, LFQUALITY,
& LFPITCHANDFAMILY, LFFACENAME)
CALL ADD_TEXT_DESCRIPTOR (iCW_Handle, NEWFONT, RGB@(255,0,0))
LFITALIC = 0
LFUNDERLINE = 1
NEWFONT = CreateFont (LFHEIGHT, LFWIDTH, LFESCAPEMENT,
& LFORIENTATION, LFWEIGHT, LFITALIC,
& LFUNDERLINE, LFSTRIKEOUT, LFCHARSET,
& LFOUTPRECISION, LFCLIPPRECISION, LFQUALITY,
& LFPITCHANDFAMILY, LFFACENAME)
CALL ADD_TEXT_DESCRIPTOR (iCW_Handle, NEWFONT, RGB@(0,0,255))
WRITE(99,*) "@t1This is the default font - maybe for headings"
WRITE(99,*) "@t2This is the first additional font - red, italic"
WRITE(99,*) "@t3This is the next additional font - blue, upright"
& //", underlined"
WRITEAT = 1
RETURN
END |
To Steve, I say that if you have 'conversational' prompted input in a CW window, colour is a terrific way of distinguishing prompt from reply.
To Paul, I say that there really is no substitute for something like the above, so it isn't really obsolete at all. It therefore deserves mention in the CHM file, and possibly in the Knowledgebase. I haven't a clue whether or not it works with TrueType fonts, and indeed, what possible settings there are for the 14 variables.
Eddie |
|
Back to top |
|
|
silicondale
Joined: 15 Mar 2007 Posts: 243 Location: Matlock, Derbyshire, UK
|
Posted: Tue May 21, 2013 3:26 pm Post subject: |
|
|
Excellent, Eddie. I guess somebody must know how it works. Definitely worth proper documentation! _________________ (Steve Henley) |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Tue May 21, 2013 4:28 pm Post subject: |
|
|
Back in 2009 Paul introduced an option to %cw i.e. %cw[local_font] that makes the %cw window use the currently defined font, i.e. uses current %fn and %ts, but this doesn't allow colour and style changes within the text.
E |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Tue May 21, 2013 6:33 pm Post subject: |
|
|
Paul,
Here's my suggestion for what to put in FTN95.CHM (as requested):
In the section headed “Clearwin windows”
Remove ADD_TEXT_DESCRIPTOR@ and SET_WIN_ESCAPE@ from the obsolete list.
Add a section describing the %cw[local_font] option, i.e. if this option is chosen then the font currently selected using %fn and %ts is used as the default font for the %cw window.
Add a section about using ADD_TEXT_DESCRIPTOR@ to define multiple fonts for a particular %cw window, and how they are selected with an ESCape sequence, @tn embedded in the output.
Add a section explaining how to change the ESCape code from @ if that symbol is required in the output.
Put the subroutine names in the library reference
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Wed May 22, 2013 8:45 am Post subject: |
|
|
Many thanks for all your contributions.
Here is an alternative sample based on Eddie's code
Code: | winapp
program at
include <clearwin.ins>
integer ia,kontrol,icw_handle,hfont2,hfont3
ia=winio@('%ww%ca[Test for embedded CW window]&')
ia=winio@('%pv%60.10`cw&', 99, icw_handle)
ia=winio@('%ac[F1]&','COPY')
ia=winio@('%it%gf%`it&', hfont2)
ia=winio@('%ul%gf%`ul&', hfont3)
ia=winio@('%ff%nl%rj%6bt[Stop]%lw', kontrol)
call add_text_descriptor(icw_handle, hfont2, rgb@(255,0,0))
call add_text_descriptor(icw_handle, hfont3, rgb@(0,0,255))
write(99,*) "@t1This is the default font - maybe for headings"
write(99,*) "@t2This is the first additional font - red, italic"
write(99,*) "@t3This is the next additional font - blue, upright"
end
|
|
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Wed May 22, 2013 6:46 pm Post subject: |
|
|
Oh, that's excellent! Avoids that awful CreateFont stuff.
Eddie |
|
Back to top |
|
|
silicondale
Joined: 15 Mar 2007 Posts: 243 Location: Matlock, Derbyshire, UK
|
Posted: Wed May 22, 2013 10:44 pm Post subject: |
|
|
Paul -
Many thanks for taking all this seriously and coming up with such an elegant solution! Really appreciated.
- Steve _________________ (Steve Henley) |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2813 Location: South Pole, Antarctica
|
Posted: Thu May 23, 2013 3:58 am Post subject: |
|
|
That rainbow of colors makes CWP very nice looking. Is it possible to change the font in Simpleplot %pl control similar way? |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Thu Sep 29, 2016 9:25 pm Post subject: |
|
|
I would like to get my hands on a copy of this old manual for these functions specifically. I've tried searching, but, alas, no valid hits.
Is there a way for someone to upload it and post the link here so the rest of us can get a copy?
Assuming it is in PDF or some electronic form!
I have implemented the @t construct to notify my users of important status messages! And learned some valuable information along the way. |
|
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
|