コード例 #1
0
        /// <summary>
        /// Validate the edit cell in a row.
        /// </summary>
        /// <param name="rowIndex">The row index to validate.</param>
        /// <param name="value">The value to validate.</param>
        /// <returns>True if the cell was valid false if not.</returns>
        bool validateEditCell(TableCell cell, String value)
        {
            bool valid = true;

            if (allowValidation)
            {
                TableRow         row = propertiesTable.Rows[cell.RowIndex];
                EditableProperty var = rowProperties[row];
                if (var != null)
                {
                    String errorText;
                    if (!var.canParseString(cell.ColumnIndex, value, out errorText))
                    {
                        valid = false;
                        PopupError.ShowPopup(errorText, cell.AbsolutePosition + new IntVector2(cell.Size.Width, 0));
                        //propGridView.Rows[rowIndex].ErrorText = errorText;
                    }
                    else
                    {
                        //propGridView.Rows[rowIndex].ErrorText = "";
                    }
                }
            }
            return(valid);
        }
コード例 #2
0
ファイル: PopupError.cs プロジェクト: AnomalousMedical/Engine
        public static void ShowPopup(String text, IntVector2 location)
        {
            PopupError error = new PopupError(text);

            error.show(location.x, location.y);
        }