Silverfrost Forums

Welcome to our forums

window maximise issue

10 Nov 2006 4:47 #1248

Hi,

I seem to have a problem with maximising a window, perhaps I haven't fully understood some of the affects of ClearWin+ format codes.

I have a main program window which has a menu at the top and a toolbar underneath the file menu, then the rest of the space of this window is a big graphics space using the %gr code. Now in this program I have an Open File Dialog(OFD) that I am currently trying to update.

The OFD has a little preview box that shows you an image of the file that you highlight/select (single click), now after highlighting a file the image gets loaded in the preview box and then if the user decides, they can click OK, to open or CANCEL to close the OFD box.

The problem happens when the user decides NOT to open the file and clicks CANCEL, the file doesn't open at that time but if you maximise the main window, it loads the file in its graphic space (where it is originally supposed to) automatically. Is there a way to control a window maximise in FTN95?

Basically, OFD → Select file to preview → Cancel to come out of OFD → Maximise Main Window → File Loads in %GR space of main window. The obvious idea here is to only the file when and only when the user clicks OK, just like any other program.

I think I, kind, of know what the problem is about but I am not sure how to tackle it. I think when I preview the selected file (this calls another function) all the variables get loaded with that file information and they dont get cleared when CANCEL is pressed.

One thing I am uncertain of is, how does %GR react to maximise does it do an equivalent of a REPAINT?

I hope this explains the problem clearly. Any suggestions regarding this issue would be greatly appreciated.

Thank you

Kind regards

Murt

10 Nov 2006 8:54 #1250

Murt

This is an odd behaviour. If your %gr control accepts mouse clicks then a mouse click in the Open File Dialog may be getting through to the graphics region and causing some kind of problem.

Try using a PRINT instruction in your %gr callback to report when a mouse click gets through.

13 Nov 2006 3:00 #1258

Hi,

I tried the PRINT statement to see if the mouse clicks get through to the main %gr region, and I found that they dont.

The open file dialog also has a %gr region in which a preview is shown of the selected file, this calls the functions involved in actaully opening the file, but instead of projecting the file onto the main %gr region is shows it in the preview %gr region of the open file dialog.

The maximise issue still remains unsolved because when I cancel out of the open file dialog and maximise the window it still shows the last previewed file in the main %gr region.

I guess I could put a PRINT statement in every single function just to see which one is called when a window is maximised, or would that be a complete waste of time?

Thanx

Murt

13 Nov 2006 4:41 #1259

Murt

It sounds like you should be using select_graphics_object@. See the help file under the heading 'Graphics format %gr[options]'.

13 Nov 2006 8:00 #1261

Hey,

Thanx a lot for all the help, your PRINT command helped me in finding the cause of the problem.

Added an if statement and a flag to resolve the issue.

Thanks once again.

Murt

Please login to reply.