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 Previous  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: Mon Apr 03, 2023 10:18 pm    Post subject: Reply with quote

In an effort to code ad analogiam Kenneth's code

program main
use clrwin
implicit none
integer :: iw
integer :: x = 10
integer :: y = 5
iw = winio@('%nl%gr[white]&',500,500)
call draw_filled_rectangle@(0,0,500,500,rgb@(255,255,255))
call draw_characters@('Hello World',x,y,rgb@(1,1,1))
end program main

What is wrong? / How to get it to work? Apologies if this is very stupid.
Back to top
View user's profile Send private message Send e-mail
wahorger



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

PostPosted: Tue Apr 04, 2023 1:23 am    Post subject: Reply with quote

Your program has a couple of faults. No matter, we've all done this at one time or another (for me about a week ago).

Your code should read:
Code:
        WINAPP
   program main
   use clrwin
   implicit none
   integer :: iw,control=0
   integer :: x = 10
   integer :: y = 5
   iw = winio@('%nl%gr[white]&',500,500)
   iw = winio@('%lw',control)
   call draw_filled_rectangle@(0,0,500,500,rgb@(255,255,255))
   call draw_characters@('Hello World',x,y,rgb@(1,1,1))
   end program main


Note that I declared an integer "control" that is required for a %lw.

The %lw is required so the window can be "created" and the program continues to the next lines afterward. Yet, the window remains!!

It is on those remaining lines that you can do what you wish. You cannot draw on a surface until it is created. It is not created until the window is actually built (hence the %lw).

Suggestion: Instead of "use clrwin", you can "use mswin". That will get you additional capabilities later on.

Also WINAPP is a good thing to use at the top of your main program to insure all the appropriate windows setup routines are called.
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: Tue Apr 04, 2023 5:43 pm    Post subject: Reply with quote

Hi, your corrected code works nicely. Thank you. How do I get rid of the black ugly compiler output frame behind the new white frame? Calling clear_screen@ doesn't do the job. And how do I make the font bigger in the new white frame?
Back to top
View user's profile Send private message Send e-mail
Zach



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

PostPosted: Tue Apr 04, 2023 7:22 pm    Post subject: Reply with quote

program main
use clrwin
implicit none

integer :: iw,control=0
integer, dimension(2)::loc = (/20,50/)
iw = winio@('%nl%gr[white]&',500,500)
iw = winio@('%lw',control)
call draw_filled_rectangle@(100,100,500,500,rgb@(255,255,255))
!here
call locate(loc)
end program main


subroutine locate(loc)
use clrwin
integer,intent(in)::loc(2)
!there
call draw_characters@('Hello World',loc(1),loc(2),rgb@(1,1,1))
end subroutine

Hello World is being printed, But how do I pass "Hi there" form !here to !there and cause the called statement to print "Hi There"

Q: How do i make the font bigger?
Q: How could I get rid of the big black compiler output frame, behind the newly created white frame?
Back to top
View user's profile Send private message Send e-mail
Kenneth_Smith



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

PostPosted: Tue Apr 04, 2023 8:52 pm    Post subject: Reply with quote

One of a few possibilities:

Code:
winapp
program main
use clrwin
implicit none

integer :: iw,control=0
integer, dimension(1:2)::loc = (/20,50/)
iw = winio@('%nl%gr[red]&',500,500)
iw = winio@('%lw',control)
call draw_filled_rectangle@(100,100,500,500,rgb@(255,255,255))
call SCALE_FONT@(2.d0)
call locate(loc,'Hello World')
end program main


subroutine locate(loc,text)
use clrwin
integer,intent(in)::loc(2)
character(len=*) text
call draw_characters@(text,loc(1),loc(2),rgb@(1,1,1))
end subroutine
Back to top
View user's profile Send private message Visit poster's website
wahorger



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

PostPosted: Tue Apr 04, 2023 11:57 pm    Post subject: Reply with quote

Just FYI: your variable LOC is also an intrinsic integer(7) function. It returns the address of the argument.

FTN95 is really good about divining intent of reserved function names usage. Still, best to avoid using function names as variables with dimensions.

In the example:
Code:
integer(7):: i,a
i = loc(a)
print *,i

you will get the decimal address of the variable "a" printed.

LOC() has lots of great uses!
Back to top
View user's profile Send private message Visit poster's website
wahorger



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

PostPosted: Wed Apr 05, 2023 12:02 am    Post subject: Reply with quote

Use WINAPP and the black DOS command box will not be displayed.

If you do console output in a WINAPP application, an output window will be created automatically. All I/O from to/from the console are carried out in this window.

Please note: When you close you main window and there is a console window displayed, you'll need to also close this window in order re-compile and run.
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: Wed Apr 05, 2023 7:57 am    Post subject: Reply with quote

Removed

Last edited by Zach on Wed Apr 05, 2023 12:21 pm; 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: 682
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Wed Apr 05, 2023 9:02 am    Post subject: Reply with quote

Look up the help file for IMPORT_IMAGE@

Clearwin+ is extremely powerful and you should persevere with it.

Given the complexity of some of the user interfaces I have developed over the last 10 years using Clearwin+, I cannot fault the library, everything needed is there.
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: Wed Apr 05, 2023 1:15 pm    Post subject: Reply with quote

Is there a way to change the as is big cross-cursor into something more modest? And can the font be changed to Consolas, because the output as is, is very feeble. And can the size of big the black compiler output frame be reduced in size, and also to say: "One moment please."? Thank you very much in advance.

Last edited by Zach on Wed Apr 05, 2023 3:16 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
wahorger



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

PostPosted: Wed Apr 05, 2023 1:26 pm    Post subject: Reply with quote

I suggest you look at the help available on cursors found in the FTN95 and Clearwin HELP file available through Plato. Search for cursor and gets lots of references. Read up on them. I use it constantly, even after a decade of using this product!

Specifically, winio@() format code%cu. I think you'll find good stuff there.

The help is available there, to start.
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: Wed Apr 05, 2023 1:40 pm    Post subject: Reply with quote

I did not expect to find (a reference to) the language manual under the help button of the ide. Sorry.

Last edited by Zach on Wed Apr 05, 2023 2:26 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
wahorger



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

PostPosted: Wed Apr 05, 2023 1:52 pm    Post subject: Reply with quote

From PLATO. find "Help" on the menu bar and click it.
Back to top
View user's profile Send private message Visit poster's website
wahorger



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

PostPosted: Wed Apr 05, 2023 3:05 pm    Post subject: Reply with quote

There is also an FTN95 link on this HELP menu, as well as for ClearWin, etc. Just pull it up, and search. It's a single HELP file (generally) that has links in Plato to the appropriate starting sections for the HELP you're looking for.
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: Wed Apr 05, 2023 5:03 pm    Post subject: Reply with quote

I am taking a break from this discussion. Thank you for having shown so much patience with me.

Last edited by Zach on Wed Apr 05, 2023 8:02 pm; edited 3 times in total
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 Previous  1, 2, 3  Next
Page 2 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