private int GetColumnBestHeight(GridBand column, int width, DevExpress.Utils.AppearanceObject app)
        {
            GridBandInfoArgs   ex       = null;
            BandedGridViewInfo viewInfo = GridView.GetViewInfo() as BandedGridViewInfo;

            viewInfo.GInfo.AddGraphics(null);
            ex = new GridBandInfoArgs(null, viewInfo.GInfo.Cache);
            try
            {
                ex.InnerElements.Add(new DrawElementInfo(new GlyphElementPainter(),
                                                         new GlyphElementInfoArgs(viewInfo.View.Images, 0, null),
                                                         StringAlignment.Near));
                ex.SetAppearance(app);
                ex.Caption     = column.Caption;
                ex.CaptionRect = new Rectangle(0, 0, (int)(width - 10 * DpiXRel), 1000);
            }
            finally
            {
                viewInfo.GInfo.ReleaseGraphics();
            }

            GraphicsInfo grInfo = new GraphicsInfo();

            grInfo.AddGraphics(null);
            ex.Cache = grInfo.Cache;
            int Height = CalcCaptionTextSize(grInfo.Cache, ex as HeaderObjectInfoArgs, column.Caption);

            return(Height);
        }
示例#2
0
        private void BtnRename4_Click(object sender, EventArgs e)
        {
            GraphicsInfo gi = CmbGraphics4.SelectedItem as GraphicsInfo;

            gi.Name = TxtGName4.Text;
            UpdateGraphicsNames(gi);
        }
示例#3
0
        private List <GraphicsInfo> CreateGraphicsInfo(ZebraGraphics graphics, Dictionary <PrintType, string> imageInfo, CardSide side)
        {
            List <GraphicsInfo> graphicsInfoList = new List <GraphicsInfo>();

            foreach (PrintType type in imageInfo.Keys)
            {
                graphics.Initialize(0, 0, OrientationType.Landscape, type, -1);

                if (type == PrintType.Overlay && imageInfo[type] == null)
                {
                    GraphicsInfo graphicsInfo = new GraphicsInfo {
                        Side        = side,
                        PrintType   = type,
                        GraphicType = GraphicType.NA
                    };
                    graphicsInfoList.Add(graphicsInfo);
                }
                else
                {
                    byte[] imageData = File.ReadAllBytes(imageInfo[type]);
                    graphics.DrawImage(imageData, 0, 0, 0, 0, RotationType.RotateNoneFlipNone);
                    graphicsInfoList.Add(BuildGraphicsInfo(graphics.CreateImage(), side, type));
                }

                graphics.Clear();
            }

            return(graphicsInfoList);
        }
示例#4
0
 protected Preprocessor(
     NodeDataProvider dataProvider,
     GraphicsInfo graphicsInfo
     )
 {
     this._dataProvider = dataProvider;
     this._graphicsInfo = graphicsInfo;
 }
 /// <summary>
 /// Data grid preprocessor dialog.
 /// </summary>
 public DataGridPreprocessorDialog(
     NodeDataProvider dataProvider,
     GraphicsInfo graphicsInfo
     ) : base(
         dataProvider,
         graphicsInfo
         )
 {
 }
示例#6
0
        protected int[] GetCharWidths()
        {
            GraphicsInfo info = new GraphicsInfo();

            info.AddGraphics(null);
            int[] widths = DevExpress.Utils.Text.TextUtils.GetMeasureString(info.Graphics, Text, Appearance.Font);
            info.ReleaseGraphics();
            return(widths);
        }
示例#7
0
        private void CmbGraphics4_SelectedIndexChanged(object sender, EventArgs e)
        {
            GraphicsInfo gi = CmbGraphics4.SelectedItem as GraphicsInfo;

            TxtGName4.Text = gi.Name;
            CompositeTable.SetGraphicsbank(3, ProjectController.GraphicsManager.GraphicsBanks[gi.Bank]);
            PtvTileSelector.UpdateSelection();
            LblHexGraphics4.Text = "x" + CmbGraphics4.SelectedIndex.ToHexString();
        }
