示例#1
0
        private void InitTables()
        {
            ColumnModel columnModel = new ColumnModel();

            //VillageId
            TextColumn villId = new TextColumn
            {
                Editable    = false,
                Text        = "Id",
                ToolTipText = "Village Id",
                Width       = 40
            };

            columnModel.Columns.Add(villId);
            //Village name
            TextColumn vill = new TextColumn
            {
                Editable    = false,
                Text        = "Village",
                ToolTipText = "Village name",
                Width       = 120
            };

            columnModel.Columns.Add(vill);

            //Alert type
            ComboBoxColumn alertType = new ComboBoxColumn
            {
                Text        = "Alert Type",
                ToolTipText = "On what type of attack should I alert you?",
                Width       = 80
            };

            ComboBoxCellEditor typeEditor = new ComboBoxCellEditor
            {
                DropDownStyle = DropDownStyle.DropDownList
            };

            typeEditor.Items.AddRange(new string[] { "Disabled", "FullAttack", "AnyAttack" });
            alertType.Editor = typeEditor;

            columnModel.Columns.Add(alertType);

            // Alert only if hero is present in the attack, for spies art users
            CheckBoxColumn onHero = new CheckBoxColumn
            {
                Text        = "AlertOnHero",
                Width       = 85,
                ToolTipText = "Only alert if hero is present in attack. For spies art users. Otherwise ignored"
            };

            columnModel.Columns.Add(onHero);

            // set the Table's ColumModel and TableModel
            table1.ColumnModel        = columnModel;
            XpTableGlobal.ColumnModel = columnModel;

            table1.TableModel = tableModelMain;
        }
        private void RefreshAreaComboList()
        {
            ComboBoxCellEditor editor = new ComboBoxCellEditor();

            editor.DropDownStyle = DropDownStyle.DropDownList;
            editor.Items.AddRange(GetAreasList());
            columnModelFrames.Columns[0].Editor = editor;
        }
示例#3
0
		/// <summary>
		/// Sets the editor on which this control is operating - the control is re-used by the <see cref="TableView"/>.
		/// </summary>
		/// <param name="editor"></param>
		public void SetEditor(ComboBoxCellEditor editor)
		{
			_editor = editor;

			// update value
			_comboBox.DataSource = _editor.GetChoices();
			_comboBox.SelectedItem = _editor.Value;
		}
示例#4
0
        /// <summary>
        /// Sets the editor on which this control is operating - the control is re-used by the <see cref="TableView"/>.
        /// </summary>
        /// <param name="editor"></param>
        public void SetEditor(ComboBoxCellEditor editor)
        {
            _editor = editor;

            // update value
            _comboBox.DataSource   = _editor.GetChoices();
            _comboBox.SelectedItem = _editor.Value;
        }
示例#5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="XSLStyleEdit"/> class.
        /// </summary>
        /// <remarks>Documented by Dev05, 2007-10-30</remarks>
        public XSLStyleEdit()
        {
            InitializeComponent();

            tableXSL.HeaderRenderer = new XPTable.Renderers.GradientHeaderRenderer();

            //manually localized resource strings
            tableXSL.NoItemsText       = Properties.Resources.STYLEEDIT_NOITEMSTEXT;
            textColumnElementName.Text = Properties.Resources.STYLEEDIT_COLUMN_ELEMENT;
            colorColumnColor.Text      = Properties.Resources.STYLEEDIT_COLUMN_COLOR;
            colorColumnBackColor.Text  = Properties.Resources.STYLEEDIT_COLUMN_BACKCOLOR;
            buttonColumnFont.Text      = Properties.Resources.STYLEEDIT_COLUMN_FONT;
            comboBoxColumnHAlign.Text  = Properties.Resources.STYLEEDIT_COLUMN_HALIGN;
            comboBoxColumnVAlign.Text  = Properties.Resources.STYLEEDIT_COLUMN_VALIGN;

            horizontalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.HorizontalAlignment.None));
            horizontalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.HorizontalAlignment.Left));
            horizontalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.HorizontalAlignment.Center));
            horizontalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.HorizontalAlignment.Right));
            ComboBoxCellEditor horizontalEditor = new ComboBoxCellEditor();

            horizontalEditor.DropDownStyle = DropDownStyle.DropDownList;
            horizontalEditor.Items.AddRange(horizontalElements.ToArray());
            comboBoxColumnHAlign.Editor = horizontalEditor;

            verticalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.VerticalAlignment.None));
            verticalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.VerticalAlignment.Top));
            verticalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.VerticalAlignment.Middle));
            verticalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.VerticalAlignment.Bottom));
            ComboBoxCellEditor verticalEditor = new ComboBoxCellEditor();

            verticalEditor.DropDownStyle = DropDownStyle.DropDownList;
            verticalEditor.Items.AddRange(verticalElements.ToArray());
            comboBoxColumnVAlign.Editor = verticalEditor;

            textBoxFile.ScrollBars = RichTextBoxScrollBars.Both;
            textBoxFile.WordWrap   = false;

            textBoxFile.Seperators.Add(' ');
            textBoxFile.Seperators.Add('\t');
            textBoxFile.Seperators.Add('\r');
            textBoxFile.Seperators.Add('\n');
            textBoxFile.Seperators.Add(';');
            textBoxFile.Seperators.Add('=');

            textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor("body", Color.Red, null, DescriptorType.Word, DescriptorRecognition.WholeWord, false));
            textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor("button", Color.Red, null, DescriptorType.Word, DescriptorRecognition.WholeWord, false));
            textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor("a", Color.Red, null, DescriptorType.Word, DescriptorRecognition.WholeWord, false));
            textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor("a:", Color.Red, null, DescriptorType.Word, DescriptorRecognition.StartsWith, false));
            textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor("div.", Color.Red, null, DescriptorType.Word, DescriptorRecognition.StartsWith, false));
            textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor(".", Color.Red, null, DescriptorType.Word, DescriptorRecognition.StartsWith, false));
            textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor("#", Color.Cyan, null, DescriptorType.Word, DescriptorRecognition.StartsWith, false));
            textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor(":", Color.DarkBlue, null, DescriptorType.Word, DescriptorRecognition.Contains, false));
        }
