示例#1
0
 protected virtual void SetupInnerControls(
     KeyValuePair <string, Control> pair,
     Size propertyItemControlSize,
     Point propertyItemControlLocation,
     RadPanel propertyItemContainer,
     RadLabel labelControl,
     RadLabel validationControl,
     Control editorControl)
 {
     propertyItemContainer.PanelElement.PanelBorder.Visibility = ElementVisibility.Collapsed;
     if (this.RightToLeft)
     {
         labelControl.Dock          = DockStyle.Right;
         validationControl.Dock     = DockStyle.Left;
         labelControl.TextAlignment = ContentAlignment.MiddleRight;
     }
     else
     {
         labelControl.Dock          = DockStyle.Left;
         validationControl.Dock     = DockStyle.Right;
         labelControl.TextAlignment = ContentAlignment.MiddleLeft;
     }
     editorControl.Dock                     = DockStyle.Fill;
     labelControl.AutoSize                  = false;
     labelControl.TextWrap                  = false;
     labelControl.Text                      = pair.Key;
     validationControl.TextWrap             = false;
     validationControl.LabelElement.MinSize = new Size(20, 0);
     if (editorControl is RadControl)
     {
         (editorControl as RadControl).AutoSize = false;
     }
     propertyItemContainer.Location = propertyItemControlLocation;
     propertyItemContainer.Size     = propertyItemControlSize;
 }
