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


C# MasterPane.CalcClientRect方法代码示例

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


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

示例1: DoLayout

        /// <summary>
        /// Internal method that applies a previously set layout with a rows per column or
        /// columns per row configuration.  This method is only called by
        /// <see cref="DoLayout(Graphics,MasterPane)" />.
        /// </summary>
        internal void DoLayout( Graphics g, MasterPane master, bool isColumnSpecified, int[] countList,
            float[] proportion)
        {
            // calculate scaleFactor on "normal" pane size (BaseDimension)
            float scaleFactor = master.CalcScaleFactor();

            // innerRect is the area for the GraphPane's
            RectangleF innerRect = master.CalcClientRect( g, scaleFactor );
            master.Legend.CalcRect( g, master, scaleFactor, ref innerRect );

            // scaled InnerGap is the area between the GraphPane.Rect's
            float scaledInnerGap = (float)( master._innerPaneGap * scaleFactor );

            int iPane = 0;

            if ( isColumnSpecified )
            {
                int rows = countList.Length;

                float y = 0.0f;

                for ( int rowNum = 0; rowNum < rows; rowNum++ )
                {
                    float propFactor = _prop == null ? 1.0f / rows : _prop[rowNum];

                    float height = ( innerRect.Height - (float)( rows - 1 ) * scaledInnerGap ) *
                                    propFactor;

                    int columns = countList[rowNum];
                    if ( columns <= 0 )
                        columns = 1;
                    float width = ( innerRect.Width - (float)( columns - 1 ) * scaledInnerGap ) /
                                    (float)columns;

                    if ( iPane >= master._paneList.Count )
                        return;

                    for ( int colNum = 0; colNum < columns; colNum++ )
                    {
                        master[iPane].Rect = new RectangleF(
                                            innerRect.X + colNum * ( width + scaledInnerGap ),
                                            innerRect.Y + y,
                                            width,
                                            height );
                        iPane++;
                    }

                    y += height + scaledInnerGap;
                }
            }
            else
            {
                int columns = countList.Length;

                float x = 0.0f;

                for ( int colNum = 0; colNum < columns; colNum++ )
                {
                    float propFactor = _prop == null ? 1.0f / columns : _prop[colNum];

                    float width = ( innerRect.Width - (float)( columns - 1 ) * scaledInnerGap ) *
                                    propFactor;

                    int rows = countList[colNum];
                    if ( rows <= 0 )
                        rows = 1;
                    float height = ( innerRect.Height - (float)( rows - 1 ) * scaledInnerGap ) / (float)rows;

                    for ( int rowNum = 0; rowNum < rows; rowNum++ )
                    {
                        if ( iPane >= master._paneList.Count )
                            return;

                        master[iPane].Rect = new RectangleF(
                                            innerRect.X + x,
                                            innerRect.Y + rowNum * ( height + scaledInnerGap ),
                                            width,
                                            height );
                        iPane++;
                    }

                    x += width + scaledInnerGap;
                }
            }
        }
开发者ID:Rupan,项目名称:BDInfo,代码行数:90,代码来源:PaneLayoutMgr.cs


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