soccer jersey forums.silverfrost.com :: View topic - Library with screen location(x,y)
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 

Library with screen location(x,y)
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
Zach



Joined: 13 Mar 2023
Posts: 85
Location: Groningen, Netherlands

PostPosted: Fri Mar 31, 2023 7:20 pm    Post subject: Library with screen location(x,y) Reply with quote

My question is:

(1.) Is there an include library that deals with e.g. locate(x,y) and
(2.) If so, could you please give a very simple code example of how the library in question facilitates coding e.g. locate(10,6)? I.e., what then that simple main (using) program could look like?

Many thanks.
Back to top
View user's profile Send private message Send e-mail
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Fri Mar 31, 2023 8:56 pm    Post subject: Reply with quote

There is no locate() function that I can see. What is it supposed to do?

Perhaps a more detailed statement of the question is in order?
Back to top
View user's profile Send private message Visit poster's website
Zach



Joined: 13 Mar 2023
Posts: 85
Location: Groningen, Netherlands

PostPosted: Fri Mar 31, 2023 10:26 pm    Post subject: Reply with quote

Bill, I did reply, but my post has disappeared. I am receiving error messages from the SilverFrost desk. Will try again tomorrow. Patrick.
Back to top
View user's profile Send private message Send e-mail
Zach



Joined: 13 Mar 2023
Posts: 85
Location: Groningen, Netherlands

PostPosted: Fri Mar 31, 2023 10:44 pm    Post subject: Reply with quote

I had a look at the messages without logging first and I did get to se my response message to you / if I log in properly first, I don't see my response message. So there is something fishy going on in the provider's software it would seem.
Back to top
View user's profile Send private message Send e-mail
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Fri Mar 31, 2023 11:12 pm    Post subject: Reply with quote

You should look at the documentation for FTN95 for the drawing primitives. I pulled this list below directly from the Plato HELP file.

DRAW_LINE_BETWEEN@
Draws a straight line between two points.

DRAW_CHARACTERS@
Draws text.

DRAW_ELLIPSE@
Draws an ellipse.

DRAW_FILLED_ELLIPSE@
Fills an ellipse.

DRAW_FILLED_POLYGON@
Fills a polygon.

DRAW_FILLED_RECTANGLE@
Fills a rectangle.

DRAW_POLYLINE@
Draws a number of connected straight lines.

DRAW_RECTANGLE@
Draws a rectangle.

DRAW_POINT@
Sets a pixel colour.

SET_LINE_STYLE@
Sets attributes for line drawing.

SET_LINE_WIDTH@
Sets the width for line drawing.

This is probably what you are after.
Back to top
View user's profile Send private message Visit poster's website
Zach



Joined: 13 Mar 2023
Posts: 85
Location: Groningen, Netherlands

PostPosted: Sat Apr 01, 2023 12:06 am    Post subject: Reply with quote

I want to be able to place something on the screen, ad hoc, by means of a locate(x,y) statement. I am not wanting to draw lines and what not. What would be really perfect, would be to be able to put an image on screen from within a FTN program, as a backdrop, then place stuff on it, in the way just now described. Then you would have visual FTN. Dead simple! Creating an image with a tuppence graphics program, then incorporating that image in a FTN program, to be projected on-screen, is something I've been unable to find how to do. It would be revolutionary. You'd have visual FTN (or visual C) without all the fuss of e.g. visual C#.

This is how you put things on screen in C:

