The base class for Max-specific WPF-implemented ribbon controls.
Public Member Functions |
|
MaxWpfControlBase () | |
override void | CopyFrom (RibbonItem source) |
void | ExecuteValueRefresh () |
Runs the mechanism that refreshes this data
structure, and calls the abstract method ValueRefresh(object)
|
|
void | RunValueChanged (Object newValue) |
Runs the mechanism that reports a value
change on the data structure. |
|
bool | HasKeyAtACurrentTime () |
Checks whether the control has an assigned
key frame at the current time. |
|
Static Public Member Functions |
|
static bool | HasProperty (String aProperty, String aStruct) |
Evaluates whether the passed in struct has a
given property (or function) |
|
Static Public Attributes |
|
static readonly String | MaxcriptCallbackPropertyName = "MaxscriptCallback" |
static readonly String | IsEnabledMaxscriptFunctionName = "IsEnabled" |
The name of the function that is used on the
MaxscriptCallback struct to evaluate if this control is enabled.
|
|
static readonly String | ControllerFunctionString = @"Controller" |
The name of the property we check for a
Controller declaration. |
|
Protected Member Functions |
|
abstract void | ValueRefresh (String script) |
This method should be implemented by
deriving classes in such a way that the class anticipates what the
result of a script will be and processed it accordingly. |
|
virtual void | ExecuteValueChanged (Object newValue) |
Template method called from RunValueChanged.
|
|
void | ClearHasControllerValue () |
Call this if something about the script
would result in us having to re-evaluate the Controller property.
|
|
Properties |
|
String |
MaxscriptCallback [get, set] |
Callback struct that is used to query values
for a control. |
|
bool |
ShouldRefresh [get, set] |
This property roughly reflects the IsVisible
WPF property of the templated control, and can be used as a way of
determining whether we should bother trying to refresh this
control. |
|
virtual String |
GetValueFormatString [get] |
The standard format string for extracting a
the current value from the callback struct. |
|
virtual String |
IsEnabledFormatString [get] |
The standard format string for extracting a
the IsEnabled property from the struct. |
|
bool |
HasIsEnabledFunctionDeclared [get, set] |
Internal cache value that is evaluated when
MaxscriptCallback is set. |
|
bool |
MaxscriptPushEnabled [get, set] |
If this is false, then 'pushing' values back
to maxscript is disabled. |
|
virtual String |
OnChangedFormatString [get] |
The standard format string for reporting a
value change to the callback struct. |
|
virtual String |
CheckForControllerString [get] |
The format string used to assemble the
maxscript we use to check for a controller. |
WPFCustomControls::MaxWpfControlBase::MaxWpfControlBase | ( | ) | [inline] |
override void WPFCustomControls::MaxWpfControlBase::CopyFrom | ( | RibbonItem | source | ) | [inline] |
Reimplemented in WPFCustomControls::MaxWpfColorSwatch, and WPFCustomControls::MaxWpfRibbonSpinner.
void WPFCustomControls::MaxWpfControlBase::ExecuteValueRefresh | ( | ) | [inline] |
Runs the mechanism that refreshes this data structure, and calls the abstract method ValueRefresh(object)
static bool WPFCustomControls::MaxWpfControlBase::HasProperty | ( | String | aProperty, |
String | aStruct | ||
) | [inline, static] |
Evaluates whether the passed in struct has a given property (or function)
aProperty | The name of the property. This value should be unquoted. This value can also contain maxscript-legal wildcards. |
aStruct | The name of the struct or object to evaluate. |
abstract void WPFCustomControls::MaxWpfControlBase::ValueRefresh | ( | String | script | ) | [protected, pure virtual] |
This method should be implemented by deriving classes in such a way that the class anticipates what the result of a script will be and processed it accordingly.
script | A script, normally in the format: "MaxscriptCallback.GetValue()", unless the formatting string method GetValueFormatString() is overriden by the deriving class. |
Implemented in WPFCustomControls::MaxWpfColorSwatch, and WPFCustomControls::MaxWpfRibbonSpinner.
void WPFCustomControls::MaxWpfControlBase::RunValueChanged | ( | Object | newValue | ) | [inline] |
Runs the mechanism that reports a value change on the data structure.
virtual void WPFCustomControls::MaxWpfControlBase::ExecuteValueChanged | ( | Object | newValue | ) | [inline, protected, virtual] |
Template method called from RunValueChanged.
Override this method to supply custom value query mechanics, but always call RunValueChanged directly.
newValue | The new value to push back to the model. |
void WPFCustomControls::MaxWpfControlBase::ClearHasControllerValue | ( | ) | [inline, protected] |
Call this if something about the script would result in us having to re-evaluate the Controller property.
bool WPFCustomControls::MaxWpfControlBase::HasKeyAtACurrentTime | ( | ) | [inline] |
Checks whether the control has an assigned key frame at the current time.
readonly String
WPFCustomControls::MaxWpfControlBase::MaxcriptCallbackPropertyName
= "MaxscriptCallback" [static] |
readonly String
WPFCustomControls::MaxWpfControlBase::IsEnabledMaxscriptFunctionName
= "IsEnabled" [static] |
The name of the function that is used on the MaxscriptCallback struct to evaluate if this control is enabled.
readonly String
WPFCustomControls::MaxWpfControlBase::ControllerFunctionString
= @"Controller" [static] |
The name of the property we check for a Controller declaration.
String
WPFCustomControls::MaxWpfControlBase::MaxscriptCallback [get,
set] |
Callback struct that is used to query values for a control.
This struct should have control-specific callback functions.
bool
WPFCustomControls::MaxWpfControlBase::ShouldRefresh [get,
set] |
This property roughly reflects the IsVisible WPF property of the templated control, and can be used as a way of determining whether we should bother trying to refresh this control.
virtual String
WPFCustomControls::MaxWpfControlBase::GetValueFormatString
[get, protected] |
The standard format string for extracting a the current value from the callback struct.
Defaults to "{0}.GetValue()" where {0} is the name of the struct (MaxscriptCallback)
virtual String
WPFCustomControls::MaxWpfControlBase::IsEnabledFormatString
[get, protected] |
The standard format string for extracting a the IsEnabled property from the struct.
Defaults to "{0}.IsEnabled()" where {0} is the name of the struct (MaxscriptCallback)
bool
WPFCustomControls::MaxWpfControlBase::HasIsEnabledFunctionDeclared
[get, set, protected] |
Internal cache value that is evaluated when MaxscriptCallback is set.
True if struct has a function called "IsEnabled"
bool
WPFCustomControls::MaxWpfControlBase::MaxscriptPushEnabled
[get, set, protected] |
If this is false, then 'pushing' values back to maxscript is disabled.
Used to 'set' a value on the ribbon side which was extracted from maxscript.
virtual String
WPFCustomControls::MaxWpfControlBase::OnChangedFormatString
[get, protected] |
The standard format string for reporting a value change to the callback struct.
Defaults to "{0}.Onchanged({1})" where {0} is the name of the struct (MaxscriptCallback) and {1} is the new Value.
virtual String
WPFCustomControls::MaxWpfControlBase::CheckForControllerString
[get, protected] |
The format string used to assemble the maxscript we use to check for a controller.