예제 #1
0
        private void SetTabPageProperties(int pageIndex)
        {
            XtraTabPage  tabPage  = this.tabControl.TabPages[pageIndex];
            ColorListBox colorBox = null;
            BaseControl  control  = null;

            switch (pageIndex)
            {
            case 0:
                tabPage.Text = Localizer.Active.GetLocalizedString(StringId.ColorTabCustom);
                control      = new ColorCellsControl(null);
                DevExpress.XtraEditors.Repository.RepositoryItemColorEdit rItem = new DevExpress.XtraEditors.Repository.RepositoryItemColorEdit();
                rItem.ShowColorDialog = false;
                (control as ColorCellsControl).Properties  = rItem;
                (control as ColorCellsControl).EnterColor += new EnterColorEventHandler(OnEnterColor);
                control.Size = ColorCellsControlViewInfo.BestSize;
                break;

            case 1:
                tabPage.Text = Localizer.Active.GetLocalizedString(StringId.ColorTabWeb);
                colorBox     = CreateColorListBox();
                colorBox.Items.AddRange(ColorListBoxViewInfo.WebColors);
                colorBox.EnterColor += new EnterColorEventHandler(OnEnterColor);
                control              = colorBox;
                break;

            case 2:
                tabPage.Text = Localizer.Active.GetLocalizedString(StringId.ColorTabSystem);
                colorBox     = CreateColorListBox();
                colorBox.Items.AddRange(ColorListBoxViewInfo.SystemColors);
                colorBox.EnterColor += new EnterColorEventHandler(OnEnterColor);
                control              = colorBox;
                break;
            }
            control.Dock        = DockStyle.Fill;
            control.BorderStyle = BorderStyles.NoBorder;
            control.LookAndFeel.ParentLookAndFeel = itemFontColor.Manager.GetController().LookAndFeel;
            tabPage.Controls.Add(control);
        }
예제 #2
0
 private void SetTabPageProperties(int pageIndex)
 {
     XtraTabPage tabPage = this.tabControl.TabPages[pageIndex];
     ColorListBox colorBox = null;
     BaseControl control = null;
     switch(pageIndex) {
         case 0:
             tabPage.Text = Localizer.Active.GetLocalizedString(StringId.ColorTabCustom);
             control = new ColorCellsControl(null);
             DevExpress.XtraEditors.Repository.RepositoryItemColorEdit rItem = new DevExpress.XtraEditors.Repository.RepositoryItemColorEdit();
             rItem.ShowColorDialog = false;
             (control as ColorCellsControl).Properties = rItem;
             (control as ColorCellsControl).EnterColor += new EnterColorEventHandler(OnEnterColor);
             control.Size = ColorCellsControlViewInfo.BestSize;
             break;
         case 1:
             tabPage.Text = Localizer.Active.GetLocalizedString(StringId.ColorTabWeb);
             colorBox = CreateColorListBox();
             colorBox.Items.AddRange(ColorListBoxViewInfo.WebColors);
             colorBox.EnterColor += new EnterColorEventHandler(OnEnterColor);
             control = colorBox;
             break;
         case 2:
             tabPage.Text = Localizer.Active.GetLocalizedString(StringId.ColorTabSystem);
             colorBox = CreateColorListBox();
             colorBox.Items.AddRange(ColorListBoxViewInfo.SystemColors);
             colorBox.EnterColor += new EnterColorEventHandler(OnEnterColor);
             control = colorBox;
             break;
     }
     control.Dock = DockStyle.Fill;
     control.BorderStyle = BorderStyles.NoBorder;
     control.LookAndFeel.ParentLookAndFeel = itemFontColor.Manager.GetController().LookAndFeel;
     tabPage.Controls.Add(control);
 }
예제 #3
0
        private void SetTabPageProperties(int pageIndex)
        {
            XtraTabPage page = this.tabControl.TabPages[pageIndex];
            ColorListBox box = null;
            BaseControl control = null;
            switch (pageIndex)
            {
                case 0:
                {
                    page.Text = Localizer.Active.GetLocalizedString(0);
                    control = new ColorCellsControl(null);
                    RepositoryItemColorEdit edit = new RepositoryItemColorEdit();
                    edit.ShowColorDialog  = false;
                    (control as ColorCellsControl).Properties = edit;
                    (control as ColorCellsControl).EnterColor += new EnterColorEventHandler(this.OnEnterColor);
                    control.Size = ColorCellsControlViewInfo.BestSize;
                    break;
                }
                case 1:
                    //page.Text = Localizer.Active.GetLocalizedString(0);
                    page.Text = "Màu web";
                    box = this.CreateColorListBox();
                    box.Items.AddRange(ColorListBoxViewInfo.WebColors);
                    box.EnterColor +=(new EnterColorEventHandler(this.OnEnterColor));
                    control = box;
                    break;

                case 2:
                    //page.Text = Localizer.Active.GetLocalizedString(0);
                    page.Text = "Màu hệ thống";
                    box = this.CreateColorListBox();
                    box.Items.AddRange(ColorListBoxViewInfo.SystemColors);
                    box.EnterColor +=new EnterColorEventHandler(this.OnEnterColor);
                    control = box;
                    break;
            }
            control.Dock = DockStyle.Fill;
            control.BorderStyle = BorderStyles.NoBorder;
            control.LookAndFeel.ParentLookAndFeel = (itemFontColor.Manager.GetController().LookAndFeel);
            page.Controls.Add(control);
        }