示例#2
0
 protected virtual void CreateAssociatedCoverPanel()
 {
     this.associatedControlCover           = new RadPanel();
     this.associatedControlCover.BackColor = Color.FromArgb(128, (int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue);
     this.associatedControlCover.PanelElement.PanelBorder.ForeColor = Color.FromArgb(238, 238, 238);
     this.associatedControlCover.PanelElement.Text = string.Empty;
 }
示例#3
0
        protected override void OnThemeChanged()
        {
            base.OnThemeChanged();
            if (!TelerikHelper.IsMaterialTheme(this.ThemeName))
            {
                return;
            }
            SizeF dpiScaleFactor = this.PanelElement.DpiScaleFactor;

            this.ItemDefaultSize = new Size(Math.Max(this.ItemDefaultSize.Width, (int)(300.0 / (double)dpiScaleFactor.Width)), Math.Max(this.ItemDefaultSize.Height, (int)(36.0 / (double)dpiScaleFactor.Height)));
            this.DataEntryElement.Clear();
            this.DataEntryElement.InitializeDataEntry();
            this.DataEntryElement.CreateEditors();
            this.DataEntryElement.ArrangeControls();
            foreach (Control control1 in (ArrangedElementCollection)this.PanelContainer.Controls)
            {
                RadPanel radPanel = control1 as RadPanel;
                if (radPanel != null)
                {
                    RadTextBox control2 = radPanel.Controls[0] as RadTextBox;
                    if (control2 != null)
                    {
                        control2.TextBoxItem.StretchVertically = true;
                    }
                }
            }
        }
        private void CreateElements()
        {
            if (this.timePicker != null)
            {
                this.timePicker.CloseButtonClicked -= new EventHandler(this.timePicker_CloseButtonClicked);
                this.timePicker.ValueChanged       -= new EventHandler(this.timePicker_ValueChanged);
            }
            if (this.popupControl != null)
            {
                this.popupControl.Opened  -= new EventHandler(this.popupControl_Opened);
                this.popupControl.Closing -= new RadPopupClosingEventHandler(this.popupControl_Closing);
                this.popupControl.Closed  -= new RadPopupClosedEventHandler(this.popupControl_Closed);
            }
            if (this.ShowTimePicker)
            {
                this.panel                          = new RadPanel();
                this.calendar.Size                  = new Size(180, 150);
                this.calendar.Dock                  = DockStyle.Left;
                this.timePicker                     = new RadTimePickerContent();
                this.timePicker.ReadOnly            = this.Calendar.ReadOnly;
                this.timePicker.Culture             = this.textBoxElement.Culture;
                this.timePicker.CloseButtonClicked += new EventHandler(this.timePicker_CloseButtonClicked);
                this.timePicker.ValueChanged       += new EventHandler(this.timePicker_ValueChanged);
                this.timePicker.Dock                = DockStyle.Fill;
                if (this.showFooter)
                {
                    this.footerPanel      = new TimePickerDoneButtonContent(this.timePicker.TimePickerElement);
                    this.footerPanel.Dock = DockStyle.Bottom;
                }
                this.panel.Controls.Add((Control)this.timePicker);
                this.panel.Controls.Add((Control)this.calendar);
                if (this.showFooter)
                {
                    this.panel.Controls.Add((Control)this.footerPanel);
                }
            }
            this.popupControl               = new RadDateTimePickerDropDown((RadItem)this.dateTimePickerElement);
            this.popupControl.SizingMode    = SizingMode.UpDownAndRightBottom;
            this.popupControl.Opened       += new EventHandler(this.popupControl_Opened);
            this.popupControl.Closing      += new RadPopupClosingEventHandler(this.popupControl_Closing);
            this.popupControl.Closed       += new RadPopupClosedEventHandler(this.popupControl_Closed);
            this.popupControl.HostedControl = !this.ShowTimePicker ? (RadControl)this.calendar : (RadControl)this.panel;
            string themeName = this.Calendar.ThemeName;

            this.popupControl.ThemeName = themeName;
            if (this.ShowTimePicker && this.TimePicker != null)
            {
                this.panel.ThemeName      = themeName;
                this.TimePicker.ThemeName = themeName;
                if (this.ShowFooter)
                {
                    this.FooterPanel.ThemeName = themeName;
                }
            }
            this.popupControl.LoadElementTree();
        }
示例#5
0
        protected virtual bool GenerateControlsRunTime(
            int currentColumn,
            KeyValuePair <string, Control> pair,
            Size propertyItemControlSize,
            Point propertyItemControlLocation)
        {
            RadPanel radPanel          = new RadPanel();
            RadLabel labelControl      = new RadLabel();
            RadLabel validationControl = new RadLabel();
            Control  editorControl     = pair.Value;
            string   str = this.DataEntryControl.ThemeName;

            if (string.IsNullOrEmpty(str))
            {
                str = ThemeResolutionService.ApplicationThemeName;
            }
            radPanel.ThemeName          = str;
            labelControl.ThemeName      = str;
            validationControl.ThemeName = str;
            if (editorControl is RadControl)
            {
                (editorControl as RadControl).ThemeName = str;
            }
            this.SetupInnerControls(pair, propertyItemControlSize, propertyItemControlLocation, radPanel, labelControl, validationControl, editorControl);
            radPanel.Controls.Add(editorControl);
            radPanel.Controls.Add((Control)labelControl);
            radPanel.Controls.Add((Control)validationControl);
            ItemInitializingEventArgs e = new ItemInitializingEventArgs(radPanel);

            this.OnItemInitializing((object)this, e);
            if (e.Cancel)
            {
                return(false);
            }
            this.DataEntryControl.PanelContainer.Controls.Add((Control)radPanel);
            this.OnItemInitialized((object)this, new ItemInitializedEventArgs(radPanel));
            this.allReadyGeneratedProperties.Add(pair.Key, editorControl);
            if (this.controlsInEachColumn.ContainsKey(currentColumn))
            {
                this.controlsInEachColumn[currentColumn].Add(labelControl);
            }
            else
            {
                this.controlsInEachColumn.Add(currentColumn, new List <RadLabel>()
                {
                    labelControl
                });
            }
            this.validationInfoForEachEditor[editorControl].Label           = labelControl;
            this.validationInfoForEachEditor[editorControl].ValidationLabel = validationControl;
            return(true);
        }
示例#6
0
        private bool IsThisPropertyAlreadyCreated(string labeltext, PropertyDescriptor property)
        {
            foreach (Control control in (ArrangedElementCollection)this.DataEntryControl.PanelContainer.Controls)
            {
                RadPanel radPanel = control as RadPanel;
                if (radPanel != null && radPanel.Controls[1] is RadLabel && radPanel.Controls[1].Text == labeltext)
                {
                    System.Type type;
                    if (property.PropertyType.IsEnum)
                    {
                        type = typeof(RadDropDownList);
                    }
                    else
                    {
                        switch (property.PropertyType.Name)
                        {
                        case "DateTime":
                            type = typeof(RadDateTimePicker);
                            break;

                        case "Boolean":
                            type = typeof(RadCheckBox);
                            break;

                        case "Color":
                            type = typeof(RadColorBox);
                            break;

                        case "Image":
                            type = typeof(PictureBox);
                            break;

                        default:
                            type = typeof(RadTextBox);
                            break;
                        }
                    }
                    if ((object)type == (object)radPanel.Controls[0].GetType())
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
示例#7
0
        protected virtual void GenerateControlsDesignTime(
            int currentColumn,
            KeyValuePair <string, Control> pair,
            Size propertyItemControlSize,
            Point propertyItemControlLocation)
        {
            IComponent component1        = this.designerHost.CreateComponent(typeof(RadPanel));
            IComponent component2        = this.designerHost.CreateComponent(typeof(RadLabel));
            IComponent component3        = this.designerHost.CreateComponent(typeof(RadLabel));
            RadPanel   radPanel          = (RadPanel)component1;
            RadLabel   labelControl      = (RadLabel)component2;
            RadLabel   validationControl = (RadLabel)component3;

            this.SetupInnerControls(pair, propertyItemControlSize, propertyItemControlLocation, radPanel, labelControl, validationControl, pair.Value);
            this.changeService.OnComponentChanging((object)this.DataEntryControl.Site.Component, (MemberDescriptor)null);
            radPanel.SuspendLayout();
            radPanel.Controls.Add(pair.Value);
            radPanel.Controls.Add((Control)labelControl);
            radPanel.Controls.Add((Control)validationControl);
            ItemInitializingEventArgs e = new ItemInitializingEventArgs(radPanel);

            this.OnItemInitializing((object)this, e);
            if (e.Cancel)
            {
                return;
            }
            this.DataEntryControl.PanelContainer.Controls.Add((Control)radPanel);
            this.OnItemInitialized((object)this, new ItemInitializedEventArgs(radPanel));
            this.changeService.OnComponentChanged((object)this.DataEntryControl.Site.Component, (MemberDescriptor)null, (object)null, (object)null);
            this.allReadyGeneratedProperties.Add(pair.Key, pair.Value);
            if (this.controlsInEachColumn.ContainsKey(currentColumn))
            {
                this.controlsInEachColumn[currentColumn].Add(labelControl);
            }
            else
            {
                this.controlsInEachColumn.Add(currentColumn, new List <RadLabel>()
                {
                    labelControl
                });
            }
            radPanel.ResumeLayout(true);
            this.validationInfoForEachEditor[pair.Value].Label           = labelControl;
            this.validationInfoForEachEditor[pair.Value].ValidationLabel = validationControl;
        }
示例#8
0
 private void ClearAssociatedControl()
 {
     if (this.associatedControlCover != null)
     {
         this.associatedControlCover.Layout           -= new LayoutEventHandler(this.associatedControlCover_Layout);
         this.associatedControlCover.BackColorChanged -= new EventHandler(this.associatedControlCover_BackColorChanged);
         if (this.associatedControlCover.Controls.Contains((Control)this))
         {
             this.associatedControlCover.Controls.Remove((Control)this);
         }
     }
     if (this.associatedControl != null && this.associatedControl.Controls.Contains((Control)this.associatedControlCover))
     {
         this.associatedControl.Controls.Remove((Control)this.associatedControlCover);
     }
     if (this.oldParent != null)
     {
         this.Parent = this.oldParent;
     }
     this.associatedControlCover = (RadPanel)null;
 }
示例#9
0
 private void TrySubscribeControls()
 {
     foreach (Control control1 in (ArrangedElementCollection)this.PanelContainer.Controls)
     {
         RadPanel radPanel        = control1 as RadPanel;
         RadLabel label           = (RadLabel)null;
         RadLabel validationLabel = (RadLabel)null;
         if (radPanel != null)
         {
             label           = radPanel.Controls.Count > 0 ? radPanel.Controls[1] as RadLabel : (RadLabel)null;
             validationLabel = radPanel.Controls.Count > 2 ? radPanel.Controls[2] as RadLabel : (RadLabel)null;
         }
         List <Control> controlList = new List <Control>(ControlHelper.EnumChildControls(control1, true));
         controlList.Insert(0, control1);
         foreach (Control control2 in controlList)
         {
             if (control2.DataBindings.Count > 0 && control2.DataBindings[0].DataSource == this.DataSource)
             {
                 PropertyDescriptor property           = (PropertyDescriptor)null;
                 BindingManagerBase bindingManagerBase = control2.DataBindings[0].BindingManagerBase;
                 if (bindingManagerBase != null)
                 {
                     foreach (PropertyDescriptor itemProperty in bindingManagerBase.GetItemProperties())
                     {
                         if (itemProperty.Name == control2.DataBindings[0].BindingMemberInfo.BindingMember)
                         {
                             property = itemProperty;
                         }
                     }
                     if (property != null)
                     {
                         this.DataEntryElement.SubscribeControl(control1, property, label, validationLabel);
                     }
                 }
             }
         }
     }
 }
示例#10
0
        /// <exclude/>
        public override ControlStyleBuilderInfoList GetThemeDesignedControls(Control previewSurface)
        {
            RadPanel panel = new RadPanel();

            panel.AutoSize = true;

            panel.Text = "RadPanel";

            RadPanel panelStructure = new RadPanel();

            panelStructure.AutoSize = true;

            panelStructure.Text = "RadPanel";

            ControlStyleBuilderInfo designed = new ControlStyleBuilderInfo(panel, panelStructure.RootElement);

            designed.MainElementClassName = typeof(RadPanelElement).FullName;

            ControlStyleBuilderInfoList res = new ControlStyleBuilderInfoList();

            res.Add(designed);

            return(res);
        }
示例#11
0
 public ItemInitializingEventArgs(RadPanel panel)
 {
     this.panel = panel;
 }
示例#12
0
 private void InitializeComponent()
 {
     this.radTextBox1 = new RadTextBox();
     this.plusButton  = new RadRepeatButton();
     this.minusButton = new RadRepeatButton();
     this.radPanel1   = new RadPanel();
     this.radTextBox1.BeginInit();
     this.plusButton.BeginInit();
     this.minusButton.BeginInit();
     this.radPanel1.BeginInit();
     this.radPanel1.SuspendLayout();
     this.SuspendLayout();
     this.radTextBox1.Anchor   = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
     this.radTextBox1.AutoSize = false;
     this.radTextBox1.Location = new Point(26, 2);
     this.radTextBox1.Name     = "radTextBox1";
     this.radTextBox1.RootElement.StretchVertically = true;
     this.radTextBox1.Size     = new Size(62, 17);
     this.radTextBox1.TabIndex = 2;
     this.radTextBox1.TabStop  = false;
     this.radTextBox1.Text     = "text";
     this.radTextBox1.GetChildAt(0).StretchVertically        = true;
     ((RadItem)this.radTextBox1.GetChildAt(0)).Text          = "text";
     this.radTextBox1.GetChildAt(0).GetChildAt(0).Alignment  = ContentAlignment.MiddleCenter;
     this.radTextBox1.GetChildAt(0).GetChildAt(2).Visibility = ElementVisibility.Collapsed;
     this.plusButton.Dock      = DockStyle.Right;
     this.plusButton.Location  = new Point(88, 1);
     this.plusButton.Name      = "plusButton";
     this.plusButton.Size      = new Size(25, 19);
     this.plusButton.TabIndex  = 1;
     this.plusButton.Text      = "+";
     this.plusButton.Click    += new EventHandler(this.plusButton_Click);
     this.minusButton.Dock     = DockStyle.Left;
     this.minusButton.Location = new Point(1, 1);
     this.minusButton.Name     = "minusButton";
     this.minusButton.Size     = new Size(25, 19);
     this.minusButton.TabIndex = 0;
     this.minusButton.Text     = "-";
     this.minusButton.Click   += new EventHandler(this.minusButton_Click);
     this.radPanel1.Controls.Add((Control)this.radTextBox1);
     this.radPanel1.Controls.Add((Control)this.plusButton);
     this.radPanel1.Controls.Add((Control)this.minusButton);
     this.radPanel1.Dock                = DockStyle.Fill;
     this.radPanel1.Location            = new Point(0, 0);
     this.radPanel1.Name                = "radPanel1";
     this.radPanel1.Padding             = new Padding(1);
     this.radPanel1.RootElement.Padding = new Padding(1);
     this.radPanel1.Size                = new Size(114, 21);
     this.radPanel1.TabIndex            = 3;
     this.AutoScaleDimensions           = new SizeF(6f, 13f);
     this.AutoScaleMode = AutoScaleMode.None;
     this.Controls.Add((Control)this.radPanel1);
     this.Name = nameof(PlusMinusEditor);
     this.Size = new Size(114, 21);
     this.radTextBox1.EndInit();
     this.plusButton.EndInit();
     this.minusButton.EndInit();
     this.radPanel1.EndInit();
     this.radPanel1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
示例#13
0
        public Frm_MainProcess()
        {
            InitializeComponent();
            DiagramRibbonBarLocalizationProvider.CurrentProvider = new PersianDiagramRibbonBarLocalizationProvider();



            //foreach (var Item in Rd_Toolbars.Items.ToList())
            //{
            //    Item.Key = "";
            //}
            //        this.Rd_Toolbars.ListViewElement.DragDropService.PreviewDragDrop
            //    += DragDropService_PreviewDragDrop;

            //        this.Rd_Toolbars.VisualItemFormatting += radDiagramToolbox1_VisualItemFormatting;
            //        DiagramListViewDataItem item = new DiagramListViewDataItem();
            //        item.Key = "Image";
            //        item.Text = "";


            //// item.Shape = new AShape();
            //        item.Group = Rd_Toolbars.Groups[0];
            //        this.Rd_Toolbars.Items.Add(item);



            this.radPanel1     = new Telerik.WinControls.UI.RadPanel();
            this.Img           = new System.Windows.Forms.PictureBox();
            this.Btn_OpenImg   = new System.Windows.Forms.Button();
            this.Txt_ImagePath = new Telerik.WinControls.UI.RadTextBox();
            this.Lbl_imagePath = new System.Windows.Forms.Label();

            //
            // radPanel1
            //
            this.radPanel1.Controls.Add(this.Img);
            this.radPanel1.Controls.Add(this.Btn_OpenImg);
            this.radPanel1.Controls.Add(this.Txt_ImagePath);
            this.radPanel1.Controls.Add(this.Lbl_imagePath);
            this.radPanel1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.radPanel1.Location = new System.Drawing.Point(0, 0);
            this.radPanel1.Name     = "radPanel1";
            this.radPanel1.Size     = new System.Drawing.Size(258, 197);
            this.radPanel1.TabIndex = 1;
            //
            // Img
            //
            this.Img.Location = new System.Drawing.Point(8, 33);
            this.Img.Name     = "Img";
            this.Img.Size     = new System.Drawing.Size(250, 190);
            this.Img.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.Img.TabIndex = 3;
            this.Img.TabStop  = false;
            //
            // Btn_OpenImg
            //
            this.Btn_OpenImg.Location = new System.Drawing.Point(213, 7);
            this.Btn_OpenImg.Name     = "Btn_OpenImg";
            this.Btn_OpenImg.Size     = new System.Drawing.Size(38, 20);
            this.Btn_OpenImg.TabIndex = 2;
            this.Btn_OpenImg.Text     = "...";
            this.Btn_OpenImg.UseVisualStyleBackColor = true;
            this.Btn_OpenImg.Click += new System.EventHandler(this.Btn_OpenImg_Click);
            //
            // Txt_ImagePath
            //
            this.Txt_ImagePath.Enabled  = false;
            this.Txt_ImagePath.Location = new System.Drawing.Point(70, 7);
            this.Txt_ImagePath.Name     = "Txt_ImagePath";
            this.Txt_ImagePath.Size     = new System.Drawing.Size(143, 20);
            this.Txt_ImagePath.TabIndex = 1;
            //
            // Lbl_imagePath
            //
            this.Lbl_imagePath.AutoSize = true;
            this.Lbl_imagePath.Location = new System.Drawing.Point(3, 9);
            this.Lbl_imagePath.Name     = "Lbl_imagePath";
            this.Lbl_imagePath.Size     = new System.Drawing.Size(70, 13);
            this.Lbl_imagePath.TabIndex = 0;
            this.Lbl_imagePath.Text     = "Image Path :";

            RadPageViewPage toolsPage = new RadPageViewPage();

            toolsPage.Text = "image";
            toolsPage.Controls.Add(radPanel1);

            this.RdMainDiagram.DiagramElement.SettingsPane.RadPageView.Pages.Add(toolsPage);
        }