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 

Possible to resize the program window?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
lozzer



Joined: 27 Jun 2007
Posts: 49

PostPosted: Thu Apr 24, 2008 3:35 pm    Post subject: Possible to resize the program window? Reply with quote

This is a fairly basic question, but is it possible to program in FTN95 the ability to dynamically resize an application window so that the end-user can click and drag the window while at the same time all icons reshuffle themselves in the available space just like every other Windows program I have used?

Thanks.
_________________
Lozzer
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Apr 24, 2008 4:41 pm    Post subject: Reply with quote

The usual approach is to use ClearWin+, winio@ and %ww with %pv, etc.
Maybe also %fr and %ac.
Reshuffling of icons will not happen automatically but there will probably be a way to do this.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Thu Apr 24, 2008 8:35 pm    Post subject: Reply with quote

Yes, it is possible, but it does not happen automatically - i.e. with no programmer intervention.

If your main application windows has a graphics area, defined by a %gr, then you can make it user-resizable by grabbing and moving the corners of the application window. You make the %gr graphics area resizable by using the %pv format code, i.e.

'%pv%gr

If the user does that, do you want to resize and/or change the contents of the graphics window? It seem to me that you do. So, you have to give the %gr graphics area a callback function, and tell it that the program will take care of redrawing the graphics area contents.

Hence, you will want:

'%pv%^gr[user_resize,rgb_colours]&', .... GRAPHICS_CALLBACK etc.

In the GRAPHICS_CALLBACK function, you need to see if the callback has been invoked by reason of a graphics resize. There are two ways of doing this, but the preferred way seems to be by this sort of construct:

CBR=clearwin_string@(‘CALLBACK_REASON’)

which returns "RESIZE" in CBR if the graphics resize was the reason for invoking the callback. If it is, then you calculate where everything needs to appear, and redraw the graphics area. Be prepared for this to happen repeatedly as the application window is resized. On a modern computer, quite complex redraws are essentially instant.

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



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

PostPosted: Thu Apr 24, 2008 9:25 pm    Post subject: Reply with quote

Piece of cace. See the Salford examples.
Back to top
View user's profile Send private message
lozzer



Joined: 27 Jun 2007
Posts: 49

PostPosted: Fri Apr 25, 2008 10:55 am    Post subject: Reply with quote

Thanks guys. I'll pass it on.
_________________
Lozzer
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 -> Support 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