1 ViewRedirect { // Abstract class
3 classvar <>redirectQueries = false;
10 ^GUI.scheme.perform(this.key)
12 *key { ^\viewRedirect }
13 *new { arg parent, bounds;
15 if ( this.implScheme.notNil ){
16 if((impl = this.implClass).notNil) {
17 ^impl.new(parent, bounds)
19 MethodError("ViewRedirect is an abstract class and should not be instantiated directly. *new method not valid.", this).throw;}
21 ("No GUI scheme active: " + this.key ++ ".new" + parent ).warn;
24 *browse { ^ClassBrowser(this.implClass ?? { ViewRedirect }) }
25 *doesNotUnderstand{|selector ... args|
27 if ( this.implScheme.notNil ){
28 if((impl = this.implClass).notNil) {
29 ^impl.perform(selector, *args)
31 DoesNotUnderstandError(this, selector, args).throw;
34 ("No GUI scheme active: " + selector + args ).warn;
37 *classRedirect { ^redirectQueries.if({this.implClass ? this}, this)}
40 Window : ViewRedirect {
42 *new { arg name = "panel", bounds, resizable = true, border = true, server, scroll = false;
43 ^this.implClass.new(name, bounds, resizable, border, server, scroll)
47 CompositeView : ViewRedirect { *key { ^\compositeView }}
48 ScrollView : ViewRedirect { *key { ^\scrollView }}
49 HLayoutView : ViewRedirect { *key { ^\hLayoutView }}
50 VLayoutView : ViewRedirect { *key { ^\vLayoutView }}
52 Slider : ViewRedirect { *key { ^\slider }}
57 //Font : ViewRedirect { *key { ^\font }}
58 Pen : ViewRedirect { *key { ^\pen }}
60 Stethoscope : ViewRedirect {
61 *new { arg server, numChannels = 2, index, bufsize = 4096, zoom, rate, view, bufnum;
62 index = index.asControlInput;
63 ^this.implClass.new(server, numChannels, index, bufsize, zoom, rate, view, bufnum)
65 *key { ^\stethoscope }
68 ScopeView : ViewRedirect { *key { ^\scopeView }}
69 FreqScopeView : ViewRedirect { *key { ^\freqScopeView }} // redirects to FreqScope
71 FreqScope : ViewRedirect { // redirects to FreqScopeWindow
72 *new { arg width=512, height=300, busNum=0, scopeColor, bgColor;
73 busNum = busNum.asControlInput;
74 ^this.implClass.new(width, height, busNum, scopeColor)
79 Dialog : ViewRedirect { *key { ^\dialog }}
80 View : ViewRedirect { *key { ^\view }}
82 RangeSlider : ViewRedirect { *key { ^\rangeSlider }}
83 Slider2D : ViewRedirect { *key { ^\slider2D }}
84 TabletSlider2D : ViewRedirect { *key { ^\tabletSlider2D }}
85 Button : ViewRedirect { *key { ^\button }}
87 PopUpMenu : ViewRedirect { *key { ^\popUpMenu }}
88 StaticText : ViewRedirect { *key { ^\staticText }}
89 NumberBox : ViewRedirect { *key { ^\numberBox }}
90 ListView : ViewRedirect { *key { ^\listView }}
92 DragSource : ViewRedirect { *key { ^\dragSource }}
93 DragSink : ViewRedirect { *key { ^\dragSink }}
94 DragBoth : ViewRedirect { *key { ^\dragBoth }}
96 UserView : ViewRedirect { *key { ^\userView }}
97 MultiSliderView : ViewRedirect { *key { ^\multiSliderView }}
98 EnvelopeView : ViewRedirect { *key { ^\envelopeView }}
100 TextField : ViewRedirect { *key { ^\textField }}
103 TabletView : ViewRedirect { *key { ^\tabletView }}
104 SoundFileView : ViewRedirect { *key { ^\soundFileView }}
105 MovieView : ViewRedirect { *key { ^\movieView }}
106 TextView : ViewRedirect { *key { ^\textView }}
108 Font : ViewRedirect {
110 *findFirstAvailable { |fontNames, action|
112 fontNames.do { |name|
113 if(this.availableFonts.any(_.contains(name))) {
122 Knob : ViewRedirect { *key { ^\knob }}
124 LevelIndicator : ViewRedirect { *key { ^\levelIndicator }}
126 Image : ViewRedirect { *key { ^\image }}
128 WebView : ViewRedirect { *key { ^\webView }}
130 CheckBox : ViewRedirect { *key { ^\checkBox }}
132 TreeView : ViewRedirect { *key { ^\treeView }}
134 LayoutRedirect : ViewRedirect {
136 ^this.implClass.new(*args);
140 HLayout : LayoutRedirect { *key { ^\hLayout }}
141 VLayout : LayoutRedirect { *key { ^\vLayout }}
142 GridLayout : LayoutRedirect { *key { ^\gridLayout }}