Movable Modal Dialog ?

I want to set the kind of a window to what is said in “User’s Guide, User Interface, Movable Modal Dialog”.

BUT, I am able to click in the window that is behind that one and that is something I do not want.

That window allows the user to set some text that is sent to the caller’s window. So that window must stay in front of its parent.

Remember, this is a XPlatform project.

How can I do that ?

BTW:
Modal dialog hides the Window’s Title, but also hides the Toolbar…

Are you opening the window with Show instead of ShowModal?

I changed that (.Show) to ShowModal unsuccessfully.

That is when I found that some kinds of windows hides the ToolBar. I checked the help, the pdf (as noted far above) and loose my temper, so I power off the MBPro and do something else. Yes, I am not proud of that.

BTW: that is the window where I used the Array Move code (move left / move right for me, but we can think at move top / move bottom); the code works fine as far as I can tell.

I will try that back this afternoon (and create some missing icons for the toolbar: using random icons for testings is diverting).

At “code” testing time, I do not try to click elsewhere (on a different window and lost the one at the front). But at awake time, this morning, I realized that Joe Newbie can do that and lost the window where he was working and so save a file without the correct service data.

All that ShowModal does for you is to pause execution of the current method. It doesn’t prevent access to other windows.

Only the combination Frame = MovableModal and ShowModal() prevents accessing another window. Frame = MovableModal and Show() allows manipulating and setting the focus to another window. Hence my question.

Maybe a bit radical, but maximizing the modal window will prevent clicking on another app window.

I changed that (.Show) to ShowModal unsuccessfully.

That is when I found that some kinds of windows hides the ToolBar. I checked the help, the pdf (as noted far above) and loose my temper, so I power off the MBPro and do something else. Yes, I am not proud of that.

BTW: that is the window where I used the Array Move code (move left / move right for me, but we can think at move top / move bottom); the code works fine as far as I can tell.

I will try that back this afternoon (and create some missing icons for the toolbar: using random icons for testings is diverting).

At “code” testing time, I do not try to click elsewhere (on a different window and lost the one at the front). But at awake time, this morning, I realized that Joe Newbie can do that and lost the window where he was working and so save a file without the correct service data.

Maybe. One of the ideas behind the Modal window (if I’m right) was to let the user able to move the Modal window so (s)he can watch what was behind it.

I am perhaps too cautious. After all, if the user changes window, it will still sing again some to return where it was…

[quote=115701:@Emile Schwarz]Maybe. One of the ideas behind the Modal window (if I’m right) was to let the user able to move the Modal window so (s)he can watch what was behind it.

I am perhaps too cautious. After all, if the user changes window, it will still sing again some to return where it was…[/quote]

[quote=115701:@Emile Schwarz]Maybe. One of the ideas behind the Modal window (if I’m right) was to let the user able to move the Modal window so (s)he can watch what was behind it.

I am perhaps too cautious. After all, if the user changes window, it will still sing again some to return where it was…[/quote]

There is yet another way but it is more involved, that will let the user see what is under without being ablle to deactivate the app. I will not post code but here is the way I did it in another app of mine :

  • Before displaying you movable modal, capture the whole screen with shell to screncspture or Mbs
  • Display a full screen window with that picture
  • Show the modal

So if the user wants to move he can but if he clicks all it does is within the app. Upon close the modal, close the full screen window.

Emile, I’m confused about what you are trying to accomplish. Do you want the user to be unable to access the application while the modal dialog is up or do you want the entire computer screen disabled except for the modal dialog? If you are looking to prevent the user doing anything until the dialog is dismissed, then you need to take over the entire screen (similar to what Michael suggested) AND you will need to intercept any and all keyboard input that might allow for the user to switch your app out behind the scenes (such as with ALT-TAB on Windows).

If you just want to prevent other activity pertinent to your app, a MovableModal dialog called with .ShowModal should work. Of course, you could resize the dialog window and position it to completely and exactly cover your application’s window.

To be honest, if I had an application that would, at times, prevent me from doing anything else on my machine, no matter what, I would soon trash that app and look for a more user-friendly one. I don’t mean to sound negative but it seems to me that there should be a better solution to accomplish what you need.

[quote=115827:@Dale Arends]To be honest, if I had an application that would, at times, prevent me from doing anything else on my machine, no matter what, I would soon trash that app and look for a more user-friendly one. I don’t mean to sound negative but it seems to me that there should be a better solution to accomplish what you need.
[/quote]

