예제 #1
0
 private void OnColumnRemoved(JetListViewColumn column)
 {
     if (ColumnRemoved != null)
     {
         ColumnRemoved(this, new ColumnEventArgs(column));
     }
 }
예제 #2
0
 public void Move(JetListViewColumn col, int toIndex)
 {
     BeginUpdate();
     _items.Remove(col);
     _items.Insert(toIndex, col);
     EndUpdate();
 }
예제 #3
0
 private void RecalcColumnWidth(ProcessSizeToContentColumnDelegate callback, JetListViewNode paramNode)
 {
     if (_sizeToContentColumnCount > 0)
     {
         int fixedWidth = 0;
         JetListViewColumn indentCol = null;
         for (int i = 0; i < _columnCollection.Count; i++)
         {
             JetListViewColumn col = _columnCollection [i];
             if (col.IsIndentColumn())
             {
                 indentCol = col;
             }
             if (col.FixedSize && indentCol != null)
             {
                 fixedWidth += col.Width;
             }
             if (col.SizeToContent)
             {
                 callback(col, indentCol, fixedWidth, paramNode);
             }
             if (!col.FixedSize && !col.IsIndentColumn())
             {
                 indentCol  = null;
                 fixedWidth = 0;
             }
         }
         UpdateScrollRange();
     }
 }
예제 #4
0
 protected void OnColumnClick(JetListViewColumn col)
 {
     if (ColumnClick != null)
     {
         ColumnClick(this, new ColumnEventArgs(col));
     }
 }
예제 #5
0
 /// <summary>
 /// Adds a column to the multiline column scheme.
 /// </summary>
 /// <param name="column">The column to add.</param>
 /// <param name="startRow">The row in which the column rectangle starts.</param>
 /// <param name="endRow">The row in which the column rectangle ends.</param>
 /// <param name="startX">The X position where the column data starts.</param>
 /// <param name="width">The width of the column in pixels.</param>
 /// <param name="anchor">The anchoring of the columnn to the edges of the view area.</param>
 /// <param name="textColor">The color of the text displayed in the column.</param>
 public void AddColumn(JetListViewColumn column, int startRow, int endRow, int startX, int width,
                       ColumnAnchor anchor, Color textColor, HorizontalAlignment textAlign)
 {
     _columns.Add(column);
     _columnSettings.Add(new MultiLineColumnSetting(column, startRow, endRow, startX, width, anchor,
                                                    textColor, textAlign));
 }
예제 #6
0
 public JetItemEditEventArgs(string text, object item, JetListViewColumn column)
 {
     _text       = text;
     _item       = item;
     _column     = column;
     _cancelEdit = false;
 }
예제 #7
0
        private void RecalcOnNodeAdded(JetListViewColumn col, JetListViewColumn indentCol, int fixedWidth,
                                       JetListViewNode paramNode)
        {
            int desiredWidth = GetDesiredWidthIndented(col, indentCol, paramNode, fixedWidth);

            col.Width = Math.Max(col.Width, desiredWidth);
        }
예제 #8
0
 private void HandleAfterSectionTrack(object sender, HeaderSectionWidthEventArgs ea)
 {
     if (_trackColumn != null)
     {
         int trackWidth = AdjustTrackWidth(ea.Width);
         int delta      = ea.Width - trackWidth;
         if (trackWidth >= 10)
         {
             _trackColumn.Width = trackWidth;
             if (_trackColumn.AutoSize)
             {
                 _trackColumn.AutoSizeMinWidth = trackWidth;
             }
         }
         else
         {
             _trackColumn.Width = 10;
             _methodInvoker.BeginInvoke(new SetMinWidthDelegate(SetMinWidth), ea.Item, 10 + delta);
         }
         _trackColumn = null;
     }
     _processingHeaderOperation = false;
     OnInvalidate();
     _methodInvoker.BeginInvoke(new ProcessColumnUpdateDelegate(ProcessColumnUpdate), true);
 }
예제 #9
0
 private void OnColumnAdded(JetListViewColumn value)
 {
     if (ColumnAdded != null)
     {
         ColumnAdded(this, new ColumnEventArgs(value));
     }
 }
예제 #10
0
 protected override void UnhookColumn(JetListViewColumn col)
 {
     base.UnhookColumn(col);
     col.SizeToContentChanged -= HandleSizeToContentChanged;
     col.AutoSizeChanged      -= HandleAutoSizeChanged;
     col.WidthChanged         -= HandleColumnWidthChanged;
     col.TextChanged          -= HandleColumnTextChanged;
 }
