
Libs : dashed splitterbar & requester position ( PB 3.94
[ Released ]
version : 1.2
- new ID parameter for DashBarDrawer
- Don't move the grip button when window is minimized ( for PureResize lib compatibility )
download : here ( Extract to your PB folder and restart your PB compiler. )
version : 1.2
- new ID parameter for DashBarDrawer
- Don't move the grip button when window is minimized ( for PureResize lib compatibility )
download : here ( Extract to your PB folder and restart your PB compiler. )
Code: Select all
Enumeration
#GADGET1
#GADGET2
#GADGET3
#DASHBAR
#DASHBAR2
EndEnumeration
; =======
; bar drawing procedure
; =======
Procedure MyBarDrawing(id, w, h, State, flag)
;color mode
Select id
Case #DASHBAR
If State=0
buttonColor=RGB($C9,$EF,$FA)
Else
buttonColor=RGB($D7,$DB,$DF)
EndIf
Case #DASHBAR2
If State=0
buttonColor=RGB(255,0,0)
Else
buttonColor=RGB($D7,$DB,$DF)
EndIf
EndSelect
Select flag
Case #DashedBar_Horizontal
;background
Box(0,0,w,h,buttonColor)
;borders
Line(0,0,0,h,GetSysColor_(#COLOR_BTNSHADOW))
Line(1,0,0,h,GetSysColor_(#COLOR_BTNHILIGHT))
Line(w-2,0,0,h,GetSysColor_(#COLOR_BTNSHADOW))
Line(w-1,0,0,h,GetSysColor_(#COLOR_BTNHILIGHT))
;dots
For x=10 To w-10 Step 3
Line(x,h/2-1,1,2,GetSysColor_(#COLOR_BTNSHADOW))
Next
Case #DashedBar_Vertical
;background
Box(0,0,w,h,buttonColor)
;borders
Line(0,0,w,0,GetSysColor_(#COLOR_BTNSHADOW))
Line(0,1,w,0,GetSysColor_(#COLOR_BTNHILIGHT))
Line(0,h-2,w,0,GetSysColor_(#COLOR_BTNSHADOW))
Line(0,h-1,w,0,GetSysColor_(#COLOR_BTNHILIGHT))
;dots
For y=10 To h-10 Step 3
Line(w/2-1,y,2,1,GetSysColor_(#COLOR_BTNSHADOW))
Next
EndSelect
EndProcedure
; ======================================
; EXAMPLE : 3-Panel-Window
; ======================================
OpenWindow(0,100,100,300,300,#PB_Window_SystemMenu|#PB_Window_SizeGadget,"dashed bar")
CreateGadgetList(WindowID())
; [LEFT | MIDDLE | MIDDLE]
ButtonGadget(#GADGET1,0,0,0,0,"left")
ButtonGadget(#GADGET3,0,0,0,0,"middle")
ButtonGadget(#GADGET2,0,0,0,0,"right")
DashedBarInit(@MyBarDrawing())
;SECONDARY dashedbar [LEFT | MIDDLE]
DashedBarGadget(#DASHBAR,5,5,290,290,6,100,#GADGET1,#GADGET3,#DashedBar_Vertical)
DashedBarAttribute(#DASHBAR,32,32,#DashedBar_FavoriteBorder1)
SetGadgetState(#DASHBAR,290/3-6)
;MAIN dashedbar [.... | RIGHT]
DashedBarGadget(#DASHBAR2,5,5,290,290,6,100,#DASHBAR,#GADGET2,#DashedBar_Vertical)
DashedBarAttribute(#DASHBAR2,32,32,#DashedBar_FavoriteBorder2)
SetGadgetState(#DASHBAR2,2*290/3-6)
Repeat
e=WaitWindowEvent()
;resize MAIN dashedbar
If e=#PB_Event_SizeWindow
UseWindow(0)
w=WindowWidth()
h=WindowHeight()
ResizeGadget(#DASHBAR2,5,5,w-10,h-10)
EndIf
Until e=#PB_Event_CloseWindow

[ Released ]
download : here ( Extract to your PB folder and restart your PB compiler. )
version : 1.3
- bug fixed : default grip rendering causes crash (version 1.2)
- added : the splitter bar follows its favorite border
download : here ( Extract to your PB folder and restart your PB compiler. )
version : 1.3
- bug fixed : default grip rendering causes crash (version 1.2)
- added : the splitter bar follows its favorite border

- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact: