public ViewDrawRibbonGroupCheckBox(KryptonRibbon ribbon,
KryptonRibbonGroupCheckBox ribbonCheckBox,
NeedPaintHandler needPaint)
{
Debug.Assert(ribbon != null);
Debug.Assert(ribbonCheckBox != null);
Debug.Assert(needPaint != null);
// Remember incoming references
_ribbon = ribbon;
_ribbonCheckBox = ribbonCheckBox;
_needPaint = needPaint;
_currentSize = _ribbonCheckBox.ItemSizeCurrent;
// Create delegate used to process end of click action
_finishDelegateLarge = new EventHandler(ActionFinishedLarge);
_finishDelegateMediumSmall = new EventHandler(ActionFinishedMediumSmall);
// Associate this view with the source component (required for design time selection)
Component = _ribbonCheckBox;
// Create the different views for different sizes of the check box
CreateLargeCheckBoxView();
CreateMediumSmallCheckBoxView();
// Update all views to reflect current check box state
UpdateEnabledState();
UpdateCheckState();
UpdateItemSizeState();
// Hook into changes in the ribbon check box definition
_ribbonCheckBox.PropertyChanged += new PropertyChangedEventHandler(OnCheckBoxPropertyChanged);
}