Modal window ... menu disabled

How can I make a window modal and retain the functionality of a menu?

Seems that whenever I set a window’s Frame to be Modal, the Menu gets disabled.

Have you assigned the menu bar to the modal ?
Have you implemented any of the menu handlers ?

[quote=51921:@Norman Palardy]Have you assigned the menu bar to the modal ?
Have you implemented any of the menu handlers ?[/quote]

What do you mean “assigned the menu bar to the modal”?

The window uses a menu that I created. The menu handlers do what they are designed to do. If I set the Window’s frame to be Modal, the menu is disabled. If I set the Window’s frame to be a normal (something other than modal), then the menus work.

Hey Rick I’m just a beginner with xojo but I think what Norman was saying…
Assign the menu

Add the Handler to both your main window and your modal window

I made this quick sample to show you that I can have different menu’s based on the modal window. I know that you want the same but wanted to show you how to display different menu’s with the various windows.

It seems that if your modal window has been called by a menu, then the menu are disabled. I think it’s normal as your are already in a menu event then you can’t launch another menu event.

Good Lord!

[quote=52001:@Rob Vanarsdall]Hey Rick I’m just a beginner with xojo but I think what Norman was saying…
Assign the menu

Add the Handler to both your main window and your modal window

I made this quick sample to show you that I can have different menu’s based on the modal window. I know that you want the same but wanted to show you how to display different menu’s with the various windows.[/quote]

Here’s what I have for a specific Window…

Frame: 3 - Floating Window
MenuBar: mnuCommon (a menu I created)
MenuBarVisible: True

With the Frame set at Floating Window, the menu is active and usable.
Now, if I change the Frame setting to either Movable Modal or Modal Dialog, the menu is inactive (can’t be used).

As for having different menu’s for different windows, I already have that. With the exception of about 3 windows which use mnuCommon, all of the other windows (appx 7 or 8 of them) have their own menus and each is different. Certain windows, when opened, need to be Modal … but the menu for that window needs to be operable also.

Perhaps I’m missing something here but I don’t see it.

Yes, I am opening the “Modal” window from another window’s menu event.

Sorry for venting but this sucks … just when I get over constructing a workaround for another issue, I run into a new one because of it.

EDIT: correction, I am opening the Window using an F key which is trapped via code in the App … I created a “KeyPressed” Method and that is called via a given window’s “KeyDown” event.

I even set the “offending” window to be the startup window and the menu is disabled when the window’s Frame is set to Modal.

Does your modal actually implement any of the MenuHandlers for the menu bar ?

When you open a Modal window, your code stop at this instruction, until you finish the code of the modal window and close it, as if you display a MsgBox, then the menu are disabled. If you open a normal window, the window is openened and the code continue.

I totally understand what goes on when a window is opened in a modal state … I’ve been programming for over 25 years.

The windows that I open that I want to be modal have their own code, which runs just fine, when the window’s frame is set to modal (or otherwise for that matter). What I don’t “get” is why do menus become disabled?

If not then the menus will be disabled

Not sure what you mean Norman. It’s a simple menu setup to allow the user to press Ctrl + X to close the window. When the window is opened in a modal state, the menu is inactive and Ctrl + X does nothing.

Now, considering that I have had to develop a menu system for every window I have to facilitate using Ctrl + some key as a workaround to having buttons that are naturally activated using Alt + whatever “&” letter is in their Caption which caused that rbguiframework.dll crash, running into this “oddity” is but one more frustration with XoJo.

How do I make my modal implement a menu handler? What does that mean?

Excuse me Rick. I wasn’t sure to have understood your previous answer to me. I understtod now.
I’m not a pro and do softwares in my sparetime, but as far as I remember, a ModalWindow (or a NormalWindow.ShowModal) always disabled menu.
I think you’ve another question I didn’t understand, then I will stop to answer.
Sorry,
Regards,

Like I say in this video I’m a beginner and hopefully this helps you or maybe it’s totally off base.

Video Help for Menu on Modal

Hi all,
well, it seems to work on Mac, but on Windows the menu stays disabled no matter how the modal window got invoked.
I ran into this on both RS and Xojo.

@Thomas: I dunno how it works on Mac, but on windows side if you open a modal window/dialog with e.g. “window2.show” the code in the calling function continues; only if called with “window2.showmodal” it stops.

Regards,
Rolf

I just tried the windows OS build of the modal example I did in the video and you’re right it appears disabled…I had to right click on the menu item to get it to not show disabled. I’m running windows 7.

Hey, awesome. That right-click did the trick. But you can’t tell this one customers, they’ll go nuts…