Indeed kiosk mode or doing anything that locks the user out of his own computer is rude. On a Mac, unless special things done, the dock and the menu remain active with the method I described, so the user still has control. I am not sure Emile even knows exactly what he wants, but is exploring somewhat at random. His latest thread shows him dabbling with Floating Window. :wink:
https://forum.xojo.com/14285-no-auto-hightlight-part-of-textfield-text-with-floating-window

Dale,

at the time that window is displayed, the user have two other windows behind that one.

That window let the user set (change) strings in its .Parent window.

If the user click in the desktop or in another window: I do not care: it is his/her problem.

If the user click in the .Parent window: he may be tempted to save the data without making the changes (s)he wanted to make. In that case, the service data (data used to display the text into a ListBox) will be the default one (think one background color, Heading strings: 1,2,3,4 instead of significant strings, and so on).

At debug time, I never clicked elsewhere and that window will stay on top. But I know what a newbie (for this application) is able to do to confuse himself / herself.

To make a good compare, think at a Save As Dialog that allows you to go elsewhere in that application, but can be automatically dismissed at quit time.

In fact, in the Save As… process, this window is a part that appears before the Save As… Dialog.

Am I clear now ?

  1. ContextualMenu --> Open As List
  2. A List window is displayed with a ListBox.
    The ListBox Heading is set to useless text
  3. The user click in a Button of the window ToolBar (to set the ListBox Heading Strings)
  4. The window that let the user set the ListBox Heading Strings is displayed.
    At this step, I wanted to keep the Window frontmost (thus the Modal Dialog idea)
  5. The user operations are done, he click in “done” or “Use new settings” or…
    The data are placed in the previous (parent) window and this one is closed (I open it in Step 3, fill the data in Step 4).
  6. the user click in Save (or Export or…) and the data set by the user are stored with the date found in the window (see Step 2)

Since there is no relation between these two windows, one can - actually - click where (s)he want and loose the window where (s)he was previously. In OS X, there is a sheet window who avoid this to happens. I cannot use that because this is a LOW multi-Platforms projects.

LOW: Linux, OS X, Windows.

[quote=115966:@Emile Schwarz]If the user click in the .Parent window: he may be tempted to save the data without making the changes (s)he wanted to make. In that case, the service data (data used to display the text into a ListBox) will be the default one (think one background color, Heading strings: 1,2,3,4 instead of significant strings, and so on).

At debug time, I never clicked elsewhere and that window will stay on top. But I know what a newbie (for this application) is able to do to confuse himself / herself.[/quote]

Emile, you are not very clear, but here is what I understand :

The other windows of the application the user can access to change values in the other windows, but it does not update in your main window ? Use the fields TextChange to update the main window. However, this looks like a strange design. Modifications should be carried out in the main window made modal. Whatever you where doing, showmodal does work. Maybe you are accessing properties in your main window which makes it popup as implicit instance, so it is not modal. You should make a small test project and see that it works, then go through your code and spot where you may call implicit.

Modal windows are precisely here to prevent users to click anywhere but in the modal window. No need to look for anything else.

First: I have to take some times to check that as this is what I want.
But, it does not worked whan I first attempted to do that, thus this conversation.

And, the docs were not that clear.

Thank you for the kind answers.

ShowModal will not work if your window is a document window.

To make it modal, you have to set it as Movable Modal in the IDE.

See http://documentation.xojo.com/index.php/Window.ShowModal

If the window is a Document window it is shown as a normal Document window. It becomes the frontmost window but it is not modal. You must use a modal window Frame type to force the window into a modal state.

Could be your problem …

I just found an extremely simple workaround to make modal any document window :

Sub Deactivate() me.showmodal End Sub

In this ShowModal simply sets focus to the window (see previous post). But that’s enough to prevent activating other windows.

[quote=115972:@Michel Bujardet]ShowModal will not work if your window is a document window.

To make it modal, you have to set it as Movable Modal in the IDE.

See http://documentation.xojo.com/index.php/Window.ShowModal

If the window is a Document window it is shown as a normal Document window. It becomes the frontmost window but it is not modal. You must use a modal window Frame type to force the window into a modal state.

Could be your problem …[/quote]
No, it is not.

Yes, it is.

I tried in another project and it works as described. But I think it wil hide the ToolBar I have in the project I wanted to set it.

Something wrooong… I really, really have to explorate this deeply (this afternoon).

That is why I posted a way to make a document window modal :confused: You need to read all posts.

I read them, and I read them with more attentions later. Thanks.