当前位置: 首页>>代码示例>>C#>>正文


C# TreeList.GetFormattingFlags方法代码示例

本文整理汇总了C#中TreeList.GetFormattingFlags方法的典型用法代码示例。如果您正苦于以下问题:C# TreeList.GetFormattingFlags方法的具体用法?C# TreeList.GetFormattingFlags怎么用?C# TreeList.GetFormattingFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TreeList的用法示例。


在下文中一共展示了TreeList.GetFormattingFlags方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PaintCell

        public virtual void PaintCell(Graphics dc, 
            Rectangle cellRect,
            Node node,
            TreeListColumn column,
            TreeList.TextFormatting format,
            object data)
        {
            if (format.BackColor != Color.Transparent)
            {
                Rectangle r = cellRect;
                r.X = column.CalculatedRect.X;
                r.Width = column.CalculatedRect.Width;
                SolidBrush brush = new SolidBrush(format.BackColor);
                dc.FillRectangle(brush, r);
                brush.Dispose();
            }
            if (data != null)
            {
                cellRect = CommonTools.Util.AdjustRectangle(cellRect, format.Padding);
                //dc.DrawRectangle(Pens.Black, cellRect);

                Color color = format.ForeColor;
                if (m_owner.FocusedNode == node && Application.RenderWithVisualStyles  == false)
                    color = SystemColors.HighlightText;
                TextFormatFlags flags= TextFormatFlags.EndEllipsis | format.GetFormattingFlags();
                TextRenderer.DrawText(dc, data.ToString(), m_owner.Font, cellRect, color, flags);
            }
        }
开发者ID:Diullei,项目名称:Storm,代码行数:28,代码来源:TreeListPainter.cs

示例2: DrawHeaderText

 public void DrawHeaderText(Graphics dc, Rectangle cellRect, TreeListColumn column, TreeList.TextFormatting format)
 {
     Color color = format.ForeColor;
     TextFormatFlags flags = TextFormatFlags.EndEllipsis | format.GetFormattingFlags();
     TextRenderer.DrawText(dc, column.Caption, column.Font, cellRect, color, flags);
 }
开发者ID:lanphon,项目名称:renderdoc,代码行数:6,代码来源:TreeListPainter.cs

示例3: PaintCellText

        public virtual void PaintCellText(Graphics dc, 
            Rectangle cellRect,
            Node node,
            TreeListColumn column,
            TreeList.TextFormatting format,
            object data)
        {
            if (data != null)
            {
                cellRect = AdjustRectangle(cellRect, format.Padding);
                //dc.DrawRectangle(Pens.Black, cellRect);

                Color color = format.ForeColor;
                if (m_owner.FocusedNode == node && Application.RenderWithVisualStyles == false && m_owner.Focused)
                    color = SystemColors.HighlightText;
                TextFormatFlags flags= TextFormatFlags.EndEllipsis | format.GetFormattingFlags();

                Font f = m_owner.Font;
                Font disposefont = null;

                if(node.Bold && node.Italic)
                    disposefont = f = new Font(f, FontStyle.Bold|FontStyle.Italic);
                else if (node.Bold)
                    disposefont = f = new Font(f, FontStyle.Bold);
                else if (node.Italic)
                    disposefont = f = new Font(f, FontStyle.Italic);

                string datastring = "";

                if(m_converter != null)
                    datastring = m_converter(column, data);
                else
                    datastring = data.ToString();

                TextRenderer.DrawText(dc, datastring, f, cellRect, color, flags);

                if (disposefont != null) disposefont.Dispose();
            }
        }
开发者ID:lanphon,项目名称:renderdoc,代码行数:39,代码来源:TreeListPainter.cs

示例4: DrawHeader

        public virtual void DrawHeader(Graphics dc, Rectangle cellRect, TreeListColumn column, TreeList.TextFormatting format, bool isHot)
        {
            if (!Application.RenderWithVisualStyles)
            {
                ControlPaint.DrawButton(dc, cellRect, ButtonState.Flat);
                return;
            }
            VisualStyleElement element = VisualStyleElement.Header.Item.Normal;
            if (isHot)
                element = VisualStyleElement.Header.Item.Hot;
            if (VisualStyleRenderer.IsElementDefined(element))
            {
                VisualStyleRenderer renderer = new VisualStyleRenderer(element);
                renderer.DrawBackground(dc, cellRect);

                if (format.BackColor != Color.Transparent)
                {
                    SolidBrush brush = new SolidBrush(format.BackColor);
                    dc.FillRectangle(brush, cellRect);
                    brush.Dispose();
                }
                cellRect = CommonTools.Util.AdjustRectangle(cellRect, format.Padding);
                //dc.DrawRectangle(Pens.Black, cellRect);

                Color color = format.ForeColor;
                TextFormatFlags flags= TextFormatFlags.EndEllipsis | format.GetFormattingFlags();
                TextRenderer.DrawText(dc, column.Caption, column.Font, cellRect, color, flags);
            }
        }
开发者ID:moisesiq,项目名称:aupaga,代码行数:29,代码来源:TreeListPainter.cs

示例5: PaintCellText

        public virtual void PaintCellText(Graphics dc, 
            Rectangle cellRect,
            Node node,
            TreeListColumn column,
            TreeList.TextFormatting format,
            object data)
        {
            if (data != null)
            {
                cellRect = AdjustRectangle(cellRect, format.Padding);
                //dc.DrawRectangle(Pens.Black, cellRect);

                Color color = format.ForeColor;
                if (node.ForeColor != Color.Transparent)
                    color = node.ForeColor;
                if (m_owner.FocusedNode == node && Application.RenderWithVisualStyles == false && m_owner.Focused)
                    color = SystemColors.HighlightText;
                TextFormatFlags flags= TextFormatFlags.EndEllipsis | format.GetFormattingFlags();

                Font f = m_owner.Font;
                Font disposefont = null;

                if(node.Bold && node.Italic)
                    disposefont = f = new Font(f, FontStyle.Bold|FontStyle.Italic);
                else if (node.Bold)
                    disposefont = f = new Font(f, FontStyle.Bold);
                else if (node.Italic)
                    disposefont = f = new Font(f, FontStyle.Italic);

                string datastring = "";

                if(m_converter != null)
                    datastring = m_converter(column, data);
                else
                    datastring = data.ToString();

                TextRenderer.DrawText(dc, datastring, f, cellRect, color, flags);

                Size sz = TextRenderer.MeasureText(dc, datastring, f, new Size(1000000, 10000), flags);

                int treecolumn = node.TreeColumn;
                if (treecolumn < 0)
                    treecolumn = node.OwnerView.TreeColumn;

                if (column.Index == treecolumn)
                    node.ClippedText = (sz.Width > cellRect.Width || sz.Height > cellRect.Height);

                if (disposefont != null) disposefont.Dispose();
            }
        }
开发者ID:kvark,项目名称:renderdoc,代码行数:50,代码来源:TreeListPainter.cs


注:本文中的TreeList.GetFormattingFlags方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。