A sexy divider gadget

BlitzPlus Forums/BlitzPlus Programming/A sexy divider gadget

JoshK(Posted 2003) [#1]
If style=1, divider is vertical.


Function CreateDivider(x,y,length,group,style=0)
Select style
Case 0
gadget=CreateCanvas(x,y,length,2,group)
Case 1
gadget=CreateCanvas(x,y,2,length,group)
End Select
SetBuffer CanvasBuffer(gadget)
LockBuffer CanvasBuffer(gadget)
Select style
Case 0
For x=0 To length-1
WritePixelFast x,0,10329505;RGB(157,157,161)
WritePixelFast x,1,16777215;RGB(255,255,255)
Next
Case 1
For y=0 To length-1
WritePixelFast 0,y,10329505;RGB(157,157,161)
WritePixelFast 1,y,16777215;RGB(255,255,255)
Next
End Select
UnlockBuffer CanvasBuffer(gadget)
FlipCanvas gadget
Return gadget
End Function


cyberseth(Posted 2003) [#2]
Even better if you used GetSysColor (API) to find the "true" colour of 3D borders.


Red(Posted 2003) [#3]
yes with GetSysColor it would be perfect

Mark please add GetSysColor to B+ :)


JoshK(Posted 2003) [#4]
Add it yourself.


MutteringGoblin(Posted 2003) [#5]
Yeah, add it yourself, bitch! *rolls eyes*


JoshK(Posted 2003) [#6]
What I mean is, there's no reason you can't write a .decls file to access that command.


MutteringGoblin(Posted 2003) [#7]
hehe :)