Ejemplo n.º 1
0
        public MultipleResultsPane()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            this.label1.Text = Core.ProductName + " has found multiple feeds for the site. Please select the feeds to which y" +
                               "ou want to subscribe:";

            _checkColumn                  = new CheckBoxColumn();
            _checkColumn.AfterCheck      += new CheckBoxEventHandler(_checkColumn_AfterCheck);
            _nameColumn                   = new JetListViewColumn();
            _nameColumn.ItemTextCallback  = new ItemTextCallback(GetNameColumnText);
            _nameColumn.ForeColorCallback = new ItemColorCallback(GetNameColumnForeColor);
            _nameColumn.FontCallback      = new ItemFontCallback(GetNameColumnFont);
            _nameColumn.CursorCallback    = new ItemCursorCallback(GetNameColumnCursor);
            _nameColumn.MouseDown        += new ItemMouseEventHandler(HandleNameColumnMouseDown);
            _urlColumn = new JetListViewColumn();
            _urlColumn.ItemTextCallback = new ItemTextCallback(GetUrlColumnText);
            _resultList.Columns.AddRange(new JetListViewColumn[] { _checkColumn, _nameColumn, _urlColumn });
            _resultList.MultiLineView  = true;
            _resultList.ControlPainter = new GdiControlPainter();
            _resultList.FullRowSelect  = true;

            _columnScheme            = new MultiLineColumnScheme();
            _resultList.ColumnScheme = _columnScheme;
            _columnScheme.AddColumn(_checkColumn, 0, 0, 0, 20, ColumnAnchor.Left, SystemColors.ControlText,
                                    HorizontalAlignment.Left);
            _columnScheme.AddColumn(_nameColumn, 0, 0, 20, 80, ColumnAnchor.Left | ColumnAnchor.Right, SystemColors.ControlText,
                                    HorizontalAlignment.Left);
            _columnScheme.AddColumn(_urlColumn, 1, 1, 20, 80, ColumnAnchor.Left | ColumnAnchor.Right, SystemColors.ControlText,
                                    HorizontalAlignment.Left);
        }
Ejemplo n.º 2
0
        [Test] public void TestDraw()
        {
            _defaultScheme.AddColumn(_column1, 0, 0, 0, 100, 0, SystemColors.ControlText, HorizontalAlignment.Left);

            Rectangle rcPaint = new Rectangle(0, 0, 100, 20);

            _renderer.DrawRow(null, rcPaint, _testNode, RowState.None);
            Assert.AreEqual(rcPaint, _column1.LastDrawItemRect);
        }
Ejemplo n.º 3
0
        private MultiLineColumnScheme BuildColumnScheme(IResource res)
        {
            MultiLineColumnScheme scheme = new MultiLineColumnScheme();

            scheme.AlignTopLevelItems = _displayColumnManager.GetAlignTopLevelItems(res.Type);

            ArrayList allTypesColumnSchemes = _displayColumnManager.GetResourceColumnSchemes("?");
            ArrayList resourceColumnSchemes = _displayColumnManager.GetResourceColumnSchemes(res.Type);

            ConversationStructureColumn structureColumn = FindConversationColumn();

            if (structureColumn != null)
            {
                structureColumn.Indent = 8;
                scheme.AddColumn(structureColumn, 0, 0, 0, 0, ColumnAnchor.Left, SystemColors.ControlText,
                                 HorizontalAlignment.Left);
            }

            int allTypesIndent = 0;

            foreach (DisplayColumnManager.ResourceColumnScheme resScheme in allTypesColumnSchemes)
            {
                if (resScheme.StartX >= 0)
                {
                    JetListViewColumn col = FindColumn(resScheme.PropIds);
                    if (col != null)
                    {
                        scheme.AddColumn(col, resScheme.StartRow, resScheme.EndRow, resScheme.StartX, resScheme.Width,
                                         AnchorFromFlags(resScheme.Flags), resScheme.TextColor, resScheme.TextAlign);
                        allTypesIndent = resScheme.StartX + resScheme.Width;
                    }
                }
            }

            ArrayList hiddenColumns = null;
            int       maxWidth      = 0;

            foreach (DisplayColumnManager.ResourceColumnScheme resScheme in resourceColumnSchemes)
            {
                if (IsHiddenColumn(res, resScheme))
                {
                    if (hiddenColumns == null)
                    {
                        hiddenColumns = new ArrayList();
                    }
                    hiddenColumns.Add(resScheme);
                }
                else
                {
                    int width = resScheme.StartX + allTypesIndent + resScheme.Width;
                    if (width > maxWidth)
                    {
                        maxWidth = width;
                    }

                    JetListViewColumn col = FindColumn(resScheme.PropIds);
                    if (col != null)
                    {
                        scheme.AddColumn(col, resScheme.StartRow, resScheme.EndRow, resScheme.StartX + allTypesIndent, resScheme.Width,
                                         AnchorFromFlags(resScheme.Flags), resScheme.TextColor, resScheme.TextAlign);
                    }
                }
            }

            if (hiddenColumns != null)
            {
                foreach (DisplayColumnManager.ResourceColumnScheme resScheme in hiddenColumns)
                {
                    StretchColumnsToHidden(scheme, resScheme, allTypesIndent);
                }
            }

            foreach (DisplayColumnManager.ResourceColumnScheme resScheme in allTypesColumnSchemes)
            {
                if (resScheme.StartX < 0)
                {
                    JetListViewColumn col = FindColumn(resScheme.PropIds);
                    if (col != null)
                    {
                        scheme.AddColumn(col, resScheme.StartRow, resScheme.EndRow, maxWidth + resScheme.StartX, resScheme.Width,
                                         AnchorFromFlags(resScheme.Flags), resScheme.TextColor, resScheme.TextAlign);
                    }
                }
            }

            return(scheme);
        }