示例#6
0
文件: Demo.cs 项目: zeroyou/XPTable
 void table_EditingStopped(object sender, XPTable.Events.CellEditEventArgs e)
 {
     if (e.Column == 0)
     {
         ComboBoxCellEditor editor = e.Editor as ComboBoxCellEditor;
         if (editor != null)
         {
             Console.WriteLine("selected [{0}] {1}", editor.SelectedIndex, editor.Text);
         }
     }
 }
示例#7
0
        private ComboBoxCellEditor GetActiveUsers()
        {
            ComboBoxCellEditor genreEditor = new ComboBoxCellEditor();

            genreEditor.DropDownStyle = DropDownStyle.DropDownList;
            //genreEditor.Items.AddRange(new string[] { "ANGELA", "TERI", "JULIE", "TYFANNY", "MYRNA" });
            User      oUser = new User();
            DataTable dt    = oUser.GetActiveUsers();

            foreach (DataRow row in dt.Rows)
            {
                genreEditor.Items.Add(row["User"].ToString());
            }
            genreEditor.EndEdit += new XPTable.Events.CellEditEventHandler(genreEditor_EndEdit);
            return(genreEditor);
        }
示例#8
0
文件: Demo.cs 项目: zeroyou/XPTable
        private void DoBinding2()
        {
            ImageList ilist = GetImageList();

            Table table = this.table;       // The Table control on a form - already initialised

            table.BeginUpdate();
            table.SelectionStyle = SelectionStyle.ListView;
            table.EnableWordWrap = false;    // If false, then Cell.WordWrap is ignored
            table.GridLines      = GridLines.None;
            int h = table.RowHeight;

            table.DataMember = "";
            MyBinder binder = new MyBinder(ilist, this.Font);

            table.DataSourceColumnBinder = binder;
            table.DataSource             = GetDataSource();

            //table.ColumnModel.Columns[0].Width = 60;
            ////table.ColumnModel.Columns[1].Width = 40;
            //table.ColumnModel.Columns[2].Width = 120;
            //table.ColumnModel.Columns[3].Width = 120;
            //table.ColumnModel.Columns[4].Width = 60;

            table.ColumnModel.Columns["name"].Width = 60;
            ComboBoxColumn combo = table.ColumnModel.Columns["name"] as ComboBoxColumn;

            if (combo != null)
            {
                ComboBoxCellEditor editor = new ComboBoxCellEditor();
                //editor.SelectedIndexChanged += new EventHandler(editor_SelectedIndexChanged);
                //editor.EndEdit += new XPTable.Events.CellEditEventHandler(editor_EndEdit);
                combo.Editor = editor;
            }

            //table.ColumnModel.Columns[1].Width = 40;
            table.ColumnModel.Columns["date"].Width       = 120;
            table.ColumnModel.Columns["colour"].Width     = 120;
            table.ColumnModel.Columns["like them?"].Width = 60;

            table.BeginEditing   += new XPTable.Events.CellEditEventHandler(table_BeginEditing);
            table.EditingStopped += new XPTable.Events.CellEditEventHandler(table_EditingStopped);

            this.table.EndUpdate();

            this.table.TableModel.RowHeight = 40;
        }
