RequestFile$ window appears under main program

BlitzMax Forums/MaxGUI Module/RequestFile$ window appears under main program

T-Light(Posted 2008) [#1]
Hello

I have a problem with my main app, the app opens using a maximized window and is a mixture of windows system menus and graphics.

On one of the graphics sections I'm using a small animated 'file 'graphic. When the user clicks on it it opens the windows file requester [RequestFile$].

If the user left clicks with a mouse or single taps with a laptop pad the requester opens in front of the app window. The problem arises if the user double taps a laptop pad (or double clicks a mouse). The first click activates the gadget, the second click hides it behind the app.

Other than writing my own windows file requester, is there another way of forcing the file window on top of my main app window?

At the minute, if the user double clicks, it looks like the apps frozen.


Brucey(Posted 2008) [#2]
A file requester should be created with your main window as its parent, and run modal.

Dunno how much of that MaxGUI can cope with :-)


T-Light(Posted 2008) [#3]
:) Thanks Brucey

Well it's sort of modal in that it stops the main app in its tracks while waiting for input, problem is, it doesnt stop the main app from taking focus, even though it wont respond to anything.

Think I'll just have to write my own, shame.


T-Light(Posted 2008) [#4]
Actually, could this be submitted as a bug?

I can't think of any app that lets a file requester dissapear behind the main window.


rs22(Posted 2008) [#5]
RequestFile$ isn't actually part of MaxGUI. It's part of the BRL.System module. RequestColor$ and RequestFont$ which are part of MaxGUI, are modal.

As a temporary workaround for this, you can uncomment line 286 in mod/brl.mod/system.mod/system.win32.c. It's hardly ideal, though, since this will set the currently active window as the selector's parent - if something goes wrong and this happens to be a window that isn't part of your application, then that window will be set as the parent.

Maybe this function could be modified to allow you to pass a window handle to use as the parent?


T-Light(Posted 2008) [#6]
I'm taking a look now Robbie, thankyou.


rs22(Posted 2008) [#7]
I forgot to mention that you'll need to Build Modules after editing the file. I hope it works for you.


T-Light(Posted 2008) [#8]
:)

First thing I did.

Put it through a fair amount of testing this afternoon and it seemed pretty solid. Course, you know once someone else gets their paws on it, it'll go pair shaped :D

Thanks again for the advice and the warning, much appreciated.