fb:porticula NoPaste
Console_Example.bas
Uploader: | OneCypher |
Datum/Zeit: | 13.10.2009 10:59:26 |
Hinweis: Dieser Quelltext ist Bestandteil des Projekts GuiPtr, zu dem es auf FreeBASIC-Portal.de eine Projektseite gibt.
#include once "GuiPtr.bi"
#include once "GuiPtrTools.bi"
#include once "GuiPtrControls.bi"
#include once "fbgfx.bi"
USING FB
dim as integer sx = 800, sy = 480 '424
screenres sx,sy,32,0
Width sx / 8, sy /16
Dim Application as NullWindow ptr = New NullWindow
Dim Quit as Button ptr = Application->Object->Add(New Button(600,0,40,20,"X"))
Dim Window1 as GuiWindow ptr = Application->object->Add(New GuiWindow(40,40,500,400,"Befehlszeile"))
dim shared CBox1 as Console ptr
CBox1 = Window1->Object->Add(new Console(10,40,20,30))
dim clear1 as Button ptr = Application->Object->Add(New Button(600,50,40,20,"Y"))
Sub Loeschen
CBox1->Print "Hallo," & CHR(13,10) & CHR(13,10)
CBox1->print "Dies ist ein Brief fuer sie!"
CBox1->Print "hiermit moechte ich etwas demonstrieren..."
end sub
Event(Clear1)->SingleClick = @loeschen
dim DumpO as Button ptr = Application->Object->Add(New Button(600,100,40,20,"Z"))
Sub DumpAll(b as button ptr)
CBox1->cls
CBox1->Print b->Object->Root->DumpObjects
end sub
Event(DumpO)->SingleClick = @DumpAll
dim TextBox1 as TextBox ptr = Window1->Object->Add(New TextBox(10,2,30))
Sub TEnter(tbox as textbox ptr)
if lcase(tbox->text) = "cls" then
CBox1->cls
else
CBox1->Print tbox->text
end if
tbox->Clear
end sub
Event(Textbox1)->OnEnter = @Tenter
for i as integer = 1 to 16
CBox1->print str(i)
next
CBox1->Color 0,15
Application->StartThread
dim s as string = "H"
dim t as double
do: loop until RC(Application) = Quit
Application->QuitThread