Пример #1
0
 /// <summary>
 /// Initialize a new instance of the ViewLayoutRibbonRowCenter class.
 /// </summary>
 public ViewLayoutRibbonRowCenter()
 {
     CurrentSize   = GroupItemSize.Large;
     _viewToSmall  = new ViewToSize();
     _viewToMedium = new ViewToSize();
     _viewToLarge  = new ViewToSize();
 }
Пример #2
0
        /// <summary>
        /// Initialize a new instance of the ViewLayoutRibbonGroupCluster class.
        /// </summary>
        /// <param name="ribbon">Owning ribbon control instance.</param>
        /// <param name="ribbonCluster">Reference to cluster definition.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public ViewLayoutRibbonGroupCluster(KryptonRibbon ribbon,
                                            KryptonRibbonGroupCluster ribbonCluster,
                                            NeedPaintHandler needPaint)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(ribbonCluster != null);
            Debug.Assert(needPaint != null);

            // Cache references
            _ribbon        = ribbon;
            _ribbonCluster = ribbonCluster;
            _needPaint     = needPaint;
            _currentSize   = GroupItemSize.Medium;

            // Associate the component with this view element for design time selection
            Component = _ribbonCluster;

            // Create the start and end separators
            _startSep        = new ViewDrawRibbonGroupClusterSeparator(_ribbon, true);
            _endSep          = new ViewDrawRibbonGroupClusterSeparator(_ribbon, false);
            _startSepVisible = false;
            _endSepVisible   = false;

            // Create palette used to supply a width to a border edge view
            PaletteBorderEdgeRedirect borderEdgeRedirect = new PaletteBorderEdgeRedirect(_ribbon.StateCommon.RibbonGroupClusterButton.Border, needPaint);

            _paletteBorderEdge = new PaletteBorderEdge(borderEdgeRedirect, needPaint);
            _lastShape         = PaletteRibbonShape.Office2007;

            // Use hashtable to store relationships
            _itemToView       = new ItemToView();
            _viewToEdge       = new ViewToEdge();
            _viewToSizeMedium = new ViewToSize();
            _viewToSizeSmall  = new ViewToSize();

            // Hook into changes in the ribbon cluster definition
            _ribbonCluster.PropertyChanged += new PropertyChangedEventHandler(OnClusterPropertyChanged);
            _ribbonCluster.ClusterView      = this;

            // At design time we want to track the mouse and show feedback
            if (_ribbon.InDesignMode)
            {
                ViewHightlightController controller = new ViewHightlightController(this, needPaint);
                controller.ContextClick += new MouseEventHandler(OnContextClick);
                MouseController          = controller;
            }
        }
Пример #3
0
        /// <summary>
        /// Initialize a new instance of the ViewLayoutRibbonGroupTriple class.
        /// </summary>
        /// <param name="ribbon">Owning ribbon control instance.</param>
        /// <param name="ribbonTriple">Reference to triple definition.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public ViewLayoutRibbonGroupTriple(KryptonRibbon ribbon,
                                           KryptonRibbonGroupTriple ribbonTriple,
                                           NeedPaintHandler needPaint)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(ribbonTriple != null);
            Debug.Assert(needPaint != null);

            // Cache references
            _ribbon       = ribbon;
            _ribbonTriple = ribbonTriple;
            _needPaint    = needPaint;

            // Associate the component with this view element for design time selection
            Component = _ribbonTriple;

            // Use hashtables to store relationships
            _itemToView  = new ItemToView();
            _smallCache  = new ViewToSize();
            _mediumCache = new ViewToSize();
            _largeCache  = new ViewToSize();

            // Get the initial size used for sizing and positioning
            SetCurrentSize(ribbonTriple.ItemSizeCurrent);

            // Hook into changes in the ribbon triple definition
            _ribbonTriple.PropertyChanged += new PropertyChangedEventHandler(OnTriplePropertyChanged);
            _ribbonTriple.TripleView       = this;

            // At design time we want to track the mouse and show feedback
            if (_ribbon.InDesignMode)
            {
                ViewHightlightController controller = new ViewHightlightController(this, needPaint);
                controller.ContextClick += new MouseEventHandler(OnContextClick);
                MouseController          = controller;
            }
        }