Ejemplo n.º 1
0
        protected override void CreateChildItems(RadElement parent)
        {
            base.CreateChildItems(parent);
            panel = new StackLayoutPanel();
            panel.StretchVertically = false;

            addButton                     = new RadButtonElement();
            addButton.Text                = "AddButton";
            addButton.MinSize             = new Size(200, 20);
            addButton.StretchVertically   = true;
            addButton.StretchHorizontally = true;
            addButton.Click              += this.AddButton_Click;
            panel.Children.Add(addButton);


            deleteButton                     = new RadButtonElement();
            deleteButton.Text                = "DeleteButton";
            deleteButton.MinSize             = new Size(200, 20);
            deleteButton.StretchVertically   = true;
            deleteButton.StretchHorizontally = true;
            deleteButton.Click              += this.DeleteButton_Click;
            panel.Children.Add(deleteButton);
            base.SizingGripDockLayout.Children.Insert(1, this.panel);

            DockLayoutPanel.SetDock(this.SizingGrip, Telerik.WinControls.Layouts.Dock.Bottom);
            DockLayoutPanel.SetDock(panel, Telerik.WinControls.Layouts.Dock.Bottom);
        }
Ejemplo n.º 2
0
        protected override void CreateChildElements()
        {
            this.LastChildFill   = true;
            this.BorderThickness = Padding.Empty;

            this.header        = new RadLabelElement();
            this.header.Margin = new Padding(0, 0, 0, 4);
            DockLayoutPanel.SetDock(this.header, Telerik.WinControls.Layouts.Dock.Top);
            this.Children.Add(this.header);

            this.viewer = new RadScrollViewer();
            this.viewer.BorderThickness = Padding.Empty;
            this.viewer.ShowBorder      = false;
            this.viewer.ShowFill        = false;
            //we do not vertical scrollbar
            this.viewer.VerticalScrollState = ScrollState.AlwaysHide;

            this.itemsPanel             = new WrapLayoutPanel();
            this.itemsPanel.Orientation = Orientation.Vertical;

            RadCanvasViewport viewport = new RadCanvasViewport();

            viewport.Children.Add(this.itemsPanel);
            this.viewer.Viewport = viewport;

            this.Children.Add(this.viewer);
        }
Ejemplo n.º 3
0
            protected override void InitializeTextElement()
            {
                base.InitializeTextElement();
                this.TextBoxElement.TextBoxItem.NullText = "Enter search criteria";
                searchButton.Click += new EventHandler(button_Click);
                searchButton.Margin = new Padding(0, 0, 0, 0);
                searchButton.Text   = string.Empty;
                searchButton.Image  = Properties.Resources.SearchIcon;

                StackLayoutElement stackPanel = new StackLayoutElement();

                stackPanel.Orientation = Orientation.Horizontal;
                stackPanel.Margin      = new Padding(1, 0, 1, 0);
                stackPanel.Children.Add(searchButton);
                RadTextBoxItem tbItem = this.TextBoxElement.TextBoxItem;

                this.TextBoxElement.Children.Remove(tbItem);

                DockLayoutPanel dockPanel = new DockLayoutPanel();

                dockPanel.Children.Add(stackPanel);
                dockPanel.Children.Add(tbItem);
                DockLayoutPanel.SetDock(tbItem, Telerik.WinControls.Layouts.Dock.Left);
                DockLayoutPanel.SetDock(stackPanel, Telerik.WinControls.Layouts.Dock.Right);
                this.TextBoxElement.Children.Add(dockPanel);
            }
Ejemplo n.º 4
0
        protected override void OnTabStripAlignmentChanged(EventArgs e)
        {
            switch (this.TabStripAlignment)
            {
            case TabStripAlignment.Top:
                this.documentButtonsLayout.Alignment = ContentAlignment.TopRight;
                this.documentButtonsLayout.SetDefaultValueOverride(RadElement.MarginProperty, new Padding(0, 2, 0, 0));
                DockLayoutPanel.SetDock(this.closeButton, Telerik.WinControls.Layouts.Dock.Right);
                DockLayoutPanel.SetDock(this.overflowMenuButton, Telerik.WinControls.Layouts.Dock.Right);
                break;

            case TabStripAlignment.Bottom:
                this.documentButtonsLayout.Alignment = ContentAlignment.BottomRight;
                this.documentButtonsLayout.SetDefaultValueOverride(RadElement.MarginProperty, new Padding(0, 0, 0, 2));
                DockLayoutPanel.SetDock(this.closeButton, Telerik.WinControls.Layouts.Dock.Right);
                DockLayoutPanel.SetDock(this.overflowMenuButton, Telerik.WinControls.Layouts.Dock.Right);
                break;

            case TabStripAlignment.Left:
                this.documentButtonsLayout.Alignment = ContentAlignment.BottomLeft;
                DockLayoutPanel.SetDock(this.closeButton, Telerik.WinControls.Layouts.Dock.Top);
                DockLayoutPanel.SetDock(this.overflowMenuButton, Telerik.WinControls.Layouts.Dock.Top);
                break;

            case TabStripAlignment.Right:
                this.documentButtonsLayout.Alignment = ContentAlignment.BottomRight;
                DockLayoutPanel.SetDock(this.closeButton, Telerik.WinControls.Layouts.Dock.Top);
                DockLayoutPanel.SetDock(this.overflowMenuButton, Telerik.WinControls.Layouts.Dock.Top);
                break;
            }

            this.tabStripElement.ItemContainer.BringToFront();

            base.OnTabStripAlignmentChanged(e);
        }
        public Point ShowControl(RadDirection popupDirection, int ownerOffset)
        {
            bool flag = false;

            this.DropDownAnimationDirection = popupDirection;
            if (this.OwnerElement is RadDateTimePickerElement)
            {
                this.SizingGrip.MinSize                = new Size(10, 10);
                this.SizingGrip.Visibility             = ElementVisibility.Visible;
                this.SizingGrip.GripItemNSEW.Alignment = ContentAlignment.BottomRight;
            }
            if (this.SizingGrip != null)
            {
                if (flag)
                {
                    DockLayoutPanel.SetDock((RadElement)this.SizingGrip, Dock.Top);
                }
                else
                {
                    DockLayoutPanel.SetDock((RadElement)this.SizingGrip, Dock.Bottom);
                }
            }
            if (!(this.OwnerElement as RadDateTimePickerElement).RightToLeft)
            {
                this.SizingGrip.RightToLeft = false;
            }
            else
            {
                this.SizingGrip.RightToLeft = true;
            }
            this.AutoUpdateBounds();
            this.ShowPopup(this.OwnerControl.RectangleToScreen(this.OwnerElement.ControlBoundingRectangle));
            return(this.Location);
        }
