ComponentFactory.Krypton.Toolkit.ViewDrawButton.SetCheckedPalettes C# (CSharp) Method

SetCheckedPalettes() public method

Update the source palettes for checked state drawing.
public SetCheckedPalettes ( IPaletteTriple paletteCheckedNormal, IPaletteTriple paletteCheckedTracking, IPaletteTriple paletteCheckedPressed ) : void
paletteCheckedNormal IPaletteTriple Palette source for the normal checked state.
paletteCheckedTracking IPaletteTriple Palette source for the tracking checked state.
paletteCheckedPressed IPaletteTriple Palette source for the pressed checked state.
return void
        public void SetCheckedPalettes(IPaletteTriple paletteCheckedNormal,
                                       IPaletteTriple paletteCheckedTracking,
                                       IPaletteTriple paletteCheckedPressed)
        {
            Debug.Assert(paletteCheckedNormal != null);
            Debug.Assert(paletteCheckedTracking != null);
            Debug.Assert(paletteCheckedPressed != null);

            // Remember the new palette settings
            _paletteCheckedNormal = paletteCheckedNormal;
            _paletteCheckedTracking = paletteCheckedTracking;
            _paletteCheckedPressed = paletteCheckedPressed;

            // Must force update of palettes to use latest ones provided
            _forcePaletteUpdate = true;
        }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Initialize a new instance of the KryptonCheckButton class.
        /// </summary>
        public KryptonCheckButton()
        {
            // Create the extra state needed for the checked additions the the base button
            StateCheckedNormal   = new PaletteTriple(StateCommon, NeedPaintDelegate);
            StateCheckedTracking = new PaletteTriple(StateCommon, NeedPaintDelegate);
            StateCheckedPressed  = new PaletteTriple(StateCommon, NeedPaintDelegate);

            // Create the override handling classes
            _overrideCheckedFocus    = new PaletteTripleOverride(OverrideFocus, StateCheckedNormal, PaletteState.FocusOverride);
            _overrideCheckedNormal   = new PaletteTripleOverride(OverrideDefault, _overrideCheckedFocus, PaletteState.NormalDefaultOverride);
            _overrideCheckedTracking = new PaletteTripleOverride(OverrideFocus, StateCheckedTracking, PaletteState.FocusOverride);
            _overrideCheckedPressed  = new PaletteTripleOverride(OverrideFocus, StateCheckedPressed, PaletteState.FocusOverride);

            // Add the checked specific palettes to the existing view button
            ViewDrawButton.SetCheckedPalettes(_overrideCheckedNormal,
                                              _overrideCheckedTracking,
                                              _overrideCheckedPressed);
        }
All Usage Examples Of ComponentFactory.Krypton.Toolkit.ViewDrawButton::SetCheckedPalettes