[Done] [PB 5.10 b5] Formdesigner - Menues

Just starting out? Need help? Post your questions and find answers here.
RomanR
User
User
Posts: 16
Joined: Wed Jul 11, 2012 3:54 pm

[Done] [PB 5.10 b5] Formdesigner - Menues

Post 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
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: [PB 5.10 b5] Formdesigner - Menues

Post 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.
User avatar
Kiffi
Addict
Addict
Posts: 1484
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: [PB 5.10 b5] Formdesigner - Menues

Post 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
Hygge
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

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

Post by Polo »

That's because the form designer doesn't support empty menu/toolbars/statusbar.
User avatar
Kiffi
Addict
Addict
Posts: 1484
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

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

Post by Kiffi »

that's a pity.

Greetings ... Kiffi
Hygge
Post Reply