Dialog Box (OpenInsight 64-bit)
At 24 SEP 2020 12:35:27AM Gerry Van Niekerk wrote:
Is there a way I can keep a dialog box inside the MDI frame
Mine always just goes anywhere on the screen…
Gerry
At 24 SEP 2020 01:03AM Donald Bakke wrote:
Is there a way I can keep a dialog box inside the MDI frame
Mine always just goes anywhere on the screen…
Gerry
Is this a queestion on how to position the dialog box wihtin the MDI Frame when it is launched or is this a question on how to prevent the dialog box from being moved outside of the borders of the MDI Frame?
At 24 SEP 2020 01:17AM Gerry Van Niekerk wrote:
How to keep the Dialog Box inside the MDI Frame when launched
Also seems to go behind the MDI so you have to look for it
Gerry
At 24 SEP 2020 01:31AM Donald Bakke wrote:
How to keep the Dialog Box inside the MDI Frame when launched
The basic approach is to check the PARENT property in the CREATE event handler of your dialog box. Use the SIZE property of the parent window and the SIZE property of your dialog box and calculate the new X and Y postion for the dialog box. You'll want to make sure your dialog box is invisible at design time because once you set the new SIZE property of the dialog box it will become visible. This will avoid the user seeing the form appear in one location and then jump to another.
You can save yourself the work and just call the PlaceDialog routine. We usually call it like this:
PlaceDialog(-1, -1)Also seems to go behind the MDI so you have to look for it
This should happen. How are you calling the dialog box? What are you setting for the ParentID argument?
At 24 SEP 2020 01:33AM Donald Bakke wrote:
This should happen.
Typo. I meant that this should not happen.
At 24 SEP 2020 01:41AM Gerry Van Niekerk wrote:
Thanks Don
will give it a go shortly
Gerry
At 24 SEP 2020 06:03PM Gerry Van Niekerk wrote:
The Parent and owner etc windows are all pointing to the MDI window
However the "childwindow" variable = 0
therefore it still sits outside the MID frame
which means then ie The Save and Escape keys don't work unless you set it on the form as a menu item
The "placedialog" does bring it to the front though but still outside..
Gerry
At 24 SEP 2020 07:52PM Donald Bakke wrote:
The Parent and owner etc windows are all pointing to the MDI window
However the "childwindow" variable = 0
therefore it still sits outside the MID frame
How, exactly, are you launching the dialog box? I asked this before but I didn't get a response. For instance, are you using Dialog_Box or Create_Dialog or something else?
which means then ie The Save and Escape keys don't work unless you set it on the form as a menu item
What "Save and Escape keys" aren't working? Are these keys on the dialog box or on the MDI Frame?
The "placedialog" does bring it to the front though but still outside..
Again, this suggests to me that your appraoch to launching the dialog box is not being done correctly. I'm still unsure if your expectations about how the dialog box should behave are accurate or reasonable. Is the purpose of this dialog box to get a response from the user before the application can move on (i.e., modal)? Is the purpose of this dialog box to just sit above the MDI Frame while the user continues to interact with the application (i.e., modeless)? Are you expecting the shortcuts, buttons, or menu items on the MDI Frame to work with the dialog box?
At 24 SEP 2020 09:52PM Gerry Van Niekerk wrote:
Hi Don,
Yes its modal and waiting for a response before you can move on
and if it was within the MDI all the mdi menus and actions will be available to you to use
when it sits outside the frame you cant use say, options, save etc from the MDI frame
and Ctl S or F9 doesn't work, in other words you have to use your mouse in stead of just going Ctl S or F9
this can be done of course but needs to be setup as a Menu item on the form, which is not a problem but time consuming as we have a standard menu structure build into all forms and it doesn't include the save and options etc functions, as its controlled in the MDI Menu setup.
so the answer at this stage is probably no you can't I suppose, I will add it as a suggestion for future considerations.
Thanks..
Gerry
At 25 SEP 2020 06:29AM Carl Pates wrote:
Hi Gerry,
A modal dialog always uses a top level window (like the MDI frame) as it's parent, and because it's modal the parent is disabled until the dialog is closed.
From what you describe it seems like you want a "modal mdichild", which will probably be an exercise left you for you :) Something like:
Start the dialog via MDI Child Make sure its the active child Disable all the other children Re-enable them when the "dialog child"is closed.However, having said that, there is a solution that might help you with a normal dialog box - WINDOW objects support a property called the ACCELERATORFRAME - this allows it to direct the menu accelerator lookup to another WINDOW, so you could try something like this in your dialog's create event:
call Set_Property_Only( @Window, "ACCELERATORFRAME", "MY_MDIFRAME_THAT_HAS_THE _MENU" )And see if that works for you?
Regards