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 = 0, bufsize = 4096, zoom = 1, rate = \audio, view, bufnum;
63 index = index.asControlInput;
65 if (GUI.id == \qt and:
66 { server.serverRunning and: server.hasShmInterface.not })
68 ^GUI.current.stethoscope1.new
69 (server, numChannels, index, bufsize, zoom, rate, view, bufnum)
71 ^super.new(server, numChannels, index, bufsize, zoom, rate, view, bufnum)
74 *key { ^\stethoscope }
77 ScopeView : ViewRedirect { *key { ^\scopeView }}
78 FreqScopeView : ViewRedirect { *key { ^\freqScopeView }} // redirects to FreqScope
80 FreqScope : GuiRedirect { // redirects to FreqScopeWindow
81 *new { arg width=512, height=300, busNum=0, scopeColor, bgColor;
82 busNum = busNum.asControlInput;
83 ^super.new(width, height, busNum, scopeColor)
88 Dialog : GuiRedirect {
90 *openPanel { arg okFunc, cancelFunc, multipleSelection=false;
91 ^super.openPanel(okFunc, cancelFunc, multipleSelection)
93 *savePanel { arg okFunc, cancelFunc;
94 ^super.savePanel(okFunc, cancelFunc)
98 View : ViewRedirect { *key { ^\view }}
100 RangeSlider : ViewRedirect { *key { ^\rangeSlider }}
101 Slider2D : ViewRedirect { *key { ^\slider2D }}
102 TabletSlider2D : ViewRedirect { *key { ^\tabletSlider2D }}
103 Button : ViewRedirect { *key { ^\button }}
105 PopUpMenu : ViewRedirect { *key { ^\popUpMenu }}
106 StaticText : ViewRedirect { *key { ^\staticText }}
107 NumberBox : ViewRedirect { *key { ^\numberBox }}
108 ListView : ViewRedirect { *key { ^\listView }}
110 DragSource : ViewRedirect { *key { ^\dragSource }}
111 DragSink : ViewRedirect { *key { ^\dragSink }}
112 DragBoth : ViewRedirect { *key { ^\dragBoth }}
114 UserView : ViewRedirect { *key { ^\userView }}
115 MultiSliderView : ViewRedirect { *key { ^\multiSliderView }}
116 EnvelopeView : ViewRedirect { *key { ^\envelopeView }}
118 TextField : ViewRedirect { *key { ^\textField }}
121 TabletView : ViewRedirect { *key { ^\tabletView }}
122 SoundFileView : ViewRedirect { *key { ^\soundFileView }}
123 MovieView : ViewRedirect { *key { ^\movieView }}
124 TextView : ViewRedirect { *key { ^\textView }}
128 *findFirstAvailable { |fontNames, action|
130 fontNames.do { |name|
131 if(this.availableFonts.any(_.contains(name))) {
138 *new { arg name, size, bold = false, italic = false, isPointSize = false;
139 ^super.new(name, size, bold, italic, isPointSize)
143 Knob : ViewRedirect { *key { ^\knob }}
145 LevelIndicator : ViewRedirect { *key { ^\levelIndicator }}
147 Image : ViewRedirect { *key { ^\image }}
149 WebView : ViewRedirect { *key { ^\webView }}
151 CheckBox : ViewRedirect { *key { ^\checkBox }}
153 TreeView : ViewRedirect { *key { ^\treeView }}
155 HLayout : GuiRedirect { *key { ^\hLayout }}
156 VLayout : GuiRedirect { *key { ^\vLayout }}
157 GridLayout : GuiRedirect { *key { ^\gridLayout }}
158 StackLayout : GuiRedirect { *key { ^\stackLayout } }