示例#9
0
        public void InitializeTable(string[] patterns, string[] categories)
        {
            this._templateTable.ColumnModel = new ColumnModel();
            this._templateTable.TableModel  = new TableModel();
            // 0: Name
            ComboBoxColumn     patternCol    = new ComboBoxColumn("Pattern");
            ComboBoxCellEditor patternEditor = new ComboBoxCellEditor();

            patternEditor.TextChanged  += new EventHandler(patternEditor_TextChanged);
            patternEditor.DropDownStyle = DropDownStyle.DropDown;
//		  patternEditor.Items.AddRange(patterns);
            patternEditor.AutCompleteAddItems(patterns, AutoCompleteMode.Suggest);
            patternCol.Editor   = patternEditor;
            patternCol.Editable = true;
            this._templateTable.ColumnModel.Columns.Add(patternCol);
            // 1: Type
            ComboBoxColumn     typeCol    = new ComboBoxColumn("Type");
            ComboBoxCellEditor typeEditor = new ComboBoxCellEditor();

            typeEditor.Items.Add(CategoryItemType.String.ToString());
            typeEditor.Items.Add(CategoryItemType.WildCard.ToString());
            typeEditor.Items.Add(CategoryItemType.Regex.ToString());
            typeCol.Editor   = typeEditor;
            typeCol.Editable = true;
            this._templateTable.ColumnModel.Columns.Add(typeCol);
            // 2: Category
            ComboBoxColumn     categoryCol    = new ComboBoxColumn("Category");
            ComboBoxCellEditor categoryEditor = new ComboBoxCellEditor();

            categoryEditor.DropDownStyle = DropDownStyle.DropDown;
//		  categoryEditor.Items.AddRange(categories);
            categoryEditor.AutCompleteAddItems(categories, AutoCompleteMode.SuggestAppend);
            categoryCol.Editor   = categoryEditor;
            categoryCol.Editable = true;
            this._templateTable.ColumnModel.Columns.Add(categoryCol);

            AdjustColumnWidth();

            this._templateTable.BeginEditing       += new XPTable.Events.CellEditEventHandler(_templateTable_BeginEditing);
            this._templateTable.AfterEditing       += new XPTable.Events.CellEditEventHandler(_templateTable_AfterEditing);
            this._templateTable.MouseDown          += new System.Windows.Forms.MouseEventHandler(this._templateTable_MouseDown);
            this._templateTable.AlternatingRowColor = Color.LightBlue;
        }
示例#10
0
文件: Demo.cs 项目: zeroyou/XPTable
 void table_BeginEditing(object sender, XPTable.Events.CellEditEventArgs e)
 {
     if (e.Column == 0)
     {
         ComboBoxCellEditor edit = e.Editor as ComboBoxCellEditor;
         if (edit != null)
         {
             edit.Items.Clear();
             edit.Items.Add("apple");
             edit.Items.Add("pear");
             edit.Items.Add("grapes");
             edit.Items.Add("row " + e.Row.ToString());
             for (int i = 0; i < 500; i++)
             {
                 edit.Items.Add("more " + i.ToString());
             }
         }
     }
 }
示例#11
0
        public void OnGetPrinterSetting(ref SPrinterSetting ss)
        {
            //ss.sBaseSetting.bMirrorX = this.m_CheckBoxMirror.Checked;
            //ss.sBaseSetting.bReversePrint = CheckBoxReversePrint.Checked;
            ss.sBaseSetting.nSpotColor1Mask = this.spotColorMaskSetting1.SpotColorMask;
            ss.sBaseSetting.nSpotColor2Mask = this.spotColorMaskSetting2.SpotColorMask;
            if (spp.bSupportWhiteInk)
            {
                string color   = ResString.GetResString("EnumLayerType_Color");
                string color2  = string.Format("{0}2", ResString.GetResString("EnumLayerType_Color"));
                string White   = ResString.GetResString("EnumLayerType_White");
                string Varnish = ResString.GetResString("EnumLayerType_Varnish");

                ss.sBaseSetting.nWhiteInkLayer = (byte)(this.comboBox1.SelectedIndex + 1);
                int layerColorArray = 0;
                for (int i = 0; i < this.table.TableModel.Rows.Count; i++)
                {
                    int  layercolor = 0;
                    Cell cell       = this.table.TableModel.Rows[i].Cells[1];
#if false
                    ComboBoxCellEditor editor = (ComboBoxCellEditor)this.table.ColumnModel.GetCellEditor(1);
                    for (int j = 0; j < editor.Items.Count; j++)
                    {
                        if (editor.Items[j].ToString() == cell.Text)
                        {
                            layercolor = j;
                            break;
                        }
                    }
#else
                    if (cell.Text == color)
                    {
                        layercolor = (int)EnumLayerType.Color;                 //0;
                    }
                    if (cell.Text == White)
                    {
                        layercolor = (int)EnumLayerType.White;//1;
                    }
                    if (cell.Text == Varnish)
                    {
                        layercolor = (int)EnumLayerType.Varnish;//2;
                    }
                    if (cell.Text == color2)
                    {
                        layercolor = (int)EnumLayerType.Color2;//3;
                    }
#endif
                    layerColorArray |= (layercolor << (i * 2));
                }
                ss.sBaseSetting.nLayerColorArray = (uint)layerColorArray;
            }

            if (spp.bSupportWhiteInkYoffset)
            {
                uint mask = 0;
                if (this.checkBoxColorNoPrint.Checked)
                {
                    mask |= 0x01;
                }
                if (this.checkBoxWhiteNoPrint.Checked)
                {
                    mask |= 0x02;
                }
                if (this.checkBoxVarnishNoPrint.Checked)
                {
                    mask |= 0x04;
                }
                ss.sBaseSetting.nLayerColorArray = mask;
            }
            ss.sBaseSetting.multipleWriteInk = (byte)this.cbo_MultipleInk.SelectedIndex;
            if (this.checkBox14plTo42pl.Checked)
            {
                ss.sBaseSetting.bitRegion |= 1;
            }
            else
            {
                ss.sBaseSetting.bitRegion &= 0xfffe;
            }
        }
