当前位置: 首页>>代码示例>>C#>>正文


C# VisualOrientation类代码示例

本文整理汇总了C#中VisualOrientation的典型用法代码示例。如果您正苦于以下问题:C# VisualOrientation类的具体用法?C# VisualOrientation怎么用?C# VisualOrientation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VisualOrientation类属于命名空间,在下文中一共展示了VisualOrientation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: KryptonButton

        /// <summary>
        /// Initialize a new instance of the KryptonButton class.
        /// </summary>
        public KryptonButton()
        {
            // We generate click events manually, suppress default
            // production of them by the base Control class
            SetStyle(ControlStyles.StandardClick |
                     ControlStyles.StandardDoubleClick, false);

            // Set default button properties
            _style = ButtonStyle.Standalone;
            _dialogResult = DialogResult.None;
            _orientation = VisualOrientation.Top;
            _useMnemonic = true;

            // Create content storage
            _buttonValues = CreateButtonValues(NeedPaintDelegate);
            _buttonValues.TextChanged += new EventHandler(OnButtonTextChanged);

            // Create the palette storage
            _stateCommon = new PaletteTripleRedirect(Redirector, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, NeedPaintDelegate);
            _stateDisabled = new PaletteTriple(_stateCommon, NeedPaintDelegate);
            _stateNormal = new PaletteTriple(_stateCommon, NeedPaintDelegate);
            _stateTracking = new PaletteTriple(_stateCommon, NeedPaintDelegate);
            _statePressed = new PaletteTriple(_stateCommon, NeedPaintDelegate);
            _stateDefault = new PaletteTripleRedirect(Redirector, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, NeedPaintDelegate);
            _stateFocus = new PaletteTripleRedirect(Redirector, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, NeedPaintDelegate);

            // Create the override handling classes
            _overrideFocus = new PaletteTripleOverride(_stateFocus, _stateNormal,  PaletteState.FocusOverride);
            _overrideNormal = new PaletteTripleOverride(_stateDefault, _overrideFocus, PaletteState.NormalDefaultOverride);
            _overrideTracking = new PaletteTripleOverride(_stateFocus, _stateTracking, PaletteState.FocusOverride);
            _overridePressed = new PaletteTripleOverride(_stateFocus, _statePressed, PaletteState.FocusOverride);

            // Create the view button instance
            _drawButton = new ViewDrawButton(_stateDisabled,
                                             _overrideNormal,
                                             _overrideTracking,
                                             _overridePressed,
                                             new PaletteMetricRedirect(Redirector),
                                             this,
                                             Orientation,
                                             UseMnemonic);

            // Only draw a focus rectangle when focus cues are needed in the top level form
            _drawButton.TestForFocusCues = true;

            // Create a button controller to handle button style behaviour
            _buttonController = new ButtonController(_drawButton, NeedPaintDelegate);

            // Assign the controller to the view element to treat as a button
            _drawButton.MouseController = _buttonController;
            _drawButton.KeyController = _buttonController;
            _drawButton.SourceController = _buttonController;

            // Need to know when user clicks the button view or mouse selects it
            _buttonController.Click += new MouseEventHandler(OnButtonClick);
            _buttonController.MouseSelect += new MouseEventHandler(OnButtonSelect);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawButton);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:63,代码来源:KryptonButton.cs

示例2: KryptonLabel

        /// <summary>
        /// Initialize a new instance of the KryptonLabel class.
        /// </summary>
        public KryptonLabel()
        {
            // The label cannot take the focus
            SetStyle(ControlStyles.Selectable, false);

            // Set default properties
            _style = LabelStyle.NormalControl;
            _useMnemonic = true;
            _orientation = VisualOrientation.Top;
            _target = null;
            _enabledTarget = true;

            // Create content storage
            _labelValues = new LabelValues(NeedPaintDelegate);
            _labelValues.TextChanged += new EventHandler(OnLabelTextChanged);

            // Create palette redirector
            _paletteCommonRedirect = new PaletteContentInheritRedirect(Redirector, PaletteContentStyle.LabelNormalControl);

            // Create the palette provider
            _stateCommon = new PaletteContent(_paletteCommonRedirect, NeedPaintDelegate);
            _stateDisabled = new PaletteContent(_stateCommon, NeedPaintDelegate);
            _stateNormal = new PaletteContent(_stateCommon, NeedPaintDelegate);

            // Our view contains background and border with content inside
            _drawContent = new ViewDrawContent(_stateNormal, this, VisualOrientation.Top);
            _drawContent.UseMnemonic = _useMnemonic;

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawContent);

            // We want to be auto sized by default, but not the property default!
            AutoSize = true;
            AutoSizeMode = AutoSizeMode.GrowAndShrink;
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:38,代码来源:KryptonLabel.cs

