Implement storage for a KryptonDataGridView normal state.
상속: PaletteDataGridViewCells
 /// <summary>
 /// Initialize a new instance of the KryptonPaletteGrid class.
 /// </summary>
 /// <param name="redirect">Redirector to inherit values from.</param>
 /// <param name="gridStyle">Grid style.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public KryptonPaletteGrid(PaletteRedirect redirect,
                           GridStyle gridStyle,
                           NeedPaintHandler needPaint)
 {
     // Create the storage objects
     _stateCommon = new PaletteDataGridViewRedirect(redirect, needPaint);
     _stateDisabled = new PaletteDataGridViewAll(_stateCommon, needPaint);
     _stateNormal = new PaletteDataGridViewAll(_stateCommon, needPaint);
     _stateTracking = new PaletteDataGridViewHeaders(_stateCommon, needPaint);
     _statePressed = new PaletteDataGridViewHeaders(_stateCommon, needPaint);
     _stateSelected = new PaletteDataGridViewCells(_stateCommon, needPaint);
 }
예제 #2
0
 /// <summary>
 /// Initialize a new instance of the KryptonPaletteGrid class.
 /// </summary>
 /// <param name="redirect">Redirector to inherit values from.</param>
 /// <param name="gridStyle">Grid style.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public KryptonPaletteGrid(PaletteRedirect redirect,
                           GridStyle gridStyle,
                           NeedPaintHandler needPaint)
 {
     // Create the storage objects
     _stateCommon   = new PaletteDataGridViewRedirect(redirect, needPaint);
     _stateDisabled = new PaletteDataGridViewAll(_stateCommon, needPaint);
     _stateNormal   = new PaletteDataGridViewAll(_stateCommon, needPaint);
     _stateTracking = new PaletteDataGridViewHeaders(_stateCommon, needPaint);
     _statePressed  = new PaletteDataGridViewHeaders(_stateCommon, needPaint);
     _stateSelected = new PaletteDataGridViewCells(_stateCommon, needPaint);
 }
        /// <summary>
        /// Constructor
        /// </summary>
        public KryptonOutlookGridGroupBox()
        {
            // To remove flicker we use double buffering for drawing
            SetStyle(
                     ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.ResizeRedraw, true);

            InitializeComponent();

            columnsList = new List<OutlookGridGroupBoxColumn>();

            // Cache the current global palette setting
            _palette = KryptonManager.CurrentGlobalPalette;

            // Hook into palette events
            if (_palette != null)
                _palette.PalettePaint += new EventHandler<PaletteLayoutEventArgs>(OnPalettePaint);

            // (4) We want to be notified whenever the global palette changes
            KryptonManager.GlobalPaletteChanged += new EventHandler(OnGlobalPaletteChanged);

            // Create redirection object to the base palette
            _paletteRedirect = new PaletteRedirect(_palette);

            // Create accessor objects for the back, border and content
            // Store the inherit instances
            _paletteBack = new PaletteBackInheritRedirect(_paletteRedirect);
            _paletteBorder = new PaletteBorderInheritRedirect(_paletteRedirect);
            _paletteContent = new PaletteContentInheritRedirect(_paletteRedirect);
            _paletteDataGridView = new PaletteDataGridViewRedirect(_paletteRedirect, null);
            _paletteDataGridViewAll = new PaletteDataGridViewAll(_paletteDataGridView, null);

            // Create storage that maps onto the inherit instances
            _border = new PaletteBorder(_paletteBorder, null);
            _dragColumnToGroupText = LangManager.Instance.GetString("DRAGCOLUMNTOGROUP");

            using (Graphics g = CreateGraphics())
            {
                factorX = g.DpiX > 96 ? (1f * g.DpiX / 96) : 1f;
                factorY = g.DpiY > 96 ? (1f * g.DpiY / 96) : 1f;
            }
        }