j***@yahoo.com
2006-03-08 13:14:05 UTC
Hi,
I encounter trouble to update menus in my LApplication-derived app for
LSingleDoc-derived windows.
Each time I display a dialog box using this king of code:
void AnyFunc()
{
StDialogHandler theHandler(PPob_MyID, this);
LWindow* theDialog = theHandler.GetDialog();
theDialog->Show();
while (true) {
MessageT hitMessage = theHandler.DoDialog();
if (hitMessage == msg_Cancel) {
break;
} else if (hitMessage == msg_OK) {
// Do something
break;
}
}
}
when exiting this dialog using cancel or OK my app's menus are not
updated correctly, even by calling
LCommander::SetUpdateCommandStatus(true) plus
LEventDispatcher::UpdateMenus()...
The latter one ends up by calling MyApp::FindCommandStatus instead of
the topmost LSingleDoc-derived window's FindCommandStatus (that could
correctly update the menus).
Therefore if my doc contains an edit field the Edit menu is not
enabled...
The only way to update the menus is to switch to another app (using
cmd+tab or by clicking in another app's window) and switch back to my
app!
Does anyone know a trick to enforce correct menus updating?
Thanks in advance for your help...
Regards,
MacPorter.
I encounter trouble to update menus in my LApplication-derived app for
LSingleDoc-derived windows.
Each time I display a dialog box using this king of code:
void AnyFunc()
{
StDialogHandler theHandler(PPob_MyID, this);
LWindow* theDialog = theHandler.GetDialog();
theDialog->Show();
while (true) {
MessageT hitMessage = theHandler.DoDialog();
if (hitMessage == msg_Cancel) {
break;
} else if (hitMessage == msg_OK) {
// Do something
break;
}
}
}
when exiting this dialog using cancel or OK my app's menus are not
updated correctly, even by calling
LCommander::SetUpdateCommandStatus(true) plus
LEventDispatcher::UpdateMenus()...
The latter one ends up by calling MyApp::FindCommandStatus instead of
the topmost LSingleDoc-derived window's FindCommandStatus (that could
correctly update the menus).
Therefore if my doc contains an edit field the Edit menu is not
enabled...
The only way to update the menus is to switch to another app (using
cmd+tab or by clicking in another app's window) and switch back to my
app!
Does anyone know a trick to enforce correct menus updating?
Thanks in advance for your help...
Regards,
MacPorter.