/// <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 = 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; } }