Пример #1
0
 private void SaveSheet(DataGridView sheet, ResourceDataList dest)
 {
     for (int rowidx = 0; rowidx < sheet.Rows.Count; rowidx++)
     {
         dest.SetValue(rowidx, "" + sheet.Rows[rowidx].Cells[(int)ShColumn.VALUE].Value);
     }
 }
Пример #2
0
 public Enemy(ImageFile mitame, TileImage ti, string name, ResourceDataList ppl)
 {
     this.Mitame          = mitame;
     this.Tile            = ti;
     this.Name            = name;
     this.ParamPromptList = ppl;
 }
Пример #3
0
        public FieldCellData GetFieldCellData(ResourceData reader)
        {
            string index_val = reader.ReadValue();

            if (index_val == ResourceData.DEFAULT_VALUE)
            {
                return(null);
            }

            int index             = Tools.ParseInt(index_val);
            ResourceDataList pvl1 = reader.ReadBlock();
            ResourceDataList pvl2 = reader.ReadBlock();

            return(new FieldCellData(index, pvl1, pvl2));
        }
Пример #4
0
        private void InitSheet(DataGridView sheet, ResourceDataList prompts, ResourceDataList values)
        {
            Tools.InitTileSheet(sheet);

            sheet.AllowUserToResizeColumns = true;
            sheet.ColumnHeadersVisible     = true;
            sheet.RowTemplate.Height       = 20;

            try
            {
                sheet.Font = new Font("MS Gothic", 10f, FontStyle.Regular);
                //sheet.Font = new Font(Tools.GetUIFontName(), 10f, FontStyle.Regular);
            }
            catch
            { }

            sheet.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            sheet.MultiSelect   = false;
            sheet.ReadOnly      = true;

            sheet.RowCount    = 0;
            sheet.ColumnCount = 0;

            sheet.Columns.Add(new DataGridViewTextBoxColumn());
            sheet.Columns.Add(new DataGridViewTextBoxColumn());
            sheet.Columns.Add(new DataGridViewTextBoxColumn());

            sheet.Columns[(int)ShColumn.NUMBER].HeaderText = "#";
            sheet.Columns[(int)ShColumn.VALUE].HeaderText  = "値";
            sheet.Columns[(int)ShColumn.PROMPT].HeaderText = "値の説明";

            foreach (string r_prompt in prompts.GetValueList())
            {
                string prompt = r_prompt;

                if (prompt == ResourceData.DEFAULT_VALUE)
                {
                    prompt = "(項目はありません)";
                }
                sheet.Rows.Add();

                DataGridViewRow row    = sheet.Rows[sheet.Rows.Count - 1];
                int             rowidx = sheet.Rows.Count - 1;

                row.Cells[(int)ShColumn.NUMBER].Value = "" + (rowidx + 1);
                row.Cells[(int)ShColumn.VALUE].Value  = values.GetValue(rowidx);
                row.Cells[(int)ShColumn.PROMPT].Value = prompt;

                row.Cells[(int)ShColumn.NUMBER].Style.BackColor = Color.White;
                row.Cells[(int)ShColumn.VALUE].Style.BackColor  = Color.LightYellow;
                row.Cells[(int)ShColumn.PROMPT].Style.BackColor = Color.White;
            }
            //sheet.Columns[(int)ShColumn.NUMBER].ReadOnly = true;
            //sheet.Columns[(int)ShColumn.VALUE].ReadOnly = false;
            //sheet.Columns[(int)ShColumn.PROMPT].ReadOnly = true;

            sheet.Columns[(int)ShColumn.NUMBER].Width = 30;
            sheet.Columns[(int)ShColumn.VALUE].Width  = 100;
            sheet.Columns[(int)ShColumn.PROMPT].Width = 250;

            foreach (DataGridViewColumn column in sheet.Columns)
            {
                column.SortMode = DataGridViewColumnSortMode.NotSortable;
            }
            sheet.ClearSelection();
        }
Пример #5
0
 public FieldCellData(int index, ResourceDataList cpvl, ResourceDataList pvl)
 {
     this.Index = index;
     this.CommonParamValueList = cpvl;
     this.ParamValueList       = pvl;
 }