fb:porticula NoPaste
Divider.bi
Uploader: | OneCypher |
Datum/Zeit: | 13.10.2009 10:59:44 |
Hinweis: Dieser Quelltext ist Bestandteil des Projekts GuiPtr, zu dem es auf FreeBASIC-Portal.de eine Projektseite gibt.
#include once "GuiPtr.bi"
type Divider
Object as GuiObject ptr
Orientation as ubyte
LT as integer
declare constructor(Orientation as ubyte, LeftTop as integer)
end type
Sub DrawDivider(GO as any ptr)
Dim D as Divider ptr = GO
dim as integer w, h
with *d->Object
If .Buffer = 0 then
Screencontrol 4, w,h
else
ImageInfo .Buffer, w , h
end if
if d->Orientation = 1 then
line .Buffer, (.left,0)-(.left,h),RGB(128,128,128)
line .Buffer, (.left+1,0)-(.left+1,h),RGB(255,255,255)
else
line .Buffer, (0,.top)-(w,.top),RGB(128,128,128)
line .Buffer, (0,.top+1)-(w,.top+1),RGB(255,255,255)
end if
end with
end sub
Constructor Divider(DOrientation as ubyte, LeftTop as integer)
Object = new GuiObject(@This)
LT = LeftTop
Orientation = DOrientation
if DOrientation = 1 then
Object->left = LT
Object->width = 2
else
Object->top = LT
Object->height = 2
end if
Object->ClassName = "Divider"
Object->PrivateEvents = New Events
Object->PrivateEvents->OnDraw = @DrawDivider
end constructor