Colored Progress Bar in PB

Share your advanced PureBasic knowledge/code with the community.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Colored Progress Bar in PB

Post by Num3 »

Pretty Progress .... 8)

Code: Select all

Declare Open_Window_0()

;- Window Constants
;
#Window_0  = 0
#PBM_SETBARCOLOR = $409
#PBM_SETBKCOLOR = $2001
;- Gadget Constants
;
#Gadget_0  = 0


Procedure Open_Window_0()
  If OpenWindow(#Window_0, 251, 249, 300, 100, #PB_Window_SystemMenu  | #PB_Window_SizeGadget  | #PB_Window_TitleBar , "Colored Progress Bar")
    If CreateGadgetList(WindowID())
      ProgressBarGadget(#Gadget_0, 10, 10, 190, 10, 0, 100 ,#PB_ProgressBar_Smooth)       
      PostMessage_(GadgetID(#Gadget_0), #PBM_SETBARCOLOR, 0, RGB(255, 204, 51))
      PostMessage_(GadgetID(#Gadget_0), #PBM_SETBKCOLOR, 0, RGB(51, 102, 153))
      SetGadgetState(#Gadget_0,80)  
      
    EndIf
  EndIf
EndProcedure


open_window_0()
Repeat
  Event  = WaitWindowEvent()
  
  
Until Event  = #PB_EventCloseWindow