示例#12
0
        public void OnPrinterPropertyChange(SPrinterProperty sp)
        {
            spp = sp;
            this.m_GroupBoxInkStripe.Visible = sp.bSupportWhiteInk;
            this.m_groupOffset.Visible       = sp.bSupportWhiteInkYoffset;

            bool bsupportwhite   = (sp.nWhiteInkNum & 0x0F) > 0;
            bool bsupportVarnish = (sp.nWhiteInkNum >> 4) > 0;

            checkBoxWhiteNoPrint.Visible           =
                this.spotColorMaskSetting1.Visible = bsupportwhite;
            checkBoxVarnishNoPrint.Visible         =
                this.spotColorMaskSetting2.Visible = bsupportVarnish;
            if (!bsupportwhite && bsupportVarnish)
            {
                this.spotColorMaskSetting2.Location = this.spotColorMaskSetting1.Location;
            }

            this.spotColorMaskSetting1.OnPrinterPropertyChange(sp);
            this.spotColorMaskSetting2.OnPrinterPropertyChange(sp);
            this.spotColorMaskSetting1.Title = ResString.GetResString("EnumLayerType_White");
            this.spotColorMaskSetting2.Title = ResString.GetResString("EnumLayerType_Varnish");

            grouper3.Visible = false;//白墨不显示反向功能
            if (sp.bSupportWhiteInk)
            {
                this.table.BeginUpdate();
                TextColumn textColumn = new TextColumn(ResString.GetResString("ColorLayer"), table.Width / 2 - 2);
                textColumn.Editable = false;
                ComboBoxColumn comboboxColumn = new ComboBoxColumn("Ink Type", table.Width / 2 - 2);
                this.table.ColumnModel = new ColumnModel(new Column[] { textColumn, comboboxColumn });
                ComboBoxCellEditor cbeditor = (ComboBoxCellEditor)this.table.ColumnModel.GetCellEditor(1);
                cbeditor.Items.Clear();
                cbeditor.Items.Add(ResString.GetResString("EnumLayerType_Color"));
                if (bsupportwhite)
                {
                    cbeditor.Items.Add(ResString.GetResString("EnumLayerType_White"));
                }
                if (bsupportVarnish)
                {
                    cbeditor.Items.Add(ResString.GetResString("EnumLayerType_Varnish"));
                }
                cbeditor.Items.Add(string.Format("{0}2", ResString.GetResString("EnumLayerType_Color")));
                this.table.ColumnResizing = false;
                this.table.EndUpdate();

                this.comboBox1.Items.Clear();
                for (int i = 0; i < MAXLAYERCOUNT; i++)
                {
                    this.comboBox1.Items.Add(i + 1);
                }

                grouper3.Top = this.m_GroupBoxInkStripe.Bottom + 8;
            }

            if (sp.bSupportWhiteInkYoffset)
            {
                this.m_groupOffset.Location = this.m_GroupBoxInkStripe.Location;
                grouper3.Top = this.m_groupOffset.Bottom + 8;
            }

            //cbo_MultipleInk.Items.Clear();
            //foreach (MultipleInkEnum place in Enum.GetValues(typeof(MultipleInkEnum)))
            //{
            //    string cmode = ResString.GetEnumDisplayName(typeof(MultipleInkEnum), place);
            //    cbo_MultipleInk.Items.Add(cmode);
            //}
            checkBox14plTo42pl.Visible = SPrinterProperty.IsSurpportVolumeConvert(sp.ePrinterHead);
            this.isDirty = false;
        }
