예제 #1
0
        /// <summary>
        /// Initialize a new instance of the PaletteDataGridViewAll class.
        /// </summary>
        /// <param name="inherit">Source for inheriting values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteDataGridViewAll(PaletteDataGridViewRedirect inherit,
                                      NeedPaintHandler needPaint)
            : base(inherit, needPaint)
        {
            Debug.Assert(inherit != null);

            // Create storage that maps onto the inherit instances
            _background = new PaletteDouble(inherit.BackgroundDouble, 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>
        /// Initialize a new instance of the PaletteDataGridViewHeaders class.
        /// </summary>
        /// <param name="inherit">Source for inheriting values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteDataGridViewHeaders(PaletteDataGridViewRedirect inherit,
                                          NeedPaintHandler needPaint)
        {
            Debug.Assert(inherit != null);

            // Store the provided paint notification delegate
            NeedPaint = needPaint;

            // Create storage that maps onto the inherit instances
            _headerColumn = new PaletteDataGridViewTripleStates(inherit.HeaderColumn, needPaint);
            _headerRow    = new PaletteDataGridViewTripleStates(inherit.HeaderRow, needPaint);
        }
예제 #4
0
        /// <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 = LanguageManager.Instance.GetStringGB("DRAGCOLUMNTOGROUP");

            using (Graphics g = CreateGraphics())
            {
                factorX = g.DpiX > 96 ? (1f * g.DpiX / 96) : 1f;
                factorY = g.DpiY > 96 ? (1f * g.DpiY / 96) : 1f;
            }
        }
예제 #5
0
 /// <summary>
 /// Sets the inheritance parent.
 /// </summary>
 public override void SetInherit(PaletteDataGridViewRedirect inherit)
 {
     base.SetInherit(inherit);
     _background.SetInherit(inherit.BackgroundDouble);
 }
 /// <summary>
 /// Sets the inheritance parent.
 /// </summary>
 public virtual void SetInherit(PaletteDataGridViewRedirect inherit)
 {
     _dataCell.SetInherit(inherit.DataCell);
     _headerColumn.SetInherit(inherit.HeaderColumn);
     _headerRow.SetInherit(inherit.HeaderRow);
 }