File: PageLayout.schelp

package info (click to toggle)
supercollider 1%3A3.11.2%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 71,152 kB
  • sloc: cpp: 387,846; lisp: 80,328; ansic: 76,515; sh: 22,779; python: 7,932; makefile: 2,333; perl: 1,123; javascript: 915; java: 677; xml: 582; yacc: 314; lex: 175; objc: 152; ruby: 136
file content (233 lines) | stat: -rw-r--r-- 5,317 bytes parent folder | download | duplicates (6)
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
CLASS:: PageLayout
summary:: a Window with a FlowView on it for use in ObjectGui's MVC model
categories:: GUI
related:: Classes/ObjectGui, Classes/FlowView, Classes/Window, Classes/NotificationCenter

DESCRIPTION::
This class encapsulates the common task of creating a Window, adding a FlowView (CompositeView with a FlowLayout on it).  It also supports the MVC model by registering controllers that are then removed (sent the .remove message) when the Window closes.  Additionally it can resize itself to fit the contents.


CLASSMETHODS::

METHOD:: new
Create a Window with a FlowView on it.  The PageLayout object can be treated like a Window or like a View.

argument:: title
Window title

argument:: bounds
Bounds or nil.  Default of nil will size the window to the entire screen size.  Use .resizeToFit to shrink the window to the content size.

argument:: margin
FlowLayout margin.

argument:: background
Background color

argument:: scroll
boolean: add scroll bars or not.

argument:: front
boolean: whether to immediately display the window, bringing it to the front.  default is true.  You may choose to first add your views to the window and then front it which is useful for large slow GUIs

returns:: a PageLayout


INSTANCEMETHODS::

METHOD:: window
the Window object

returns:: a Window

METHOD:: view
the top most view on the Window

returns:: a View

METHOD:: isClosed
boolean: has the window been closed ?

returns:: boolean

METHOD:: onClose
Just as for Window, this method is called when the PageLayout's window is closed.  The actual Window's onClose method is used to trigger clean up operations, releasing dependencies and will also call this onClose function.

returns:: get/set onClose handler

METHOD:: asView
returns the top view

returns:: a View

METHOD:: asFlowView

argument:: bounds
if bounds are nil then it returns self, as a PageLayout is compatible with FlowView.  If bounds are supplied then a child FlowView is placed and returned

returns:: self or a new FlowView

METHOD:: bounds
inner bounds of the top level view.

returns:: a Rect

METHOD:: asPageLayout
Similar to asFlowView, this message converts nil and various other objects to a PageLayout. This is already a PageLayout, so it returns self.

argument:: name
Ignored. If the receiver had been nil then the name would be the Window name. 

argument:: bounds
Ignored. Would have been used to size the PageLayout

returns:: self

METHOD:: startRow
compatible with FlowView

returns:: self

METHOD:: indentedRemaining
compatible with FlowView

returns:: self

METHOD:: checkNotClosed
isClosed.not

returns:: boolean

METHOD:: front
bring Window to the front

returns:: self

METHOD:: hide
Hide window

returns:: self

METHOD:: show
Show the window if it was previously hidden.

returns:: self

METHOD:: close
Close the window, releasing any dependencies and calling the onClose handler.

returns:: self

METHOD:: refresh
Refresh the top level view

returns:: self

METHOD:: background
set background color of top level view

argument:: c
color

returns:: self

METHOD:: removeOnClose
Register an object, usually a ObjectGui subclass or an Updater so that when the Window closes the .remove message will be sent to it. This will cause the object to release its dependencies on its Model.  This means the ObjectGui (or other controller object) will stop getting update messages and will stop trying to update the View which has just been closed along with the Window.  It also means that if there is no link to the Model and no longer any Views that held links to the controller object, that the controller is now unreferenced and will be garbage collected.

argument:: dependant
the object that wishes to be sent .remove on closing the window

returns:: self

METHOD:: resizeToFit
Resize the top FlowView to fit its contents and then resize the Window to fit that.=

argument:: reflow
boolean: FlowView can relay all of its child views in cases where the bounds have changed or views have been removed.  This puts them all back in place one by one for the updated bounds.  So this may result in smaller over all bounds, after which the window is shrunk.

argument:: center
boolean: after resizing, re-center the window in the screen.

returns:: self

METHOD:: reflowAll
see FlowView reflowAll

returns:: self

METHOD:: fullScreen
go Full screen

returns:: self

METHOD:: endFullScreen
end full screen

returns:: self

subsection::FlowView extensions

METHOD:: flow
Place a new FlowView on the window

argument:: func
A handler that recieves the new FlowView as argument

argument:: bounds
Bounds fo the FlowView

returns:: (returnvalue)

METHOD:: vert
(describe method here)

argument:: func
(describe argument here)

argument:: bounds
(describe argument here)

argument:: spacing
(describe argument here)

returns:: (returnvalue)

METHOD:: horz
(describe method here)

argument:: func
(describe argument here)

argument:: bounds
(describe argument here)

argument:: spacing
(describe argument here)

returns:: (returnvalue)

METHOD:: comp
(describe method here)

argument:: func
(describe argument here)

argument:: bounds
(describe argument here)

returns:: (returnvalue)

METHOD:: scroll
(describe method here)

argument::  ... args
(describe argument here)

returns:: (returnvalue)


EXAMPLES::

code::
PageLayout.new
::