示例#8
0
 /// <summary>
 /// Initializing object GraphPreprocessorDialog.
 /// </summary>
 public GraphPreprocessor(
     NodeDataProvider dataProvider,
     GraphicsInfo graphicsInfo
     ) : base(
         dataProvider,
         graphicsInfo
         )
 {
 }
示例#9
0
 /// <summary>
 /// Rdlc preprocessor dialog.
 /// </summary>
 public RDLPreprocessorDialog(
     NodeDataProvider dataProvider,
     GraphicsInfo graphics
     ) : base(
         dataProvider,
         graphics
         )
 {
 }
示例#10
0
        public static Assembly CreateAssembly(string type, string subtitle)
        {
            if (type == "KUKA KR180")
            {
                KUKAKR180Info info = new KUKAKR180Info();

                info.name = Experior.Core.Assemblies.Assembly.GetValidName("KUKA KR180 ");

                return(new KUKAKR180(info));
            }
            else if (type == "Man1" || type == "Man2")
            {
                GraphicsInfo info = new GraphicsInfo();
                info.name         = Experior.Core.Assemblies.Assembly.GetValidName(type + " ");
                info.GraphicsName = type;
                info.Category     = "Man";
                info.height       = 0;

                return(new Graphics(info));
            }
            else if (type == "Text")
            {
                Catalog.Logistic.Basic.TextBitmapInfo info = new Logistic.Basic.TextBitmapInfo();
                info.name = Experior.Core.Assemblies.Assembly.GetValidName(type + " ");
                return(new Catalog.Logistic.Basic.TextBitmap(info));
            }
            else if (type == "3D Text")
            {
                TextLabel3DInfo tInfo = new TextLabel3DInfo();
                tInfo.name = Experior.Core.Assemblies.Assembly.GetValidName(type + " ");
                return(new TextLabel3D(tInfo));
            }
            else if (type == "Logo")
            {
                DematicLogoInfo logoinfo = new DematicLogoInfo();
                logoinfo.name = Experior.Core.Assemblies.Assembly.GetValidName("DematicLogo ");
                return(new Dematic_Logo(logoinfo));
            }
            else if (type == "Box")
            {
                DematicBoxInfo boxInfo = new DematicBoxInfo();
                boxInfo.name = Experior.Core.Assemblies.Assembly.GetValidName("Box ");
                return(new DematicBox(boxInfo));
            }
            else if (type == "Image")
            {
                GraphicsInfo ImageInfo = new GraphicsInfo();
                ImageInfo.GraphicsName = @"C:\tesco logo.png";
                return(new Graphics(ImageInfo));
            }

            return(null);
        }
示例#11
0
            /// <summary>
            /// Get size in milimetrs for report size.
            /// </summary>
            /// <returns></returns>
            private Tuple <float, float> GetSizeInMillimetrs()
            {
                int          scrollWidth  = SystemInformation.VerticalScrollBarWidth;
                GraphicsInfo gi           = Preprocessor.GraphicsInfo;
                Size         ownerSize    = gi.Size;
                var          currentTuple = new Tuple <float, float>(
                    ((float)(((ownerSize.Width - scrollWidth - 4) / gi.DpiX) * 25.4)),
                    ((float)((ownerSize.Height / gi.DpiY) * 25.4))
                    );

                return(currentTuple);
            }
示例#12
0
        private bool IsButtonRect(Point point, GridColumn column)
        {
            GraphicsInfo info = new GraphicsInfo();

            info.AddGraphics(null);
            GridViewInfo       viewInfo   = view.GetViewInfo() as GridViewInfo;
            GridColumnInfoArgs columnArgs = viewInfo.ColumnsInfo[column];
            Rectangle          buttonRect = CalcButtonRect(columnArgs, info.Graphics);

            info.ReleaseGraphics();
            return(buttonRect.Contains(point));
        }
 /// <summary>
 /// Html preprocessor dialog.
 /// </summary>
 public HtmlPreprocessorDialog(
     NodeDataProvider dataProvider,
     GraphicsInfo graphicsInfo,
     XslPreprocessManager preprocessManager
     ) : base(
         dataProvider,
         graphicsInfo
         )
 {
     this._pathToHtml        = GetDbfsFolderName();
     this._preprocessManager = preprocessManager;
 }
