SlideShare a Scribd company logo
1 of 10
Download to read offline
Ring Documentation, Release 1.7
7.11. What is new in Ring 1.4.1? 112
CHAPTER
EIGHT
WHAT IS NEW IN RING 1.3?
In this chapter we will learn about the changes and new features in Ring 1.3 release.
8.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
8.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("")
113
Ring Documentation, Release 1.7
}
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:
8.2. Better RingQt 114
Ring Documentation, Release 1.7
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)
8.2. Better RingQt 115
Ring Documentation, Release 1.7
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 doesn’t 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 doesn’t have any effect on our previous code, It’s 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
8.2. Better RingQt 116
Ring Documentation, Release 1.7
2. https://github.com/ring-lang/ring/blob/master/applications/formdesigner/tests/indexstart/indexstartController.ring
8.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.
8.3. Better Ring Notepad 117
Ring Documentation, Release 1.7
4. Functions and Methods List
8.3. Better Ring Notepad 118
Ring Documentation, Release 1.7
5. Output Window
6. Classes List
8.3. Better Ring Notepad 119
Ring Documentation, Release 1.7
7. Change the Current Style
8.4 Ring mode for Emacs Editor
Ring 1.3 comes with Ring mode for Emacs Editor
Screen Shot:
8.4. Ring mode for Emacs Editor 120
Ring Documentation, Release 1.7
8.5 Better StdLib
The StdLib is updated to include the next functions
• SplitMany()
• JustFilePath()
• JustFileName()
8.6 Better Loop|Exit Command
The Loop|Exit command is updated to accept Expressions after the command (not only numbers).
The syntax:
Loop|Exit [Number]
Changed to
Loop|Exit [Expression]
Example
XLoop = 2 # The outer loop
YLoop = 1 # The first inner loop
for x = 1 to 10
for y = 1 to 10
see "x=" + x + " y=" + y + nl
if x = 3 and y = 5
exit XLoop
ok
8.5. Better StdLib 121

More Related Content

What's hot

What's hot (18)

The Ring programming language version 1.8 book - Part 14 of 202
The Ring programming language version 1.8 book - Part 14 of 202The Ring programming language version 1.8 book - Part 14 of 202
The Ring programming language version 1.8 book - Part 14 of 202
 
The Ring programming language version 1.10 book - Part 72 of 212
The Ring programming language version 1.10 book - Part 72 of 212The Ring programming language version 1.10 book - Part 72 of 212
The Ring programming language version 1.10 book - Part 72 of 212
 
The Ring programming language version 1.9 book - Part 16 of 210
The Ring programming language version 1.9 book - Part 16 of 210The Ring programming language version 1.9 book - Part 16 of 210
The Ring programming language version 1.9 book - Part 16 of 210
 
The Ring programming language version 1.5.3 book - Part 11 of 184
The Ring programming language version 1.5.3 book - Part 11 of 184The Ring programming language version 1.5.3 book - Part 11 of 184
The Ring programming language version 1.5.3 book - Part 11 of 184
 
Lightining Talk - Task queue and micro task queues in browser
Lightining Talk - Task queue and micro task queues in browserLightining Talk - Task queue and micro task queues in browser
Lightining Talk - Task queue and micro task queues in browser
 
The Ring programming language version 1.9 book - Part 33 of 210
The Ring programming language version 1.9 book - Part 33 of 210The Ring programming language version 1.9 book - Part 33 of 210
The Ring programming language version 1.9 book - Part 33 of 210
 
The Ring programming language version 1.5.4 book - Part 26 of 185
The Ring programming language version 1.5.4 book - Part 26 of 185The Ring programming language version 1.5.4 book - Part 26 of 185
The Ring programming language version 1.5.4 book - Part 26 of 185
 
distributed message queue dengan python celery dan rabbitmq
distributed message queue dengan python celery dan rabbitmqdistributed message queue dengan python celery dan rabbitmq
distributed message queue dengan python celery dan rabbitmq
 
Dagger & rxjava & retrofit
Dagger & rxjava & retrofitDagger & rxjava & retrofit
Dagger & rxjava & retrofit
 
The Ring programming language version 1.9 book - Part 17 of 210
The Ring programming language version 1.9 book - Part 17 of 210The Ring programming language version 1.9 book - Part 17 of 210
The Ring programming language version 1.9 book - Part 17 of 210
 
The Ring programming language version 1.9 book - Part 92 of 210
The Ring programming language version 1.9 book - Part 92 of 210The Ring programming language version 1.9 book - Part 92 of 210
The Ring programming language version 1.9 book - Part 92 of 210
 
