View previous topic :: View next topic |
Author |
Message |
lozzer
Joined: 27 Jun 2007 Posts: 49
|
Posted: Thu Apr 24, 2008 3:35 pm Post subject: Possible to resize the program window? |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu Apr 24, 2008 4:41 pm Post subject: |
|
|
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 |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Thu Apr 24, 2008 8:35 pm Post subject: |
|
|
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 |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2816 Location: South Pole, Antarctica
|
Posted: Thu Apr 24, 2008 9:25 pm Post subject: |
|
|
Piece of cace. See the Salford examples. |
|
Back to top |
|
|
lozzer
Joined: 27 Jun 2007 Posts: 49
|
Posted: Fri Apr 25, 2008 10:55 am Post subject: |
|
|
Thanks guys. I'll pass it on. _________________ Lozzer |
|
Back to top |
|
|
|