Ejemplo n.º 6
0
        public void ShowControl(RadDirection popupDirection, int ownerOffset)
		{
			if (this.Visible)
				return;

			bool corected = false;
			Point location = RadPopupHelper.GetValidLocationForDropDown(popupDirection,
				this.Size, this.OwnerElement, ownerOffset, ref corected);

			if (this.grip != null)
			{
				if (corected)
					DockLayoutPanel.SetDock(grip, Telerik.WinControls.Layouts.Dock.Top);		
				else
					DockLayoutPanel.SetDock(grip, Telerik.WinControls.Layouts.Dock.Bottom);		
			}

            this.Location = location;

			this.AutoUpdateBounds();
			if (this.AnimationEnabled)
			{
				this.AnimateDropDown(true);
			}
			else
			{
				this.Show();
			}
        }
Ejemplo n.º 7
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            //init section
            this.GroupHolderStackLayout.Orientation = Orientation.Vertical;
            this.gripElement.SizingMode             = SizingMode.UpDownAndRightBottom;
            this.scrollViewer.Viewport              = this.GroupHolderStackLayout;
            this.scrollViewer.ShowFill              = true;
            this.scrollViewer.ShowBorder            = false;
            this.scrollViewer.HorizontalScrollState = ScrollState.AlwaysHide;
            this.scrollViewer.ScrollLayoutPanel.MeasureWithAvaibleSize = true;
            this.mainLayout.LastChildFill = true;

            this.menuElement.AllItemsEqualHeight = true;

            //dock
            DockLayoutPanel.SetDock(this.filtersDropDownButton, Dock.Top);
            DockLayoutPanel.SetDock(this.gripElement, Dock.Bottom);
            DockLayoutPanel.SetDock(this.menuElement, Dock.Bottom);
            this.scrollViewer.Class             = "RadGalleryPopupScrollViewer";
            this.scrollViewer.FillElement.Class = "RadGalleryPopupScrollViewerFill";

            //children section
            this.gripElement.SizingMode = this.dropDownSizingMode;
            this.mainLayout.Children.Add(this.filtersDropDownButton);
            this.mainLayout.Children.Add(this.gripElement);
            this.mainLayout.Children.Add(this.menuElement);
            this.mainLayout.Children.Add(this.scrollViewer);
            this.Children.Add(this.mainLayout);

            this.WireEvents();//resize events
        }
Ejemplo n.º 8
0
        protected override void OnRightToLeftChanged(EventArgs e)
        {
            base.OnRightToLeftChanged(e);

            DockLayoutPanel.SetDock(this.captionText,
                                    (this.RightToLeft == System.Windows.Forms.RightToLeft.Yes) ?
                                    Telerik.WinControls.Layouts.Dock.Right :
                                    Telerik.WinControls.Layouts.Dock.Left);

            DockLayoutPanel.SetDock(this.actionMenuButton,
                                    (this.RightToLeft == System.Windows.Forms.RightToLeft.Yes) ?
                                    Telerik.WinControls.Layouts.Dock.Left :
                                    Telerik.WinControls.Layouts.Dock.Right);

            DockLayoutPanel.SetDock(this.autoHideButton,
                                    (this.RightToLeft == System.Windows.Forms.RightToLeft.Yes) ?
                                    Telerik.WinControls.Layouts.Dock.Left :
                                    Telerik.WinControls.Layouts.Dock.Right);

            DockLayoutPanel.SetDock(this.closeButton,
                                    (this.RightToLeft == System.Windows.Forms.RightToLeft.Yes) ?
                                    Telerik.WinControls.Layouts.Dock.Left :
                                    Telerik.WinControls.Layouts.Dock.Right);

            this.captionText.TextAlignment = (this.RightToLeft == System.Windows.Forms.RightToLeft.Yes) ? ContentAlignment.MiddleRight : ContentAlignment.MiddleLeft;
        }
Ejemplo n.º 9
0
 private RadElement CreateWindowPanesList()
 {
     this.documentWindowList = new QuickNavigatorList();
     this.documentWindowList.Header.LabelText.Class = "QuickNavigatorDocumentWindowListHeader";
     this.documentWindowList.Header.Class           = "QuickNavigatorDocumentWindowListHeaderLabel";
     DockLayoutPanel.SetDock(this.documentWindowList, Telerik.WinControls.Layouts.Dock.Left);
     return(this.documentWindowList);
 }
Ejemplo n.º 10
0
        protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
        {
            base.OnPropertyChanged(e);

            if (e.Property == RightToLeftProperty)
            {
                DockLayoutPanel.SetDock(this.stackLayout, (bool)e.NewValue ? Dock.Left : Dock.Right);
            }
        }
Ejemplo n.º 11
0
 protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
 {
     base.OnPropertyChanged(e);
     if (e.Property == RadElement.RightToLeftProperty)
     {
         DockLayoutPanel.SetDock(this.text, (this.RightToLeft) ? Dock.Right : Dock.Left);
         DockLayoutPanel.SetDock(this.buttonsLayoutPanel, (this.RightToLeft) ? Dock.Left : Dock.Right);
     }
 }
