/// <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); }
/// <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); }
/// <summary> /// Initialize a new instance of the PaletteDataGridViewCells class. /// </summary> /// <param name="inherit">Source for inheriting values.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteDataGridViewCells(PaletteDataGridViewRedirect inherit, NeedPaintHandler needPaint) { Debug.Assert(inherit != null); // Store the provided paint notification delegate NeedPaint = needPaint; // Create storage that maps onto the inherit instances _dataCell = new PaletteDataGridViewTripleStates(inherit.DataCell, needPaint); _headerColumn = new PaletteDataGridViewTripleStates(inherit.HeaderColumn, needPaint); _headerRow = new PaletteDataGridViewTripleStates(inherit.HeaderRow, needPaint); }
/// <summary> /// Sets the inheritence parent. /// </summary> public virtual void SetInherit(PaletteDataGridViewRedirect inherit) { _dataCell.SetInherit(inherit.DataCell); _headerColumn.SetInherit(inherit.HeaderColumn); _headerRow.SetInherit(inherit.HeaderRow); }
/// <summary> /// Sets the inheritence parent. /// </summary> public override void SetInherit(PaletteDataGridViewRedirect inherit) { base.SetInherit(inherit); _background.SetInherit(inherit.BackgroundDouble); }
/// <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; } }