A WPF implementation of a Spinner Control data object for the ribbon.
This is actually the data representation of a spinner for ribbon. The data representation (its template) is supplied by the MaxSpinnerUserControl class, and is associated in Themes\Spinner.xaml
Public Member Functions |
|
MaxWpfRibbonSpinner () | |
override void | CopyFrom (RibbonItem source) |
virtual void | RunButtonDown (decimal newValue) |
Calls the maxscript callback function with a
new value. |
|
virtual void | RunButtonUp (decimal newValue) |
Calls the maxscript callback function with a
new value. |
|
virtual void | RunEditEnter (decimal newValue) |
Called when the user types in a new value.
|
|
Static Public Attributes |
|
static readonly String | MinPropertyName = "Min" |
static readonly String | MaxPropertyName = "Max" |
static readonly String | InitPropertyName = "Init" |
static readonly String | ScalePropertyName = "Scale" |
static readonly String | ShowTextBoxPropertyName = "ShowTextBox" |
static readonly String | CanSpinPropertyName = "CanSpin" |
static readonly String | IsMouseCapturedPropertyName = "IsMouseCaptured" |
static readonly String | RightClickOnSpinnerBehaviorName = "RightClickOnSpinnerBehavior" |
static readonly String | ValuePropertyName = "Value" |
static readonly String | PrecisionPropertyName = "Precision" |
Protected Member Functions |
|
override void | OnInitialized (object sender, EventArgs e) |
virtual void | OnIsMouseCapturedChanged (EventArgs args) |
virtual void | OnValueChanged (EventArgs args) |
override void | ValueRefresh (String script) |
This is the overriden method that queries
maxscript for the most current value. |
|
override void | ExecuteValueChanged (object newValue) |
Properties |
|
decimal |
Min [get, set] |
The minimum value for this spinner. |
|
decimal |
Max [get, set] |
The maximum value for this spinner. |
|
decimal |
Init [get, set] |
An initial value for this spinner. |
|
decimal |
Scale [get, set] |
The scale determines the increment (per
pixel) and precision of the spinner. |
|
bool |
ShowTextBox [get, set] |
If this value is set to false, then only the
spinner will be shown. |
|
bool |
CanSpin [get, set] |
If this value is false, the spinner cannot
enter Spin mode, but can increment and decrement its value by
clicking or holding the Up and Down arrows of the spinner or
changing the text value. |
|
bool |
IsMouseCaptured [get, set] |
A property that tracks when the user is
interacting with the spinner. |
|
WpfSpinner.RightClickOnSpinnerBehaviorEnum |
RightClickOnSpinnerBehavior [get, set] |
Determines the behaviour of the spinner when
the user right-clicks on it. |
|
decimal |
Value [get, set] |
The Spinner's current valid, committed
Value. |
|
int |
Precision [get, set] |
Events |
|
EventHandler< EventArgs > | IsMouseCapturedChanged |
EventHandler< EventArgs > | ValueChanged |
WPFCustomControls::MaxWpfRibbonSpinner::MaxWpfRibbonSpinner | ( | ) | [inline] |
override void WPFCustomControls::MaxWpfRibbonSpinner::CopyFrom | ( | RibbonItem | source | ) | [inline] |
Reimplemented from WPFCustomControls::MaxWpfControlBase.
override void WPFCustomControls::MaxWpfRibbonSpinner::OnInitialized | ( | object | sender, |
EventArgs | e | ||
) | [inline, protected] |
virtual void WPFCustomControls::MaxWpfRibbonSpinner::OnIsMouseCapturedChanged | ( | EventArgs | args | ) | [inline, protected, virtual] |
virtual void WPFCustomControls::MaxWpfRibbonSpinner::OnValueChanged | ( | EventArgs | args | ) | [inline, protected, virtual] |
virtual void WPFCustomControls::MaxWpfRibbonSpinner::RunButtonDown | ( | decimal | newValue | ) | [inline, virtual] |
Calls the maxscript callback function with a new value.
Normally, this is the beginning delimeter for an undoable action. The newValue parameter is the current spinner Value.
newValue | The current spinner Value. |
virtual void WPFCustomControls::MaxWpfRibbonSpinner::RunButtonUp | ( | decimal | newValue | ) | [inline, virtual] |
Calls the maxscript callback function with a new value.
Normally, this is the ending delimeter for an undoable action. The newValue parameter is the current spinner Value.
newValue | The current spinner Value. |
virtual void WPFCustomControls::MaxWpfRibbonSpinner::RunEditEnter | ( | decimal | newValue | ) | [inline, virtual] |
Called when the user types in a new value.
This should be called for a blunt Value change and represents a single undoable action.
newValue | The current spinner Value. |
override void WPFCustomControls::MaxWpfRibbonSpinner::ValueRefresh | ( | String | script | ) | [inline, protected, virtual] |
This is the overriden method that queries maxscript for the most current value.
It calls the appropriate maxscript query method according to the spinner precision.
script | The script that is used to run the query. |
Implements WPFCustomControls::MaxWpfControlBase.
override void WPFCustomControls::MaxWpfRibbonSpinner::ExecuteValueChanged | ( | object | newValue | ) | [inline, protected] |
readonly String
WPFCustomControls::MaxWpfRibbonSpinner::MinPropertyName = "Min"
[static] |
readonly String
WPFCustomControls::MaxWpfRibbonSpinner::MaxPropertyName = "Max"
[static] |
readonly String
WPFCustomControls::MaxWpfRibbonSpinner::InitPropertyName =
"Init" [static] |
readonly String
WPFCustomControls::MaxWpfRibbonSpinner::ScalePropertyName =
"Scale" [static] |
readonly String
WPFCustomControls::MaxWpfRibbonSpinner::ShowTextBoxPropertyName
= "ShowTextBox" [static] |
readonly String
WPFCustomControls::MaxWpfRibbonSpinner::CanSpinPropertyName =
"CanSpin" [static] |
readonly String
WPFCustomControls::MaxWpfRibbonSpinner::IsMouseCapturedPropertyName
= "IsMouseCaptured" [static] |
readonly String
WPFCustomControls::MaxWpfRibbonSpinner::RightClickOnSpinnerBehaviorName
= "RightClickOnSpinnerBehavior" [static] |
readonly String
WPFCustomControls::MaxWpfRibbonSpinner::ValuePropertyName =
"Value" [static] |
readonly String
WPFCustomControls::MaxWpfRibbonSpinner::PrecisionPropertyName =
"Precision" [static] |
decimal
WPFCustomControls::MaxWpfRibbonSpinner::Min [get,
set] |
The minimum value for this spinner.
decimal
WPFCustomControls::MaxWpfRibbonSpinner::Max [get,
set] |
The maximum value for this spinner.
decimal
WPFCustomControls::MaxWpfRibbonSpinner::Init [get,
set] |
An initial value for this spinner.
decimal
WPFCustomControls::MaxWpfRibbonSpinner::Scale [get,
set] |
The scale determines the increment (per pixel) and precision of the spinner.
A Scale of 0.2 will show a Spinner with a precision of 1. A scale of 10 will show a Spinner with a precision of 0. Any scale with decimal points will result in a float spinner, while an integer-based spinner will be considered an Int spinner.
bool
WPFCustomControls::MaxWpfRibbonSpinner::ShowTextBox [get,
set] |
If this value is set to false, then only the spinner will be shown.
bool
WPFCustomControls::MaxWpfRibbonSpinner::CanSpin [get,
set] |
If this value is false, the spinner cannot enter Spin mode, but can increment and decrement its value by clicking or holding the Up and Down arrows of the spinner or changing the text value.
This is a useful setting for spinners that control parameters that can drastically affect scene complexity and redraw times.
bool
WPFCustomControls::MaxWpfRibbonSpinner::IsMouseCaptured [get,
set] |
A property that tracks when the user is interacting with the spinner.
Used to delimit a click and hold interaction, for undo purposes.
WpfSpinner.RightClickOnSpinnerBehaviorEnum
WPFCustomControls::MaxWpfRibbonSpinner::RightClickOnSpinnerBehavior
[get, set] |
Determines the behaviour of the spinner when the user right-clicks on it.
The default behaviour is the same as all spinners in max - when you right-click on the spinner, it sets the minimize value. Other options include Maximize everywhere, and we can also split the spinner so that if a user right-clicks on the up arrow, it maximizes, and if the user right-clicks on the bottom arrow, it minimizes.
decimal
WPFCustomControls::MaxWpfRibbonSpinner::Value [get,
set] |
The Spinner's current valid, committed Value.
int
WPFCustomControls::MaxWpfRibbonSpinner::Precision [get,
set] |
EventHandler<EventArgs> WPFCustomControls::MaxWpfRibbonSpinner::IsMouseCapturedChanged |
EventHandler<EventArgs> WPFCustomControls::MaxWpfRibbonSpinner::ValueChanged |