You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: output/book.md
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ The sixth section is dedicated to the creation of new
43
43
\(This documentation was written by Benjamin Van Ryseghem and Johan Fabry\. For corrections, comments and questions about this text please send a mail to either of them\.\)
44
44
45
45
46
-
##2\. Defining and Reuse UIs with *Spec*
46
+
##2\. Defining and Reusing UIs with *Spec*
47
47
<aname="sec_reuse_spec"></a>
48
48
49
49
This section introduces an example of how to define and reuse
@@ -58,21 +58,21 @@ In this section we do not detail the different parts of
58
58
59
59
60
60
The example is structured in four parts\.
61
-
First a list UI dedicated to render the subclasses of the
62
-
*AbstractWidgetModel* class is created and is called
63
-
**ModelList**\.
64
-
Second a UI composed of a list and a label is defined and named
61
+
First, a list UI named
62
+
**ModelList** that is dedicated to render the subclasses of the
63
+
*AbstractWidgetModel* class is created\.
64
+
Second, a UI composed of a list and a label is defined and named
65
65
**ProtocolList**\.
66
-
Third a protocol viewer is defined by combining a
66
+
Third, a protocol viewer is defined by combining a
67
67
**ModelList** with two
68
68
**ProtocolList** to browse the
69
69
*protocol* and
70
70
*protocol\-events* methods\.
71
-
Finally a protocol browser is made by reusing a protocol viewer with a text zone in addition\.
71
+
Finally a protocol browser is made by reusing a protocol viewer and adding a text zone\.
72
72
73
73
74
74
75
-
###2\.1\. The MethodList
75
+
###2\.1\. The ModelList
76
76
77
77
78
78
Creating a specific UI always starts with the subclassing of
@@ -169,7 +169,7 @@ The code
169
169
170
170
171
171
The first UI is now done\.
172
-
The result can be seen by performing the following snippet:
172
+
The result can be seen by executing the following snippet of code:
173
173
`ModelList new openWithSpec`\.
174
174
175
175
@@ -196,7 +196,7 @@ The class definition is similar to the code above, as can be seen in
196
196
197
197
198
198
The
199
-
`initializeWidgets` method for this UI is quite similar to the method in ModelList, as the code
199
+
`initializeWidgets` method for this UI is quite similar to the method in ModelList, as the code in
200
200
[2\.6](#ex_protocolList_init) shows\.
201
201
202
202
@@ -287,7 +287,7 @@ The code
287
287
288
288
289
289
The
290
-
**ProtocolList** UI can be seen by evaluating the snippet
290
+
**ProtocolList** UI can be seen by evaluating
291
291
`ProtocolList new openWithSpec`\.
292
292
293
293
@@ -332,8 +332,8 @@ The code in
332
332
333
333
The
334
334
`initializeWidgets` method now uses a different way to initialize the sub\-widgets of the UI\.
335
-
This is because it does not use basic widgets but instead reuses the user interfaces we defines previously as sub widgets\.
336
-
The remainder of the method is quite similar to the previous implementation, as shown in the code
335
+
This is because it does not use basic widgets but instead reuses the user interfaces we defines previously\.
336
+
The remainder of the method is quite similar to the previous implementation, as shown in the code in
337
337
[2\.10](#ex_viewer_initializeWidgets)\.
338
338
339
339
@@ -359,7 +359,7 @@ The remainder of the method is quite similar to the previous implementation, as
359
359
360
360
361
361
The layout puts the sub widgets in one column, with all sub widgets taking the same amount of space\.
362
-
The code
362
+
The code in
363
363
[2\.11](#ex_viewer_layout) shows the implementation of this layout\.
364
364
365
365
@@ -416,7 +416,7 @@ More details on the
416
416
417
417
418
418
The remaining methods are getters, methods to delegate to sub widgets, one method to compute the methods in a specific class for a specific protocol, and methods to register to sub widget events\.
419
-
Those methods are summed up in the code in
419
+
Those methods are given in the code in
420
420
[2\.13](#ex_viewer_others)\.
421
421
422
422
@@ -475,7 +475,7 @@ Those methods are summed up in the code in
475
475
476
476
477
477
478
-
As previously the result can be seen by executing the following snippet:
478
+
As previously, the result can be seen by executing the following snippet of code:
479
479
`ProtocolViewer new openWithSpec`\.
480
480
481
481
@@ -525,7 +525,8 @@ The
525
525
526
526
527
527
The layout is more complex than the previous layouts\.
528
-
Now the user interface mainly lays out sub widgets of its sub widgets\.
528
+
Now the user interface mainly lays out widgets that are contained in its
529
+
`viewer` sub widget \(the list of models and the two protocol browsers\)\.
529
530
The layout is based on a column whose first row is divided in columns\.
530
531
The implementation of this method is shown in code in
Copy file name to clipboardExpand all lines: output/chapters/SpecReusability.pier.md
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
2
2
3
-
##1\. Defining and Reuse UIs with *Spec*
3
+
##1\. Defining and Reusing UIs with *Spec*
4
4
<aname="sec_reuse_spec"></a>
5
5
6
6
This section introduces an example of how to define and reuse
@@ -15,21 +15,21 @@ In this section we do not detail the different parts of
15
15
16
16
17
17
The example is structured in four parts\.
18
-
First a list UI dedicated to render the subclasses of the
19
-
*AbstractWidgetModel* class is created and is called
20
-
**ModelList**\.
21
-
Second a UI composed of a list and a label is defined and named
18
+
First, a list UI named
19
+
**ModelList** that is dedicated to render the subclasses of the
20
+
*AbstractWidgetModel* class is created\.
21
+
Second, a UI composed of a list and a label is defined and named
22
22
**ProtocolList**\.
23
-
Third a protocol viewer is defined by combining a
23
+
Third, a protocol viewer is defined by combining a
24
24
**ModelList** with two
25
25
**ProtocolList** to browse the
26
26
*protocol* and
27
27
*protocol\-events* methods\.
28
-
Finally a protocol browser is made by reusing a protocol viewer with a text zone in addition\.
28
+
Finally a protocol browser is made by reusing a protocol viewer and adding a text zone\.
29
29
30
30
31
31
32
-
###1\.1\. The MethodList
32
+
###1\.1\. The ModelList
33
33
34
34
35
35
Creating a specific UI always starts with the subclassing of
@@ -126,7 +126,7 @@ The code
126
126
127
127
128
128
The first UI is now done\.
129
-
The result can be seen by performing the following snippet:
129
+
The result can be seen by executing the following snippet of code:
130
130
`ModelList new openWithSpec`\.
131
131
132
132
@@ -153,7 +153,7 @@ The class definition is similar to the code above, as can be seen in
153
153
154
154
155
155
The
156
-
`initializeWidgets` method for this UI is quite similar to the method in ModelList, as the code
156
+
`initializeWidgets` method for this UI is quite similar to the method in ModelList, as the code in
157
157
[1\.6](#ex_protocolList_init) shows\.
158
158
159
159
@@ -244,7 +244,7 @@ The code
244
244
245
245
246
246
The
247
-
**ProtocolList** UI can be seen by evaluating the snippet
247
+
**ProtocolList** UI can be seen by evaluating
248
248
`ProtocolList new openWithSpec`\.
249
249
250
250
@@ -289,8 +289,8 @@ The code in
289
289
290
290
The
291
291
`initializeWidgets` method now uses a different way to initialize the sub\-widgets of the UI\.
292
-
This is because it does not use basic widgets but instead reuses the user interfaces we defines previously as sub widgets\.
293
-
The remainder of the method is quite similar to the previous implementation, as shown in the code
292
+
This is because it does not use basic widgets but instead reuses the user interfaces we defines previously\.
293
+
The remainder of the method is quite similar to the previous implementation, as shown in the code in
294
294
[1\.10](#ex_viewer_initializeWidgets)\.
295
295
296
296
@@ -316,7 +316,7 @@ The remainder of the method is quite similar to the previous implementation, as
316
316
317
317
318
318
The layout puts the sub widgets in one column, with all sub widgets taking the same amount of space\.
319
-
The code
319
+
The code in
320
320
[1\.11](#ex_viewer_layout) shows the implementation of this layout\.
321
321
322
322
@@ -373,7 +373,7 @@ More details on the
373
373
374
374
375
375
The remaining methods are getters, methods to delegate to sub widgets, one method to compute the methods in a specific class for a specific protocol, and methods to register to sub widget events\.
376
-
Those methods are summed up in the code in
376
+
Those methods are given in the code in
377
377
[1\.13](#ex_viewer_others)\.
378
378
379
379
@@ -432,7 +432,7 @@ Those methods are summed up in the code in
432
432
433
433
434
434
435
-
As previously the result can be seen by executing the following snippet:
435
+
As previously, the result can be seen by executing the following snippet of code:
436
436
`ProtocolViewer new openWithSpec`\.
437
437
438
438
@@ -482,7 +482,8 @@ The
482
482
483
483
484
484
The layout is more complex than the previous layouts\.
485
-
Now the user interface mainly lays out sub widgets of its sub widgets\.
485
+
Now the user interface mainly lays out widgets that are contained in its
486
+
`viewer` sub widget \(the list of models and the two protocol browsers\)\.
486
487
The layout is based on a column whose first row is divided in columns\.
487
488
The implementation of this method is shown in code in
0 commit comments