示例#13
0
        private void RegionDescriptionForm_Load(object sender, EventArgs e)
        {
            tableRegDescr.BeginUpdate();

            string[] Units =
            {
                UnitsValue.Millimeters.ToString(),
                UnitsValue.Centimeters.ToString(),
                UnitsValue.Decimeters.ToString(),
                UnitsValue.Meters.ToString(),
                UnitsValue.Inches.ToString()
            };


            ComboBoxCellEditor UnitsEditor = new ComboBoxCellEditor();

            UnitsEditor.DropDownStyle = DropDownStyle.DropDownList;
            UnitsEditor.Items.AddRange(Units);
            tableRegDescr.ColumnModel.Columns[2].Editor = UnitsEditor;

            foreach (string str in Units)
            {
                comboUnits.Items.Add(str);
            }

            string sysUnits = (Application.GetSystemVariable("INSUNITS")).ToString();

            switch (sysUnits)
            {
            case "1":
                sysUnits = "Inches";
                break;

            case "2":
                sysUnits = "Feet";
                break;

            case "4":
                sysUnits = "Millimeters";
                break;

            case "5":
                sysUnits = "Centimeters";
                break;

            case "6":
                sysUnits = "Meters";
                break;

            case "14":
                sysUnits = "Decimeters";
                break;

            default:
                MessageBox.Show("\nUnits to scale inserted content: UNRECOGNIZED ?!", "units E R R O R");
                buttonCancel_Click(sender, e);
                break;
            }

            comboUnits.Text = sysUnits;
            comboUnits.SelectedIndexChanged += comboUnits_SelectedIndexChanged;

            #region filling the table

            // area
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" Area"), new XPTable.Models.Cell(RMS.Area),
                new XPTable.Models.Cell(sysUnits /*RMS.AreaUnit.ToString()*/), new XPTable.Models.Cell(" 2 "),
                new XPTable.Models.Cell("")
            }));

            // Iy
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" Iy"), new XPTable.Models.Cell(RMS.Iy),
                new XPTable.Models.Cell(sysUnits /*RMS.IyUnit.ToString()*/), new XPTable.Models.Cell(" 4 "),
                new XPTable.Models.Cell(" Moment of Inertia")
            }));

            // Wy_Upper
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" Wy_Upper"), new XPTable.Models.Cell(RMS.WyUpper),
                new XPTable.Models.Cell(sysUnits /*RMS.Wy_UpperUnit.ToString()*/), new XPTable.Models.Cell(" 3 "),
                new XPTable.Models.Cell(" Section Modulus")
            }));

            // Wy_Lower
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" Wy_Lower"), new XPTable.Models.Cell(RMS.WyLower),
                new XPTable.Models.Cell(sysUnits /*RMS.Wy_LowerUnit.ToString()*/), new XPTable.Models.Cell(" 3 "),
                new XPTable.Models.Cell(" Section Modulus")
            }));

            // D_Upper
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" D_Upper"), new XPTable.Models.Cell(RMS.DUpper),
                new XPTable.Models.Cell(sysUnits /*RMS.D_UpperUnit.ToString()*/), new XPTable.Models.Cell(" 1 "),
                new XPTable.Models.Cell(" Distance")
            }));

            // D_Lower
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" D_Lower"), new XPTable.Models.Cell(RMS.DLower),
                new XPTable.Models.Cell(sysUnits /*RMS.D_LowerUnit.ToString()*/), new XPTable.Models.Cell(" 1 "),
                new XPTable.Models.Cell(" Distance")
            }));

            // Iyy
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" Iyy"), new XPTable.Models.Cell(RMS.Iyy),
                new XPTable.Models.Cell(sysUnits /*RMS.IyyUnit.ToString()*/), new XPTable.Models.Cell(" 1 "),
                new XPTable.Models.Cell(" Radii of gyration")
            }));

            // Iz
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" Iz"), new XPTable.Models.Cell(RMS.Iz),
                new XPTable.Models.Cell(sysUnits /*RMS.IzUnit.ToString()*/), new XPTable.Models.Cell(" 4 "),
                new XPTable.Models.Cell(" Moment of Inertia")
            }));

            // Wz_Right
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" Wz_Right"), new XPTable.Models.Cell(RMS.WzRight),
                new XPTable.Models.Cell(sysUnits /*RMS.Wz_RightUnit.ToString()*/), new XPTable.Models.Cell(" 3 "),
                new XPTable.Models.Cell(" Section Modulus")
            }));

            // Wz_Left
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" Wz_Left"), new XPTable.Models.Cell(RMS.WzLeft),
                new XPTable.Models.Cell(sysUnits /*RMS.Wz_LeftUnit.ToString()*/), new XPTable.Models.Cell(" 3 "),
                new XPTable.Models.Cell(" Section Modulus")
            }));

            // D_Right
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" D_Right"), new XPTable.Models.Cell(RMS.DRight),
                new XPTable.Models.Cell(sysUnits /*RMS.D_RightUnit.ToString()*/), new XPTable.Models.Cell(" 1 "),
                new XPTable.Models.Cell(" Distance")
            }));

            // D_Left
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" D_Left"), new XPTable.Models.Cell(RMS.DLeft),
                new XPTable.Models.Cell(sysUnits /*RMS.D_LeftUnit.ToString()*/), new XPTable.Models.Cell(" 1 "),
                new XPTable.Models.Cell(" Distance")
            }));

            // Izz
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" Izz"), new XPTable.Models.Cell(RMS.Izz),
                new XPTable.Models.Cell(sysUnits /*RMS.IzzUnit.ToString()*/), new XPTable.Models.Cell(" 1 "),
                new XPTable.Models.Cell(" Radii of gyration")
            }));

            // Imin
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" Imin"), new XPTable.Models.Cell(RMS.Imin),
                new XPTable.Models.Cell(sysUnits /*RMS.IminUnit.ToString()*/), new XPTable.Models.Cell(" 4 "),
                new XPTable.Models.Cell(" Principal moment")
            }));

            // Imax
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" Imax"), new XPTable.Models.Cell(RMS.Imax),
                new XPTable.Models.Cell(sysUnits /*RMS.ImaxUnit.ToString()*/), new XPTable.Models.Cell(" 4 "),
                new XPTable.Models.Cell(" Principal moment")
            }));

            // Density
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" Density"), new XPTable.Models.Cell(RMS.Density),
                new XPTable.Models.Cell("kg / cubic meter" /* + sysUnits RMS.DensityUnit.ToString()*/),
                new XPTable.Models.Cell(""), new XPTable.Models.Cell("")
            }));

            // M
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" m"), new XPTable.Models.Cell(RMS.G),
                new XPTable.Models.Cell("kg / m" /*RMS.GUnit.ToString()*/), new XPTable.Models.Cell(""),
                new XPTable.Models.Cell(" Mass per length")
            }));
            // G
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" G"), new XPTable.Models.Cell(RMS.G),
                new XPTable.Models.Cell("kgf / m" /*RMS.GUnit.ToString()*/), new XPTable.Models.Cell(" ≈"),
                new XPTable.Models.Cell(" Weight per length")
            }));
            tableRegDescr.TableModel.Rows.Add(
                new XPTable.Models.Row(new[]
            {
                new XPTable.Models.Cell(" G"), new XPTable.Models.Cell(RMS.G * 9.80665),
                new XPTable.Models.Cell("N / m" /*RMS.GUnit.ToString()*/), new XPTable.Models.Cell(" ≈"),
                new XPTable.Models.Cell(" Weight per length")
            }));

            int N = tableRegDescr.TableModel.Rows.Count;
            for (int i = 0; i < N; i++)
            {
                tableRegDescr.TableModel.Rows[i].Cells[0].Enabled = false;
                tableRegDescr.TableModel.Rows[i].Cells[1].Enabled = false;
                tableRegDescr.TableModel.Rows[i].Cells[3].Enabled = false;
                tableRegDescr.TableModel.Rows[i].Cells[4].Enabled = false;
            }
            tableRegDescr.TableModel.Rows[N - 1].Cells[2].Enabled = false;
            tableRegDescr.TableModel.Rows[N - 4].Cells[1].Enabled = true;
            tableRegDescr.TableModel.Rows[N - 4].Cells[2].Enabled = false;
            tableRegDescr.TableModel.Rows[N - 3].Cells[2].Enabled = false;
            tableRegDescr.TableModel.Rows[N - 2].Cells[2].Enabled = false;

            #endregion

            tableRegDescr.CellPropertyChanged  += tableRegDescr_CellPropertyChanged;
            tableRegDescr.HeaderRenderer        = new XPTable.Renderers.GradientHeaderRenderer();
            tableRegDescr.TableModel.RowHeight += 3;
            tableRegDescr.FullRowSelect         = true;
            tableRegDescr.EndUpdate();

            radioKg.Checked         = true;
            radioKg.CheckedChanged += radioKg_CheckedChanged;

            DocumentHelper   _drawingHelper = new DocumentHelper(Application.DocumentManager.MdiActiveDocument);
            StringCollection DimStyles      = _drawingHelper.GetDimensionStylesList();

            int currentIndex = 0;
            foreach (string dimStyle in DimStyles)
            {
                comboBoxDimensionStyle.Items.Add(dimStyle);
                if (Settings.Default.SPG_DimensionStyle == dimStyle)
                {
                    comboBoxDimensionStyle.SelectedIndex = currentIndex;
                }

                currentIndex++;
            }

            //comboBoxDimensionStyle.Text = Application.DocumentManager.MdiActiveDocument.Database.Dimstyle;


            // RegionDescription.DrawText( ref RMS );
        }