예제 #11
0
        /// <summary>
        /// Adds the specified column to the list.
        /// </summary>
        /// <param name="value">The column to add.</param>
        /// <returns>The index of the added column.</returns>
        public int Add(JetListViewColumn value)
        {
            int result = _items.Add(value);

            value.Owner = this;
            OnColumnAdded(value);
            return(result);
        }
예제 #12
0
        protected override void HandleSortIconChanged(object sender, EventArgs e)
        {
            JetListViewColumn col     = (JetListViewColumn)sender;
            HeaderSection     section = (HeaderSection)_headerMap [col];

            if (section != null)
            {
                SetHeaderSortIcon(section, col);
            }
        }
예제 #13
0
        public bool AcceptDoubleClick(JetListViewNode node, int x, int y)
        {
            JetListViewColumn col = GetColumnAt(node, x, y);

            if (col == null)
            {
                return(false);
            }
            return(col.AcceptColumnDoubleClick);
        }
예제 #14
0
 public MultiLineColumnSetting(MultiLineColumnSetting rhs)
 {
     _column    = rhs._column;
     _startRow  = rhs._startRow;
     _endRow    = rhs._endRow;
     _startX    = rhs._startX;
     _width     = rhs._width;
     _anchor    = rhs._anchor;
     _textColor = rhs._textColor;
     _textAlign = rhs._textAlign;
 }
예제 #15
0
 public Rectangle GetColumnBounds(JetListViewColumn col, JetListViewNode node)
 {
     if (col == _previewColumn)
     {
         int startX = _baseRowRenderer.BorderSize - _baseRowRenderer.ScrollOffset;
         int endX   = _baseRowRenderer.ScrollRange - _baseRowRenderer.BorderSize;
         return(new Rectangle(startX, _baseRowRenderer.GetRowHeight(node),
                              endX - startX, _previewColumn.GetAutoPreviewHeight(node)));
     }
     return(_baseRowRenderer.GetColumnBounds(col, node));
 }
예제 #16
0
파일: ItemToolTip.cs 프로젝트: mo5h/omeo
        internal void UpdateToolTip(Point pt)
        {
            JetListViewNode   node = _ownerControl.GetNodeAt(pt);
            JetListViewColumn col  = _ownerControl.GetColumnAt(pt);

            if (node != _lastToolTipNode || col != _lastToolTipColumn)
            {
                Hide();
                Win32Declarations.SendMessage(Handle, Win32Declarations.TTM_UPDATE, IntPtr.Zero, IntPtr.Zero);
            }
        }
예제 #17
0
        private void HandleCustomDrawSection(object sender, HeaderCustomDrawEventArgs ea)
        {
            JetListViewColumn col = ColumnFromHeaderSection(ea.Item);

            if (col != null)
            {
                using (Graphics g = Graphics.FromHdc(ea.Hdc))
                {
                    col.DrawHeader(g, ea.Bounds);
                }
            }
        }
예제 #18
0
 private void SetColumnWidth(JetListViewColumn col, int colWidth)
 {
     _internalChange++;
     try
     {
         col.Width = colWidth;
     }
     finally
     {
         _internalChange--;
     }
 }
예제 #19
0
 public MultiLineColumnSetting(JetListViewColumn column, int startRow, int endRow,
                               int startX, int width, ColumnAnchor anchor, Color textColor, HorizontalAlignment textAlign)
 {
     _column    = column;
     _startRow  = startRow;
     _endRow    = endRow;
     _startX    = startX;
     _width     = width;
     _anchor    = anchor;
     _textColor = textColor;
     _textAlign = textAlign;
 }
예제 #20
0
        protected override void ScrollColumnInView(JetListViewColumn col, JetListViewNode node)
        {
            Rectangle rc = GetColumnBounds(col, node);

            if (rc.Left < 0)
            {
                OnRequestScroll(_scrollOffset + rc.Left + _borderSize);
            }
            else if (rc.Right > _visibleWidth)
            {
                OnRequestScroll(_scrollOffset + rc.Right - _visibleWidth);
            }
        }
예제 #21
0
 public bool HandleMouseUp(JetListViewNode node, int x, int y, MouseButtons button, Keys modifiers)
 {
     if (button == MouseButtons.Left)
     {
         int deltaX, deltaY;
         JetListViewColumn col = GetClickColumn(node, x, y, out deltaX, out deltaY);
         if (col != null)
         {
             return(col.HandleMouseUp(node, deltaX, deltaY));
         }
     }
     return(false);
 }
