' this is the mainwindow scope ' 6-November-2011 Example program by J. van Zijl aka Slowdown. ' Resize_1 ' compiler beta june 22 2011 ' IDE beta july 11 2011 ' You can find me on, ' http://www.q7basic.org/forum/index.php and ' http://www.kbasic.com/forum/index.php Outlet plainTextEdit As QPlainTextEdit Outlet ListBox As QListWidget Outlet progressBar As QProgressBar Outlet MsgLabel As QLabel Outlet treeWidget As QTreeWidget Outlet lineEdit As QLineEdit Outlet pushButton As QPushButton Dim ReadStr As String = "Q7Basic;KBasic;Objective Basic;Visual Basic;Real Basic;QBasic;Quick Basic;Chipmunk Basic" Dim ReadLst As List Event Init() pushButton!tag = "0" pushButton.Text = "TreeWidget" ReadLst = Split(ReadStr, ";", False) treeWidget.SetColumnCount(ReadLst.Length()) Totreewidget() ToListBox() lineEdit.Text = "line edit" progressBar.Maximum = 100 progressBar.Value = 56 ToPlainTextEdit() plainTextEdit.Visible = False ListBox.Visible = False End Event Signal on_pushButton_clicked(Checked As Boolean) Select Case pushButton!tag Case "0" pushButton!tag = "1" treeWidget.Visible = False ListBox.Visible = True pushButton.Text = "ListWidget" Case "1" pushButton!tag = "2" ListBox.Visible = False plainTextEdit.Visible = True pushButton.Text = "PlainTextEdit" Case "2" pushButton!tag = "3" pushButton.Text = "TreeWidget" treeWidget.Visible = True ListBox.Visible = False plainTextEdit.Visible = False Case "3" pushButton!tag = "4" pushButton.Text = "Tree- Listwidget" ListBox.Visible = True TreeAndList() Case 4 pushButton!tag = "0" pushButton.Text = "All" ListBox.Visible = True plainTextEdit.Visible = True ShowAll() End Select End Signal Sub ToPlainTextEdit() Dim Lus As Integer ReadLst = Split(ReadStr, ";", False) For Lus = 0 To ReadLst.Length() - 1 plainTextEdit.PlainText = plainTextEdit.PlainText & ReadLst.Object(Lus) & "\n" Next End Sub Sub Totreewidget() Dim Lus As Int64 treeWidget.clear() Dim Myid As Integer = treeWidget.AppendChild("") For Lus = 0 To ReadLst.Length() - 1 treeWidget.SetText(Myid, Lus, ReadLst.Object(Lus)) Next End Sub Sub ToListBox() Dim Lus As Int64 For Lus = 1 To ReadLst.Length() - 1 ListBox.Append(ReadLst.Object(Lus)) Next End Sub Sub TreeAndList() ListBox.setGeometry(4, 1,( Me!width / 2) - 10, Me!height - 90) treeWidget.setGeometry(( Me!width / 2) + 2, 1,( Me!width / 2) - 10, Me!height - 90) End Sub Sub ShowAll() ListBox.setGeometry(4, 1,( Me!width / 2) - 10, Me!height / 2) treeWidget.setGeometry(( Me!width / 2) + 2, 1,( Me!width / 2) - 10, Me!height / 2) plainTextEdit.setGeometry(4,( Me!height / 2) + 3, Me!width - 3,( Me!height / 2) - 80) End Sub Event ResizeEvent(e As QResizeEvent) plainTextEdit.resize( Me!width - 3, Me!height - 90) ListBox.resize( Me!width - 3, Me!height - 90) treeWidget.resize( Me!width - 3, Me!height - 90) progressBar.setGeometry(4, Me!height - 55, Me!width - 4, 15) MsgLabel.setGeometry(4, Me!height - 75, Me!width - 4, 15) lineEdit.setGeometry(4, Me!height - 25, 220, 20) pushButton.setGeometry( Me!width -(pushButton!width + 10), Me!height - 25, pushButton!width, pushButton!height) End Event