示例#14
0
        private GraphicsInfo BuildGraphicsInfo(ZebraCardImageI zebraCardImage, CardSide side, PrintType printType)
        {
            GraphicsInfo graphicsInfo = new GraphicsInfo {
                Side        = side,
                PrintType   = printType,
                GraphicType = zebraCardImage != null ? GraphicType.BMP : GraphicType.NA
            };

            if (zebraCardImage != null)
            {
                graphicsInfo.GraphicData = zebraCardImage;
            }
            return(graphicsInfo);
        }
示例#15
0
        private int GetColumnBestHeight(GridBand column, int width /*, GridBand parent_column*/)
        {
            /*GridBandInfoArgs ex = null;
             *
             * if (parent_column == null)
             *  ex = viewInfo.BandsInfo[column];
             * else
             *  ex = viewInfo.BandsInfo[parent_column].Children[column];
             *
             * GraphicsInfo grInfo = new GraphicsInfo();
             * grInfo.AddGraphics(null);
             * ex.Cache = grInfo.Cache;
             * bool canDrawMore = true;
             * Size captionSize = CalcCaptionTextSize(grInfo.Cache, ex as HeaderObjectInfoArgs, column.Caption);
             * Size res = ex.InnerElements.CalcMinSize(grInfo.Graphics, ref canDrawMore);
             * res.Height = Math.Max(res.Height, captionSize.Height);
             * res.Width += captionSize.Width;
             * //res = viewInfo.Painter.ElementsPainter.Column.CalcBoundsByClientRectangle(ex, new Rectangle(Point.Empty, res)).Size;
             * grInfo.ReleaseGraphics();
             * return res.Height;*/

            GridBandInfoArgs   ex       = null;
            BandedGridViewInfo viewInfo = GridView.GetViewInfo() as BandedGridViewInfo;

            viewInfo.GInfo.AddGraphics(null);
            ex = new GridBandInfoArgs(null, viewInfo.GInfo.Cache);
            try
            {
                ex.InnerElements.Add(new DrawElementInfo(new GlyphElementPainter(),
                                                         new GlyphElementInfoArgs(viewInfo.View.Images, 0, null),
                                                         StringAlignment.Near));
                ex.SetAppearance(GridView.Appearance.BandPanel);
                ex.Caption     = column.Caption;
                ex.CaptionRect = new Rectangle(0, 0, width, 1000);
            }
            finally
            {
                viewInfo.GInfo.ReleaseGraphics();
            }

            GraphicsInfo grInfo = new GraphicsInfo();

            grInfo.AddGraphics(null);
            ex.Cache = grInfo.Cache;
            Size captionSize = CalcCaptionTextSize(grInfo.Cache, ex as HeaderObjectInfoArgs, column.Caption);

            return(captionSize.Height);
        }
    private int GetColumnBestHeight(GridViewInfo viewInfo, GridColumn column)
    {
        GridColumnInfoArgs ex     = viewInfo.ColumnsInfo[column];
        GraphicsInfo       grInfo = new GraphicsInfo();

        grInfo.AddGraphics(null);
        ex.Cache = grInfo.Cache;
        bool canDrawMore = true;
        Size captionSize = CalcCaptionTextSize(grInfo.Cache, ex as HeaderObjectInfoArgs, column.GetCaption());
        Size res         = ex.InnerElements.CalcMinSize(grInfo.Graphics, ref canDrawMore);

        res.Height = Math.Max(res.Height, captionSize.Height);
        res.Width += captionSize.Width;
        res        = viewInfo.Painter.ElementsPainter.Column.CalcBoundsByClientRectangle(ex, new Rectangle(Point.Empty, res)).Size;
        grInfo.ReleaseGraphics();
        return(res.Height);
    }