예제 #22
0
        public override Rectangle GetColumnBounds(JetListViewColumn col, JetListViewNode node)
        {
            MultiLineColumnScheme scheme = _columnSchemeProvider.GetColumnScheme(node.Data);

            foreach (MultiLineColumnSetting setting in scheme.ColumnSettings)
            {
                if (setting.Column == col)
                {
                    int indent = GetRowIndent(node, scheme);
                    return(GetRectangleFromSetting(scheme, setting, indent));
                }
            }
            throw new Exception("The specified column is not found in the column scheme for the specified node");
        }
예제 #23
0
        private void HandleSectionClick(object sender, HeaderSectionEventArgs ea)
        {
            JetListViewColumn col = ColumnFromHeaderSection(ea.Item);

            if (!_processingHeaderOperation)
            {
                if (ea.Button == MouseButtons.Left)
                {
                    _processingHeaderOperation = true;
                    OnColumnClick(col);
                    _processingHeaderOperation = false;
                }
            }
        }
예제 #24
0
        private void HandleAutoSizeChanged(object sender, EventArgs e)
        {
            JetListViewColumn col = (JetListViewColumn)sender;

            if (col.AutoSize)
            {
                _autoSizeColumnCount++;
            }
            else
            {
                _autoSizeColumnCount--;
            }
            AllocateAutoSizeWidth();
        }
예제 #25
0
 protected void DrawRowSelectRect(Graphics g, Rectangle rcFocus, bool dropTargetRow, bool focusRow)
 {
     if (_fullRowSelect)
     {
         if (dropTargetRow)
         {
             JetListViewColumn.DrawDropTarget(g, rcFocus);
         }
         else if (focusRow)
         {
             _controlPainter.DrawFocusRect(g, rcFocus);
         }
     }
 }
예제 #26
0
        private void HandleBeforeSectionTrack(object sender, HeaderSectionWidthConformableEventArgs ea)
        {
            JetListViewColumn col = ColumnFromHeaderSection(ea.Item);

            if (col.FixedSize || col.SizeToContent || _processingHeaderOperation)
            {
                ea.Accepted = false;
            }
            else
            {
                _processingHeaderOperation = true;
                _trackColumn = col;
                OnInvalidate();
            }
        }
예제 #27
0
        private void RecalcOnCollapse(JetListViewColumn col, JetListViewColumn indentCol, int fixedWidth, JetListViewNode paramNode)
        {
            IEnumerator enumerator = paramNode.EnumerateChildrenRecursive();

            while (enumerator.MoveNext())
            {
                JetListViewNode node         = (JetListViewNode)enumerator.Current;
                int             desiredWidth = GetDesiredWidthIndented(col, indentCol, node, fixedWidth);
                if (col.Width == desiredWidth)
                {
                    RecalcAll(col, indentCol, fixedWidth, null);
                    break;
                }
            }
        }
예제 #28
0
        protected void DrawColumnWithHighlight(Graphics g, Rectangle rcCol, JetListViewNode itemNode,
                                               JetListViewColumn col, RowState state)
        {
            if ((state & RowState.InPlaceEdit) == 0 || col != GetInPlaceEditColumn(itemNode))
            {
                string highlightText = null;
                if ((state & RowState.IncSearchMatch) != 0 &&
                    col.MatchIncrementalSearch(itemNode, _searchHighlightText))
                {
                    highlightText = _searchHighlightText;
                }

                col.DrawNode(g, rcCol, itemNode, state, highlightText);
            }
        }
예제 #29
0
        private void RecalcOnExpand(JetListViewColumn col, JetListViewColumn indentCol, int fixedWidth, JetListViewNode paramNode)
        {
            int         maxWidth   = col.Width;
            IEnumerator enumerator = paramNode.EnumerateChildrenRecursive();

            while (enumerator.MoveNext())
            {
                JetListViewNode node         = (JetListViewNode)enumerator.Current;
                int             desiredWidth = GetDesiredWidthIndented(col, indentCol, node, fixedWidth);
                if (desiredWidth > maxWidth)
                {
                    maxWidth = desiredWidth;
                }
            }
            col.Width = maxWidth;
        }
예제 #30
0
        public override Rectangle GetColumnBounds(JetListViewColumn col, JetListViewNode node)
        {
            int curX = -_scrollOffset + _borderSize;
            ColumnWidthEnumerator enumerator = new ColumnWidthEnumerator(_columnCollection, node);

            while (enumerator.MoveNext())
            {
                if (enumerator.Current == col)
                {
                    return(new Rectangle(curX, 0, enumerator.CurrentWidth, _rowHeight));
                }

                curX += enumerator.CurrentWidth;
            }
            throw new ArgumentException("Column not found in list", "col");
        }