コード例 #1
0
 public CommandProperties(Type t, CommandImage beforeImage, CommandImage afterImage, bool Hasdialog)
 {
     _type        = t;
     _beforeImage = beforeImage;
     _afterImage  = afterImage;
     _hasdialog   = Hasdialog;
 }
コード例 #2
0
        private void InternalConstruct()
        {
            // Set internal state
            _image = new CommandImage();

            // Default exposed properties
            ResetText();
            ResetImage();
        }
コード例 #3
0
        /// <summary>
        /// Update internal fields from source Node.
        /// </summary>
        /// <param name="source">Source Node to update from.</param>
        public override void UpdateInstance(CommandBase source)
        {
            // Update base members
            base.UpdateInstance(source);

            // Cast to correct type
            CommandBaseCommon original = source as CommandBaseCommon;

            // Copy class members
            _text  = original._text;
            _image = original._image;
        }
コード例 #4
0
ファイル: ButtonWithStyle.cs プロジェクト: zhaoyin/officeOBA
        /// <summary>
        /// Initializes a new instance of the ButtonWithStyle class.
        /// </summary>
        public ButtonWithStyle()
        {
            // NAG processing
            NAG.NAG_Start();

            // Prevent drawing flicker by blitting from memory in WM_PAINT
            SetStyle(ControlStyles.DoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.UserPaint |
                     ControlStyles.ResizeRedraw, true);

            // Prevent base class from trying to generate double click events and
            // so testing clicks against the double click time and rectangle. Getting
            // rid of this allows the user to press then button very quickly.
            SetStyle(ControlStyles.StandardDoubleClick, false);

            // Should not be allowed to select this control
            SetStyle(ControlStyles.Selectable, false);

            // We do not want a mouse up to always cause a click, we decide that
            SetStyle(ControlStyles.StandardClick, false);

            // We are happy to allow a transparent background color
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);

            // Set initial state
            _image        = new CommandImage();
            _mouseOver    = false;
            _staticIDE    = false;
            _mouseCapture = false;
            _mouseButton  = MouseButtons.None;
            _colorDetails = new ColorDetails();

            // Update with the tracking colors for the IDE style
            _colorDetails.DefineTrackColors(SystemColors.Highlight);

            // We need to know when our text changes
            TextChanged += new EventHandler(OnTextChanged);

            // Reset all properties to default values
            ResetImage();
            ResetStyle();
            ResetDirection();
            ResetTextEdge();
            ResetButtonStyle();
            ResetPushed();
            ResetBackColor();
            ResetAlwaysDrawEnabled();
            ResetAlwaysDrawBorder();
            ResetOffice2003GradBack();
            ResetIDE2005GradBack();
        }
コード例 #5
0
        //Get the image file name for this command
        public static string GetImageNameFileName(CommandImage cmdImage)
        {
            if (cmdImage != CommandImage.None)
            {
                if (_imagesFolder == null)
                {
                    _imagesFolder = DemosGlobal.ImagesFolder;
                }


                string name     = cmdImage.ToString().Replace("____", " ");
                string name2    = name.Replace("___", "-");
                string name3    = name2.Replace("__", "\\");
                string name4    = name3.Replace("_", ".");
                string fullPath = Path.Combine(_imagesFolder, "");
                fullPath = Path.Combine(fullPath, name4);

                return(fullPath);
            }
            else
            {
                return(string.Empty);
            }
        }