2 var <stringColor, <font, <editable;
3 var <autohidesScrollers, <hasHorizontalScroller, <hasVerticalScroller, <textBounds;
4 var <usesTabToFocusNextView=true, <enterInterpretsSelection=true;
7 mouseUp {arg x, y, modifiers, buttonNumber, clickCount, clickPos;
8 mouseUpAction.value(this, x, y, modifiers, buttonNumber, clickCount, clickPos); }
10 doLinkAction { arg url, description;
11 linkAction.value(this, url, description);
15 ^this.getProperty(\string);
19 ^this.setString(str, -1);
23 ^this.getProperty(\selectedString);
27 this.setProperty(\selectedString, str);
31 ^this.getProperty(\selectedRangeLocation);
35 ^this.getProperty(\selectedRange);
39 ^this.getProperty(\path);
42 stringColor_ {arg color;
44 this.setStringColor(color,-1, 0);
47 setStringColor{arg color, rangeStart = -1, rangeSize = 0;
48 this.setProperty(\setTextColor, [color,rangeStart, rangeSize]);
52 this.setProperty(\setSyntaxColors);
57 this.setFont(font, -1, 0)
60 setFont{| font, rangestart = -1, rangesize=0|
61 this.setProperty(\setFont, [font, rangestart, rangesize]);
64 usesAutoInOutdent_{|bool|
65 this.setProperty(\setUsesAutoInOutdent, bool);
68 setString{|string, rangestart=0, rangesize=0|
69 this.setProperty(\insertStringInRange, [string, rangestart, rangesize]);
74 this.setProperty(\setEditable, bool);
80 usesTabToFocusNextView_{|bool|
81 usesTabToFocusNextView=bool;
82 this.setProperty(\usesTabToFocusNextView, bool);
84 enterInterpretsSelection_{|bool|
85 enterInterpretsSelection=bool;
86 this.setProperty(\enterExecutesSelection, bool);
88 autohidesScrollers_{|bool|
89 autohidesScrollers = bool;
90 this.setProperty(\setAutohidesScrollers, bool);
92 hasHorizontalScroller_{|bool|
93 hasHorizontalScroller = bool;
94 this.setProperty(\setHasHorizontalScroller, bool);
96 hasVerticalScroller_{|bool|
97 hasVerticalScroller = bool;
98 this.setProperty(\setHasVerticalScroller, bool);
103 this.setProperty(\textBounds, rect);
107 if ( path.contains( "://" ).not, {
108 if ( path.first.asString != "/" ) { path = String.scDir +/+ path; };
109 path = "file://"++path;
111 path = path.replace(" ", "%20");
112 this.setProperty(\open, path);
115 *paletteExample{ arg parent, bounds;
116 ^this.new(parent, bounds).string_("The quick brown fox jumps over the lazy dog.");
120 SCMovieView : SCView{
121 var <rate, <loopMode, <muted, <path, <editable;
125 0 Playback runs forward and backward between both endpoints.
126 1 Restarts playback at beginning when end is reached.
127 2 Playback stops when end is reached.
131 this.setProperty(\start);
135 this.setProperty(\stop);
140 this.setProperty(\setMovie, moviePath);
145 this.setProperty(\setMuted, bool);
148 playSelectionOnly_{|bool|
149 this.setProperty(\setPlaysSelectionOnly, bool);
154 this.setProperty(\setRate, ratein);
159 this.setProperty(\setLoopMode, mode);
163 this.setProperty(\gotoEnd);
166 this.setProperty(\stepForward);
170 this.setProperty(\stepBack);
174 this.setProperty(\gotoBeginning);
178 this.setProperty(\setCurrentTime, time);
182 //"SCMovieView-currentTime is not implemented".warn;
183 ^this.getProperty(\getCurrentTime);
188 this.setProperty(\setEditable, bool);
191 showControllerAndAdjustSize{|show, adjust|
192 this.setProperty(\showControllerAndAdjustSize, [show, adjust]);
195 resizeWithMagnification{|size|
196 this.setProperty(\resizeWithMagnification, size)
200 this.setProperty(\copy);
203 this.setProperty(\clear);
206 this.setProperty(\cut);
209 this.setProperty(\paste);
212 *paletteExample{ arg parent, bounds;
213 ^this.new(parent, bounds).path_("Help/GUI/Cocoa-GUI/SCImage/flowers2.jpg");
220 var <>onLoadFinished, <>onLoadFailed, <onLinkActivated, <enterInterpretsSelection=true;
223 if ( path.contains( "://" ).not, {
224 if ( path.first.asString != "/" ) { path = String.scDir +/+ path; };
225 path = "file://"++path;
227 path = path.replace(" ", "%20");
228 this.setProperty(\url, path);
231 url { ^this.getProperty(\url);}
233 title { ^this.getProperty(\title);}
235 forward { this.setProperty(\forward);}
237 back { this.setProperty(\back);}
239 reload { this.setProperty(\reload);}
241 didLoad { onLoadFinished.value(this); }
243 didFail { onLoadFailed.value(this); }
245 // Get the displayed content in html form.
246 html { ^this.getProperty(\html); }
249 html_ { arg htmlString;
250 this.setProperty(\html, htmlString);
253 editable_ { arg bool;
254 this.setProperty(\editable, bool);
257 selectedText { ^this.getProperty(\selectedText); }
259 // Try to extract plain text from html content and return it.
260 plainText { ^this.getProperty(\plainText); }
262 onLinkActivated_{|func|
263 onLinkActivated = func;
264 this.setProperty(\handleLinks, func.isNil);
267 linkActivated {|linkString| onLinkActivated.value(this, linkString) }
269 findText { arg string, reverse = false;
270 this.setProperty( \findText, [string, reverse] );
273 enterInterpretsSelection_{|bool|
274 enterInterpretsSelection=bool;
275 this.setProperty(\enterExecutesSelection, bool);
278 setFontFamily { arg generic, specific;
279 this.setProperty(\fontFamily, [generic, specific]);
282 *paletteExample{ arg parent, bounds;
283 ^this.new(parent, bounds).url_("http://supercollider.sourceforge.net");