Page 1 of 1

MDI-Gadgets and Tab-cycling

Posted: Mon Apr 03, 2006 9:57 am
by Sven
While using this snippet:

Code: Select all

  #Main = 0
  #MDIChild = 1
  If OpenWindow(#Main, 0, 0, 400, 300, "MDIGadget", #PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget|#PB_Window_MaximizeGadget)
    If CreateGadgetList(WindowID(#Main)) And CreateMenu(#Main, WindowID(#Main))
      MenuTitle("Menu index 0")
      MenuTitle("MDI windows menu")
        MenuItem(0, "self created item")
        MenuItem(1, "self created item")
        
      MDIGadget(0, 0, 0, 0, 0, 1, 2, #PB_MDI_AutoSize)
        For k.w = 0 To 3
          AddGadgetItem(0, #MDIChild + k, "child window")
        Next
        ; CreateGadgetList(WindowID(#MDIChild))
        
          ; add gadgets here...
      UseGadgetList(WindowID(#Main)) ; wir gehen zurück zur Gadgetliste des Hauptfensters
    EndIf
    RemoveKeyboardShortcut(#Main, #PB_Shortcut_F6)
    
    Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
  EndIf
cycling the child-windows with >Tab< is not possible, it only switches between the last and current selected window. >Shift-Tab< cycles right backwards all childs.

Cycling forward all childs is done with >F6<, but one can not remove >F6< from the shortcut-list (while >Tab< and >Shift-Tab< can be removed) to prevent cycling the childs if using F6 for an user-defined command.

Is this a Win restriction? Using WinXP / PB4beta7 / 8.

Sven

Posted: Mon Apr 03, 2006 10:14 am
by Michael Vogel
Hard to say, microsofts own programs do not use MDIs (e.g. Winword) or using the tab for other things (w.g. Excel)...

What I saw, is that you need 4 times Shift-Tab in your program to rotate through the 3 windows...

Posted: Sun Apr 09, 2006 6:29 pm
by freak
The Tab key is not supposed to work between MDI childs. This is corrected now.
It now only changes the tab inside a mdi child, not between them.

As for the F6: Actually the standard way to switch MDI childs is Ctrl+F6,
which even appears in the SystemMenu of all MDI childs. The reason why
F6 alone worked as well was a bug and is now fixed.

So Ctrl+F6 is now the only key to switch MDI windows. It cannot be removed,
because it would be odd to have a SystemMenu entry that sais "Ctrl+F6", and the
key actually performs a totally different operation.

Posted: Sun Apr 09, 2006 7:35 pm
by Edwin Knoppert
Don't forget the Ctrl+Tab which let's you switch as well.