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 if(server.hasShmInterface and: { GUI.current.respondsTo(\stethoscope2) }) {
65 ^Stethoscope2(server, numChannels, index, bufsize, zoom, rate, view, bufnum)
67 // if server has shared mem but current gui doesn't support,
68 // this should show the "scoping on internal server only" message
69 ^super.new(server, numChannels, index, bufsize, zoom, rate, view, bufnum)
72 *key { ^\stethoscope }
74 Stethoscope2 : GuiRedirect {
75 *new { arg server, numChannels = 2, index, bufsize = 4096, zoom, rate, view, bufnum;
76 index = index.asControlInput;
77 if(server.hasShmInterface) {
78 ^super.new(server, numChannels, index, bufsize, zoom, rate, view, bufnum)
80 ^Stethoscope(server, numChannels, index, bufsize, zoom, rate, view, bufnum)
83 *key { ^\stethoscope2 }
85 ScopeView : ViewRedirect { *key { ^\scopeView }}
86 FreqScopeView : ViewRedirect { *key { ^\freqScopeView }} // redirects to FreqScope
88 FreqScope : GuiRedirect { // redirects to FreqScopeWindow
89 *new { arg width=512, height=300, busNum=0, scopeColor, bgColor;
90 busNum = busNum.asControlInput;
91 ^super.new(width, height, busNum, scopeColor)
96 Dialog : GuiRedirect {
98 *openPanel { arg okFunc, cancelFunc, multipleSelection=false;
99 ^super.openPanel(okFunc, cancelFunc, multipleSelection)
101 *savePanel { arg okFunc, cancelFunc;
102 ^super.savePanel(okFunc, cancelFunc)
106 View : ViewRedirect { *key { ^\view }}
108 RangeSlider : ViewRedirect { *key { ^\rangeSlider }}
109 Slider2D : ViewRedirect { *key { ^\slider2D }}
110 TabletSlider2D : ViewRedirect { *key { ^\tabletSlider2D }}
111 Button : ViewRedirect { *key { ^\button }}
113 PopUpMenu : ViewRedirect { *key { ^\popUpMenu }}
114 StaticText : ViewRedirect { *key { ^\staticText }}
115 NumberBox : ViewRedirect { *key { ^\numberBox }}
116 ListView : ViewRedirect { *key { ^\listView }}
118 DragSource : ViewRedirect { *key { ^\dragSource }}
119 DragSink : ViewRedirect { *key { ^\dragSink }}
120 DragBoth : ViewRedirect { *key { ^\dragBoth }}
122 UserView : ViewRedirect { *key { ^\userView }}
123 MultiSliderView : ViewRedirect { *key { ^\multiSliderView }}
124 EnvelopeView : ViewRedirect { *key { ^\envelopeView }}
126 TextField : ViewRedirect { *key { ^\textField }}
129 TabletView : ViewRedirect { *key { ^\tabletView }}
130 SoundFileView : ViewRedirect { *key { ^\soundFileView }}
131 MovieView : ViewRedirect { *key { ^\movieView }}
132 TextView : ViewRedirect { *key { ^\textView }}
136 *findFirstAvailable { |fontNames, action|
138 fontNames.do { |name|
139 if(this.availableFonts.any(_.contains(name))) {
146 *new { arg name, size, bold = false, italic = false, isPointSize = false;
147 ^super.new(name, size, bold, italic, isPointSize)
151 Knob : ViewRedirect { *key { ^\knob }}
153 LevelIndicator : ViewRedirect { *key { ^\levelIndicator }}
155 Image : ViewRedirect { *key { ^\image }}
157 WebView : ViewRedirect { *key { ^\webView }}
159 CheckBox : ViewRedirect { *key { ^\checkBox }}
161 TreeView : ViewRedirect { *key { ^\treeView }}
163 HLayout : GuiRedirect { *key { ^\hLayout }}
164 VLayout : GuiRedirect { *key { ^\vLayout }}
165 GridLayout : GuiRedirect { *key { ^\gridLayout }}
166 StackLayout : GuiRedirect { *key { ^\stackLayout } }