Anda di halaman 1dari 10

Ring Documentation, Release 1.5.

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:

5.11. What is new in Ring 1.4.1? 75


Ring Documentation, Release 1.5.1

5.11. What is new in Ring 1.4.1? 76


CHAPTER

SIX

WHAT IS NEW IN RING 1.3?

In this chapter we will learn about the changes and new features in Ring 1.3 release.

6.1 List of changes and new features

Ring 1.3 comes with many new features


Better RingQt
Better Ring Notepad
Ring mode for Emacs Editor
Better StdLib
Better Loop/Exit Command
New Functions
Return Self by Reference
Using < and : operators as from keyword
Embedding Ring in Ring without sharing the State
RingZip Library
Form Designer

6.2 Better RingQt

(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:

6.2. Better RingQt 78


Ring Documentation, Release 1.5.1

2. The Objects Library is updated to include the next functions


Last_WindowID()
Open_WindowNoShow()
Open_WindowAndLink()
Also the class name (WindowViewBase) is changed to (WindowsViewParent).
In The next code for example the Open_WindowAndLink() will create an object from the SecondWindowController
Class Then will add the Method SecondWindow() to the FirstWindowController Class Also will add the Method
FirstWindow() to the SecondWindowController Class
So the SendMessage() method in FirstWindowController class can use the SecondWindow() method to access the
object.
class firstwindowController from windowsControllerParent

oView = new firstwindowView

func OpenSecondWindow
Open_WindowAndLink(:SecondWindowController,self)

6.2. Better RingQt 79


Ring Documentation, Release 1.5.1

func SendMessage
if IsSecondWindow()
SecondWindow().setMessage("Message from the first window")
ok

func setMessage cMessage


oView.Label1.setText(cMessage)

3. The next classes are added to RingQt


QPixMap2
QScrollArea
QSplitter
QCompleter
QCompleter2
QCompleter3
QProcess
QMdiArea
QMdiSubWindow
QCursor
QListView
QDesktopServices
4. Many constants are defined in qt.rh (loaded by guilib.ring)
5. New Classes names - Index Start from 1
We added new classes to RingQt - another version of classes where the class names doesnt start with the q letter
Also updated methods so the index start from 1 when we deal with the GUI controls like
ComboBox
ListWidget
TableWidget
TreeWidget
These classes are inside guilib.ring under the package name : System.GUI
To use it
load "guilib.ring"

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

6.2. Better RingQt 80


Ring Documentation, Release 1.5.1

2. https://github.com/ring-lang/ring/blob/master/applications/formdesigner/tests/indexstart/indexstartController.ring

6.3 Better Ring Notepad

1. Using QPlainTextEdit instead of QTextEdit


2. Displaying the line number for each line in the source code file.
Screen Shot:

3. Auto-Complete for Ring functions names, classes and words in the opened file.

6.3. Better Ring Notepad 81


Ring Documentation, Release 1.5.1

4. Functions and Methods List

6.3. Better Ring Notepad 82


Ring Documentation, Release 1.5.1

5. Output Window

6. Classes List

6.3. Better Ring Notepad 83


Ring Documentation, Release 1.5.1

7. Change the Current Style

6.4 Ring mode for Emacs Editor

Ring 1.3 comes with Ring mode for Emacs Editor


Screen Shot:

6.4. Ring mode for Emacs Editor 84

Anda mungkin juga menyukai