示例#14
0
        private void InitTable()
        {
            ColumnModel columnModel = new ColumnModel();

            // set the Table's ColumModel and TableModel
            table1.ColumnModel        = columnModel;
            XpTableGlobal.ColumnModel = columnModel;

            table1.TableModel = tableModelMain;

            //VillageId
            TextColumn villId = new TextColumn
            {
                Editable    = false,
                Text        = "Id",
                ToolTipText = "Village Id",
                Width       = 40
            };

            columnModel.Columns.Add(villId);
            //Village name
            TextColumn vill = new TextColumn
            {
                Editable    = true,
                Text        = "Village",
                ToolTipText = "Village name",
                Width       = 120
            };

            columnModel.Columns.Add(vill);

            //Village barracks trainign
            ComboBoxColumn barracks = new ComboBoxColumn
            {
                Text        = "Barracks",
                ToolTipText = "Troops to train in Barracks",
                Width       = 100
            };

            ComboBoxCellEditor barracksEditor = new ComboBoxCellEditor
            {
                DropDownStyle = DropDownStyle.DropDownList
            };

            barracksEditor.Items.AddRange(GetPossibleTroops(Classificator.BuildingEnum.Barracks));
            barracks.Editor = barracksEditor;

            columnModel.Columns.Add(barracks);

            //great barracks training
            CheckBoxColumn GB = new CheckBoxColumn
            {
                Text        = "GB",
                ToolTipText = "Train troops in Great Barracks",
                Width       = 40
            };

            columnModel.Columns.Add(GB);

            //stable
            ComboBoxColumn stable = new ComboBoxColumn
            {
                Text        = "Stable",
                ToolTipText = "Troops to train in Stable",
                Width       = 100
            };

            ComboBoxCellEditor stableEditor = new ComboBoxCellEditor
            {
                DropDownStyle = DropDownStyle.DropDownList
            };

            stableEditor.Items.AddRange(GetPossibleTroops(Classificator.BuildingEnum.Stable));
            stable.Editor = stableEditor;

            columnModel.Columns.Add(stable);
            //great stable
            CheckBoxColumn GS = new CheckBoxColumn
            {
                Text        = "GS",
                ToolTipText = "Train troops in Great Stable",
                Width       = 40
            };

            columnModel.Columns.Add(GS);
            //workshop
            ComboBoxColumn workshop = new ComboBoxColumn
            {
                Text        = "Workshop",
                ToolTipText = "Troops to train in Workshop",
                Width       = 100
            };

            ComboBoxCellEditor workshopEditor = new ComboBoxCellEditor
            {
                DropDownStyle = DropDownStyle.DropDownList
            };

            workshopEditor.Items.AddRange(GetPossibleTroops(Classificator.BuildingEnum.Workshop));
            workshop.Editor = workshopEditor;

            columnModel.Columns.Add(workshop);

            // Auto-Improve troops
            columnModel.Columns.Add(new CheckBoxColumn
            {
                Text        = "AutoImprove",
                ToolTipText = "Auto Improve troops in smithy",
                Width       = 100
            });
        }
