-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwhatisnew3.html
707 lines (578 loc) · 45.7 KB
/
whatisnew3.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>What is new in Ring 1.3? — Ring 1.14 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="What is new in Ring 1.4?" href="whatisnew4.html" />
<link rel="prev" title="What is new in Ring 1.2?" href="whatisnew2.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html">
<img src="_static/ringdoclogo.jpg" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="ringapps.html">Applications developed in a few hours</a></li>
<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringnotepad.html">Using Ring Notepad</a></li>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started - First Style</a></li>
<li class="toctree-l1"><a class="reference internal" href="getting_started2.html">Getting Started - Second Style</a></li>
<li class="toctree-l1"><a class="reference internal" href="getting_started3.html">Getting Started - Third Style</a></li>
<li class="toctree-l1"><a class="reference internal" href="variables.html">Variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="operators.html">Operators</a></li>
<li class="toctree-l1"><a class="reference internal" href="controlstructures.html">Control Structures - First Style</a></li>
<li class="toctree-l1"><a class="reference internal" href="controlstructures2.html">Control Structures - Second Style</a></li>
<li class="toctree-l1"><a class="reference internal" href="controlstructures3.html">Control Structures - Third Style</a></li>
<li class="toctree-l1"><a class="reference internal" href="getinput.html">Getting Input</a></li>
<li class="toctree-l1"><a class="reference internal" href="functions.html">Functions - First Style</a></li>
<li class="toctree-l1"><a class="reference internal" href="functions2.html">Functions - Second Style</a></li>
<li class="toctree-l1"><a class="reference internal" href="functions3.html">Functions - Third Style</a></li>
<li class="toctree-l1"><a class="reference internal" href="programstructure.html">Program Structure</a></li>
<li class="toctree-l1"><a class="reference internal" href="lists.html">Lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="strings.html">Strings</a></li>
<li class="toctree-l1"><a class="reference internal" href="dateandtime.html">Date and Time</a></li>
<li class="toctree-l1"><a class="reference internal" href="checkandconvert.html">Check Data Type and Conversion</a></li>
<li class="toctree-l1"><a class="reference internal" href="mathfunc.html">Mathematical Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="files.html">Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="systemfunc.html">System Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="evaldebug.html">Eval() and Debugging</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo.html">Demo Programs</a></li>
<li class="toctree-l1"><a class="reference internal" href="odbc.html">ODBC Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="mysql.html">MySQL Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="sqlite.html">SQLite Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="postgresql.html">PostgreSQL Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="secfunc.html">Security and Internet Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="oop.html">Object Oriented Programming (OOP)</a></li>
<li class="toctree-l1"><a class="reference internal" href="fp.html">Functional Programming (FP)</a></li>
<li class="toctree-l1"><a class="reference internal" href="metaprog.html">Reflection and Meta-programming</a></li>
<li class="toctree-l1"><a class="reference internal" href="declarative.html">Declarative Programming using Nested Structures</a></li>
<li class="toctree-l1"><a class="reference internal" href="natural.html">Natural language programming</a></li>
<li class="toctree-l1"><a class="reference internal" href="naturallibrary.html">Using the Natural Library</a></li>
<li class="toctree-l1"><a class="reference internal" href="scope.html">Scope Rules for Variables and Attributes</a></li>
<li class="toctree-l1"><a class="reference internal" href="scope2.html">Scope Rules for Functions and Methods</a></li>
<li class="toctree-l1"><a class="reference internal" href="syntaxflexibility.html">Syntax Flexibility</a></li>
<li class="toctree-l1"><a class="reference internal" href="typehints.html">The Type Hints Library</a></li>
<li class="toctree-l1"><a class="reference internal" href="debug.html">The Trace Library and the Interactive Debugger</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringemb.html">Embedding Ring Language in Ring Programs</a></li>
<li class="toctree-l1"><a class="reference internal" href="stdlib.html">Stdlib Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="stdlibclasses.html">Stdlib Classes</a></li>
<li class="toctree-l1"><a class="reference internal" href="qt.html">Desktop, WebAssembly and Mobile development using RingQt</a></li>
<li class="toctree-l1"><a class="reference internal" href="formdesigner.html">Using the Form Designer</a></li>
<li class="toctree-l1"><a class="reference internal" href="qt3d.html">Graphics Programming using RingQt3D</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringqtobjects.html">Objects Library for RingQt Application</a></li>
<li class="toctree-l1"><a class="reference internal" href="multilanguage.html">Multi-language Applications</a></li>
<li class="toctree-l1"><a class="reference internal" href="qtmobile.html">Building RingQt Applications for Mobile</a></li>
<li class="toctree-l1"><a class="reference internal" href="qtwebassembly.html">Building RingQt Applications for WebAssembly</a></li>
<li class="toctree-l1"><a class="reference internal" href="web.html">Web Development (CGI Library)</a></li>
<li class="toctree-l1"><a class="reference internal" href="deployincloud.html">Deploying Web Applications in the Cloud</a></li>
<li class="toctree-l1"><a class="reference internal" href="allegro.html">Graphics and 2D Games programming using RingAllegro</a></li>
<li class="toctree-l1"><a class="reference internal" href="gameengine.html">Demo Project - Game Engine for 2D Games</a></li>
<li class="toctree-l1"><a class="reference internal" href="gameengineandorid.html">Building Games For Android</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringraylib.html">Developing Games using RingRayLib</a></li>
<li class="toctree-l1"><a class="reference internal" href="usingopengl.html">Using RingOpenGL and RingFreeGLUT for 3D Graphics</a></li>
<li class="toctree-l1"><a class="reference internal" href="usingopengl2.html">Using RingOpenGL and RingAllegro for 3D Graphics</a></li>
<li class="toctree-l1"><a class="reference internal" href="goldmagic800.html">Demo Project - The Gold Magic 800 Game</a></li>
<li class="toctree-l1"><a class="reference internal" href="tilengine.html">Using RingTilengine</a></li>
<li class="toctree-l1"><a class="reference internal" href="performancetips.html">Performance Tips</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiler.html">Command Line Options</a></li>
<li class="toctree-l1"><a class="reference internal" href="distribute.html">Distributing Ring Applications (Manual)</a></li>
<li class="toctree-l1"><a class="reference internal" href="distribute_ring2exe.html">Distributing Ring Applications using Ring2EXE</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringpm.html">The Ring Package Manager (RingPM)</a></li>
<li class="toctree-l1"><a class="reference internal" href="zerolib.html">ZeroLib Functions Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="foxringfuncsdoc.html">FoxRing Functions Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="bignumber.html">BigNumber Functions Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="libcurl.html">Using RingLibCurl</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringlibcurlfuncsdoc.html">RingLibCurl Functions Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="socket.html">Using RingSockets</a></li>
<li class="toctree-l1"><a class="reference internal" href="threads.html">Using RingThreads</a></li>
<li class="toctree-l1"><a class="reference internal" href="libui.html">Using RingLibui</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringzip.html">Using RingZip</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringlibzipfuncsdoc.html">RingLibZip Functions Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringmurmurhashfuncsdoc.html">RingMurmurHash Functions Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringconsolecolorsfuncsdoc.html">RingConsoleColors Functions Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringallegrofuncsdoc.html">RingAllegro Functions Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="libsdl.html">Using RingLibSDL</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringlibsdlfuncsdoc.html">RingLibSDL Functions Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="libuv.html">Using Ringlibuv</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringlibuvfuncsdoc.html">RingLibuv Functions Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringfreeglutfuncsdoc.html">RingFreeGLUT Functions Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringstbimage.html">RingStbImage Functions Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringopengl32funcsdoc.html">RingOpenGL (OpenGL 3.2) Functions Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="qtclassesdoc.html">RingQt Classes and Methods Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="lowlevel.html">Low Level Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="extension_tutorial.html">Tutorial: Ring Extensions in C/C++</a></li>
<li class="toctree-l1"><a class="reference internal" href="extension.html">Extension using the C/C++ languages</a></li>
<li class="toctree-l1"><a class="reference internal" href="embedding.html">Embedding Ring Language in C/C++ Programs</a></li>
<li class="toctree-l1"><a class="reference internal" href="codegenerator.html">Code Generator for wrapping C/C++ Libraries</a></li>
<li class="toctree-l1"><a class="reference internal" href="ringbeep.html">Create your first extension using the Code Generator</a></li>
<li class="toctree-l1"><a class="reference internal" href="languagedesign.html">Release Notes: Version 1.0</a></li>
<li class="toctree-l1"><a class="reference internal" href="whatisnew.html">Release Notes: Version 1.1</a></li>
<li class="toctree-l1"><a class="reference internal" href="whatisnew2.html">Release Notes: Version 1.2</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Release Notes: Version 1.3</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#list-of-changes-and-new-features">List of changes and new features</a></li>
<li class="toctree-l2"><a class="reference internal" href="#better-ringqt">Better RingQt</a></li>
<li class="toctree-l2"><a class="reference internal" href="#better-ring-notepad">Better Ring Notepad</a></li>
<li class="toctree-l2"><a class="reference internal" href="#ring-mode-for-emacs-editor">Ring mode for Emacs Editor</a></li>
<li class="toctree-l2"><a class="reference internal" href="#better-stdlib">Better StdLib</a></li>
<li class="toctree-l2"><a class="reference internal" href="#better-loop-exit-command">Better Loop|Exit Command</a></li>
<li class="toctree-l2"><a class="reference internal" href="#new-functions">New Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="#return-self-by-reference">Return Self by Reference</a></li>
<li class="toctree-l2"><a class="reference internal" href="#using-and-operators-as-from-keyword">Using ‘<’ and ‘:’ operators as ‘from’ keyword</a></li>
<li class="toctree-l2"><a class="reference internal" href="#embedding-ring-in-ring-without-sharing-the-state">Embedding Ring in Ring without sharing the State</a></li>
<li class="toctree-l2"><a class="reference internal" href="#ringzip-library">RingZip Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="#form-designer">Form Designer</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="whatisnew4.html">Release Notes: Version 1.4</a></li>
<li class="toctree-l1"><a class="reference internal" href="whatisnew5.html">Release Notes: Version 1.5</a></li>
<li class="toctree-l1"><a class="reference internal" href="whatisnew6.html">Release Notes: Version 1.6</a></li>
<li class="toctree-l1"><a class="reference internal" href="whatisnew7.html">Release Notes: Version 1.7</a></li>
<li class="toctree-l1"><a class="reference internal" href="whatisnew8.html">Release Notes: Version 1.8</a></li>
<li class="toctree-l1"><a class="reference internal" href="whatisnew9.html">Release Notes: Version 1.9</a></li>
<li class="toctree-l1"><a class="reference internal" href="whatisnew10.html">Release Notes: Version 1.10</a></li>
<li class="toctree-l1"><a class="reference internal" href="whatisnew11.html">Release Notes: Version 1.11</a></li>
<li class="toctree-l1"><a class="reference internal" href="whatisnew12.html">Release Notes: Version 1.12</a></li>
<li class="toctree-l1"><a class="reference internal" href="whatisnew13.html">Release Notes: Version 1.13</a></li>
<li class="toctree-l1"><a class="reference internal" href="whatisnew14.html">Release Notes: Version 1.14</a></li>
<li class="toctree-l1"><a class="reference internal" href="codeeditors.html">Using Other Code Editors</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">Frequently Asked Questions (FAQ)</a></li>
<li class="toctree-l1"><a class="reference internal" href="sourcecode.html">How to Compile Ring From Source Code?</a></li>
<li class="toctree-l1"><a class="reference internal" href="contribute.html">How to contribute?</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Language Specification</a></li>
<li class="toctree-l1"><a class="reference internal" href="resources.html">Resources</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Ring</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> »</li>
<li>What is new in Ring 1.3?</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="what-is-new-in-ring-1-3">
<span id="index-0"></span><h1>What is new in Ring 1.3?<a class="headerlink" href="#what-is-new-in-ring-1-3" title="Permalink to this headline">¶</a></h1>
<p>In this chapter we will learn about the changes and new features in Ring 1.3 release.</p>
<div class="section" id="list-of-changes-and-new-features">
<span id="index-1"></span><h2>List of changes and new features<a class="headerlink" href="#list-of-changes-and-new-features" title="Permalink to this headline">¶</a></h2>
<p>Ring 1.3 comes with many new features</p>
<ul class="simple">
<li><p>Better RingQt</p></li>
<li><p>Better Ring Notepad</p></li>
<li><p>Ring mode for Emacs Editor</p></li>
<li><p>Better StdLib</p></li>
<li><p>Better Loop/Exit Command</p></li>
<li><p>New Functions</p></li>
<li><p>Return Self by Reference</p></li>
<li><p>Using ‘<’ and ‘:’ operators as ‘from’ keyword</p></li>
<li><p>Embedding Ring in Ring without sharing the State</p></li>
<li><p>RingZip Library</p></li>
<li><p>Form Designer</p></li>
</ul>
</div>
<div class="section" id="better-ringqt">
<span id="index-2"></span><h2>Better RingQt<a class="headerlink" href="#better-ringqt" title="Permalink to this headline">¶</a></h2>
<p>(1) Another version of QPixMap class is added (QPixMap2) which takes (int width,int height)
during object init.</p>
<p>Example:</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="k">Load</span> <span class="s">"guilib.ring"</span>
<span class="k">New</span> <span class="n">qapp</span>
<span class="p">{</span>
<span class="n">win1</span> <span class="o">=</span> <span class="k">new</span> <span class="n">qwidget</span><span class="p">()</span>
<span class="p">{</span>
<span class="n">setwindowtitle</span><span class="p">(</span><span class="s">"Drawing using QPixMap"</span><span class="p">)</span>
<span class="n">setgeometry</span><span class="p">(</span><span class="mi">100</span><span class="p">,</span><span class="mi">100</span><span class="p">,</span><span class="mi">500</span><span class="p">,</span><span class="mi">500</span><span class="p">)</span>
<span class="n">label1</span> <span class="o">=</span> <span class="k">new</span> <span class="n">qlabel</span><span class="p">(</span><span class="n">win1</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">setgeometry</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span><span class="mi">10</span><span class="p">,</span><span class="mi">400</span><span class="p">,</span><span class="mi">400</span><span class="p">)</span>
<span class="n">settext</span><span class="p">(</span><span class="s">""</span><span class="p">)</span>
<span class="p">}</span>
<span class="n">imageStock</span> <span class="o">=</span> <span class="k">new</span> <span class="n">qlabel</span><span class="p">(</span><span class="n">win1</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">image</span> <span class="o">=</span> <span class="k">new</span> <span class="n">qPixMap2</span><span class="p">(</span><span class="mi">200</span><span class="p">,</span><span class="mi">200</span><span class="p">)</span>
<span class="n">color</span> <span class="o">=</span> <span class="k">new</span> <span class="n">qcolor</span><span class="p">()</span> <span class="p">{</span>
<span class="n">setrgb</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span><span class="mi">255</span><span class="p">,</span><span class="mi">255</span><span class="p">,</span><span class="mi">255</span><span class="p">)</span>
<span class="p">}</span>
<span class="n">pen</span> <span class="o">=</span> <span class="k">new</span> <span class="n">qpen</span><span class="p">()</span> <span class="p">{</span>
<span class="n">setcolor</span><span class="p">(</span><span class="n">color</span><span class="p">)</span>
<span class="n">setwidth</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
<span class="p">}</span>
<span class="k">new</span> <span class="n">qpainter</span><span class="p">()</span> <span class="p">{</span>
<span class="n">begin</span><span class="p">(</span><span class="n">image</span><span class="p">)</span>
<span class="n">setpen</span><span class="p">(</span><span class="n">pen</span><span class="p">)</span>
<span class="n">drawline</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">200</span><span class="p">,</span><span class="mi">200</span><span class="p">)</span>
<span class="n">drawline</span><span class="p">(</span><span class="mi">200</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">200</span><span class="p">)</span>
<span class="n">endpaint</span><span class="p">()</span>
<span class="p">}</span>
<span class="n">setpixmap</span><span class="p">(</span><span class="n">image</span><span class="p">)</span>
<span class="p">}</span>
<span class="n">show</span><span class="p">()</span>
<span class="p">}</span>
<span class="n">exec</span><span class="p">()</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Screen Shot:</p>
<img alt="Using QPixMap2" src="_images/ringqtpixmap2.png" />
<ol class="arabic simple" start="2">
<li><p>The Objects Library is updated to include the next functions</p></li>
</ol>
<ul class="simple">
<li><p>Last_WindowID()</p></li>
<li><p>Open_WindowNoShow()</p></li>
<li><p>Open_WindowAndLink()</p></li>
</ul>
<p>Also the class name (WindowViewBase) is changed to (WindowsViewParent).</p>
<p>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</p>
<p>So the SendMessage() method in FirstWindowController class can use the
SecondWindow() method to access the object.</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="n">firstwindowController</span> <span class="k">from</span> <span class="n">windowsControllerParent</span>
<span class="n">oView</span> <span class="o">=</span> <span class="k">new</span> <span class="n">firstwindowView</span>
<span class="k">func</span> <span class="n">OpenSecondWindow</span>
<span class="n">Open_WindowAndLink</span><span class="p">(:</span><span class="n">SecondWindowController</span><span class="p">,</span><span class="n">self</span><span class="p">)</span>
<span class="k">func</span> <span class="n">SendMessage</span>
<span class="k">if</span> <span class="n">IsSecondWindow</span><span class="p">()</span>
<span class="n">SecondWindow</span><span class="p">().</span><span class="n">setMessage</span><span class="p">(</span><span class="s">"Message from the first window"</span><span class="p">)</span>
<span class="k">ok</span>
<span class="k">func</span> <span class="n">setMessage</span> <span class="n">cMessage</span>
<span class="n">oView</span><span class="p">.</span><span class="n">Label1</span><span class="p">.</span><span class="n">setText</span><span class="p">(</span><span class="n">cMessage</span><span class="p">)</span>
</pre></div>
</div>
<ol class="arabic simple" start="3">
<li><p>The next classes are added to RingQt</p></li>
</ol>
<ul class="simple">
<li><p>QPixMap2</p></li>
<li><p>QScrollArea</p></li>
<li><p>QSplitter</p></li>
<li><p>QCompleter</p></li>
<li><p>QCompleter2</p></li>
<li><p>QCompleter3</p></li>
<li><p>QProcess</p></li>
<li><p>QMdiArea</p></li>
<li><p>QMdiSubWindow</p></li>
<li><p>QCursor</p></li>
<li><p>QListView</p></li>
<li><p>QDesktopServices</p></li>
</ul>
<ol class="arabic simple" start="4">
<li><p>Many constants are defined in qt.rh (loaded by guilib.ring)</p></li>
<li><p>New Classes names - Index Start from 1</p></li>
</ol>
<p>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</p>
<ul class="simple">
<li><p>ComboBox</p></li>
<li><p>ListWidget</p></li>
<li><p>TableWidget</p></li>
<li><p>TreeWidget</p></li>
</ul>
<p>These classes are inside guilib.ring under the package name : System.GUI</p>
<p>To use it</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="k">load</span> <span class="s">"guilib.ring"</span>
<span class="k">import</span> <span class="n">System</span><span class="p">.</span><span class="n">GUI</span>
</pre></div>
</div>
<p>This doesn’t have any effect on our previous code, It’s just another choice for better code that is consistent with Ring rules.</p>
<p>Also the form designer is updated to provide us the choice between using classes where (index start from 0) or (index start from 1)</p>
<p>Example (Uses the Form Designer)</p>
<ol class="arabic simple">
<li><p><a class="reference external" href="https://github.com/ring-lang/ring/blob/master/samples/UsingFormDesigner/indexstart/indexstartView.ring">https://github.com/ring-lang/ring/blob/master/samples/UsingFormDesigner/indexstart/indexstartView.ring</a></p></li>
<li><p><a class="reference external" href="https://github.com/ring-lang/ring/blob/master/samples/UsingFormDesigner/indexstart/indexstartController.ring">https://github.com/ring-lang/ring/blob/master/samples/UsingFormDesigner/indexstart/indexstartController.ring</a></p></li>
</ol>
</div>
<div class="section" id="better-ring-notepad">
<span id="index-3"></span><h2>Better Ring Notepad<a class="headerlink" href="#better-ring-notepad" title="Permalink to this headline">¶</a></h2>
<ol class="arabic simple">
<li><p>Using QPlainTextEdit instead of QTextEdit</p></li>
<li><p>Displaying the line number for each line in the source code file.</p></li>
</ol>
<p>Screen Shot:</p>
<img alt="Ring Notepad - Line Number" src="_images/rnotelinenumber.png" />
<ol class="arabic simple" start="3">
<li><p>Auto-Complete for Ring functions names, classes and words in the opened file.</p></li>
</ol>
<img alt="Ring Notepad - Auto Complete" src="_images/autocomplete.png" />
<ol class="arabic simple" start="4">
<li><p>Functions and Methods List</p></li>
</ol>
<img alt="Ring Notepad - Functions List" src="_images/functionslist.png" />
<ol class="arabic simple" start="5">
<li><p>Output Window</p></li>
</ol>
<img alt="Ring Notepad - Output Window" src="_images/outputwin.png" />
<ol class="arabic simple" start="6">
<li><p>Classes List</p></li>
</ol>
<img alt="Ring Notepad - Classes List" src="_images/classeslist.png" />
<ol class="arabic simple" start="7">
<li><p>Change the Current Style</p></li>
</ol>
<img alt="Ring Notepad - Style Menu" src="_images/rnotestylemenu.png" />
</div>
<div class="section" id="ring-mode-for-emacs-editor">
<span id="index-4"></span><h2>Ring mode for Emacs Editor<a class="headerlink" href="#ring-mode-for-emacs-editor" title="Permalink to this headline">¶</a></h2>
<p>Ring 1.3 comes with Ring mode for Emacs Editor</p>
<p>Screen Shot:</p>
<img alt="Ring mode for Emacs Editor" src="_images/ringemacs.png" />
</div>
<div class="section" id="better-stdlib">
<span id="index-5"></span><h2>Better StdLib<a class="headerlink" href="#better-stdlib" title="Permalink to this headline">¶</a></h2>
<p>The StdLib is updated to include the next functions</p>
<ul class="simple">
<li><p>SplitMany()</p></li>
<li><p>JustFilePath()</p></li>
<li><p>JustFileName()</p></li>
</ul>
</div>
<div class="section" id="better-loop-exit-command">
<span id="index-6"></span><h2>Better Loop|Exit Command<a class="headerlink" href="#better-loop-exit-command" title="Permalink to this headline">¶</a></h2>
<p>The Loop|Exit command is updated to accept Expressions after the command (not only numbers).</p>
<p>The syntax:</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="k">Loop</span><span class="o">|</span><span class="k">Exit</span> <span class="o">[</span><span class="n">Number</span><span class="o">]</span>
</pre></div>
</div>
<p>Changed to</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="k">Loop</span><span class="o">|</span><span class="k">Exit</span> <span class="o">[</span><span class="n">Expression</span><span class="o">]</span>
</pre></div>
</div>
<p>Example</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="n">XLoop</span> <span class="o">=</span> <span class="mi">2</span> <span class="c"># The outer loop</span>
<span class="n">YLoop</span> <span class="o">=</span> <span class="mi">1</span> <span class="c"># The first inner loop</span>
<span class="k">for</span> <span class="n">x</span> <span class="o">=</span> <span class="mi">1</span> <span class="k">to</span> <span class="mi">10</span>
<span class="k">for</span> <span class="n">y</span> <span class="o">=</span> <span class="mi">1</span> <span class="k">to</span> <span class="mi">10</span>
<span class="k">see</span> <span class="s">"x="</span> <span class="o">+</span> <span class="n">x</span> <span class="o">+</span> <span class="s">" y="</span> <span class="o">+</span> <span class="n">y</span> <span class="o">+</span> <span class="n">nl</span>
<span class="k">if</span> <span class="n">x</span> <span class="o">=</span> <span class="mi">3</span> <span class="ow">and</span> <span class="n">y</span> <span class="o">=</span> <span class="mi">5</span>
<span class="k">exit</span> <span class="n">XLoop</span>
<span class="k">ok</span>
<span class="k">next</span>
<span class="k">next</span>
</pre></div>
</div>
</div>
<div class="section" id="new-functions">
<span id="index-7"></span><h2>New Functions<a class="headerlink" href="#new-functions" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><p>PackageName() function</p></li>
<li><p>Swap() function</p></li>
</ul>
<p>Example:</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="n">aList</span> <span class="o">=</span> <span class="o">[</span><span class="p">:</span><span class="n">one</span><span class="p">,:</span><span class="n">two</span><span class="p">,:</span><span class="n">four</span><span class="p">,:</span><span class="n">three</span><span class="o">]</span>
<span class="k">see</span> <span class="n">aList</span>
<span class="k">see</span> <span class="n">copy</span><span class="p">(</span><span class="s">"*"</span><span class="p">,</span><span class="mi">50</span><span class="p">)</span> <span class="o">+</span> <span class="n">nl</span>
<span class="n">swap</span><span class="p">(</span><span class="n">aList</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">)</span>
<span class="k">see</span> <span class="n">aList</span>
</pre></div>
</div>
<p>Output</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="n">one</span>
<span class="n">two</span>
<span class="n">four</span>
<span class="n">three</span>
<span class="o">**************************************************</span>
<span class="n">one</span>
<span class="n">two</span>
<span class="n">three</span>
<span class="n">four</span>
</pre></div>
</div>
</div>
<div class="section" id="return-self-by-reference">
<span id="index-8"></span><h2>Return Self by Reference<a class="headerlink" href="#return-self-by-reference" title="Permalink to this headline">¶</a></h2>
<p>In this release, using Return Self in class methods will return the object by reference.</p>
<p>Example:</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="n">mylist</span> <span class="o">=</span> <span class="o">[</span><span class="k">new</span> <span class="n">mytest</span><span class="p">()</span> <span class="p">{</span>
<span class="k">see</span> <span class="n">self</span>
<span class="n">x</span> <span class="o">=</span> <span class="mi">20</span>
<span class="k">see</span> <span class="n">self</span>
<span class="p">}</span><span class="o">]</span>
<span class="k">see</span> <span class="n">mylist</span>
<span class="k">class</span> <span class="n">mytest</span>
<span class="n">x</span> <span class="o">=</span> <span class="mi">15</span>
<span class="k">func</span> <span class="n">init</span>
<span class="k">return</span> <span class="n">self</span> <span class="c"># Return by reference</span>
</pre></div>
</div>
<p>Output</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="n">x</span><span class="p">:</span> <span class="mf">15.000000</span>
<span class="n">x</span><span class="p">:</span> <span class="mf">20.000000</span>
<span class="n">x</span><span class="p">:</span> <span class="mf">20.000000</span>
</pre></div>
</div>
</div>
<div class="section" id="using-and-operators-as-from-keyword">
<span id="index-9"></span><h2>Using ‘<’ and ‘:’ operators as ‘from’ keyword<a class="headerlink" href="#using-and-operators-as-from-keyword" title="Permalink to this headline">¶</a></h2>
<p>In this release of the Ring language we can use the ‘<’ and ‘:’ operators as the ‘from’ keyword</p>
<p>Syntax (1):</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="n">Cat</span> <span class="k">from</span> <span class="n">Animal</span>
</pre></div>
</div>
<p>Syntax (2):</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="n">Cat</span> <span class="o"><</span> <span class="n">Animal</span>
</pre></div>
</div>
<p>Syntax (3):</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="n">Cat</span> <span class="p">:</span> <span class="n">Animal</span>
</pre></div>
</div>
</div>
<div class="section" id="embedding-ring-in-ring-without-sharing-the-state">
<span id="index-10"></span><h2>Embedding Ring in Ring without sharing the State<a class="headerlink" href="#embedding-ring-in-ring-without-sharing-the-state" title="Permalink to this headline">¶</a></h2>
<p>From Ring 1.0 we already have functions for embedding Ring in the C language. Also we
can execute Ring code inside Ring programs using the eval() function. In this release
we provide functions for embedding Ring in Ring programs without sharing the state.</p>
<p>Advantages:</p>
<ol class="arabic simple">
<li><p>Quick integration for Ring programs and applications together without conflicts.</p></li>
<li><p>Execute and run Ring code in safe environments that we can trace.</p></li>
</ol>
<p>Example:</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="n">pState</span> <span class="o">=</span> <span class="n">ring_state_init</span><span class="p">()</span>
<span class="n">ring_state_runcode</span><span class="p">(</span><span class="n">pState</span><span class="p">,</span><span class="s">"See 'Hello, World!'+nl"</span><span class="p">)</span>
<span class="n">ring_state_runcode</span><span class="p">(</span><span class="n">pState</span><span class="p">,</span><span class="s">"x = 10"</span><span class="p">)</span>
<span class="n">pState2</span> <span class="o">=</span> <span class="n">ring_state_init</span><span class="p">()</span>
<span class="n">ring_state_runcode</span><span class="p">(</span><span class="n">pState2</span><span class="p">,</span><span class="s">"See 'Hello, World!'+nl"</span><span class="p">)</span>
<span class="n">ring_state_runcode</span><span class="p">(</span><span class="n">pState2</span><span class="p">,</span><span class="s">"x = 20"</span><span class="p">)</span>
<span class="n">ring_state_runcode</span><span class="p">(</span><span class="n">pState</span><span class="p">,</span><span class="s">"see x +nl"</span><span class="p">)</span>
<span class="n">ring_state_runcode</span><span class="p">(</span><span class="n">pState2</span><span class="p">,</span><span class="s">"see x +nl"</span><span class="p">)</span>
<span class="n">v1</span> <span class="o">=</span> <span class="n">ring_state_findvar</span><span class="p">(</span><span class="n">pState</span><span class="p">,</span><span class="s">"x"</span><span class="p">)</span>
<span class="n">v2</span> <span class="o">=</span> <span class="n">ring_state_findvar</span><span class="p">(</span><span class="n">pState2</span><span class="p">,</span><span class="s">"x"</span><span class="p">)</span>
<span class="k">see</span> <span class="n">v1</span><span class="o">[</span><span class="mi">3</span><span class="o">]</span> <span class="o">+</span> <span class="n">nl</span>
<span class="k">see</span> <span class="n">V2</span><span class="o">[</span><span class="mi">3</span><span class="o">]</span> <span class="o">+</span> <span class="n">nl</span>
<span class="n">ring_state_delete</span><span class="p">(</span><span class="n">pState</span><span class="p">)</span>
<span class="n">ring_state_delete</span><span class="p">(</span><span class="n">pState2</span><span class="p">)</span>
</pre></div>
</div>
<p>Output:</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="n">Hello</span><span class="p">,</span> <span class="n">World</span><span class="o">!</span>
<span class="n">Hello</span><span class="p">,</span> <span class="n">World</span><span class="o">!</span>
<span class="mi">10</span>
<span class="mi">20</span>
<span class="mi">10</span>
<span class="mi">20</span>
</pre></div>
</div>
</div>
<div class="section" id="ringzip-library">
<span id="index-11"></span><h2>RingZip Library<a class="headerlink" href="#ringzip-library" title="Permalink to this headline">¶</a></h2>
<p>Ring 1.3 comes with the RingZip library for creating, modifying and extracting <a href="#id1"><span class="problematic" id="id2">*</span></a>.zip files.</p>
<p>Example (1): Create myfile.zip contains 4 files</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="k">load</span> <span class="s">"ziplib.ring"</span>
<span class="n">oZip</span> <span class="o">=</span> <span class="n">zip_openfile</span><span class="p">(</span><span class="s">"myfile.zip"</span><span class="p">,</span><span class="sc">'w'</span><span class="p">)</span>
<span class="n">zip_addfile</span><span class="p">(</span><span class="n">oZip</span><span class="p">,</span><span class="s">"test.c"</span><span class="p">)</span>
<span class="n">zip_addfile</span><span class="p">(</span><span class="n">oZip</span><span class="p">,</span><span class="s">"zip.c"</span><span class="p">)</span>
<span class="n">zip_addfile</span><span class="p">(</span><span class="n">oZip</span><span class="p">,</span><span class="s">"zip.h"</span><span class="p">)</span>
<span class="n">zip_addfile</span><span class="p">(</span><span class="n">oZip</span><span class="p">,</span><span class="s">"miniz.h"</span><span class="p">)</span>
<span class="n">zip_close</span><span class="p">(</span><span class="n">oZip</span><span class="p">)</span>
</pre></div>
</div>
<p>Example (2): Extract myfile.zip to myfolder folder.</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="k">load</span> <span class="s">"ziplib.ring"</span>
<span class="n">zip_extract_allfiles</span><span class="p">(</span><span class="s">"myfile.zip"</span><span class="p">,</span><span class="s">"myfolder"</span><span class="p">)</span>
</pre></div>
</div>
<p>Example (3): Print file names in the myfile.zip</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="k">load</span> <span class="s">"ziplib.ring"</span>
<span class="n">oZip</span> <span class="o">=</span> <span class="n">zip_openfile</span><span class="p">(</span><span class="s">"myfile.zip"</span><span class="p">,</span><span class="sc">'r'</span><span class="p">)</span>
<span class="k">for</span> <span class="n">x</span><span class="o">=</span><span class="mi">1</span> <span class="k">to</span> <span class="n">zip_filescount</span><span class="p">(</span><span class="n">oZip</span><span class="p">)</span>
<span class="k">see</span> <span class="n">zip_getfilenamebyindex</span><span class="p">(</span><span class="n">oZip</span><span class="p">,</span><span class="n">x</span><span class="p">)</span> <span class="o">+</span> <span class="n">nl</span>
<span class="k">next</span>
<span class="n">zip_close</span><span class="p">(</span><span class="n">oZip</span><span class="p">)</span>
</pre></div>
</div>
<p>Example (4) : Using Classes instead of Functions</p>
<div class="highlight-ring notranslate"><div class="highlight"><pre><span></span><span class="k">load</span> <span class="s">"ziplib.ring"</span>
<span class="k">new</span> <span class="n">Zip</span> <span class="p">{</span>
<span class="n">SetFileName</span><span class="p">(</span><span class="s">"myfile.zip"</span><span class="p">)</span>
<span class="n">Open</span><span class="p">(</span><span class="s">"w"</span><span class="p">)</span>
<span class="n">AddFile</span><span class="p">(</span><span class="s">"test.c"</span><span class="p">)</span>
<span class="n">AddFile</span><span class="p">(</span><span class="s">"zip.c"</span><span class="p">)</span>
<span class="n">AddFile</span><span class="p">(</span><span class="s">"zip.h"</span><span class="p">)</span>
<span class="n">AddFile</span><span class="p">(</span><span class="s">"miniz.h"</span><span class="p">)</span>
<span class="n">Close</span><span class="p">()</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="form-designer">
<span id="index-12"></span><h2>Form Designer<a class="headerlink" href="#form-designer" title="Permalink to this headline">¶</a></h2>
<p>Ring 1.3 comes with the Form Designer to quickly design your GUI application windows/forms
and generate the Ring source code.</p>
<p>It’s written in Ring (Around 8000 Lines of code) using Object-Oriented Programming and
Meta-Programming.</p>
<p>We can run the From Designer from Ring Notepad</p>
<img alt="Form Desigenr - Inside Ring Notepad" src="_images/rnotefd.png" />
<p>Also we can run the Form Designer in another window.</p>
<img alt="Form Desigenr" src="_images/formdesigner.png" />
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="whatisnew4.html" class="btn btn-neutral float-right" title="What is new in Ring 1.4?" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="whatisnew2.html" class="btn btn-neutral float-left" title="What is new in Ring 1.2?" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2016-2021, Ring Team
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(false);
});
</script>
</body>
</html>