Ejemplo n.º 12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parent"></param>
        protected override void CreateChildItems(RadElement parent)
        {
            base.CreateChildItems(parent);

            this.documentButtonsLayout       = new DockLayoutPanel();
            this.documentButtonsLayout.Class = "documentButtonsLayout";
            this.documentButtonsLayout.StretchHorizontally = false;
            this.documentButtonsLayout.StretchVertically   = false;
            this.documentButtonsLayout.Alignment           = ContentAlignment.TopRight;
            this.documentButtonsLayout.ZIndex = 10;
            this.documentButtonsLayout.Margin = new Padding(0, 2, 0, 0);

            //window.Children.Add(documentButtonsLayout);
            this.splitPanelElement.Children.Add(documentButtonsLayout);
            this.tabStripElement.ContentArea.Visibility = ElementVisibility.Visible;

            this.closeButton       = new RadButtonElement();
            this.closeButton.Class = "CloseButton";
            this.closeButton.ButtonFillElement.Class = "CloseButtonFill";
            this.closeButton.SetDefaultValueOverride(RadElement.MarginProperty, new System.Windows.Forms.Padding(0, 0, 2, 0));
            this.closeButton.ClickMode           = ClickMode.Release;
            this.closeButton.Click              += new EventHandler(closeButton_Click);
            this.closeButton.ZIndex              = 5;
            this.closeButton.StretchHorizontally = false;
            this.closeButton.StretchVertically   = false;

            DockLayoutPanel.SetDock(closeButton, Telerik.WinControls.Layouts.Dock.Right);
            this.documentButtonsLayout.Children.Add(closeButton);

            this.overflowMenuButton = new OverflowDropDownButtonElement();
            this.overflowMenuButton.SetDefaultValueOverride(RadElement.MarginProperty, new System.Windows.Forms.Padding(0, 0, 2, 0));
            this.overflowMenuButton.ImageAlignment                       = System.Drawing.ContentAlignment.MiddleRight;
            this.overflowMenuButton.ShowArrow                            = false;
            this.overflowMenuButton.Class                                = "OverflowDropDownButton";
            this.overflowMenuButton.DisplayStyle                         = DisplayStyle.Image;
            this.overflowMenuButton.BorderElement.Visibility             = ElementVisibility.Collapsed;
            this.overflowMenuButton.ActionButton.Class                   = "OverflowDropDownActionButton";
            this.overflowMenuButton.ActionButton.ButtonFillElement.Class = "OverflowDropDownButtonFill";
            this.overflowMenuButton.StretchHorizontally                  = false;
            this.overflowMenuButton.StretchVertically                    = false;
            this.overflowMenuButton.MouseDown                           += new System.Windows.Forms.MouseEventHandler(activeDocumentsMenuDropDownButton_MouseDown);
            this.overflowMenuButton.ZIndex                               = 10;
            DockLayoutPanel.SetDock(overflowMenuButton, Telerik.WinControls.Layouts.Dock.Right);
            this.documentButtonsLayout.Children.Add(this.overflowMenuButton);

            this.tabStripElement.Alignment      = ContentAlignment.TopLeft;
            this.tabStripElement.StripAlignment = StripViewAlignment.Top;
            this.tabStripElement.AllowDrag      = true;
            this.splitPanelElement.Visibility   = ElementVisibility.Hidden;

            this.tabStripElement.ItemContainer.BringToFront();

            this.SetToolTips();
        }
Ejemplo n.º 13
0
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     this.buttonsLayoutPanel.Children.Add((RadElement)this.optionsButton);
     this.buttonsLayoutPanel.Children.Add((RadElement)this.pinButton);
     this.buttonsLayoutPanel.Children.Add((RadElement)this.closeButton);
     this.mainLayoutPanel.Children.Add((RadElement)this.buttonsLayoutPanel);
     this.mainLayoutPanel.Children.Add((RadElement)this.text);
     DockLayoutPanel.SetDock((RadElement)this.text, this.RightToLeft ? Dock.Right : Dock.Left);
     DockLayoutPanel.SetDock((RadElement)this.buttonsLayoutPanel, this.RightToLeft ? Dock.Left : Dock.Right);
     this.Children.Add((RadElement)this.mainLayoutPanel);
 }
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     this.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
     this.fill         = new FillPrimitive();
     this.fill.Class   = "TitleFill";
     this.Children.Add((RadElement)this.fill);
     this.layout = new DockLayoutPanel();
     this.layout.StretchVertically   = true;
     this.layout.StretchHorizontally = true;
     this.layout.LastChildFill       = false;
     this.Children.Add((RadElement)this.layout);
     this.systemButtons                         = new StackLayoutPanel();
     this.systemButtons.ZIndex                  = 10;
     this.systemButtons.Alignment               = ContentAlignment.MiddleRight;
     this.minimizeButton                        = (RadButtonElement) new RadImageButtonElement();
     this.minimizeButton.StretchHorizontally    = false;
     this.minimizeButton.StretchVertically      = false;
     this.minimizeButton.Class                  = "MinimizeButton";
     this.minimizeButton.ButtonFillElement.Name = "MinimizeButtonFill";
     this.minimizeButton.CanFocus               = false;
     this.minimizeButton.ThemeRole              = "MDIStripMinimizeButton";
     this.systemButtons.Children.Add((RadElement)this.minimizeButton);
     this.maximizeButton = (RadButtonElement) new RadImageButtonElement();
     this.maximizeButton.StretchHorizontally = false;
     this.maximizeButton.StretchVertically   = false;
     this.maximizeButton.Class = "MaximizeButton";
     this.maximizeButton.ButtonFillElement.Name = "MaximizeButtonFill";
     this.maximizeButton.CanFocus  = false;
     this.maximizeButton.ThemeRole = "MDIStripMaximizeButton";
     this.systemButtons.Children.Add((RadElement)this.maximizeButton);
     this.closeButton = (RadButtonElement) new RadImageButtonElement();
     this.closeButton.StretchHorizontally = false;
     this.closeButton.StretchVertically   = false;
     this.closeButton.Class = "CloseButton";
     this.closeButton.ButtonFillElement.Name = "CloseButtonFill";
     this.closeButton.CanFocus  = false;
     this.closeButton.ThemeRole = "MDIStripCloseButton";
     this.systemButtons.Children.Add((RadElement)this.closeButton);
     this.mdiFormIcon       = new ImagePrimitive();
     this.mdiFormIcon.Class = "MdiStripIcon";
     this.mdiFormIcon.StretchHorizontally = false;
     this.mdiFormIcon.StretchVertically   = false;
     this.mdiFormIcon.CanFocus            = false;
     this.mdiFormIcon.Margin      = new Padding(1, 1, 0, 0);
     this.mdiFormIcon.MaxSize     = new Size(16, 16);
     this.mdiFormIcon.ImageLayout = ImageLayout.Stretch;
     this.layout.Children.Add((RadElement)this.mdiFormIcon);
     this.layout.Children.Add((RadElement)this.systemButtons);
     DockLayoutPanel.SetDock((RadElement)this.systemButtons, Dock.Right);
     DockLayoutPanel.SetDock((RadElement)this.mdiFormIcon, Dock.Left);
 }
