|
Reported by Sebastian Modersohn in QualityCentral (#822)
TPageControl has built-in support for switching tab sheets with Ctrl+Tab and Ctrl+Shift+Tab.
This does NOT work in *any* of the forms if it is a MDI application (i.e. MainForm.FormStyle=fsMDIForm).
The worst thing is that even if you have a *modal* dialog with a TPageControl open, Ctrl+Tab doesn't switch the tab sheets but toggles between the MDI children! This may break existing code as it wasn't previously possible to change the active MDI child while a modal dialog was displayed.
Try the attached project to see this bug in action.
This "bug" is caused by TApplication.IsMDIMsg. It only checks if the MainForm is a MDI form and Screen.ActiveForm<>nil before calling TranslateMDISysAccel (a WinAPI) which obviously returns True for Ctrl+Tab as this key is used for MDI child switching.
I've done a little bit more research and found out that this behaviour was introduced in Delphi 6. The same thing worked in all previous Delphi versions (including 1!).
The old code in TApplication.IsMDIMsg checked if the ActiveForm was FormStyle=fsMDIChild and only then checked if TranslateMDISysAccel wanted the message.
In D6 this check was removed (although the check for ActiveForm<>nil is still there ;-).
I guess this was introduced to fix problems with floating forms/toolbars but obviously the fix introduces new problems... |