Async JavaScript in ES7
Async JavaScript in ES7Async JavaScript in ES7
Async JavaScript in ES7
 
The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.5.3 book - Part 72 of 184The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.5.3 book - Part 72 of 184
 
The Ring programming language version 1.5.1 book - Part 58 of 180
The Ring programming language version 1.5.1 book - Part 58 of 180The Ring programming language version 1.5.1 book - Part 58 of 180
The Ring programming language version 1.5.1 book - Part 58 of 180
 
Advanced #3 threading
Advanced #3  threading Advanced #3  threading
Advanced #3 threading
 
The Ring programming language version 1.10 book - Part 82 of 212
The Ring programming language version 1.10 book - Part 82 of 212The Ring programming language version 1.10 book - Part 82 of 212
The Ring programming language version 1.10 book - Part 82 of 212
 
The Ring programming language version 1.8 book - Part 77 of 202
The Ring programming language version 1.8 book - Part 77 of 202The Ring programming language version 1.8 book - Part 77 of 202
The Ring programming language version 1.8 book - Part 77 of 202
 
The Ring programming language version 1.2 book - Part 51 of 84
The Ring programming language version 1.2 book - Part 51 of 84The Ring programming language version 1.2 book - Part 51 of 84
The Ring programming language version 1.2 book - Part 51 of 84
 

Similar to The Ring programming language version 1.7 book - Part 15 of 196

Similar to The Ring programming language version 1.7 book - Part 15 of 196 (20)

The Ring programming language version 1.10 book - Part 20 of 212
The Ring programming language version 1.10 book - Part 20 of 212The Ring programming language version 1.10 book - Part 20 of 212
The Ring programming language version 1.10 book - Part 20 of 212
 
The Ring programming language version 1.5.1 book - Part 11 of 180
The Ring programming language version 1.5.1 book - Part 11 of 180The Ring programming language version 1.5.1 book - Part 11 of 180
The Ring programming language version 1.5.1 book - Part 11 of 180
 
The Ring programming language version 1.5.3 book - Part 13 of 184
The Ring programming language version 1.5.3 book - Part 13 of 184The Ring programming language version 1.5.3 book - Part 13 of 184
The Ring programming language version 1.5.3 book - Part 13 of 184
 
The Ring programming language version 1.10 book - Part 13 of 212
The Ring programming language version 1.10 book - Part 13 of 212The Ring programming language version 1.10 book - Part 13 of 212
The Ring programming language version 1.10 book - Part 13 of 212
 
The Ring programming language version 1.8 book - Part 17 of 202
The Ring programming language version 1.8 book - Part 17 of 202The Ring programming language version 1.8 book - Part 17 of 202
The Ring programming language version 1.8 book - Part 17 of 202
 
The Ring programming language version 1.4 book - Part 3 of 30
The Ring programming language version 1.4 book - Part 3 of 30The Ring programming language version 1.4 book - Part 3 of 30
The Ring programming language version 1.4 book - Part 3 of 30
 
The Ring programming language version 1.9 book - Part 19 of 210
The Ring programming language version 1.9 book - Part 19 of 210The Ring programming language version 1.9 book - Part 19 of 210
The Ring programming language version 1.9 book - Part 19 of 210
 
The Ring programming language version 1.4.1 book - Part 3 of 31
The Ring programming language version 1.4.1 book - Part 3 of 31The Ring programming language version 1.4.1 book - Part 3 of 31
The Ring programming language version 1.4.1 book - Part 3 of 31
 
The Ring programming language version 1.3 book - Part 53 of 88
The Ring programming language version 1.3 book - Part 53 of 88The Ring programming language version 1.3 book - Part 53 of 88
The Ring programming language version 1.3 book - Part 53 of 88
 
The Ring programming language version 1.5.1 book - Part 12 of 180
The Ring programming language version 1.5.1 book - Part 12 of 180The Ring programming language version 1.5.1 book - Part 12 of 180
The Ring programming language version 1.5.1 book - Part 12 of 180
 
The Ring programming language version 1.8 book - Part 16 of 202
The Ring programming language version 1.8 book - Part 16 of 202The Ring programming language version 1.8 book - Part 16 of 202
The Ring programming language version 1.8 book - Part 16 of 202
 
The Ring programming language version 1.4 book - Part 19 of 30
The Ring programming language version 1.4 book - Part 19 of 30The Ring programming language version 1.4 book - Part 19 of 30
The Ring programming language version 1.4 book - Part 19 of 30
 