Ejemplo n.º 15
0
 private void SetDockingAlignmentUponRtlChange(bool rtlState)
 {
     if (rtlState)
     {
         DockLayoutPanel.SetDock((RadElement)this.titleBarIcon, Dock.Right);
         DockLayoutPanel.SetDock((RadElement)this.systemButtons, Dock.Left);
     }
     else
     {
         DockLayoutPanel.SetDock((RadElement)this.titleBarIcon, Dock.Left);
         DockLayoutPanel.SetDock((RadElement)this.systemButtons, Dock.Right);
     }
 }
Ejemplo n.º 16
0
 protected override void CreateChildItems(RadElement parent)
 {
     base.CreateChildItems(parent);
     this.sizingGrip                 = new SizeGripElement();
     this.sizingGrip.SizingMode      = SizingMode.None;
     this.sizingGrip.MinSize         = new Size(0, 12);
     this.sizingGripDockLayout       = new DockLayoutPanel();
     this.sizingGripDockLayout.Class = "PopupPanel";
     this.sizingGripDockLayout.Children.Add((RadElement)this.sizingGrip);
     this.sizingGripDockLayout.LastChildFill = true;
     DockLayoutPanel.SetDock((RadElement)this.sizingGrip, Dock.Bottom);
     parent.Children.Add((RadElement)this.sizingGripDockLayout);
 }
Ejemplo n.º 17
0
        protected override void CreateChildItems(RadElement parent)
        {
            DockLayoutPanel panel = new DockLayoutPanel();
            panel.Class = "PopupPanel";

            grip = new SizeGripElement();
			grip.SizingMode = SizingMode.None;
            DockLayoutPanel.SetDock(grip, Telerik.WinControls.Layouts.Dock.Bottom);
            panel.Children.Add(grip);

            if (this.popupListBoxElement != null)
                panel.Children.Add(this.popupListBoxElement);

            parent.Children.Add(panel);
        }
Ejemplo n.º 18
0
        protected override void CreateChildElements()
        {
            this.Padding = new Padding(1);

            //create header
            this.header = new RadLabelElement();
            this.header.TextAlignment         = ContentAlignment.MiddleLeft;
            this.header.Class                 = HeaderClass;
            this.header.borderPrimitive.Class = "QuickNavigatorHeaderBorder";
            this.header.LabelFill.Class       = "QuickNavigatorHeaderFill";
            this.header.LabelText.Class       = "QuickNavigatorHeaderText";

            DockLayoutPanel.SetDock(this.header, Telerik.WinControls.Layouts.Dock.Top);
            this.Children.Add(this.header);

            //create footer
            this.footer       = new RadLabelElement();
            this.footer.Class = FooterClass;
            this.footer.borderPrimitive.Class = "QuickNavigatorFooterBorder";
            this.footer.LabelFill.Class       = "QuickNavigatorFooterFill";
            this.footer.LabelText.Class       = "QuickNavigatorFooterText";
            this.footer.TextAlignment         = ContentAlignment.MiddleLeft;
            DockLayoutPanel.SetDock(this.footer, Telerik.WinControls.Layouts.Dock.Bottom);
            this.Children.Add(this.footer);

            //a strip layout panel that will hold tool windows, documents and preview
            this.listPanel = new DockLayoutPanel();
            this.listPanel.LastChildFill = true;
            this.listPanel.Margin        = new Padding(4);

            //create tool window list
            this.listPanel.Children.Add(this.CreateToolPanesList());
            //create document window list
            this.listPanel.Children.Add(this.CreateWindowPanesList());

            //create the preview - a simple label
            this.preview       = new RadLabelElement();
            this.preview.Class = PreviewClass;
            DockLayoutPanel.SetDock(this.preview, Telerik.WinControls.Layouts.Dock.Left);
            this.listPanel.Children.Add(this.preview);

            this.contentFill       = new FillPrimitive();
            this.contentFill.Class = "QuickNavigatorContentFill";
            this.contentFill.Children.Add(this.listPanel);

            //add the list content as the last child of the main panel
            this.Children.Add(this.contentFill);
        }
Ejemplo n.º 19
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parent"></param>
        protected override void CreateChildItems(RadElement parent)
        {
            base.CreateChildItems(parent);

            this.CreateCaption();
            this.window               = new DockLayoutPanel();
            this.window.Margin        = this.GetDefaultWindowMargin();
            this.window.FitToSizeMode = RadFitToSizeMode.FitToParentBounds;
            this.splitPanelElement.Children.Add(this.window);
            DockLayoutPanel.SetDock(this.caption, Telerik.WinControls.Layouts.Dock.Top);
            this.window.Children.Add(this.caption);
            this.window.Children.Add(this.tabStripElement);

            this.tabStripElement.ItemFitMode = StripViewItemFitMode.Shrink;

            this.SetToolTips();
        }
