Silverfrost Forums

Welcome to our forums

Possible to resize the program window?

24 Apr 2008 2:35 #3077

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.

24 Apr 2008 3:41 #3078

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.

24 Apr 2008 7:35 #3079

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

24 Apr 2008 8:25 #3080

Piece of cace. See the Salford examples.

25 Apr 2008 9:55 #3081

Thanks guys. I'll pass it on.

Please login to reply.