It is currently Sun Aug 18, 2019 2:20 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: hope control ToolsPanel from toolbar for hide it
PostPosted: Sat Jan 26, 2019 3:22 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 22, 2009 3:48 am
Posts: 592
Location: china
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

_________________
my pb for chinese:
http://ataorj.ys168.com


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye