diff options
| author | pfg github <[email protected]> | 2015-03-08 09:18:40 -0700 |
|---|---|---|
| committer | pfg github <[email protected]> | 2015-03-08 09:18:40 -0700 |
| commit | a3db778746af40eb9f9ec2cccfb3c935164600f5 (patch) | |
| tree | 6fd5220c1283aeb448d4b67c8c122f78d2a7a8dc /ShiftOS/STML Test.vb | |
| parent | bfd7c782b02bce11bb07cc228e5d0775ad0d98d5 (diff) | |
| download | shiftos-a3db778746af40eb9f9ec2cccfb3c935164600f5.tar.gz shiftos-a3db778746af40eb9f9ec2cccfb3c935164600f5.tar.bz2 shiftos-a3db778746af40eb9f9ec2cccfb3c935164600f5.zip | |
Full Source
Diffstat (limited to 'ShiftOS/STML Test.vb')
| -rw-r--r-- | ShiftOS/STML Test.vb | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/ShiftOS/STML Test.vb b/ShiftOS/STML Test.vb new file mode 100644 index 0000000..3119683 --- /dev/null +++ b/ShiftOS/STML Test.vb @@ -0,0 +1,54 @@ +Imports System.Xml +Imports System.IO +Imports System.Text + +Public Class STML_Test + Dim obj As Collection + Private Sub STML_Test_Load(sender As Object, e As EventArgs) Handles MyBase.Load + + Dim test As String = "Hello,50,50,500,50,text|Hello210,100,100,500,50,text".Replace(ControlChars.NewLine, "|") + parse(test) + End Sub + Private Sub parse(objs As String) + For Each tag As String In objs.Split("|") + parseobj(tag) + Next + End Sub + Private Sub parseobj(objx As String) + Dim values As String() = objx.Split(",") + Try + Select Case values(5) + Case "text" + addLabel(getLabel(New Size(values(3), values(4)), New Point(values(1), values(2)), values(0))) + Case Else + addLabel(getLabel(New Size(values(3), values(4)), New Point(values(1), values(2)), values(0))) + End Select + Catch ex As Exception + addLabel(getLabel(New Size(50, 555), New Point(0, 0), "Syntax error somewhere")) + End Try + End Sub + Private Sub addLink(lbl As TextBox, onclick As Func(Of Object, EventArgs)) + + AddHandler lbl.MouseDown, AddressOf MyTextbox_TextChanged + Me.Controls.Add(lbl) + End Sub + Private Function getLabel(size As Size, pos As Point, text As String) + Dim tb As New TextBox() + With tb + .Size = size + .Location = pos + .BorderStyle = BorderStyle.None + .ReadOnly = True + .Multiline = True + .Text = text + End With + Return tb + End Function + Private Sub addLabel(lbl As TextBox) + Me.Controls.Add(lbl) + End Sub + Private Sub MyTextbox_TextChanged(sender As Object, e As EventArgs) + MsgBox("SS") + End Sub + +End Class
\ No newline at end of file |