Ejemplo n.º 20
0
 protected override void OnRightToLeftChanged(EventArgs e)
 {
     base.OnRightToLeftChanged(e);
     if (this.RightToLeft == System.Windows.Forms.RightToLeft.Yes)
     {
         DockLayoutPanel.SetDock(closeButton, Telerik.WinControls.Layouts.Dock.Left);
         this.closeButton.SetDefaultValueOverride(RadElement.MarginProperty, new System.Windows.Forms.Padding(2, 0, 0, 0));
         DockLayoutPanel.SetDock(overflowMenuButton, Telerik.WinControls.Layouts.Dock.Left);
         this.overflowMenuButton.SetDefaultValueOverride(RadElement.MarginProperty, new System.Windows.Forms.Padding(2, 0, 0, 0));
     }
     else
     {
         DockLayoutPanel.SetDock(closeButton, Telerik.WinControls.Layouts.Dock.Right);
         this.closeButton.SetDefaultValueOverride(RadElement.MarginProperty, new System.Windows.Forms.Padding(0, 0, 2, 0));
         DockLayoutPanel.SetDock(overflowMenuButton, Telerik.WinControls.Layouts.Dock.Right);
         this.overflowMenuButton.SetDefaultValueOverride(RadElement.MarginProperty, new System.Windows.Forms.Padding(0, 0, 2, 0));
     }
 }
Ejemplo n.º 21
0
 protected override void CreateChildElements()
 {
     this.itemsWrapLayoutPanel            = new WrapLayoutPanel();
     this.itemsBoxLayout                  = new StatusBarBoxLayout();
     this.itemsWrapLayoutPanel.Visibility = ElementVisibility.Collapsed;
     DockLayoutPanel.SetDock((RadElement)this.itemsWrapLayoutPanel, Dock.Right);
     this.items.Owner     = (RadElement)this.itemsBoxLayout;
     this.items.ItemTypes = new System.Type[13]
     {
         typeof(RadLabelElement),
         typeof(CommandBarSeparator),
         typeof(RadButtonElement),
         typeof(RadCheckBoxElement),
         typeof(RadImageButtonElement),
         typeof(RadProgressBarElement),
         typeof(RadRadioButtonElement),
         typeof(RadRepeatButtonElement),
         typeof(RadSplitButtonElement),
         typeof(RadStatusBarPanelElement),
         typeof(RadToggleButtonElement),
         typeof(RadTrackBarElement),
         typeof(RadWaitingBarElement)
     };
     this.fillPrimitive              = new FillPrimitive();
     this.borderPrimitive            = new BorderPrimitive();
     this.borderPrimitive.BoxStyle   = BorderBoxStyle.OuterInnerBorders;
     this.borderPrimitive.Class      = "StatusBarBorder";
     this.borderPrimitive.Width      = 2f;
     this.borderPrimitive.BackColor  = Color.DarkBlue;
     this.borderPrimitive.InnerColor = Color.White;
     this.fillPrimitive              = new FillPrimitive();
     this.fillPrimitive.ShouldUsePaintBufferState = false;
     this.fillPrimitive.Class = "StatusBarFill";
     this.Children.Add((RadElement)this.borderPrimitive);
     this.Children.Add((RadElement)this.fillPrimitive);
     this.Children.Add((RadElement)this.itemsWrapLayoutPanel);
     this.Children.Add((RadElement)this.itemsBoxLayout);
     DockLayoutPanel.SetDock((RadElement)this.itemsWrapLayoutPanel, Dock.Left);
     DockLayoutPanel.SetDock((RadElement)this.itemsBoxLayout, Dock.Left);
     this.grip = new RadGripElement();
     this.Children.Add((RadElement)this.grip);
 }
Ejemplo n.º 22
0
        //search textbox
        private void AddButtonToTextBox()
        {
            LightVisualElement searchIcon = new LightVisualElement();

            searchIcon.Image = Resources.searchIcon;

            RadTextBoxItem textBoxItem = this.radTextBox1.TextBoxElement.TextBoxItem;

            this.radTextBox1.TextBoxElement.Children.Remove(textBoxItem);

            DockLayoutPanel.SetDock(textBoxItem, Telerik.WinControls.Layouts.Dock.Left);
            DockLayoutPanel.SetDock(searchIcon, Telerik.WinControls.Layouts.Dock.Right);

            DockLayoutPanel dockPanel = new DockLayoutPanel();

            dockPanel.Children.Add(searchIcon);
            dockPanel.Children.Add(textBoxItem);

            this.radTextBox1.TextBoxElement.Children.Add(dockPanel);
        }
Ejemplo n.º 23
0
        /// <summary>
        /// create elements in the RadStatusBarElement
        /// </summary>
        protected override void CreateChildElements()
        {
            this.itemsWrapLayoutPanel = new WrapLayoutPanel();
            this.itemsBoxLayout       = new StatusBarBoxLayout();
            //hide this panel by default
            this.itemsWrapLayoutPanel.Visibility = ElementVisibility.Collapsed;

            DockLayoutPanel.SetDock(itemsWrapLayoutPanel, Dock.Right);

            this.items.Owner     = this.itemsBoxLayout;
            this.items.ItemTypes = new Type[] { typeof(RadButtonElement), typeof(RadToggleButtonElement), typeof(RadRepeatButtonElement), typeof(RadCheckBoxElement), typeof(RadImageButtonElement),
                                                typeof(RadRadioButtonElement), typeof(RadLabelElement), typeof(RadProgressBarElement), typeof(RadStatusBarPanelElement), typeof(RadToolStripSeparatorItem),
                                                typeof(RadTrackBarElement), typeof(RadSplitButtonElement) };
            this.fillPrimitive = new FillPrimitive();


            this.borderPrimitive            = new BorderPrimitive();
            this.borderPrimitive.BoxStyle   = BorderBoxStyle.OuterInnerBorders;
            this.borderPrimitive.Class      = "StatusBarBorder";
            this.borderPrimitive.Width      = 2f;
            this.borderPrimitive.BackColor  = Color.DarkBlue;
            this.borderPrimitive.InnerColor = Color.White;

            this.fillPrimitive       = new FillPrimitive();
            this.fillPrimitive.Class = "StatusBarFill";



            this.Children.Add(borderPrimitive);
            this.Children.Add(fillPrimitive);

            this.Children.Add(itemsWrapLayoutPanel);
            this.Children.Add(itemsBoxLayout);

            DockLayoutPanel.SetDock(itemsWrapLayoutPanel, Dock.Left);
            DockLayoutPanel.SetDock(itemsBoxLayout, Dock.Left);

            this.grip = new RadGripElement();
            this.Children.Add(grip);
        }
