Page 1 of 1

[Done] [PB 5.10 b5] Formdesigner - Menues

Posted: Wed Jan 23, 2013 10:21 am
by RomanR
With the new Version it is now not possible to create Menues, ToolBars or StatusBars!!

Also there is a bug with Menue-Shortcuts. The definitions are outside the InitWindow procedure -> Compiler Error: "[ERROR] ... #Windows is not initialized.".

As a minor issue for german users: the Control-Key (CTRL) is named STRG on german keyboards. Localized Programs use "STRG+[Key]" (see "MenuItem(#MenuItem_5,"Quit" + Chr(9) + "Strg+Q")"). This results in a wrong PB-Constant (#PB_Shortcut_Strg). It would be nice to have the correct (#PB_Shortcut_Control) Constant ...

Code: Select all

Global Window_0

Global Button_0

Enumeration #PB_Compiler_EnumerationValue
  #MenuItem_2
  #MenuItem_3
  #MenuItem_4
  #MenuItem_5
EndEnumeration

AddKeyboardShortcut(Window_0, #PB_Shortcut_Control | #PB_Shortcut_O, #MenuItem_2)
AddKeyboardShortcut(Window_0, #PB_Shortcut_Control | #PB_Shortcut_W, #MenuItem_3)
AddKeyboardShortcut(Window_0, #PB_Shortcut_Strg | #PB_Shortcut_Q, #MenuItem_5)

Procedure InitWindow_0()
  Window_0 = OpenWindow(#PB_Any, 0, 0, 250, 300, "", #PB_Window_SystemMenu)
  CreateMenu(0, WindowID(Window_0))
  MenuTitle("File")
  MenuItem(#MenuItem_2,"Open ..." + Chr(9) + "Ctrl+O")
  MenuItem(#MenuItem_3,"Close" + Chr(9) + "Ctrl+W")
  MenuBar()
  MenuItem(#MenuItem_5,"Quit" + Chr(9) + "Strg+Q")
  Button_0 = ButtonGadget(#PB_Any, 65, 240, 100, 25, "OK")
EndProcedure

Procedure Window_0_Events(event)
  Select event
    Case #PB_Event_CloseWindow
      ProcedureReturn #False

    Case #PB_Event_Menu
      Select EventMenu()
        Case #MenuItem_2
        Case #MenuItem_3
        Case #MenuItem_4
        Case #MenuItem_5
      EndSelect

    Case #PB_Event_Gadget
      Select EventGadget()
      EndSelect
  EndSelect
  ProcedureReturn #True
EndProcedure

Re: [PB 5.10 b5] Formdesigner - Menues

Posted: Fri Jan 25, 2013 8:53 pm
by Polo
Fixed.
RomanR wrote:With the new Version it is now not possible to create Menues, ToolBars or StatusBars!!
Of course you can. Select Menu, Toolbar or Statusbar and draw an empty thing in the window.

Re: [PB 5.10 b5] Formdesigner - Menues

Posted: Sat Jan 26, 2013 11:03 am
by Kiffi
Polo wrote:Of course you can. Select Menu, Toolbar or Statusbar and draw an empty thing in the window.
after adding a Toolbar and switching to 'Code View' there is no CreateToolBar()-Line (same with StatusBar and CreateStatusBar() and MenuBar and CreateMenu())

Greetings ... Kiffi

Re: [Done] [PB 5.10 b5] Formdesigner - Menues

Posted: Sat Jan 26, 2013 11:47 am
by Polo
That's because the form designer doesn't support empty menu/toolbars/statusbar.

Re: [Done] [PB 5.10 b5] Formdesigner - Menues

Posted: Sat Jan 26, 2013 4:03 pm
by Kiffi
that's a pity.

Greetings ... Kiffi