rsc3/doc-schelp/Help-3.12.2/Classes/EZGui.html

150 lines
15 KiB
HTML
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
<html><head><title>EZGui</title>
<link rel='stylesheet' href='./../scdoc.css' type='text/css' />
<link rel='stylesheet' href='./../frontend.css' type='text/css' />
<link rel='stylesheet' href='./../custom.css' type='text/css' />
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<script src='./../scdoc.js' type='text/javascript'></script>
<script src='./../docmap.js' type='text/javascript'></script>
<script src='./../prettify.js' type='text/javascript'></script>
<script src='./../lang-sc.js' type='text/javascript'></script>
<script type='text/javascript'>var helpRoot='./..';</script>
</head>
<ul id='menubar'></ul>
<body onload='fixTOC();prettyPrint()'>
<div class='contents'>
<div class='header'>
<div id='label'>SuperCollider CLASSES</div>
<div id='categories'><a href='./../Browse.html#GUI>EZ-GUI'>GUI>EZ-GUI</a></div>
<h1>EZGui</h1>
<div id='summary'>An abstract superclass for EZ widget wrappers</div>
</div>
<div class='subheader'>
<div id='filename'>Source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/GUI/Base/EZgui.sc'>/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/GUI/Base/EZgui.sc</a></div><div id='superclasses'>Inherits from: <a href="../Classes/Object.html">Object</a></div>
<div id='subclasses'>Subclasses: <a href="../Classes/EZControlSpecEditor.html">EZControlSpecEditor</a>, <a href="../Classes/EZKnob.html">EZKnob</a>, <a href="../Classes/EZLists.html">EZLists</a>, <a href="../Classes/EZNumber.html">EZNumber</a>, <a href="../Classes/EZRanger.html">EZRanger</a>, <a href="../Classes/EZSlider.html">EZSlider</a>, <a href="../Classes/EZText.html">EZText</a></div>
<div id='related'>See also: <a href="./../Classes/EZListView.html">EZListView</a>, <a href="./../Classes/EZPopUpMenu.html">EZPopUpMenu</a>, <a href="./../Classes/EZSlider.html">EZSlider</a>, <a href="./../Classes/EZNumber.html">EZNumber</a>, <a href="./../Classes/EZRanger.html">EZRanger</a>, <a href="./../Classes/EZKnob.html">EZKnob</a></div>
</div>
<div id='toc'>
<ul class='toc'><li class='toc1'><a href='#description'>Description</a></li>
<ul class='toc'></ul><li class='toc1'><a href='#classmethods'>Class methods</a></li>
<ul class='toc'><li class='toc2'><a href='#Inherited%20class%20methods'>Inherited class methods</a></li>
</ul><li class='toc1'><a href='#instancemethods'>Instance methods</a></li>
<ul class='toc'><li class='toc2'><a href='#Accessing%20Instance%20Variables'>Accessing Instance Variables</a></li>
<ul class='toc'><li class='toc3'><a href='#-view'>view</a> </li>
<li class='toc3'><a href='#-bounds'>bounds</a> </li>
<li class='toc3'><a href='#-label'>label</a> </li>
<li class='toc3'><a href='#-window'>window</a> </li>
</ul><li class='toc2'><a href='#Accessing%20GUI%20options'>Accessing GUI options</a></li>
<ul class='toc'><li class='toc3'><a href='#-alwaysOnTop'>alwaysOnTop</a> </li>
<li class='toc3'><a href='#-visible'>visible</a> </li>
<li class='toc3'><a href='#-enabled'>enabled</a> </li>
<li class='toc3'><a href='#-onClose'>onClose</a> </li>
<li class='toc3'><a href='#-font'>font</a> </li>
</ul><li class='toc2'><a href='#Subclassing'>Subclassing</a></li>
<ul class='toc'><li class='toc3'><a href='#-widget'>widget</a> </li>
<li class='toc3'><a href='#-action'>action</a> </li>
<li class='toc3'><a href='#-value'>value</a> </li>
<li class='toc3'><a href='#-valueAction'>valueAction</a> </li>
<li class='toc3'><a href='#-doAction'>doAction</a> </li>
</ul><li class='toc2'><a href='#Internal%20Utilities'>Internal Utilities</a></li>
<ul class='toc'><li class='toc3'><a href='#-prSubViewBounds'>prSubViewBounds</a> </li>
<li class='toc3'><a href='#-prMakeView'>prMakeView</a> </li>
<li class='toc3'><a href='#-prSetViewParams'>prSetViewParams</a> </li>
<li class='toc3'><a href='#-prMakeMarginGap'>prMakeMarginGap</a> </li>
</ul><li class='toc2'><a href='#Inherited%20instance%20methods'>Inherited instance methods</a></li>
<li class='toc2'><a href='#Undocumented%20instance%20methods'>Undocumented instance methods</a></li>
<ul class='toc'><li class='toc3'><a href='#-labelView'>labelView</a> </li>
<li class='toc3'><a href='#-layout'>layout</a> </li>
<li class='toc3'><a href='#-remove'>remove</a> </li>
<li class='toc3'><a href='#-valueActionIfChanged'>valueActionIfChanged</a> </li>
</ul></ul></ul></div><h2><a class='anchor' name='description'>Description</a></h2>
<p>Users will not normally directly create instances of EZGui, but only use it through its subclasses. It provides the basic mechanisms for various EZ widget wrappers. It also provides a standard for EZ GUI Classes, and new EZ Classes should subclass EZGUI to help keep a consistent user interface.<h2><a class='anchor' name='classmethods'>Class Methods</a></h2>
<h3><a class='anchor' name='Inherited%20class%20methods'>Inherited class methods</a></h3>
<div id='inheritedclassmets'></div><h2><a class='anchor' name='instancemethods'>Instance Methods</a></h2>
<h3><a class='anchor' name='Accessing%20Instance%20Variables'>Accessing Instance Variables</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-view' href='./../Overviews/Methods.html#view'>view</a> </h3>
<div class='method'>
<p>Returns the enclosing <a href="./../Classes/CompositeView.html">CompositeView</a>.</div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-bounds' href='./../Overviews/Methods.html#bounds'>bounds</a> </h3>
<div class='method'>
<p>Returns the bounds of the enclosing <a href="./../Classes/CompositeView.html">CompositeView</a>.</div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-label' href='./../Overviews/Methods.html#label'>label</a>: METHOD NOT FOUND!</h3>
<div class='method'>
<p>Sets/gets it the label. Will add the label view if none was initially created.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>string<td class='argumentdesc'>
<p>An Instance of <a href="./../Classes/String.html">String</a>.</table></div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-window' href='./../Overviews/Methods.html#window'>window</a> </h3>
<div class='method'>
<p>Returns the window if you used the popUp window function.</div><h3><a class='anchor' name='Accessing%20GUI%20options'>Accessing GUI options</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-alwaysOnTop' href='./../Overviews/Methods.html#alwaysOnTop'>alwaysOnTop</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-alwaysOnTop' href='./../Overviews/Methods.html#alwaysOnTop'>alwaysOnTop</a> = <span class='argstr'>bool</span></h3>
<div class='method'>
<p>Makes the popup window always on top, if there is one.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>bool<td class='argumentdesc'>
<p>An Instance of <a href="./../Classes/Boolean.html">Boolean</a>. Default is false.</table></div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-visible' href='./../Overviews/Methods.html#visible'>visible</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-visible' href='./../Overviews/Methods.html#visible'>visible</a> = <span class='argstr'>bool</span></h3>
<div class='method'>
<p>Sets/gets it the component views are visible.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>bool<td class='argumentdesc'>
<p>An Instance of <a href="./../Classes/Boolean.html">Boolean</a>. Default is true.</table></div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-enabled' href='./../Overviews/Methods.html#enabled'>enabled</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-enabled' href='./../Overviews/Methods.html#enabled'>enabled</a> = <span class='argstr'>bool</span></h3>
<div class='method'>
<p>Sets/gets if the list is enabled.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>bool<td class='argumentdesc'>
<p>An Instance of <a href="./../Classes/Boolean.html">Boolean</a>. Default is true.</table></div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-onClose' href='./../Overviews/Methods.html#onClose'>onClose</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-onClose' href='./../Overviews/Methods.html#onClose'>onClose</a> = <span class='argstr'>func</span></h3>
<div class='method'>
<p>Sets/gets the onClose function of either <code class='code prettyprint lang-sc'>view</code> or <code class='code prettyprint lang-sc'>window</code>, depending on whether the EZ view used a popup window.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>func<td class='argumentdesc'>
<p>An Instance of <a href="./../Classes/Function.html">Function</a> or <a href="./../Classes/FunctionList.html">FunctionList</a>.</table></div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-font' href='./../Overviews/Methods.html#font'>font</a> = <span class='argstr'>font</span></h3>
<div class='method'><h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>font<td class='argumentdesc'>
<p>An instance of <a href="./../Classes/Font.html">Font</a>.</table></div><h3><a class='anchor' name='Subclassing'>Subclassing</a></h3>
<p>EZGui provides a standard and basic tools for most EZ classes. If you make a new EZ class, then subclass EZGui, and override the necessary methods. If your class only has a label and a widget, chances are, you need to override nothing, but only need to write the new and init class methods. See existing subclasses of EZGui for examples of this. You may also want to override the following:<h3 class='imethodname'><span class='methprefix'>-</span><a name='-widget' href='./../Overviews/Methods.html#widget'>widget</a> </h3>
<div class='method'>
<p>Returns the active widget. Subclasses will typically refer to it or ignore it, e.g.:<pre class='code prettyprint lang-sc'>MyEZClass{
myOtherMethods{}
....
listView{ ^widget }
}</pre>
</div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-action' href='./../Overviews/Methods.html#action'>action</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-action' href='./../Overviews/Methods.html#action'>action</a> = value</h3>
<div class='method'>
<p>Gets/sets the action of the EZ class instance.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>(func)<td class='argumentdesc'>
<p>An Instance of <a href="./../Classes/Function.html">Function</a> or <a href="./../Classes/FunctionList.html">FunctionList</a>.</table></div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-value' href='./../Overviews/Methods.html#value'>value</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-value' href='./../Overviews/Methods.html#value'>value</a> = <span class='argstr'>val</span></h3>
<div class='method'>
<p>Gets/sets the value of the <code class='code prettyprint lang-sc'>widget</code>. Does not perform the action.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>val<td class='argumentdesc'>
<p>An integer.</table></div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-valueAction' href='./../Overviews/Methods.html#valueAction'>valueAction</a> = <span class='argstr'>val</span></h3>
<div class='method'>
<p>Gets/sets the value of the widget. Performs do action.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>val<td class='argumentdesc'>
<p>An integer.</table></div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-doAction' href='./../Overviews/Methods.html#doAction'>doAction</a> </h3>
<div class='method'>
<p>Performs <code class='code prettyprint lang-sc'>this.action.value(this)</code>.</div><h3><a class='anchor' name='Internal%20Utilities'>Internal Utilities</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-prSubViewBounds' href='./../Overviews/Methods.html#prSubViewBounds'>prSubViewBounds</a> (<span class='argstr'>rect</span>, <span class='argstr'>hasLabel</span>)</h3>
<div class='method'>
<p>This calculates the bounds of the subviews and the gaps. It returns an array of Rects, which depends on how many subview there are. Subclasses override this if they have more than one widget.</div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-prMakeView' href='./../Overviews/Methods.html#prMakeView'>prMakeView</a> (<span class='argstr'>parentView</span>, <span class='argstr'>bounds</span>)</h3>
<div class='method'>
<p>Called by init. Returns <code class='code prettyprint lang-sc'>[view, bounds]</code>. The container is either the enclosing Container, or a pop up window with a container.</div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-prSetViewParams' href='./../Overviews/Methods.html#prSetViewParams'>prSetViewParams</a>: METHOD NOT FOUND!</h3>
<div class='method'>
<p>Only defined by some subclasses. Sets the <code class='code prettyprint lang-sc'>resize</code> and <code class='code prettyprint lang-sc'>align</code> of all the views, according to the state of <code class='code prettyprint lang-sc'>layout</code>.</div><h3 class='imethodname'><span class='methprefix'>-</span><a name='-prMakeMarginGap' href='./../Overviews/Methods.html#prMakeMarginGap'>prMakeMarginGap</a> (<span class='argstr'>parentView</span>, <span class='argstr'>argMargin</span>, <span class='argstr'>argGap</span>)</h3>
<div class='method'>
<p>Called in the init method of all subclasses. Sets the margin and gap of <code class='code prettyprint lang-sc'>view</code>. By default, it tries to get its parent's gap, otherwise it defaults to <code class='code prettyprint lang-sc'>2@2</code>. Setting <code class='code prettyprint lang-sc'>argGap</code> overrides these.</div><h3><a class='anchor' name='Inherited%20instance%20methods'>Inherited instance methods</a></h3>
<div id='inheritedinstmets'></div><h3><a class='anchor' name='Undocumented%20instance%20methods'>Undocumented instance methods</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-labelView' href='./../Overviews/Methods.html#labelView'>labelView</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-labelView' href='./../Overviews/Methods.html#labelView'>labelView</a> = value</h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-layout' href='./../Overviews/Methods.html#layout'>layout</a> </h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-remove' href='./../Overviews/Methods.html#remove'>remove</a> </h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-valueActionIfChanged' href='./../Overviews/Methods.html#valueActionIfChanged'>valueActionIfChanged</a> = <span class='argstr'>val</span></h3>
<div class='extmethod'>From extension in <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/GUI/Base/extValueActionIfChanged.sc'>/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/GUI/Base/extValueActionIfChanged.sc</a></div>
<div class='doclink'>helpfile source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/EZGui.schelp'>/Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/EZGui.schelp</a><br>link::Classes/EZGui::<br>sc version: 3.8.0</div></div></body></html>