Custom made TAB PanelGadget

Share your advanced PureBasic knowledge/code with the community.
User avatar
VB6_to_PBx
Enthusiast
Enthusiast
Posts: 627
Joined: Mon May 09, 2011 9:36 am

Custom made TAB PanelGadget

Post by VB6_to_PBx »

Custom made TAB PanelGadget .... simple basic alternative version ( Vista and WIN 7 ScreenShot )

Image

Code: Select all

LoadFont(0, "Verdana", 10 )
LoadFont(1, "Verdana", 10 , #PB_Font_Bold )

Enumeration FormWindow
    #Window_0
EndEnumeration

Enumeration FormGadget
    #Container_1
    #Container_2
    #Container_3
    #ExplorerList_0
    #Calendar_0
    #Button_0
    #Button_1
    #Button_2
    #Button_3
EndEnumeration


Procedure OpenWindow_0(x = 0, y = 0, width = 600, height = 400)

    OpenWindow(#Window_0, x, y, width, height, "", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered)
  
    SetWindowColor(#Window_0, RGB(239,235,219))

    ContainerGadget(#Container_1, 75, 114, 374, 219, #PB_Container_Flat)
    SetGadgetColor(#Container_1, #PB_Gadget_BackColor,RGB(255,255,255))
    ButtonGadget(#Button_0, 98, 77, 197, 102, "Tab 1 's  Button")
    CloseGadgetList()

    ContainerGadget(#Container_2, 75, 114, 374, 219, #PB_Container_Flat)
    SetGadgetColor(#Container_2, #PB_Gadget_BackColor,RGB(255,255,100))
    CalendarGadget(#Calendar_0, 23, 20, 332, 176, 0)
    CloseGadgetList()
    HideGadget(#Container_2,1)

    ContainerGadget(#Container_3, 75, 114, 374, 219, #PB_Container_Flat)
    SetGadgetColor(#Container_3, #PB_Gadget_BackColor,RGB(240,240,200))
    ExplorerListGadget(#ExplorerList_0, 17, 20, 331, 187, "")
    CloseGadgetList()
    HideGadget(#Container_3,1)

    ButtonGadget(#Button_1, 87, 88, 93, 28, "Tab 1")
    ButtonGadget(#Button_2, 179, 92, 93, 24, "Calendar")
    ButtonGadget(#Button_3, 271, 92, 93, 24, "Files")

    SetGadgetFont(#Button_0, FontID(0))
    SetGadgetFont(#Button_1, FontID(1))     ;--------- Set Tab 1 Button As Default
    SetGadgetFont(#Button_2, FontID(0))
    SetGadgetFont(#Button_3, FontID(0))

EndProcedure


Procedure Tabs()

     ButtonGadget(#Button_1, 87, 92, 93, 24, "Tab 1")
     ButtonGadget(#Button_2, 179, 92, 93, 24, "Calendar") 
     ButtonGadget(#Button_3, 271, 92, 93, 24, "Files")

     SetGadgetFont(#Button_1, FontID(0)) : SetGadgetFont(#Button_2, FontID(0)) : SetGadgetFont(#Button_3, FontID(0))  

     HideGadget(#Container_1,1) : HideGadget(#Container_2,1) : HideGadget(#Container_3,1)
     
EndProcedure


Procedure Window_0_Events(event)

    Select event
    Case #PB_Event_CloseWindow
         ProcedureReturn #False
    Case #PB_Event_Gadget
         Select EventGadget()
         Case #Button_1
              Tabs()
              ButtonGadget(#Button_1, 87, 88, 93, 28, "Tab 1")
              SetGadgetFont(#Button_1, FontID(1))
              HideGadget(#Container_1,0)
         Case #Button_2
              Tabs()
              ButtonGadget(#Button_2, 179, 88, 93, 28, "Calendar")
              SetGadgetFont(#Button_2, FontID(1))
              HideGadget(#Container_2,0)
         Case #Button_3
              Tabs()
              ButtonGadget(#Button_3, 271, 88, 93, 28, "Files")
              SetGadgetFont(#Button_3, FontID(1)) 
              HideGadget(#Container_3,0)
         EndSelect
    EndSelect

    ProcedureReturn #True

EndProcedure

OpenWindow_0()

Repeat : event = WaitWindowEvent() : Until Window_0_Events(event) = #False

End
Last edited by VB6_to_PBx on Fri Nov 14, 2014 7:42 am, edited 2 times in total.
 
PureBasic .... making tiny electrons do what you want !

"With every mistake we must surely be learning" - George Harrison
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Custom made TAB PanelGadget

Post by Kwai chang caine »

Simple and fun.. :D
Thanks for sharing 8)
ImageThe happiness is a road...
Not a destination
User avatar
VB6_to_PBx
Enthusiast
Enthusiast
Posts: 627
Joined: Mon May 09, 2011 9:36 am

Re: Custom made TAB PanelGadget

Post by VB6_to_PBx »

Kwai chang caine wrote:Simple and fun.. :D
Thanks for sharing 8)
Glad you liked it , Kwai chang caine :)

it looks pretty good also in Win XP

Image


and it almost looks like the real PureBASIC 's PanelGadget in Windows 8

Image
 
PureBasic .... making tiny electrons do what you want !

"With every mistake we must surely be learning" - George Harrison
Post Reply