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
5.11 ToolBar and StatusBar disappears
Re: 5.11 ToolBar and StatusBar disappears
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.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?
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 

Re: 5.11 ToolBar and StatusBar disappears
This is the window design

Looks like this when run

This is the generated code

Looks like this when run

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
Re: 5.11 ToolBar and StatusBar disappears
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.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
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 

Re: 5.11 ToolBar and StatusBar disappears
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
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