1 GuiRedirect { // Abstract
2 classvar <>redirectQueries = false;
9 var scheme, key, target;
12 Error("No GUI scheme active.", this).throw
15 target = key !? {GUI.scheme.tryPerform(key)};
17 Error("No redirection for" + this.name + "available in the active GUI scheme:" +
18 scheme.id ++ ".", this).throw;
23 *classRedirect { ^redirectQueries.if({this.implClass ? this}, this)}
28 ^this.implClass.new(*args);
31 *doesNotUnderstand{|selector ... args|
33 ^this.implClass.perform(selector, *args);
36 *browse { ^ClassBrowser( this.key !? {this.implClass} ? this ) }
39 ViewRedirect : GuiRedirect { // Abstract class
40 *new { arg parent, bounds;
41 ^super.new(parent, bounds);
45 Window : GuiRedirect {
47 *new { arg name = "panel", bounds, resizable = true, border = true, server, scroll = false;
48 ^super.new(name, bounds, resizable, border, server, scroll)
52 CompositeView : ViewRedirect { *key { ^\compositeView }}
53 ScrollView : ViewRedirect { *key { ^\scrollView }}
54 HLayoutView : ViewRedirect { *key { ^\hLayoutView }}
55 VLayoutView : ViewRedirect { *key { ^\vLayoutView }}
57 Slider : ViewRedirect { *key { ^\slider }}
59 Pen : GuiRedirect { *key { ^\pen }}
61 Stethoscope : GuiRedirect {
62 *new { arg server, numChannels = 2, index, bufsize = 4096, zoom, rate, view, bufnum;
63 index = index.asControlInput;
64 ^super.new(server, numChannels, index, bufsize, zoom, rate, view, bufnum)
66 *key { ^\stethoscope }
69 ScopeView : ViewRedirect { *key { ^\scopeView }}
70 FreqScopeView : ViewRedirect { *key { ^\freqScopeView }} // redirects to FreqScope
72 FreqScope : GuiRedirect { // redirects to FreqScopeWindow
73 *new { arg width=512, height=300, busNum=0, scopeColor, bgColor;
74 busNum = busNum.asControlInput;
75 ^super.new(width, height, busNum, scopeColor)
80 Dialog : GuiRedirect {
82 *openPanel { arg okFunc, cancelFunc, multipleSelection=false;
83 ^super.openPanel(okFunc, cancelFunc, multipleSelection)
85 *savePanel { arg okFunc, cancelFunc;
86 ^super.savePanel(okFunc, cancelFunc)
90 View : ViewRedirect { *key { ^\view }}
92 RangeSlider : ViewRedirect { *key { ^\rangeSlider }}
93 Slider2D : ViewRedirect { *key { ^\slider2D }}
94 TabletSlider2D : ViewRedirect { *key { ^\tabletSlider2D }}
95 Button : ViewRedirect { *key { ^\button }}
97 PopUpMenu : ViewRedirect { *key { ^\popUpMenu }}
98 StaticText : ViewRedirect { *key { ^\staticText }}
99 NumberBox : ViewRedirect { *key { ^\numberBox }}
100 ListView : ViewRedirect { *key { ^\listView }}
102 DragSource : ViewRedirect { *key { ^\dragSource }}
103 DragSink : ViewRedirect { *key { ^\dragSink }}
104 DragBoth : ViewRedirect { *key { ^\dragBoth }}
106 UserView : ViewRedirect { *key { ^\userView }}
107 MultiSliderView : ViewRedirect { *key { ^\multiSliderView }}
108 EnvelopeView : ViewRedirect { *key { ^\envelopeView }}
110 TextField : ViewRedirect { *key { ^\textField }}
113 TabletView : ViewRedirect { *key { ^\tabletView }}
114 SoundFileView : ViewRedirect { *key { ^\soundFileView }}
115 MovieView : ViewRedirect { *key { ^\movieView }}
116 TextView : ViewRedirect { *key { ^\textView }}
120 *findFirstAvailable { |fontNames, action|
122 fontNames.do { |name|
123 if(this.availableFonts.any(_.contains(name))) {
130 *new { arg name, size, bold = false, italic = false, isPointSize = false;
131 super.new(name, size, bold, italic, isPointSize)
135 Knob : ViewRedirect { *key { ^\knob }}
137 LevelIndicator : ViewRedirect { *key { ^\levelIndicator }}
139 Image : ViewRedirect { *key { ^\image }}
141 WebView : ViewRedirect { *key { ^\webView }}
143 CheckBox : ViewRedirect { *key { ^\checkBox }}
145 TreeView : ViewRedirect { *key { ^\treeView }}
147 HLayout : GuiRedirect { *key { ^\hLayout }}
148 VLayout : GuiRedirect { *key { ^\vLayout }}
149 GridLayout : GuiRedirect { *key { ^\gridLayout }}