Vulcan.NET WinForm Text Box
REFERENCES "System"
REFERENCES "System.Drawing"
REFERENCES "System.Windows.Forms"
USING System
USING System.Windows.Forms
USING System.Drawing // for point()
FUNCTION makeWindow( x AS INT, y AS INT ) AS VOID
LOCAL oWin AS myForm
oWin := myForm{ x, y, "Vulcan.NET First Window Project" }
oWin:ShowMe( FormStartPosition.CenterScreen )
RETURN
CLASS myForm INHERIT Form
EXPORT oButton1 AS Button
EXPORT oButton2 AS Button
EXPORT oTextBox AS TextBox
FUNCTION Start() AS VOID
makeWindow( 640, 480 )
RETURN
METHOD Init( width AS INT, height AS INT, caption AS STRING ) CLASS myForm
LOCAL p1 AS Point
LOCAL s1, s2 AS STRING
p1 := Point{ 100, 300 }
s1 := "OK"
s2 := "Cancel"
SELF:oButton1 := Button{}
SELF:oButton2 := Button{}
SELF:oTextBox := TextBox{}
SELF:oButton1:Text := s1
SELF:oButton2:Text := s2
SELF:oButton1:Location := p1
SELF:oButton2:Location := Point{ 200, 300 }
SELF:Controls:Add( SELF:oButton1 )
SELF:Controls:Add( SELF:oButton2 )
SELF:Size := Size{ width, height }
SELF:Text := caption
SELF:oTextBox:Multiline := true
SELF:oTextBox:ScrollBars := ScrollBars.Vertical
SELF:oTextBox:AcceptsReturn := true
SELF:oTextBox:AcceptsTab := true
SELF:oTextBox:WordWrap := true
SELF:oTextBox:Text := "Welcome! to Vulcan.NET. This is a first sample for the control, TextBox. " + ;
"Lets see what a long string we can put in text box and find out wether" +;
"it will wrap or scroll or just what it will do with VO.Net. The rain" + ;
"in Spain stays mainly on the plain. A very long string with no meaning" +;
"that just goes on and on forever"
SELF:oTextBox:Size := Size{ 638, 200 }
SELF:oTextBox:Location := Point{ 1, 1 }
SELF:Controls:Add( SELF:oTextBox )
RETURN
METHOD ShowMe( startPos AS FormStartPosition ) AS VOID CLASS myForm
SELF:StartPosition := startPos
SELF:ShowDialog()
RETURN