示例3: ViewLayoutViewport

        /// <summary>
        /// Initialize a new instance of the ViewLayoutViewport class.
        /// </summary>
        /// <param name="paletteMetrics">Palette source for metrics.</param>
        /// <param name="metricPadding">Metric used to get view padding.</param>
        /// <param name="metricOvers">Metric used to get overposition.</param>
        /// <param name="orientation">Orientation for the viewport children.</param>
        /// <param name="alignment">Alignment of the children within the viewport.</param>
        /// <param name="animateChange">Animate changes in the viewport.</param>
        public ViewLayoutViewport(IPaletteMetric paletteMetrics,
                                  PaletteMetricPadding metricPadding,
                                  PaletteMetricInt metricOvers,
                                  VisualOrientation orientation,
                                  RelativePositionAlign alignment,
                                  bool animateChange)
        {
            // Remember the source information
            _paletteMetrics = paletteMetrics;
            _metricPadding = metricPadding;
            _metricOvers = metricOvers;
            _orientation = orientation;
            _alignment = alignment;
            _animateChange = animateChange;

            // Default other state
            _offset = Point.Empty;
            _extent = Size.Empty;
            _rightToLeft = RightToLeft.No;
            _rightToLeftLayout = false;
            _fillSpace = false;
            _counterAlignment = RelativePositionAlign.Far;

            // Create a timer for animation effect
            _animationTimer = new Timer();
            _animationTimer.Interval = _animationInterval;
            _animationTimer.Tick += new EventHandler(OnAnimationTick);
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:37,代码来源:ViewLayoutViewport.cs

示例4: DragTargetControlEdge

        /// <summary>
        /// Initialize a new instance of the DragTargetControlEdge class.
        /// </summary>
        /// <param name="screenRect">Rectangle for screen area.</param>
        /// <param name="hotRect">Rectangle for hot area.</param>
        /// <param name="drawRect">Rectangle for draw area.</param>
        /// <param name="hint">Target hint which should be one of the edges.</param>
        /// <param name="controlElement">Workspace instance that contains cell.</param>
        /// <param name="allowFlags">Only drop pages that have one of these flags defined.</param>
        /// <param name="outsideEdge">Add to the outside edge (otherwise the inner edge).</param>
        public DragTargetControlEdge(Rectangle screenRect,
                                     Rectangle hotRect,
                                     Rectangle drawRect,
                                     DragTargetHint hint,
                                     KryptonDockingControl controlElement,
                                     KryptonPageFlags allowFlags,
                                     bool outsideEdge)
            : base(screenRect, hotRect, drawRect, hint, allowFlags)
        {
            _controlElement = controlElement;
            _outsideEdge = outsideEdge;

            // Find the orientation by looking for a matching hint (we need to exclude flags from the hint enum)
            switch (hint & DragTargetHint.ExcludeFlags)
            {
                case DragTargetHint.Transfer:
                case DragTargetHint.EdgeLeft:
                    _edge = VisualOrientation.Left;
                    break;
                case DragTargetHint.EdgeRight:
                    _edge = VisualOrientation.Right;
                    break;
                case DragTargetHint.EdgeTop:
                    _edge = VisualOrientation.Top;
                    break;
                case DragTargetHint.EdgeBottom:
                    _edge = VisualOrientation.Bottom;
                    break;
                default:
                    Debug.Assert(false);
                    throw new ArgumentOutOfRangeException("Hint must be an edge value.");
            }
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:43,代码来源:DragTargetControlEdge.cs

示例5: NavigatorBar

        /// <summary>
        /// Initialize a new instance of the NavigatorBar class.
        /// </summary>
        /// <param name="navigator">Reference to owning navigator instance.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public NavigatorBar(KryptonNavigator navigator,
                            NeedPaintHandler needPaint)
        {
            Debug.Assert(navigator != null);

            // Remember back reference
            _navigator = navigator;

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

            // Default values
            _barAnimation = true;
            _barFirstItemInset = 0;
            _barLastItemInset = 0;
            _barOrientation = VisualOrientation.Top;
            _barMinimumHeight = _defaultBarMinimumHeight;
            _barMultiline = BarMultiline.Singleline;
            _checkButtonStyle = ButtonStyle.Standalone;
            _tabStyle = TabStyle.HighProfile;
            _tabBorderStyle = TabBorderStyle.RoundedOutsizeMedium;
            _itemAlignment = RelativePositionAlign.Near;
            _itemMinimumSize = _defaultItemMinimumSize;
            _itemMaximumSize = _defaultItemMaximumSize;
            _itemOrientation = ButtonOrientation.Auto;
            _itemSizing = BarItemSizing.SameHeight;
            _barMapImage = MapKryptonPageImage.Small;
            _barMapText = MapKryptonPageText.TextTitle;
            _barMapExtraText = MapKryptonPageText.None;
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:35,代码来源:NavigatorBar.cs

示例6: ViewDrawNavOutlookStack

 /// <summary>
 /// Initialize a new instance of the ViewDrawNavOutlookStack class.
 /// </summary>
 /// <param name="navigator">Owning navigator instance.</param>
 /// <param name="page">Page this check button represents.</param>
 /// <param name="orientation">Orientation for the check button.</param>
 public ViewDrawNavOutlookStack(KryptonNavigator navigator,
                                KryptonPage page,
                                VisualOrientation orientation)
     : base(navigator, page, orientation)
 {
     // Are we mapping for the full or the mini mode?
     _full = (navigator.NavigatorMode == NavigatorMode.OutlookFull);
 }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:14,代码来源:ViewDrawNavOutlookStack.cs

示例7: ViewDrawCanvas

        /// <summary>
        /// Initialize a new instance of the ViewDrawCanvas class.
        /// </summary>
        /// <param name="paletteBack">Palette source for the background.</param>		
        /// <param name="paletteBorder">Palette source for the border.</param>
        /// <param name="orientation">Visual orientation of the content.</param>
        public ViewDrawCanvas(IPaletteBack paletteBack,
							  IPaletteBorder paletteBorder,
							  VisualOrientation orientation)
            : this(paletteBack, 
                   paletteBorder, 
                   null, 
                   PaletteMetricPadding.HeaderGroupPaddingPrimary, 
                   orientation)
        {
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:16,代码来源:ViewDrawCanvas.cs

示例8: ViewLayoutInsetOverlap

        /// <summary>
        /// Initialize a new instance of the ViewLayoutInsetOverlap class.
        /// </summary>
        public ViewLayoutInsetOverlap(ViewDrawCanvas drawCanvas)
        {
            Debug.Assert(drawCanvas != null);

            // Remember source of the rounding values
            _drawCanvas = drawCanvas;

            // Default other state
            _orientation = VisualOrientation.Top;
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:13,代码来源:ViewLayoutInsetOverlap.cs

示例9: ViewDrawAutoHiddenTab

 /// <summary>
 /// Initialize a new instance of the ViewDrawAutoHiddenTab class.
 /// </summary>
 /// <param name="page">Reference to the page this tab represents.</param>
 /// <param name="orientation">Visual orientation used for drawing the tab.</param>
 public ViewDrawAutoHiddenTab(KryptonPage page,
                              VisualOrientation orientation)
     : base(page.StateDisabled.CheckButton, 
            page.StateNormal.CheckButton,
            page.StateTracking.CheckButton, 
            page.StatePressed.CheckButton,
            null, null, orientation, false)
 {
     _page = page;
     _orientation = orientation;
 }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:16,代码来源:ViewDrawAutoHiddenTab.cs

示例10: ViewDrawNavCheckButtonTab

 /// <summary>
 /// Initialize a new instance of the ViewDrawNavCheckButtonTab class.
 /// </summary>
 /// <param name="navigator">Owning navigator instance.</param>
 /// <param name="page">Page this check button represents.</param>
 /// <param name="orientation">Orientation for the check button.</param>
 public ViewDrawNavCheckButtonTab(KryptonNavigator navigator,
                                  KryptonPage page,
                                  VisualOrientation orientation)
     : base(navigator, page, orientation,
            page.StateDisabled.Tab, 
            page.StateNormal.Tab,
            page.StateTracking.Tab, 
            page.StatePressed.Tab,
            page.StateSelected.Tab,
            page.OverrideFocus.Tab)
 {
 }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:18,代码来源:ViewDrawNavCheckButtonTab.cs

示例11: ViewDrawContent

        /// <summary>
        /// Initialize a new instance of the ViewDrawContent class.
        /// </summary>
        /// <param name="paletteContent">Palette source for the content.</param>
        /// <param name="values">Reference to actual content values.</param>
        /// <param name="orientation">Visual orientation of the content.</param>
        public ViewDrawContent(IPaletteContent paletteContent, 
							   IContentValues values,
							   VisualOrientation orientation)
        {
            // Cache the starting values
            _paletteContent = paletteContent;
            _values = values;
            _orientation = orientation;

            // Default other state
            _drawOnComposition = false;
            _testForFocusCues = false;
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:19,代码来源:ViewDrawContent.cs

示例12: ViewLayoutCenter

        /// <summary>
        /// Initialize a new instance of the ViewLayoutCenter class.
        /// </summary>
        /// <param name="paletteMetric">Target for recovering metric values.</param>
        /// <param name="metricPadding">Metric to use for border padding.</param>
        /// <param name="orientation">Orientation of the element.</param>
        /// <param name="childElement">Optional element to add as child.</param>
        public ViewLayoutCenter(IPaletteMetric paletteMetric,
                                PaletteMetricPadding metricPadding,
                                VisualOrientation orientation,
                                ViewBase childElement)
        {
            // Remember provided values
            _paletteMetric = paletteMetric;
            _metricPadding = metricPadding;
            _orientation = orientation;

            if (childElement != null)
                Add(childElement);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:20,代码来源:ViewLayoutCenter.cs

示例13: ViewDrawNavCheckButtonBase

 /// <summary>
 /// Initialize a new instance of the ViewDrawNavCheckButtonBase class.
 /// </summary>
 /// <param name="navigator">Owning navigator instance.</param>
 /// <param name="page">Page this check button represents.</param>
 /// <param name="orientation">Orientation for the check button.</param>
 /// <param name="overflow">Button is used on the overflow bar.</param>
 public ViewDrawNavCheckButtonBase(KryptonNavigator navigator,
                                   KryptonPage page,
                                   VisualOrientation orientation,
                                   bool overflow)
     : this(navigator, page, orientation,
            page.StateDisabled.OverflowButton,
            page.StateNormal.OverflowButton,
            page.StateTracking.OverflowButton,
            page.StatePressed.OverflowButton,
            page.StateSelected.OverflowButton,
            page.OverrideFocus.OverflowButton)
 {
 }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:20,代码来源:ViewDrawNavCheckButtonBase.cs

示例14: ViewDrawButton

 /// <summary>
 /// Initialize a new instance of the ViewDrawButton class.
 /// </summary>
 /// <param name="paletteDisabled">Palette source for the disabled state.</param>
 /// <param name="paletteNormal">Palette source for the normal state.</param>
 /// <param name="paletteTracking">Palette source for the tracking state.</param>
 /// <param name="palettePressed">Palette source for the pressed state.</param>
 /// <param name="paletteMetric">Palette source for metric values.</param>
 /// <param name="buttonValues">Source for content values.</param>
 /// <param name="orientation">Visual orientation of the content.</param>
 /// <param name="useMnemonic">Use mnemonics.</param>
 public ViewDrawButton(IPaletteTriple paletteDisabled,
                       IPaletteTriple paletteNormal,
                       IPaletteTriple paletteTracking,
                       IPaletteTriple palettePressed,
                       IPaletteMetric paletteMetric,
                       IContentValues buttonValues,
                       VisualOrientation orientation,
                       bool useMnemonic)
     : this(paletteDisabled, paletteNormal, paletteTracking, palettePressed,
            paletteNormal, paletteTracking, palettePressed, paletteMetric,
            buttonValues, orientation, useMnemonic)
 {
 }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:24,代码来源:ViewDrawButton.cs

示例15: ViewLayoutDocker

        /// <summary>
        /// Initialize a new instance of the ViewLayoutDocker class.
        /// </summary>
        public ViewLayoutDocker()
        {
            // Create child to dock style lookup
            _childDocking = new ViewDockStyleLookup();

            // Default state
            _fillRectangle = Rectangle.Empty;
            _orientation = VisualOrientation.Top;
            _maxBorderEdges = PaletteDrawBorders.All;
            _preferredSizeAll = false;
            _removeChildBorders = false;
            _ignoreRightToLeftLayout = false;
            _padding = Padding.Empty;
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:17,代码来源:ViewLayoutDocker.cs


注:本文中的VisualOrientation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。