示例#15
0
        private void InitTable()
        {
            ColumnModel columnModel = new ColumnModel();

            // set the Table's ColumModel and TableModel
            table1.ColumnModel        = columnModel;
            XpTableGlobal.ColumnModel = columnModel;

            table1.TableModel = tableModelMain;

            //VillageId
            TextColumn villId = new TextColumn
            {
                Editable    = false,
                Text        = "Id",
                ToolTipText = "Village Id",
                Width       = 40
            };

            columnModel.Columns.Add(villId);
            //Village name
            TextColumn vill = new TextColumn
            {
                Editable    = true,
                Text        = "Village",
                ToolTipText = "Village name",
                Width       = 120
            };

            columnModel.Columns.Add(vill);

            //Village type
            ComboBoxColumn typeColumn = new ComboBoxColumn
            {
                Text        = "Type",
                ToolTipText = "Type of the village",
                Width       = 70
            };

            ComboBoxCellEditor typeEditor = new ComboBoxCellEditor
            {
                DropDownStyle = DropDownStyle.DropDownList
            };

            typeEditor.Items.AddRange(new string[] { "Farm", "Support", "Deff", "Off" });
            typeColumn.Editor = typeEditor;

            columnModel.Columns.Add(typeColumn);

            //get resources for building
            CheckBoxColumn GetRes = new CheckBoxColumn
            {
                Text        = "Get Res",
                Width       = 60,
                ToolTipText = "Select the supplying village when there are not enough resources"
            };

            columnModel.Columns.Add(GetRes);
            //get resources for troops
            columnModel.Columns.Add(new CheckBoxColumn
            {
                Text        = "Send Res",
                Width       = 75,
                ToolTipText = "Select where to send resources when too many"
            });

            ComboBoxCellEditor celebrationsEditor = new ComboBoxCellEditor
            {
                DropDownStyle = DropDownStyle.DropDownList
            };

            celebrationsEditor.Items.AddRange(new string[] { "None", "Small", "Big" });

            columnModel.Columns.Add(new ComboBoxColumn
            {
                Text        = "Celebrations",
                ToolTipText = "Auto-Start celebrations",
                Editor      = celebrationsEditor,
                Width       = 85
            });

            columnModel.Columns.Add(new CheckBoxColumn
            {
                Text        = "AutoExpandStorage",
                Width       = 130,
                ToolTipText = "Automatically Expand storage when it's full"
            });
            columnModel.Columns.Add(new CheckBoxColumn
            {
                Text        = "UseHeroRes",
                Width       = 85,
                ToolTipText = "Use hero resources"
            });
            // Donate resources to ally bonus
            ComboBoxCellEditor donationEditor = new ComboBoxCellEditor
            {
                DropDownStyle = DropDownStyle.DropDownList
            };

            donationEditor.Items.AddRange(new string[] { "None", "ExcludeCrop", "OnlyCrop" });

            columnModel.Columns.Add(new ComboBoxColumn
            {
                Text        = "Donate",
                Width       = 70,
                ToolTipText = "Donate resources to the ally bonuses",
                Editor      = donationEditor
            });
        }
