Products Applications Downloads Features Wiki forum Store

Panel Value

From Wiki077
Jump to: navigation, search

Panel Values hold the current control panel state of Panel Components. Panel Values change based on users interactions with control panels.

Panel values are accessed in 4 ways:

  • Panel values can be viewed by middle-clicking on a panel component to bring up its info box.
  • The Panel CHOP is used to view and access all the panel values of the component.
  • The panel() expression returns a panel value.

Panel values are changed:

  • when users interact with the panels.
  • when the click command is used.
  • when the controlpanel command is used.

Contents

General Panel Values

The list below gives a brief description of all the panel values. Some of the values do not have an effect on some panel types, they are described below.

  • select - value=1 when left, middle, or right mouse button is pressed over the panel.
  • lselect - value=1 when left mouse button is pressed.
  • mselect - value=1 when middle mouse button is pressed.
  • rselect - value=1 when right mouse button is pressed.
  • dragout - when you click in the gadget, drag out of the gadget and release, it goes 0 to 1 when you release outside. It gets set to 0 any time you click inside the gadget.
  • ldragout - same as dragout, but only when left mouse is used.
  • mdragout - same as dragout, but only when middle mouse is used.
  • rdragout - same as dragout, but only when right mouse is used.
  • ctrl - value=1 if Ctrl key is down when panel is clicked on.
  • alt - value=1 if Alt key is down when panel is clicked on.
  • shift - value=1 if Shift key is down when panel is clicked on.
  • u and v - corresponds to the x and y position of the cursor. Updated whenever any mouse button is pressed over the panel.
  • trueu and truev - in all panels. By default they are the same as u and v. When in Relative UV mode, they continue to behave the same as they do when not in Relative UV mode (they don’t go into relative mode).
  • rollu and rollv - give the gadget's u and v cursor position when rolling over a gadget.
  • dragrollu and dragrollv - give the gadget's u and v cursor position when dragging and rolling over a gadget.
  • dragrollover - switches from 0 to 1 when something that can be dropped is dragged over.
  • rollover - value=1 whenever the cursor is over the panel and that panel is the foremost element. NOTE: This differs from the inside value which does not need to be in the foreground.
  • inside - value=1 whenever the cursor is anywhere over the panel.
  • children - the number of components in the network inside the gadget (not including children of children).
  • display - the current value of the panel's display parameter.
  • enable - 1 if the panel is enabled, 0 otherwise.
  • key - the most recent key that was pressed while cursor was over this gadget, followed in time by 0.
  • focusselect - 1 if you have last clicked in this panel, 0 otherwise. It keeps track of focus hierarchy, which is set by mouse clicks (any of the left/middle/right mouse buttons). If a panel is clicked on, its and all the panels in its parent hierarchy will have their focusselect value set to 1. If you click on a different panel, the focusselect of the common ancestors of the two panels will remain unchanged, the first panel and ancestors not shared will have its value set to 0, and the new panel and unset ancestors will have its value set to 1. Do not modify this value directly, instead, use controlpanel -b path to set the focusselect of a panel.
  • click - counts the number of consecutive clicks separated by .6 seconds or less.
  • winopen - 1 if panel is open as a floating window, 0 otherwise.
  • winopen_perform - 1 if panel is open as the Perform mode window.
  • wheel - sends a pulse of a positive or negative number and then back to 0 when the mouse wheel is used.
  • screenw, screenh - gets updated with the most recent window size of the panel. Node Viewers do not affect this value. Use these values in expressions in TOPs to get them to render at a specific resolutions. Use with caution, as multiple viewers will conflict with each other.
  • screenwm, screenhm - Screen Width Margin and Screen Height Margin panel values get the screen coordinates of a panel after margins are taken into account.
  • drag - 1 if the panel is currently being dragged.
  • drop - 1 when the panel is dropped.

Slider Only Panel Values

  • stateu and statev - (may be obsolete, use u, v, trueu, truev) corresponds to the x and y position of the cursor. Updated whenever any mouse button is pressed over the slider panel. stateu/statev differ from u/v in that the Slider's 'Slider Page' parameters (Zone, Range, Clamp, etc.) are used to determine the result of stateu/statev.

Button Only Panel Values

  • state - (button only) For momentary or toggle buttons, the value toggles on=1/off=0 with any mouse click over the panel. For Sliders, the value matches stateu when the slider type is 'Slider U', and statev when the slider type is 'Slider V'. state does nothing for slider type 'Slider UV'.
  • lstate - (button only) value toggles on=1/off=0 with a left mouse click over the panel.
  • mstate - (button only) value toggles on=1/off=0 with a middle mouse click over the panel.
  • rstate - (button only) value toggles on=1/off=0 with a right mouse click over the panel.
  • picked - (button only) the picked panel value works in conjunction with shift or ctrl clicking a button component. When shift or ctrl clicking multiple momentary buttons the last one clicked will hold the state panel value where all others state panel values will be set to 1. Here is where the picked panel value helps out as it remains at 1 until you click select a single button.

Radio and Exclusive Buttons Only Panel Values

  • radio - index of which radio/exclusive button is selected by any mouse click. The index starts at 0 and the radio buttons are sorted in alphanumeric order. When using the exclusive button type, a value of -1 is used to indicate no button is selected after clicking a button twice in succession.
  • lradio - index of which radio/exclusive button is selected by a left mouse click.
  • mradio - index of which radio/exclusive button is selected by a middle mouse click.
  • rradio - index of which radio/exclusive button is selected by a right mouse click.
  • radioname - returns the name (string) of the button selected in the radio variable. Use this in an expression or function.
  • lradioname - returns the name (string) of the button selected in the lradio variable. Use this in an expression or function.
  • mradioname - returns the name (string) of the button selected in the mradio variable. Use this in an expression or function.
  • rradioname - returns the name (string) of the button selected in the rradio variable. Use this in an expression or function.

Field Only Panel Values

  • key - this value is set with the ASCII code of the key when it is hit on the keyboard. it is immediately followed by the value of 0.
  • invalidkey - value is pulsed whenever an invalid key is pressed. An example is pressing an alphanumeric key 'a' on a field set to numeric, the invalidkey panel value would pulse to 97 then 0 in this case.
  • focus - focus is set when you click on a field. when focus is 1, you can type if the field is editable.
Personal tools