The Ring programming language version 1.5.4 book - Part 14 of 185
The Ring programming language version 1.5.4 book - Part 14 of 185The Ring programming language version 1.5.4 book - Part 14 of 185
The Ring programming language version 1.5.4 book - Part 14 of 185
 
The Ring programming language version 1.5.3 book - Part 12 of 184
The Ring programming language version 1.5.3 book - Part 12 of 184The Ring programming language version 1.5.3 book - Part 12 of 184
The Ring programming language version 1.5.3 book - Part 12 of 184
 
The Ring programming language version 1.8 book - Part 15 of 202
The Ring programming language version 1.8 book - Part 15 of 202The Ring programming language version 1.8 book - Part 15 of 202
The Ring programming language version 1.8 book - Part 15 of 202
 
The Ring programming language version 1.10 book - Part 12 of 212
The Ring programming language version 1.10 book - Part 12 of 212The Ring programming language version 1.10 book - Part 12 of 212
The Ring programming language version 1.10 book - Part 12 of 212
 
The Ring programming language version 1.5.2 book - Part 13 of 181
The Ring programming language version 1.5.2 book - Part 13 of 181The Ring programming language version 1.5.2 book - Part 13 of 181
The Ring programming language version 1.5.2 book - Part 13 of 181
 
The Ring programming language version 1.7 book - Part 75 of 196
The Ring programming language version 1.7 book - Part 75 of 196The Ring programming language version 1.7 book - Part 75 of 196
The Ring programming language version 1.7 book - Part 75 of 196
 
The Ring programming language version 1.7 book - Part 8 of 196
The Ring programming language version 1.7 book - Part 8 of 196The Ring programming language version 1.7 book - Part 8 of 196
The Ring programming language version 1.7 book - Part 8 of 196
 
The Ring programming language version 1.8 book - Part 201 of 202
The Ring programming language version 1.8 book - Part 201 of 202The Ring programming language version 1.8 book - Part 201 of 202
The Ring programming language version 1.8 book - Part 201 of 202
 

More from Mahmoud Samir Fayed

More from Mahmoud Samir Fayed (20)

The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212
 
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212
 
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212
 
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212
 
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212
 
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212
 
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212
 
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212
 
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212
 
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212
 
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212
 
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212
 
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212
 
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212
 
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212
 
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212
 
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212
 
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212
 
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212
 
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 

The Ring programming language version 1.7 book - Part 15 of 196

  • 1. Ring Documentation, Release 1.7 7.11. What is new in Ring 1.4.1? 112
  • 2. CHAPTER EIGHT WHAT IS NEW IN RING 1.3? In this chapter we will learn about the changes and new features in Ring 1.3 release. 8.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 8.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("") 113
  • 3. Ring Documentation, Release 1.7 } 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: 8.2. Better RingQt 114
  • 4. Ring Documentation, Release 1.7 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) 8.2. Better RingQt 115
  • 5. Ring Documentation, Release 1.7 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 doesn’t 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 doesn’t have any effect on our previous code, It’s 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 8.2. Better RingQt 116
  • 6. Ring Documentation, Release 1.7 2. https://github.com/ring-lang/ring/blob/master/applications/formdesigner/tests/indexstart/indexstartController.ring 8.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. 8.3. Better Ring Notepad 117
  • 7. Ring Documentation, Release 1.7 4. Functions and Methods List 8.3. Better Ring Notepad 118
  • 8. Ring Documentation, Release 1.7 5. Output Window 6. Classes List 8.3. Better Ring Notepad 119
  • 9. Ring Documentation, Release 1.7 7. Change the Current Style 8.4 Ring mode for Emacs Editor Ring 1.3 comes with Ring mode for Emacs Editor Screen Shot: 8.4. Ring mode for Emacs Editor 120
  • 10. Ring Documentation, Release 1.7 8.5 Better StdLib The StdLib is updated to include the next functions • SplitMany() • JustFilePath() • JustFileName() 8.6 Better Loop|Exit Command The Loop|Exit command is updated to accept Expressions after the command (not only numbers). The syntax: Loop|Exit [Number] Changed to Loop|Exit [Expression] Example XLoop = 2 # The outer loop YLoop = 1 # The first inner loop for x = 1 to 10 for y = 1 to 10 see "x=" + x + " y=" + y + nl if x = 3 and y = 5 exit XLoop ok 8.5. Better StdLib 121