RibbonSpinner

Represents a Spinner control in the SharePoint Server Ribbon.
SharePoint 2010 Ribbon Standard Color Picker

Inheritance Hierarchy


Assembly: QASPRibbon.dll
Namespace: QASPRibbon.Controls

Properties

Property Type Description
Id String A string that identifies the spinner such as "RibbonControl". (Inherited from RibbonElement)
Title String A string value representing the spinner's label. (Inherited from RibbonElement)
AltDownArrow String An alternative text that is used for the spinner' down arrow.
AltUpArrow String An alternative text that is used for the spinner' down arrow.
MultiplierInterval Int32 A value that specifies a factor by which to increase the speed of incrementing or decrementing the value when focus is maintained on the up or down arrow.
AccelerationInterval Int32 A value that specifies how much the value increases or decreases when you maintain focus on the up or down button.
DefaultValue Decimal A value that specifies the initial numeric value that is displayed in the control.
DefaultUnit RibbonSpinnerUnit A value that specifies the defual value of this spinner. By default first unit is used for it.
Units IEnumerable<RibbonSpinnerUnit> Collection of units for use within this spinner control.
Visible Boolean A value that indicates whether a spinner control is rendered on the ribbon. (Inherited from RibbonVisualControl)
Enabled Boolean A value that indicates whether a spinner control is enabled. (Inherited from RibbonVisualControl)
ToolTip RibbonToolTip The tooltip of the spinner. (Inherited from RibbonVisualControl)
OnClientActivate String Client-side script that executes when a spinner is activated. (Inherited from RibbonButton)
OnClientClick String Client-side script that executes when a checkbox's Click event is raised. (Inherited from RibbonButton)
OnClientStateCheck String Client-side script that executes before checking spinner is enabled or not. (Inherited from RibbonButton)
OnClientColorPreview String Client-side script that executes when mouse pointer on color hover.
OnClientColorRevert String Client-side script that executes when menu closed without color selection.

Events

Event EventHander Description
OnAction RibbonSpinnerEventHandler Server-side event that cccurs when the Spinner control is changed

Constructors

public RibbonSpinner()

public RibbonSpinner(string id)

public RibbonSpinner(string id, string title)

Example

The following example defines a spinner control with tooltip using standart color panel.
//ToolTip
var simpleSpinnerToolTip = new RibbonToolTip("ToolTip Title", "ToolTip Description");
//Spinner
var simpleSpinner = new new RibbonSpinner("Spinner", "Spinner")
    {
        ToolTip = simpleSpinnerToolTip,
        DefaultValue = 10,
        MultiplierInterval = 20,
        AltDownArrow = "Decrease the value",
        AltUpArrow = "Increase the value",
        Units = new []
        {
            new RibbonSpinnerUnit
                {
                    DecimalDigits = 0, 
                    Interval = 10,
                    MinimumValue = 10, 
                    MaximumValue = 200, 
                    Value = "mm"
                }
        }
    };
simpleSpinner.OnAction += new RibbonSpinnerEventHandler(simpleColorPicker_OnAction);


Method to handle color picker click event:
void simpleSpinner_OnAction(object sender, RibbonSpinnerEventArgs e)
{
    var currentSpinner = e.Instance;
    var selectedValue = currentSpinner.Value;
}

See also




Last edited Dec 24, 2012 at 1:43 PM by VitalyZhukov, version 3

Comments

No comments yet.