5.11 ToolBar and StatusBar disappears

You need some new stunning features ? Tell us here.
storck
User
User
Posts: 83
Joined: Sat Oct 18, 2003 4:56 pm
Location: Sweden

5.11 ToolBar and StatusBar disappears

Post by storck »

Hi all,

I am trying a simple window design. It has a Menu, ToolBar, StausBar and a Panel. When running this the StatusBar and the MenuBar are missing. Is it a known problem? Any workaround?

Regards,

Storck
User avatar
TI-994A
Addict
Addict
Posts: 2740
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: 5.11 ToolBar and StatusBar disappears

Post by TI-994A »

storck wrote:It has a Menu, ToolBar, StausBar and a Panel. When running this the StatusBar and the MenuBar are missing. Is it a known problem? Any workaround?
Hi storck. There doesn't seem to be any known issues with PureBasic's gadgets. It could be an overlap problem, and either the Panel or ToolBar may be blocking the Menu and StatusBar. Perhaps if you posted the code snippet, we could take a look.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
storck
User
User
Posts: 83
Joined: Sat Oct 18, 2003 4:56 pm
Location: Sweden

Re: 5.11 ToolBar and StatusBar disappears

Post by storck »

This is the window design
Image

Looks like this when run
Image

This is the generated code

Code: Select all

Global Window_0

Global Panel_0

Enumeration #PB_Compiler_EnumerationValue
  #MenuItem_2
EndEnumeration

Declare ResizeGadgetsWindow_0()


Procedure OpenWindow_0()
  Window_0 = OpenWindow(#PB_Any, 0, 0, 660, 510, "TestWindow", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget)
  CreateMenu(0, WindowID(Window_0))
  MenuTitle("File")
  MenuItem(#MenuItem_2, "Exit")
  Panel_0 = PanelGadget(#PB_Any, 0, 0, 660, 443)
  AddGadgetItem(Panel_0, -1, "Tab 1")
  CloseGadgetList()
EndProcedure

Procedure ResizeGadgetsWindow_0()
  Protected WindowWidth, WindowHeight
  WindowWidth = WindowWidth(Window_0)
  WindowHeight = WindowHeight(Window_0)
  ResizeGadget(Panel_0, 0, 0, WindowWidth - 0, WindowHeight - MenuHeight() - 0)
EndProcedure

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

    Case #PB_Event_Menu
      Select EventMenu()
        Case #MenuItem_2
      EndSelect

    Case #PB_Event_Gadget
      Select EventGadget()
      EndSelect
  EndSelect
  ProcedureReturn #True
EndProcedure
User avatar
TI-994A
Addict
Addict
Posts: 2740
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: 5.11 ToolBar and StatusBar disappears

Post by TI-994A »

storck wrote:

Code: Select all

Procedure OpenWindow_0()
  Window_0 = OpenWindow(#PB_Any, 0, 0, 660, 510, "TestWindow", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget)
  CreateMenu(0, WindowID(Window_0))
  MenuTitle("File")
  MenuItem(#MenuItem_2, "Exit")
  Panel_0 = PanelGadget(#PB_Any, 0, 0, 660, 443)
  AddGadgetItem(Panel_0, -1, "Tab 1")
  CloseGadgetList()
EndProcedure
Hello again storck. Looking at the window code above, you'll notice that the ToolBar and StatusBar have not been initialised. Although you may have provisioned them in the Visual Designer, they will only be initialised once elements are added to them. From your screenshot, it looks like you've not done that. Try by adding a button to the ToolBar and a label to the StatusBar, and their code will be generated, and then they should appear on the program form.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
storck
User
User
Posts: 83
Joined: Sat Oct 18, 2003 4:56 pm
Location: Sweden

Re: 5.11 ToolBar and StatusBar disappears

Post by storck »

Hi,

Thank U! I am in the bad habit of test compiling everything as I go... Since using Delphi and C++ Builder I am used to not having to put anything in the statusbar or toolbar until later. Anyways, thank you for pointing this out. Now I can go on with the project knowing that it will work.

Best Regards,

Storck
Post Reply