示例#17
0
        private int GetColumnBestHeight(DevExpress.XtraGrid.Columns.GridColumn column)
        {
            try
            {
                DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo viewInfo = GridView.GetViewInfo() as GridViewInfo;

                GridColumnInfoArgs ex = null;
                viewInfo.GInfo.AddGraphics(null);
                ex = new GridColumnInfoArgs(viewInfo.GInfo.Cache, null);
                try
                {
                    ex.InnerElements.Add(new DrawElementInfo(new GlyphElementPainter(),
                                                             new GlyphElementInfoArgs(viewInfo.View.Images, 0, null),
                                                             StringAlignment.Near));
                    ex.SetAppearance(GridView.Appearance.HeaderPanel);
                    ex.Caption     = column.Caption;
                    ex.CaptionRect = new Rectangle(0, 0, (int)(column.VisibleWidth - 10 * DpiXRel), 1000);
                }
                finally
                {
                    viewInfo.GInfo.ReleaseGraphics();
                }

                GraphicsInfo grInfo = new GraphicsInfo();
                grInfo.AddGraphics(null);
                ex.Cache = grInfo.Cache;
                Size captionSize = CalcCaptionTextSize(grInfo.Cache, ex as HeaderObjectInfoArgs, column.Caption);
                bool canDrawMore = true;
                Size res         = ex.InnerElements.CalcMinSize(grInfo.Graphics, ref canDrawMore);

                res.Height = Math.Max(res.Height, captionSize.Height);
                res.Width += captionSize.Width;
                if (viewInfo.Painter != null)
                {
                    res = viewInfo.Painter.ElementsPainter.Column.CalcBoundsByClientRectangle(ex, new Rectangle(Point.Empty, res)).Size;
                    m_dictColumnHeight[column.Name] = res.Height;
                    return(res.Height);
                }
            }
            catch (Exception ex)
            {
                MyLocalizer.XtraMessageBoxShow("В программе произошла ошибка. Описание: " + ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(-1);
        }
        void CalcMessageBounds()
        {
            int messageTop, messageLeft, messageWidth, messageHeight;

            messageTop  = Spacing;
            messageLeft = (icon == null) ? Spacing : (this.iconRectangle.Left + this.iconRectangle.Width + Spacing);
            int maxFormWidth = this.MaximumSize.Width;

            if (maxFormWidth <= 0)
            {
                maxFormWidth = SystemInformation.WorkingArea.Width;
            }
            int maxTextWidth = maxFormWidth - Spacing - messageLeft;

            if (maxTextWidth < 10)
            {
                maxTextWidth = 10;
            }
            GraphicsInfo ginfo = new GraphicsInfo();

            ginfo.AddGraphics(null);
            SizeF textSize = GetPaintAppearance().CalcTextSize(ginfo.Graphics, labelText, maxTextWidth);

            ginfo.ReleaseGraphics();
            messageWidth = (int)Math.Ceiling(textSize.Width);
            int maxFormHeight = this.MaximumSize.Height;

            if (maxFormHeight <= 0)
            {
                maxFormHeight = SystemInformation.WorkingArea.Height;
            }
            int maxTextHeight = maxFormHeight - Spacing - ButtonsLayouter.ButtonHeight - Spacing - messageTop - SystemInformation.CaptionHeight;

            if (maxTextHeight < 10)
            {
                maxTextHeight = 10;
            }
            messageHeight = (int)Math.Ceiling(textSize.Height);
            if (messageHeight > maxTextHeight)
            {
                messageHeight = maxTextHeight;
            }
            messageWidth          = messageWidth < memoWidth ? memoWidth : messageWidth;
            this.messageRectangle = new Rectangle(messageLeft, messageTop, messageWidth, messageHeight);
        }
        private void CalcMessageBounds()
        {
            int y     = Spacing;
            int x     = (this.Message.Icon == null) ? Spacing : ((this.iconRectangle.Left + this.iconRectangle.Width) + Spacing);
            int width = this.MaximumSize.Width;

            if (width <= 0)
            {
                //width = SystemInformation.WorkingArea.Width;
                width = SystemInformation.WorkingArea.Width / 2;
            }
            int num6 = (width - Spacing) - x;

            if (num6 < 10)
            {
                num6 = 10;
            }
            GraphicsInfo info = new GraphicsInfo();

            info.AddGraphics(null);
            SizeF ef = this.GetPaintAppearance().CalcTextSize(info.Graphics, this.Message.Text, num6);

            info.ReleaseGraphics();
            int num3   = (int)Math.Ceiling((double)ef.Width);
            int height = this.MaximumSize.Height;

            if (height <= 0)
            {
                height = SystemInformation.WorkingArea.Height;
            }
            int num8 = ((((height - Spacing) - this.buttons[0].Height) - Spacing) - y) - SystemInformation.CaptionHeight;

            if (num8 < 10)
            {
                num8 = 10;
            }
            int num4 = (int)Math.Ceiling((double)ef.Height);

            if (num4 > num8)
            {
                num4 = num8;
            }
            this.messageRectangle = new Rectangle(x, y, num3, num4);
        }
示例#20
0
        private int GetColumnBestHeight(GridViewInfo viewInfo, GridColumn column, int height)
        {
            GridColumnInfoArgs ex = viewInfo.ColumnsInfo[column];

            if (ex == null)
            {
                viewInfo.GInfo.AddGraphics(null);
                ex = new GridColumnInfoArgs(viewInfo.GInfo.Cache, null);
                try
                {
                    ex.InnerElements.Add(new DrawElementInfo(new GlyphElementPainter(),
                                                             new GlyphElementInfoArgs(viewInfo.View.Images, 0, null),
                                                             StringAlignment.Near));
                    if (viewInfo.View.CanShowFilterButton(null))
                    {
                        ex.InnerElements.Add(viewInfo.Painter.ElementsPainter.FilterButton, new GridFilterButtonInfoArgs());
                    }
                    ex.SetAppearance(viewInfo.PaintAppearance.HeaderPanel);
                    ex.Caption     = column.Caption;
                    ex.CaptionRect = new Rectangle(0, 0, column.Width - 20, 17);
                }
                finally
                {
                    viewInfo.GInfo.ReleaseGraphics();
                }
            }
            GraphicsInfo grInfo = new GraphicsInfo();

            grInfo.AddGraphics(null);
            ex.Cache = grInfo.Cache;
            bool canDrawMore = true;
            Size captionSize = CalcCaptionTextSize(grInfo.Cache, ex as HeaderObjectInfoArgs, column.GetCaption());
            Size res         = ex.InnerElements.CalcMinSize(grInfo.Graphics, ref canDrawMore);

            //res.Height = Math.Max(res.Height, captionSize.Height);
            res.Height = height;
            res.Width += captionSize.Width;
            //res = viewInfo.Painter.ElementsPainter.Column.CalcBoundsByClientRectangle(ex, new Rectangle(Point.Empty, res)).Size;
            //res =new Size(180, 33);
            grInfo.ReleaseGraphics();
            return(res.Height);
        }
示例#21
0
        protected void colorPickEdit1_Paint(object sender, PaintEventArgs e)
        {
            var edit     = (ColorPickEdit)sender;
            var viewInfo = (ColorEditViewInfo)edit.GetViewInfo();
            var info     = new GraphicsInfo();

            info.AddGraphics(e.Graphics);
            var color = edit.Color.IsEmpty ? Color.White : edit.Color;

            using (var brush = new SolidBrush(color)) {
                info.Cache.FillRectangle(brush, viewInfo.ContentRect);
            }
            if (edit.Color.IsEmpty)
            {
                using (var brush = new SolidBrush(Color.FromArgb(135, 146, 159))) {
                    info.Cache.DrawString("Default", DefaultFont, brush, viewInfo.ContentRect);
                }
            }
            info.ReleaseGraphics();
        }
示例#22
0
        private void ReadFrom(BinaryReader br)
        {
            var result = new GraphicsInfo();

            // 1. Bitmap
            result.GraphicsImage = (Bitmap)SerializationHelper.ReadImage(br);

            // 2. Transformation matrix
            var elements = (float[])BinarySerializer.DeserializeByReader(br);

            result.Transform = new Matrix(elements[0], elements[1], elements[2], elements[3], elements[4], elements[5]);

            // 3. Meta
            result.OriginalVisibleClipBounds    = new Rectangle(br.ReadInt32(), br.ReadInt32(), br.ReadInt32(), br.ReadInt32());
            result.TransformedVisibleClipBounds = new RectangleF(br.ReadSingle(), br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            result.PageUnit   = (GraphicsUnit)br.ReadInt32();
            result.Resolution = new PointF(br.ReadSingle(), br.ReadSingle());

            GraphicsInfo = result;
        }
示例#23
0
        private void UpdateGraphicsNames(GraphicsInfo gi)
        {
            bool reselect = false;
            int  index    = 0;

            index    = CmbGraphics1.Items.IndexOf(gi);
            reselect = CmbGraphics1.SelectedIndex == index;
            CmbGraphics1.Items.RemoveAt(index);
            CmbGraphics1.Items.Insert(index, gi);
            if (reselect)
            {
                CmbGraphics1.SelectedIndex = index;
            }

            index    = CmbGraphics2.Items.IndexOf(gi);
            reselect = CmbGraphics2.SelectedIndex == index;
            CmbGraphics2.Items.RemoveAt(index);
            CmbGraphics2.Items.Insert(index, gi);
            if (reselect)
            {
                CmbGraphics2.SelectedIndex = index;
            }

            index    = CmbGraphics3.Items.IndexOf(gi);
            reselect = CmbGraphics3.SelectedIndex == index;
            CmbGraphics3.Items.RemoveAt(index);
            CmbGraphics3.Items.Insert(index, gi);
            if (reselect)
            {
                CmbGraphics3.SelectedIndex = index;
            }

            index    = CmbGraphics4.Items.IndexOf(gi);
            reselect = CmbGraphics4.SelectedIndex == index;
            CmbGraphics4.Items.RemoveAt(index);
            CmbGraphics4.Items.Insert(index, gi);
            if (reselect)
            {
                CmbGraphics4.SelectedIndex = index;
            }
        }
示例#24
0
        private int[] GetValuesWidths(Font font, string[] values)
        {
            GraphicsInfo info = new GraphicsInfo();

            info.AddGraphics(null);

            int[] widths         = new int[values.Length];
            int   separatorWidth = GetSeparatorWidth(font, separatorChar, info.Graphics);

            for (int i = 0; i < values.Length - 1; i++)
            {
                widths.SetValue(DevExpress.Utils.Text.TextUtils.GetStringSize(info.Graphics,
                                                                              values[i], font).Width + separatorWidth, i);
            }
            widths.SetValue(DevExpress.Utils.Text.TextUtils.GetStringSize(info.Graphics,
                                                                          values[values.Length - 1], font).Width, values.Length - 1);

            info.ReleaseGraphics();

            return(widths);
        }
示例#25
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public RobotGameGame() : base()
        {
            //  Set to window title name
            Window.Title = "Robot Game";

            //  Initialize a graphics information
            GraphicsInfo graphicsInfo = new GraphicsInfo();

#if XBOX
            graphicsInfo.screenWidth  = (int)ViewerWidth.Width1080;
            graphicsInfo.screenHeight = (int)ViewerHeight.Height1080;
#else
            graphicsInfo.screenWidth  = (int)ViewerWidth.Width720;
            graphicsInfo.screenHeight = (int)ViewerHeight.Height720;
#endif
            //  Set to shader info
            graphicsInfo.pixelShaderProfile  = ShaderProfile.PS_2_0;
            graphicsInfo.vertexShaderProfile = ShaderProfile.VS_2_0;

            //  Must be call in this constructor
            ChangeGraphics(graphicsInfo);
        }
示例#26
0
        private void CmbGraphics1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (SelectionMode == SelectionMode.Full)
            {
                if (CmbGraphics1.SelectedIndex > 252)
                {
                    CmbGraphics1.SelectedIndex = 252;
                    return;
                }
            }
            else if (SelectionMode == SelectionMode.Half)
            {
                if (CmbGraphics1.SelectedIndex > 254)
                {
                    CmbGraphics1.SelectedIndex = 254;
                    return;
                }
            }

            GraphicsInfo gi = CmbGraphics1.SelectedItem as GraphicsInfo;

            TxtGName1.Text = gi.Name;
            CompositeTable.SetGraphicsbank(0, ProjectController.GraphicsManager.GraphicsBanks[gi.Bank]);

            if (SelectionMode == SelectionMode.Full)
            {
                CmbGraphics2.SelectedIndex = CmbGraphics1.SelectedIndex + 1;
                CmbGraphics3.SelectedIndex = CmbGraphics1.SelectedIndex + 2;
                CmbGraphics4.SelectedIndex = CmbGraphics1.SelectedIndex + 3;
            }
            else if (SelectionMode == SelectionMode.Half)
            {
                CmbGraphics2.SelectedIndex = CmbGraphics1.SelectedIndex + 1;
            }

            PtvTileSelector.UpdateSelection();
            LblHexGraphics1.Text = "x" + CmbGraphics1.SelectedIndex.ToHexString();
        }
示例#27
0
 private int GetColumnBestHeight(GridViewInfo viewInfo, GridColumn column)
 {
     GridColumnInfoArgs ex = viewInfo.ColumnsInfo[column];
     if (ex == null)
     {
         viewInfo.GInfo.AddGraphics(null);
         ex = new GridColumnInfoArgs(viewInfo.GInfo.Cache, null);
         try
         {
             ex.InnerElements.Add(new DrawElementInfo(new GlyphElementPainter(),
                                                     new GlyphElementInfoArgs(viewInfo.View.Images, 0, null),
                                                     StringAlignment.Near));
             if (viewInfo.View.CanShowFilterButton(null))
             {
                 ex.InnerElements.Add(viewInfo.Painter.ElementsPainter.FilterButton, new GridFilterButtonInfoArgs());
             }
             ex.SetAppearance(viewInfo.PaintAppearance.HeaderPanel);
             ex.Caption = column.Caption;
             ex.CaptionRect = new Rectangle(0, 0, column.Width - 20, 17);
         }
         finally
         {
             viewInfo.GInfo.ReleaseGraphics();
         }
     }
     GraphicsInfo grInfo = new GraphicsInfo();
     grInfo.AddGraphics(null);
     ex.Cache = grInfo.Cache;
     bool canDrawMore = true;
     Size captionSize = CalcCaptionTextSize(grInfo.Cache, ex as HeaderObjectInfoArgs, column.GetCaption());
     Size res = ex.InnerElements.CalcMinSize(grInfo.Graphics, ref canDrawMore);
     res.Height = Math.Max(res.Height, captionSize.Height);
     res.Width += captionSize.Width;
     res = viewInfo.Painter.ElementsPainter.Column.CalcBoundsByClientRectangle(ex, new Rectangle(Point.Empty, res)).Size;
     grInfo.ReleaseGraphics();
     return res.Height;
 }
 public GraphicsInfoController(MainForm topform, GraphicsInfo item) : base(topform, item)
 {
     Data = item;
 }
示例#29
0
 internal static void DebugGraphics(GraphicsInfo graphicsInfo)
 {
     using (IViewModel vm = ViewModelFactory.FromGraphics(graphicsInfo))
         ViewFactory.ShowDialog(vm);
 }
 private bool IsButtonRect(Point point, GridColumn column)
 {
     GraphicsInfo info = new GraphicsInfo();
     info.AddGraphics(null);
     GridViewInfo viewInfo = view.GetViewInfo() as GridViewInfo;
     GridColumnInfoArgs columnArgs = viewInfo.ColumnsInfo[column];
     Rectangle buttonRect = CalcButtonRect(columnArgs, info.Graphics);
     info.ReleaseGraphics();
     return buttonRect.Contains(point);
 }
示例#31
0
 public GraphicsInfoController(MainForm topform, GraphicsInfo item, FileController targetFile) : base(topform, item, targetFile)
 {
     Data = item;
 }
示例#32
0
 /// <summary>
 /// Creates a view model for a <see cref="Graphics"/> from arbitrary debug information.
 /// </summary>
 /// <param name="graphicsInfo">The debug information for a <see cref="Graphics"/>.</param>
 /// <returns>An <see cref="IViewModel"/> instance that represents a view model for a <see cref="Graphics"/>.</returns>
 public static IViewModel FromGraphics(GraphicsInfo graphicsInfo) => new GraphicsVisualizerViewModel
 {
     GraphicsInfo = graphicsInfo
 };