The next functions are updated to display the dialogs on the top of other windows.
SetDialogIcon(cIconFile)
MsgInfo(cTitle,cMessage)
ConfirmMsg(cTitle,cMessage)
InputBox(cTitle,cMessage)
InputBoxInt(cTitle,cMessage)
InputBoxNum(cTitle,cMessage)
InputBoxPass(cTitle,cMessage)
The Sixteen Puzzle is added to the Applications folder.
Screen Shot:
SIX
In this chapter we will learn about the changes and new features in Ring 1.3 release.
(1) Another version of QPixMap class is added (QPixMap2) which takes (int width,int height) during object init.
Example:
Load "guilib.ring"
New qapp
{
win1 = new qwidget()
{
setwindowtitle("Drawing using QPixMap")
setgeometry(100,100,500,500)
label1 = new qlabel(win1)
{
setgeometry(10,10,400,400)
settext("")
77
Ring Documentation, Release 1.5.1
}
imageStock = new qlabel(win1)
{
image = new qPixMap2(200,200)
color = new qcolor() {
setrgb(255,255,255,255)
}
pen = new qpen() {
setcolor(color)
setwidth(10)
}
new qpainter() {
begin(image)
setpen(pen)
drawline(0,0,200,200)
drawline(200,0,0,200)
endpaint()
}
setpixmap(image)
}
show()
}
exec()
}
Screen Shot:
func OpenSecondWindow
Open_WindowAndLink(:SecondWindowController,self)
func SendMessage
if IsSecondWindow()
SecondWindow().setMessage("Message from the first window")
ok
import System.GUI
This doesnt have any effect on our previous code, Its just another choice for better code that is consistent with Ring
rules.
Also the form designer is updated to provide us the choice between using classes where (index start from 0) or (index
start from 1)
Example (Uses the Form Designer)
1. https://github.com/ring-lang/ring/blob/master/applications/formdesigner/tests/indexstart/indexstartView.ring
2. https://github.com/ring-lang/ring/blob/master/applications/formdesigner/tests/indexstart/indexstartController.ring
3. Auto-Complete for Ring functions names, classes and words in the opened file.
5. Output Window
6. Classes List