コード例 #1
0
        internal void OnStripButtonClicked(RadPageViewStripButtonElement button)
        {
            RadPageViewStripElement ancestor = this.FindAncestor <RadPageViewStripElement>();

            if (ancestor == null || ancestor.SelectedItem != null && ancestor.SelectedItem.Page != null && ancestor.SelectedItem.Page.HasFocusedChildControl())
            {
                return;
            }
            switch ((StripViewButtons)button.Tag)
            {
            case StripViewButtons.LeftScroll:
                this.itemLayout.Scroll(StripViewButtons.LeftScroll);
                break;

            case StripViewButtons.RightScroll:
                this.itemLayout.Scroll(StripViewButtons.RightScroll);
                break;

            case StripViewButtons.Close:
                ancestor.CloseItem(ancestor.SelectedItem);
                break;

            case StripViewButtons.ItemList:
                this.DisplayItemListMenu(ancestor);
                break;
            }
        }
コード例 #2
0
        internal void OnStripButtonClicked(RadPageViewStripButtonElement button)
        {
            RadPageViewStripElement parent = this.FindAncestor <RadPageViewStripElement>();

            if (parent == null)
            {
                return;
            }

            switch ((StripViewButtons)button.Tag)
            {
            case StripViewButtons.Close:
                parent.CloseItem(parent.SelectedItem);
                break;

            case StripViewButtons.LeftScroll:
                this.itemLayout.Scroll(StripViewButtons.LeftScroll);
                break;

            case StripViewButtons.RightScroll:
                this.itemLayout.Scroll(StripViewButtons.RightScroll);
                break;

            case StripViewButtons.ItemList:
                this.DisplayItemListMenu(parent);
                break;
            }
        }
コード例 #3
0
        protected virtual void UpdateCursor(Point mousePos)
        {
            RadPageViewStripElement owner = this.owner as RadPageViewStripElement;

            if (owner == null)
            {
                return;
            }
            if (!this.processing)
            {
                Cursor.Current = Cursors.Default;
            }
            else
            {
                Point mousePosition = Control.MousePosition;
                Point pt            = !this.owner.IsInValidState(true) ? mousePos : this.owner.ElementTree.Control.PointToClient(mousePosition);
                if (owner.ItemContainer.ControlBoundingRectangle.Contains(pt))
                {
                    return;
                }
                Cursor.Current = Cursors.Default;
                this.HintWindow.BackgroundImage = (Image)null;
                this.HintWindow.Hide();
                this.processing = false;
            }
        }
コード例 #4
0
        private void UpdateCursor(Point mousePos)
        {
            RadPageViewStripElement stripElement = this.owner as RadPageViewStripElement;

            if (stripElement == null)
            {
                return;
            }

            if (!this.processing)
            {
                Cursor.Current = Cursors.Default;
                return;
            }

            Point mousePt = Control.MousePosition;

            if (this.owner.IsInValidState(true))
            {
                mousePt = this.owner.ElementTree.Control.PointToClient(mousePt);
            }
            else
            {
                mousePt = mousePos;
            }

            if (!stripElement.ItemContainer.ControlBoundingRectangle.Contains(mousePt))
            {
                Cursor.Current = Cursors.Default;
                base.HintWindow.BackgroundImage = null;
                base.HintWindow.Hide();

                this.processing = false;
            }
        }
コード例 #5
0
ファイル: TabStripItem.cs プロジェクト: configare/hispeed
        protected override void OnLoaded()
        {
            base.OnLoaded();

            this.owner = base.Owner as RadPageViewStripElement;
            this.owner.PropertyChanged += new PropertyChangedEventHandler(owner_PropertyChanged);

            this.UpdateCloseButton(this.TabStrip);
            this.UpdateItemContentOrientation();
        }
コード例 #6
0
        private void UpdateTabsPosition()
        {
            if (this.ViewTemplate == null || this.pageViewElement is RadPageViewExplorerBarElement)
            {
                return;
            }
            RadPageViewStripElement pageViewElement1 = this.pageViewElement as RadPageViewStripElement;

            if (pageViewElement1 != null)
            {
                switch (this.ViewTemplate.ChildViewTabsPosition)
                {
                case TabPositions.Left:
                    pageViewElement1.StripAlignment = StripViewAlignment.Left;
                    break;

                case TabPositions.Right:
                    pageViewElement1.StripAlignment = StripViewAlignment.Right;
                    break;

                case TabPositions.Top:
                    pageViewElement1.StripAlignment = StripViewAlignment.Top;
                    break;

                case TabPositions.Bottom:
                    pageViewElement1.StripAlignment = StripViewAlignment.Bottom;
                    break;
                }
            }
            RadPageViewStackElement pageViewElement2 = this.pageViewElement as RadPageViewStackElement;

            if (pageViewElement2 == null)
            {
                return;
            }
            switch (this.ViewTemplate.ChildViewTabsPosition)
            {
            case TabPositions.Left:
                pageViewElement2.StackPosition = StackViewPosition.Left;
                break;

            case TabPositions.Right:
                pageViewElement2.StackPosition = StackViewPosition.Right;
                break;

            case TabPositions.Top:
                pageViewElement2.StackPosition = StackViewPosition.Top;
                break;

            case TabPositions.Bottom:
                pageViewElement2.StackPosition = StackViewPosition.Bottom;
                break;
            }
        }