示例#16
0
        private void InitTable()
        {
            ColumnModel columnModel = new ColumnModel();

            // set the Table's ColumModel and TableModel
            table1.ColumnModel = columnModel;
            XpTableGlobal.ColumnModel = columnModel;

            table1.TableModel = tableModelMain;

            //VillageId
            TextColumn villId = new TextColumn
            {
                Editable = false,
                Text = "Id",
                ToolTipText = "Village Id",
                Width = 40
            };
            columnModel.Columns.Add(villId);
            //Village name
            TextColumn vill = new TextColumn
            {
                Editable = true,
                Text = "Village",
                ToolTipText = "Village name",
                Width = 120
            };
            columnModel.Columns.Add(vill);

            //Village type
            ComboBoxColumn typeColumn = new ComboBoxColumn
            {
                Text = "Type",
                ToolTipText = "Type of the village",
                Width = 100
            };

            ComboBoxCellEditor typeEditor = new ComboBoxCellEditor
            {
                DropDownStyle = DropDownStyle.DropDownList
            };
            typeEditor.Items.AddRange(new string[] { "Farm", "Support", "Deff", "Off" });
            typeColumn.Editor = typeEditor;

            columnModel.Columns.Add(typeColumn);

            //Village barracks trainign
            ComboBoxColumn barracks = new ComboBoxColumn
            {
                Text = "Barracks",
                ToolTipText = "Troops to train in Barracks",
                Width = 100
            };

            ComboBoxCellEditor barracksEditor = new ComboBoxCellEditor
            {
                DropDownStyle = DropDownStyle.DropDownList
            };
            barracksEditor.Items.AddRange(GetPossibleTroops(Classificator.BuildingEnum.Barracks));
            barracks.Editor = barracksEditor;

            columnModel.Columns.Add(barracks);

            //great barracks training
            CheckBoxColumn GB = new CheckBoxColumn
            {
                Text = "GB",
                ToolTipText = "Train troops in Great Barracks",
                Width = 40
            };
            columnModel.Columns.Add(GB);

            //stable
            ComboBoxColumn stable = new ComboBoxColumn
            {
                Text = "Stable",
                ToolTipText = "Troops to train in Stable",
                Width = 100
            };

            ComboBoxCellEditor stableEditor = new ComboBoxCellEditor
            {
                DropDownStyle = DropDownStyle.DropDownList
            };
            stableEditor.Items.AddRange(GetPossibleTroops(Classificator.BuildingEnum.Stable));
            stable.Editor = stableEditor;

            columnModel.Columns.Add(stable);
            //great stable
            CheckBoxColumn GS = new CheckBoxColumn
            {
                Text = "GS",
                ToolTipText = "Train troops in Great Stable",
                Width = 40
            };
            columnModel.Columns.Add(GS);
            //workshop
            ComboBoxColumn workshop = new ComboBoxColumn
            {
                Text = "Workshop",
                ToolTipText = "Troops to train in Workshop",
                Width = 100
            };

            ComboBoxCellEditor workshopEditor = new ComboBoxCellEditor
            {
                DropDownStyle = DropDownStyle.DropDownList
            };
            workshopEditor.Items.AddRange(GetPossibleTroops(Classificator.BuildingEnum.Workshop));
            workshop.Editor = workshopEditor;

            columnModel.Columns.Add(workshop);
            //get resources for building
            CheckBoxColumn GetRes = new CheckBoxColumn
            {
                Text = "Get Res",
                Width = 75,
                ToolTipText = "Select the supplying village when there are not enough resources"
            };
            columnModel.Columns.Add(GetRes);
            //get resources for troops
            CheckBoxColumn SendRes = new CheckBoxColumn
            {
                Text = "Send Res",
                Width = 80,
                ToolTipText = "Select where to send resources when too many"
            };
            columnModel.Columns.Add(SendRes);
        }