PureBasic Forum
http://forums.purebasic.com/english/

hope control ToolsPanel from toolbar for hide it
http://forums.purebasic.com/english/viewtopic.php?f=18&t=72153
Page 1 of 1

Author:  gurj [ Sat Jan 26, 2019 3:22 pm ]
Post subject:  hope control ToolsPanel from toolbar for hide it

hope control ToolsPanel from toolbar for hide it
It's like this:
Code:
OpenWindow(0,0,0,800,500,"PureBasic control ToolsPanel from toolbar",#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)
    If CreateMenu(0, WindowID(0))
      MenuTitle("&File")
        MenuItem(1, "Open")
        MenuItem(2, "Save")
    EndIf
    If CreateToolBar(0, WindowID(0))
     For a=0 To 11
      ToolBarStandardButton(a, #PB_ToolBarIcon_New)
     Next
    EndIf
    ;-{****** try:
    ToolBarStandardButton(12, #PB_ToolBarIcon_Open,#PB_ToolBar_Toggle)
    SetToolBarButtonState(0,12,1)
    ;}
    CreateStatusBar(10, WindowID(0))
    AddStatusBarField(90)
StatusBarText(10, 0, "line...")

 PanelGadget (0, 0, 20, 500, 440)
 AddGadgetItem (0, -1, "Panel 1")
 AddGadgetItem (0, -1, "Panel 2")
 CloseGadgetList()
 PanelGadget (1, 500, 20, 300, 440)
 AddGadgetItem (1, -1, "tool 1")
 AddGadgetItem (1, -1, "tool 2")
 CloseGadgetList()
 SplitterGadget(2,0,20,800, 440, 0, 1,#PB_Splitter_Vertical)
 Dim gs(1)
 gs(0)=WindowWidth(0)
 gs(1)=GetGadgetState(2)
Repeat:ev=WaitWindowEvent():Select ev
  Case #PB_Event_Menu:em=EventMenu()
   Select em
    Case 12:SetGadgetState(2,gs(gsc)):gsc!1
   EndSelect
  Case #PB_Event_Gadget:eg=EventGadget()
   Select eg
     Case 2:If gs(0)-GetGadgetState(2)>100
      gs(1)=GetGadgetState(2):EndIf
   EndSelect
  Case #PB_Event_SizeWindow:gs(0)=WindowWidth(0)
   ResizeGadget(2, #PB_Ignore, #PB_Ignore,gs(0), WindowHeight(0)-60)
  Case #PB_Event_CloseWindow:Break
EndSelect:ForEver
End

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/