Beispiel #1
0
        private int GetDesiredWidthIndented(JetListViewColumn col, JetListViewColumn indentCol,
                                            JetListViewNode node, int fixedWidth)
        {
            int result = col.GetDesiredWidth(node.Data) + fixedWidth;

            if (indentCol != null)
            {
                result += indentCol.GetIndent(node);
            }
            lock ( _sizeToContentItemWidths )
            {
                HashMap widths = (HashMap)_sizeToContentItemWidths [col];
                if (widths == null)
                {
                    widths = new HashMap();
                    _sizeToContentItemWidths [col] = widths;
                }
                widths [node.Data] = result;
            }
            return(result);
        }
Beispiel #2
0
            internal bool MoveNext()
            {
                if (_colIndex >= _columns.Count - 1)
                {
                    return(false);
                }
                _colIndex++;

                JetListViewColumn curColumn = Current;

                if (curColumn.IsIndentColumn())
                {
                    _availIndent = GetAvailableIndent(_colIndex);
                    int indent = curColumn.GetIndent(_node);
                    _curWidth     = Math.Min(_availIndent, indent);
                    _availIndent -= _curWidth;
                    _itemIndent   = _curWidth;
                }
                else if (!curColumn.FixedSize)
                {
                    _curWidth    = curColumn.Width - _itemIndent;
                    _itemIndent  = 0;
                    _availIndent = Int32.MaxValue;
                }
                else
                {
                    int delta = curColumn.GetWidthDelta(_node);
                    _curWidth = curColumn.Width + delta;
                    if (_curWidth > _availIndent)
                    {
                        _itemIndent -= _curWidth - _availIndent;
                        _curWidth    = _availIndent;
                    }
                    _availIndent -= _curWidth;
                    _itemIndent  -= delta;
                }
                return(true);
            }