コード例 #7
0
 protected override void OnLoaded()
 {
     base.OnLoaded();
     this.owner = this.Owner as RadPageViewStripElement;
     if (this.owner != null)
     {
         this.owner.PropertyChanged += new PropertyChangedEventHandler(this.owner_PropertyChanged);
     }
     this.UpdateTabButtoms(this.TabStrip);
     this.UpdateItemContentOrientation();
 }
コード例 #8
0
        public RadRibbonBarCommandTabCollection(RadElement owner)
        {
            RadPageViewStripElement viewStripElement = owner as RadPageViewStripElement;

            if (owner != null)
            {
                this.pageViewElement = (RadPageViewElement)viewStripElement;
                this.Owner           = (RadElement)((RadPageViewStripElement)this.pageViewElement).ItemContainer;
            }
            else
            {
                this.Owner = owner;
            }
        }
コード例 #9
0
        private void DisplayItemListMenu(RadPageViewStripElement view)
        {
            RadPageViewElementBase   itemListButton = (RadPageViewElementBase)this.buttonsPanel.ItemListButton;
            HorizontalPopupAlignment hAlign         = this.RightToLeft ? HorizontalPopupAlignment.RightToRight : HorizontalPopupAlignment.LeftToLeft;
            VerticalPopupAlignment   vAlign         = VerticalPopupAlignment.TopToBottom;

            switch (view.StripAlignment)
            {
            case StripViewAlignment.Right:
                hAlign = HorizontalPopupAlignment.RightToLeft;
                vAlign = VerticalPopupAlignment.TopToTop;
                break;

            case StripViewAlignment.Left:
                hAlign = HorizontalPopupAlignment.LeftToRight;
                vAlign = VerticalPopupAlignment.TopToTop;
                break;
            }
            view.DisplayItemListMenu(itemListButton, hAlign, vAlign);
        }
コード例 #10
0
 protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
 {
     base.OnPropertyChanged(e);
     if (this.ElementState != ElementState.Loaded)
     {
         return;
     }
     if (RadPageViewStripElement.PropertyInvalidatesScrollOffset(e.Property))
     {
         this.ResetScrollOffset();
     }
     else
     {
         if (e.Property != RadElement.BoundsProperty)
         {
             return;
         }
         this.FindAncestor <RadPageViewElement>()?.OnContentBoundsChanged();
     }
 }
コード例 #11
0
 protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
 {
     base.OnPropertyChanged(e);
     if (e.Property == RadPageViewStripElement.StripAlignmentProperty)
     {
         this.UpdateItemOrientation((IEnumerable)this.Items);
         this.UpdateItemContainer((StripViewAlignment)e.NewValue);
         if (this.SelectedItem != null && this.EnsureSelectedItemVisible)
         {
             this.EnsureItemVisible(this.SelectedItem);
         }
     }
     else if (e.Property == RadPageViewStripElement.StripScrollingAnimationProperty)
     {
         this.itemContainer.ItemLayout.SetScrollAnimation((RadEasingType)e.NewValue);
     }
     else if (e.Property == RadPageViewStripElement.AnimatedStripScrollingProperty)
     {
         this.itemContainer.ItemLayout.EnableScrolling((bool)e.NewValue);
     }
     else if (e.Property == RadPageViewStripElement.StripButtonsProperty)
     {
         if ((StripViewButtons)e.NewValue == StripViewButtons.None)
         {
             this.itemContainer.ButtonsPanel.Visibility = ElementVisibility.Collapsed;
         }
         else
         {
             this.itemContainer.ButtonsPanel.Visibility = ElementVisibility.Visible;
         }
     }
     else if (e.Property == RadPageViewStripElement.NewItemVisibilityProperty)
     {
         this.UpdateNewItem();
     }
     if (!RadPageViewStripElement.PropertyInvalidatesScrollOffset(e.Property) || !this.EnsureSelectedItemVisible || this.SelectedItem == null)
     {
         return;
     }
     this.itemContainer.ItemLayout.EnsureVisible(this.SelectedItem);
 }
コード例 #12
0
 protected virtual void OnPinButtonClick(object sender, EventArgs e)
 {
     if (this.ElementTree != null && this.ElementTree.Control.Site != null)
     {
         return;
     }
     if (this.owner.IsPreview)
     {
         RadPageViewStripElement owner = this.owner.Owner as RadPageViewStripElement;
         if (owner == null)
         {
             return;
         }
         owner.PreviewItem = (RadPageViewItem)null;
     }
     else
     {
         RadPageViewItem owner = this.owner;
         owner.IsPinned = !owner.IsPinned;
     }
 }