void locate(short x, short y)
{
COORD pos = {x, y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}

No sweat at all.


Last edited by Zach on Sat Apr 01, 2023 6:38 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Kenneth_Smith



Joined: 18 May 2012
Posts: 709
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sat Apr 01, 2023 1:08 am    Post subject: Reply with quote

Code:
program t
use clrwin
implicit none
integer iw
integer, external :: cb_add, cb_clear
iw = winio@('%mn[Exit]&','Exit')
iw = winio@('%bg[blue]&')
iw = winio@('%^bt[Add something]%^bt[Clear]&',cb_add,cb_clear)
iw = winio@('%nl%gr[white]&',500,500)
iw = winio@('')
end program t

integer function cb_add()
use clrwin
implicit none
integer, external :: cb1
integer iw
integer x, y
character(len=40) text
common x,y,text
  x = 50
  y = 25
  text = 'This is some text'
  iw = winio@('x%rd%nly%rd%nl%rs&',x,y,text)
  iw = winio@('%nl%bt[Cancel]%ta%^bt[Apply]&',cb1)
  iw = winio@('')
  cb_add = 2
end function cb_add

integer function cb1()
use clrwin
implicit none
integer iw
integer x,y
character(len=40) text
common x,y,text
  call draw_characters@(text,x,y,rgb@(1,1,1))
  cb1 = -1
end function cb1

integer function cb_clear()
use clrwin
implicit none
  call draw_filled_rectangle@(0,0,500,500,rgb@(255,255,255))
  cb_clear = 2
end function cb_clear

Back to top
View user's profile Send private message Visit poster's website
Zach



Joined: 13 Mar 2023
Posts: 85
Location: Groningen, Netherlands

PostPosted: Sat Apr 01, 2023 5:51 am    Post subject: Reply with quote

Hi Kenneth, well, this is truly amazing and rather a different ballgame than simply Fortran. I wonder how you know how to do all that! I will have to experiment to find out which text does what. Thank you very much for responding in this way. I am impressed. Patrick
Back to top
View user's profile Send private message Send e-mail
Kenneth_Smith



Joined: 18 May 2012
Posts: 709
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sat Apr 01, 2023 11:31 am    Post subject: Reply with quote

The example uses the Silverfrost Clearwin+ library.

Documentation (from 2000, based largely on FTN77 programming) which explains the basic functionality can be found here:

https://silverfrost.com/manuals/clearwin.pdf

Updated information is in the documentation that can be searched from within Plato via the Help menu.

A comprehensive set of examples illustrating many features of ClearWin+ can be found here:

https://gitlab.com/silverfrost/clearwin-examples
Back to top
View user's profile Send private message Visit poster's website
Zach



Joined: 13 Mar 2023
Posts: 85
Location: Groningen, Netherlands

PostPosted: Sat Apr 01, 2023 12:11 pm    Post subject: Reply with quote

Kenneth, Thank you very much for the reference, Patrick.
Back to top
View user's profile Send private message Send e-mail
Zach



Joined: 13 Mar 2023
Posts: 85
Location: Groningen, Netherlands

PostPosted: Sat Apr 01, 2023 1:36 pm    Post subject: Reply with quote

The examples are about graphs, was that your intention?
Back to top
View user's profile Send private message Send e-mail
Kenneth_Smith



Joined: 18 May 2012
Posts: 709
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sat Apr 01, 2023 6:45 pm    Post subject: Reply with quote

Look at the examples in the Controls Demo folder.
Back to top
View user's profile Send private message Visit poster's website
Zach



Joined: 13 Mar 2023
Posts: 85
Location: Groningen, Netherlands

PostPosted: Sat Apr 01, 2023 9:47 pm    Post subject: Reply with quote

Yes, I will do that. Thank you for the tip.
Back to top
View user's profile Send private message Send e-mail
LitusSaxonicum



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

PostPosted: Sun Apr 02, 2023 11:39 am    Post subject: Reply with quote

What about this:

https://www.silverfrost.com/manuals/fortran-and-the-art-of-windows-programming.pdf

Requires minimal knowledge of Fortran.

Eddie
Back to top
View user's profile Send private message
Zach



Joined: 13 Mar 2023
Posts: 85
Location: Groningen, Netherlands

PostPosted: Sun Apr 02, 2023 1:09 pm    Post subject: Reply with quote

Hi, re your reference: I have downloaded it. Thank you for drawing my attention to it. Patrick
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Page 1 of 3

 
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