Ejemplo n.º 24
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parent"></param>
        protected override void CreateChildItems(RadElement parent)
        {
            base.CreateChildItems(parent);

            if (this.window.Parent != null)
            {
                this.window.Parent.Children.Remove(this.window);
            }

            this.panel = new DockLayoutPanel();
            this.splitPanelElement.Children.Add(this.panel);
            this.splitterElement = new SplitterElement();
            DockLayoutPanel.SetDock(this.splitterElement, Telerik.WinControls.Layouts.Dock.Right);
            panel.Children.Add(this.splitterElement);
            panel.Children.Add(this.window);

            this.splitterElement.PrevNavigationButton.Visibility = ElementVisibility.Hidden;
            this.splitterElement.NextNavigationButton.Visibility = ElementVisibility.Hidden;

            this.CloseButton.ToolTipText    = RadDockLocalizationProvider.CurrentProvider.GetLocalizedString(RadDockStringId.ToolTabStripCloseButton);
            this.AutoHideButton.ToolTipText = RadDockLocalizationProvider.CurrentProvider.GetLocalizedString(RadDockStringId.ToolTabStripPinButton);
        }
Ejemplo n.º 25
0
        protected override void CreateChildElements()
        {
            this.arrowButton         = new RadArrowButtonElement();
            this.arrowButton.MinSize = RadDropDownButtonElement.ArrowButtonDefaultSize;
            this.arrowButton.SetValue(DropDownEditorLayoutPanel.IsArrowButtonProperty, true);
            this.arrowButton.Class       = "DropDownButtonArrowButton";
            this.arrowButton.MouseEnter += new EventHandler(arrowButton_MouseEnter);
            this.arrowButton.MouseLeave += new EventHandler(arrowButton_MouseLeave);
            this.arrowButton.Click      += new EventHandler(arrowButton_Click);

            this.actionButton = new ActionButtonElement();
            this.actionButton.BindProperty(RadButtonElement.DisplayStyleProperty, this, RadButtonItem.DisplayStyleProperty, PropertyBindingOptions.OneWay);
            this.actionButton.BindProperty(RadButtonElement.ImageAlignmentProperty, this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.OneWay);
            this.actionButton.BindProperty(RadButtonElement.TextAlignmentProperty, this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.OneWay);
            this.actionButton.BindProperty(RadButtonElement.TextImageRelationProperty, this, RadButtonItem.TextImageRelationProperty, PropertyBindingOptions.OneWay);
            this.actionButton.BindProperty(RadButtonElement.TextProperty, this, RadButtonItem.TextProperty, PropertyBindingOptions.TwoWay);
            this.actionButton.BindProperty(RadButtonElement.ImageIndexProperty, this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            this.actionButton.BindProperty(RadButtonElement.ImageProperty, this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            this.actionButton.BindProperty(RadButtonElement.ImageKeyProperty, this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);
            this.actionButton.SetValue(DropDownEditorLayoutPanel.IsContentProperty, true);
            this.actionButton.MouseLeave += new EventHandler(actionButton_MouseLeave);
            this.actionButton.MouseEnter += new EventHandler(actionButton_MouseEnter);
            this.actionButton.Click      += new EventHandler(actionButton_Click);
            this.actionButton.NotifyParentOnMouseInput = true;

            this.layoutPanel = new DropDownEditorLayoutPanel();
            this.layoutPanel.BindProperty(DropDownEditorLayoutPanel.AutoSizeModeProperty, this, RadDropDownButtonElement.AutoSizeModeProperty, PropertyBindingOptions.OneWay);
            this.layoutPanel.Children.Add(this.arrowButton);
            this.layoutPanel.Children.Add(this.actionButton);
            DockLayoutPanel.SetDock(arrowButton, Dock.Right);
            DockLayoutPanel.SetDock(actionButton, Dock.Left);
            layoutPanel.LastChildFill = true;

            this.borderPrimitive = new BorderPrimitive();
            this.borderPrimitive.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.borderPrimitive.Class        = "DropDownButtonBorder";
            this.Children.Add(this.borderPrimitive);
            this.Children.Add(this.layoutPanel);
        }
Ejemplo n.º 26
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
            this.imageBorderAndScrollbarsDockLayout = new StackLayoutPanel();
            this.dockLayoutPanel                     = new DockLayoutPanel();
            this.scrollBarsDockLayout                = new DockLayoutPanel();
            this.imageBorder                         = new FormImageBorderPrimitive();
            this.imageBorder.Class                   = "RadFormImageBorder";
            this.borderPrimitive                     = new FormBorderPrimitive();
            this.borderPrimitive.Class               = "RadFormBorder";
            this.borderPrimitive.StretchVertically   = true;
            this.borderPrimitive.StretchHorizontally = true;
            this.radTitleBarElement                  = this.CreateTitleBarElement();
            this.radTitleBarElement.Class            = "TitleBar";
            this.radTitleBarElement.AutoSizeMode     = RadAutoSizeMode.FitToAvailableSize;
            this.mdiControlStripItem                 = new RadFormMdiControlStripItem();
            int num = (int)this.mdiControlStripItem.Fill.SetDefaultValueOverride(FillPrimitive.GradientStyleProperty, (object)GradientStyles.Solid);

            this.mdiControlStripItem.Visibility = ElementVisibility.Collapsed;
            this.mdiControlStripItem.MinSize    = new Size(0, 18);
            this.mdiControlStripItem.MaxSize    = new Size(0, 18);
            this.mdiControlStripItem.Class      = "MdiControlStrip";
            this.dockLayoutPanel.Children.Add((RadElement)this.radTitleBarElement);
            this.dockLayoutPanel.Children.Add((RadElement)this.mdiControlStripItem);
            this.dockLayoutPanel.Children.Add((RadElement)this.imageBorderAndScrollbarsDockLayout);
            this.Children.Add((RadElement)this.imageBorder);
            this.Children.Add((RadElement)this.scrollBarsDockLayout);
            this.horizontalScrollbar            = new RadScrollBarElement();
            this.horizontalScrollbar.ScrollType = ScrollType.Horizontal;
            this.horizontalScrollbar.Class      = "RadFormHScroll";
            this.horizontalScrollbar.MinSize    = new Size(0, RadScrollBarElement.HorizontalScrollBarHeight);
            this.verticalScrollbar                  = new RadScrollBarElement();
            this.verticalScrollbar.ScrollType       = ScrollType.Vertical;
            this.verticalScrollbar.Class            = "RadFormVScroll";
            this.verticalScrollbar.MinSize          = new Size(RadScrollBarElement.VerticalScrollBarWidth, 0);
            this.horizontalScrollBarAndSquareHolder = new DockLayoutPanel();
            this.formSizingGrip             = new RadItem();
            this.formSizingGripFill         = new FillPrimitive();
            this.formSizingGripFill.Class   = "RadFormScrollSquareFill";
            this.formSizingGripBorder       = new BorderPrimitive();
            this.formSizingGripBorder.Class = "RadFormScrollSquareBorder";
            this.formSizingGrip.Class       = "RadFormElementScrollbarSquare";
            this.formSizingGrip.Children.Add((RadElement)this.formSizingGripFill);
            this.formSizingGrip.Children.Add((RadElement)this.formSizingGripBorder);
            this.formSizingGrip.MinSize       = new Size(RadScrollBarElement.VerticalScrollBarWidth, RadScrollBarElement.HorizontalScrollBarHeight);
            this.horizontalScrollbarDockPanel = new DockLayoutPanel();
            this.horizontalScrollbarDockPanel.Children.Add((RadElement)this.horizontalScrollbar);
            DockLayoutPanel.SetDock((RadElement)this.horizontalScrollbar, Dock.Bottom);
            this.horizontalScrollBarAndSquareHolder.Children.Add((RadElement)this.formSizingGrip);
            this.horizontalScrollBarAndSquareHolder.Children.Add((RadElement)this.horizontalScrollbarDockPanel);
            this.horizontalScrollBarAndSquareHolder.LastChildFill = true;
            DockLayoutPanel.SetDock((RadElement)this.horizontalScrollbarDockPanel, Dock.Right);
            DockLayoutPanel.SetDock((RadElement)this.formSizingGrip, Dock.Right);
            DockLayoutPanel.SetDock((RadElement)this.radTitleBarElement, Dock.Top);
            DockLayoutPanel.SetDock((RadElement)this.mdiControlStripItem, Dock.Top);
            this.scrollBarsDockLayout.Children.Add((RadElement)this.horizontalScrollBarAndSquareHolder);
            this.scrollBarsDockLayout.Children.Add((RadElement)this.verticalScrollbar);
            this.scrollBarsDockLayout.LastChildFill = false;
            DockLayoutPanel.SetDock((RadElement)this.horizontalScrollBarAndSquareHolder, Dock.Bottom);
            DockLayoutPanel.SetDock((RadElement)this.verticalScrollbar, Dock.Right);
            this.Children.Add((RadElement)this.dockLayoutPanel);
            this.Children.Add((RadElement)this.borderPrimitive);
        }
Ejemplo n.º 27
0
        private void CreateCaption()
        {
            this.caption       = new ToolWindowCaptionElement();
            this.caption.Class = "ToolWindowCaption";
            this.caption.RadPropertyChanged += new RadPropertyChangedEventHandler(caption_RadPropertyChanged);

            this.captionFill = new FillPrimitive();
            this.captionFill.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.captionFill.Class        = "TitleFill";
            this.caption.Children.Add(this.captionFill);

            this.captionBorder       = new BorderPrimitive();
            this.captionBorder.Class = "TitleBorder";
            this.caption.Children.Add(this.captionBorder);

            this.captionLayout        = new DockLayoutPanel();
            this.captionLayout.Class  = "CaptionButtonsLayout";
            this.captionLayout.Margin = new Padding(0, 2, 0, 2);
            this.caption.Children.Add(this.captionLayout);

            this.closeButton = new RadButtonElement();
            this.closeButton.SetDefaultValueOverride(RadElement.MarginProperty, new Padding(1, 0, 1, 0));
            this.closeButton.Class = "CloseButton";
            this.closeButton.ButtonFillElement.Class = "CloseButtonFill";
            this.closeButton.MinSize   = new Size(7, 7);
            this.closeButton.ClickMode = ClickMode.Release;
            this.closeButton.Click    += new EventHandler(captionCloseButton_Click);
            DockLayoutPanel.SetDock(this.closeButton, Telerik.WinControls.Layouts.Dock.Right);
            this.captionLayout.Children.Add(closeButton);

            this.autoHideButton       = new RadToggleButtonElement();
            this.autoHideButton.Class = "AutoHideButton";
            this.autoHideButton.ButtonFillElement.Class = "AutoHideButtonFill";
            this.autoHideButton.MinSize = new Size(7, 7);
            this.autoHideButton.SetDefaultValueOverride(RadElement.MarginProperty, new Padding(1, 0, 1, 0));
            this.autoHideButton.ClickMode   = ClickMode.Release;
            this.autoHideButton.ToggleState = ToggleState.On;
            this.autoHideButton.Click      += new EventHandler(captionAutoHideButton_Click);
            DockLayoutPanel.SetDock(this.autoHideButton, Telerik.WinControls.Layouts.Dock.Right);
            this.captionLayout.Children.Add(autoHideButton);

            this.actionMenuButton = new OverflowDropDownButtonElement();
            this.actionMenuButton.SetDefaultValueOverride(RadElement.MarginProperty, new Padding(1, 0, 1, 0));
            this.actionMenuButton.ImageAlignment = System.Drawing.ContentAlignment.MiddleRight;
            this.actionMenuButton.ShowArrow      = false;
            this.actionMenuButton.Class          = "SystemDropDownButton";
            this.actionMenuButton.ActionButton.ButtonFillElement.Class = "SystemDropDownButtonFill";
            this.actionMenuButton.ActionButton.Class = "SystemDropDownActionButton";
            this.actionMenuButton.MinSize            = new Size(7, 7);
            this.actionMenuButton.DisplayStyle       = DisplayStyle.Image;
            this.actionMenuButton.Text = "";
            this.actionMenuButton.BorderElement.Visibility = ElementVisibility.Collapsed;
            this.actionMenuButton.MouseDown += new MouseEventHandler(captionSystemDownButton_MouseDown);
            DockLayoutPanel.SetDock(this.actionMenuButton, Telerik.WinControls.Layouts.Dock.Right);
            this.captionLayout.Children.Add(this.actionMenuButton);

            this.captionText       = new TextPrimitive();
            this.captionText.Text  = "ToolTabStrip";
            this.captionText.Class = "TitleCaption";
            this.captionText.StretchHorizontally = true;
            this.captionText.StretchVertically   = true;
            this.captionText.TextAlignment       = ContentAlignment.MiddleLeft;
            DockLayoutPanel.SetDock(this.captionText, Telerik.WinControls.Layouts.Dock.Left);
            this.captionLayout.Children.Add(captionText);
        }
Ejemplo n.º 28
0
        /// <summary>
        /// create child elements
        /// </summary>
        protected override void CreateChildElements()
        {
            this.textItem = new RadTextBoxItem();
            this.SetSpinValue(this.value, true);

            this.textItem.TextChanging             += new TextChangingEventHandler(textItem_TextChanging);
            this.textItem.TextChanged              += new EventHandler(textItem_TextChanged);
            this.textItem.LostFocus                += new EventHandler(textItem_LostFocus);
            this.textItem.KeyPress                 += new KeyPressEventHandler(textItem_KeyPress);
            this.textItem.KeyDown                  += new KeyEventHandler(textItem_KeyDown);
            this.textItem.KeyUp                    += new KeyEventHandler(textItem_KeyUp);
            this.textItem.HostedControl.MouseWheel += new MouseEventHandler(textItem_MouseWheel);
            this.textItem.HostedControl.MouseUp    += new MouseEventHandler(HostedControl_MouseUp);
            this.textItem.Alignment                 = ContentAlignment.MiddleLeft;
            this.textItem.StretchHorizontally       = true;
            this.textItem.StretchVertically         = false;

            this.buttonUp           = new RadRepeatArrowElement();
            this.buttonUp.ThemeRole = "UpButton";
            this.buttonUp.Class     = "UpButton";
            //hack!!!!!!!!!!!!
            this.buttonUp.Padding = new Padding(1, 0, 3, 2);
            //this.buttonUp.Margin = new Padding(0, 1, 1, 0);
            //this.buttonUp.Border.Visibility = ElementVisibility.Collapsed;
            this.buttonUp.Click         += new EventHandler(ButtonUp_Click);
            this.buttonUp.DoubleClick   += new EventHandler(ButtonUp_Click);
            this.buttonUp.Direction      = ArrowDirection.Up;
            this.buttonUp.Arrow.AutoSize = true;

            this.buttonDown           = new RadRepeatArrowElement();
            this.buttonDown.ThemeRole = "DownButton";
            this.buttonDown.Class     = "DownButton";
            //hack!!!!!!!!!!!!
            this.buttonDown.Padding = new Padding(1, 1, 3, 1);
            //this.buttonDown.Margin = new Padding(0, 0, 1, 1);
            //this.buttonDown.Border.Visibility = ElementVisibility.Collapsed;
            this.buttonDown.Click         += new EventHandler(ButtonDown_Click);
            this.buttonDown.DoubleClick   += new EventHandler(ButtonDown_Click);
            this.buttonDown.Arrow.AutoSize = true;
            this.buttonDown.Direction      = ArrowDirection.Down;
            this.stackLayout             = new BoxLayout();
            this.stackLayout.Orientation = Orientation.Vertical;
            BoxLayout.SetProportion(this.buttonUp, 1);
            BoxLayout.SetProportion(this.buttonDown, 1);
            this.stackLayout.Children.Add(this.buttonUp);
            this.stackLayout.Children.Add(this.buttonDown);

            this.textBoxFillPrimitive                = new FillPrimitive();
            this.textBoxFillPrimitive.Class          = "SpinElementFill";
            this.textBoxFillPrimitive.NumberOfColors = 1;
            this.textBoxFillPrimitive.MouseDown     += delegate { this.textItem.Focus(); };
            this.Children.Add(this.textBoxFillPrimitive);
            //this.textBoxFillPrimitive.BackColor = this.textItem.BackColor;

            this.dockLayout = new DockLayoutPanel();
            this.dockLayout.LastChildFill = true;

            if (!this.RightToLeft)
            {
                DockLayoutPanel.SetDock(stackLayout, Dock.Right);
            }
            else
            {
                DockLayoutPanel.SetDock(stackLayout, Dock.Left);
            }

            DockLayoutPanel.SetDock(this.textBoxFillPrimitive, Dock.Bottom);
            DockLayoutPanel.SetDock(this.textItem, Dock.Top);

            dockLayout.Children.Add(stackLayout);
            dockLayout.Children.Add(this.textItem);

            this.border       = new BorderPrimitive();
            this.border.Class = "SpinElementBorder";
            this.Children.Add(border);
            this.Children.Add(dockLayout);

            this.textItem.BindProperty(TextPrimitive.TextProperty, this, TextProperty, PropertyBindingOptions.TwoWay);

            this.textItem.Multiline     = false;
            this.textItem.RouteMessages = false;
            this.StretchVertically      = false;
        }