Beispiel #1
0
        private void TasView_QueryItemText(int index, InputRoll.RollColumn column, out string text, ref int offsetX, ref int offsetY)
        {
            var overrideText = GetTextOverride(index, column);

            if (overrideText != null)
            {
                text = overrideText;
                return;
            }

            try
            {
                text = string.Empty;
                var columnName = column.Name;

                if (columnName == CursorColumnName)
                {
                    int branchIndex = CurrentTasMovie.BranchIndexByFrame(index);
                    if (branchIndex != -1)
                    {
                        text = branchIndex.ToString();
                    }
                }
                else if (columnName == FrameColumnName)
                {
                    offsetX = 7;
                    text    = (index).ToString().PadLeft(CurrentTasMovie.InputLogLength.ToString().Length, '0');
                }
                else
                {
                    // Display typed float value (string "-" can't be parsed, so CurrentTasMovie.DisplayValue can't return it)
                    if (index == _floatEditRow && columnName == _floatEditColumn)
                    {
                        text = _floatTypedValue;
                    }
                    else if (index < CurrentTasMovie.InputLogLength)
                    {
                        text = CurrentTasMovie.DisplayValue(index, columnName);
                    }
                }
            }
            catch (Exception ex)
            {
                text = string.Empty;
                MessageBox.Show("oops\n" + ex);
            }
        }