Update applications/asciitable/AsciiTable.ring - Better Format!
@@ -9,27 +9,38 @@ load "guilib.ring"
size = 16
table = null
-app = new qApp {
+app = new QApp {
+
+ styleFusion()
+
+ win = new QWidget() {
- StyleFusion()
- win = new qWidget() {
setWindowTitle('ASCII Table')
resize(900,400)
setstylesheet('background-color:white')
oTable = pInit()
showAsciiTable()
- btnClose = new QPushButton(win) { setText("Close") setClickevent("win.close()") }
+
+ btnClose = new QPushButton(win) {
+ setText("Close")
+ setClickevent("win.close()")
+ }
+
oLayout = new QVBoxlayout() {
- AddWidget(oTable)
- AddWidget(btnClose)
+ addWidget(oTable)
+ addWidget(btnClose)
}
setLayout(oLayout)
+
show()
+
}
+
exec()
+
}
-func showAsciiTable()
+func showAsciiTable
for n = 33 to 125
row = floor(n/size)
@@ -42,7 +53,6 @@ func showAsciiTable()
func pInit()
Table = new qtablewidget(win) {
-
move(150,40)
resize(580,270)
setcolumncount(16)
@@ -75,12 +85,12 @@ func pInit()
next
show()
-
}
return Table
-func pDec()
+func pDec
+
row = Table.currentrow()
col = Table.currentcolumn()
temp = row * size + col
@@ -88,7 +98,7 @@ func pDec()
msgbox("The decimal value of " + char(temp) + " = " + temp)
ok
-func msgBox(cText)
+func msgBox cText
mb = new qMessageBox(win) {
setWindowTitle('ASCII Table')
@@ -96,4 +106,3 @@ func msgBox(cText)
setstandardbuttons(QMessageBox_OK)
result = exec()
}
\ No newline at end of file
-
