Пример #1
0
 /// <summary>
 /// Initialize a new instance of the ButtonSpec class.
 /// </summary>
 protected ButtonSpec()
 {
     _image                        = null;
     _toolTipImage                 = null;
     _colorMap                     = Color.Empty;
     _imageTransparentColor        = Color.Empty;
     _toolTipImageTransparentColor = Color.Empty;
     _text                     = string.Empty;
     _extraText                = string.Empty;
     UniqueName                = CommonHelper.UniqueString;
     _toolTipTitle             = string.Empty;
     _toolTipBody              = string.Empty;
     _allowInheritImage        = true;
     _allowInheritText         = true;
     _allowInheritExtraText    = true;
     _allowInheritToolTipTitle = true;
     ToolTipStyle              = LabelStyle.ToolTip;
     _style                    = PaletteButtonStyle.Inherit;
     _orientation              = PaletteButtonOrientation.Inherit;
     ProtectedType             = PaletteButtonSpecStyle.Generic;
     _edge                     = PaletteRelativeEdgeAlign.Inherit;
     _imageStates              = new CheckButtonImageStates
     {
         NeedPaint = OnImageStateChanged
     };
     ContextMenuStrip   = null;
     KryptonContextMenu = null;
     _buttonSpecView    = null;
 }
        // helper method for scaling KyrptonPaletteButtonSpecTyped
        /// <summary>Scales the type of the button spec image.</summary>
        /// <param name="bst">The ButtonSpecType.</param>
        /// <param name="scaleFactor">The scale factor.</param>
        private static void ScaleButtonSpecImageType(KryptonPaletteButtonSpecTyped bst, SizeF scaleFactor)
        {
            bst.Image = GetScaledImage(bst.Image, scaleFactor);
            CheckButtonImageStates imgState = bst.ImageStates;

            imgState.ImageCheckedNormal   = GetScaledImage(imgState.ImageCheckedNormal, scaleFactor);
            imgState.ImageCheckedPressed  = GetScaledImage(imgState.ImageCheckedPressed, scaleFactor);
            imgState.ImageCheckedTracking = GetScaledImage(imgState.ImageCheckedTracking, scaleFactor);
            imgState.ImageDisabled        = GetScaledImage(imgState.ImageDisabled, scaleFactor);
            imgState.ImageNormal          = GetScaledImage(imgState.ImageNormal, scaleFactor);
            imgState.ImagePressed         = GetScaledImage(imgState.ImagePressed, scaleFactor);
            imgState.ImageTracking        = GetScaledImage(imgState.ImageTracking, scaleFactor);
        }
 /// <summary>
 /// Initialize a new instance of the KryptonPaletteButtonSpecCommon class.
 /// </summary>
 /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
 internal KryptonPaletteButtonSpecTyped(PaletteRedirect redirector)
     : base(redirector)
 {
     _image                    = null;
     _text                     = string.Empty;
     _extraText                = string.Empty;
     _toolTipTitle             = string.Empty;
     _colorMap                 = Color.Empty;
     _allowInheritImage        = true;
     _allowInheritText         = true;
     _allowInheritExtraText    = true;
     _allowInheritToolTipTitle = true;
     ImageStates               = new CheckButtonImageStates
     {
         NeedPaint = OnImageStateChanged
     };
 }
 /// <summary>
 /// Create the storage for the image states.
 /// </summary>
 /// <returns>Storage object.</returns>
 protected override ButtonImageStates CreateImageStates()
 {
     _imageStates = new CheckButtonImageStates();
     return(_imageStates);
 }