Example #1
0
        /// <summary>Load resources here.</summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.Keyboard.KeyDown += KeyDown;
            drawing          = new QFontDrawing();
            controlsDrawing  = new QFontDrawing();
            controlsTextOpts = new QFontRenderOptions()
            {
                Colour = Color.FromArgb(new Color4(0.8f, 0.1f, 0.1f, 1.0f).ToArgb()), DropShadowActive = true
            };

            heading2        = new QFont("woodenFont.qfont", new QFontConfiguration(addDropShadow: true), 1.0f);
            heading2Options = new QFontRenderOptions()
            {
                Colour = Color.White, DropShadowActive = true
            };

            var builderConfig = new QFontBuilderConfiguration(addDropShadow: true);

            builderConfig.ShadowConfig.blurRadius  = 2; //reduce blur radius because font is very small
            builderConfig.ShadowConfig.blurPasses  = 1;
            builderConfig.ShadowConfig.Type        = ShadowType.Blurred;
            builderConfig.TextGenerationRenderHint = TextGenerationRenderHint.ClearTypeGridFit; //best render hint for this font
            builderConfig.Characters = CharacterSet.General | CharacterSet.Japanese | CharacterSet.Thai | CharacterSet.Cyrillic;
            mainText        = new QFont("Fonts/times.ttf", 14, builderConfig);
            mainTextOptions = new QFontRenderOptions()
            {
                DropShadowActive = true, Colour = Color.White, WordSpacing = 0.5f
            };

            _benchmarkResults = new QFont("Fonts/times.ttf", 14, builderConfig);

            heading1 = new QFont("Fonts/HappySans.ttf", 72, new QFontBuilderConfiguration(true));

            controlsText = new QFont("Fonts/HappySans.ttf", 32, new QFontBuilderConfiguration(true));

            codeText = new QFont("Fonts/Comfortaa-Regular.ttf", 12, new QFontBuilderConfiguration());

            heading1Options = new QFontRenderOptions()
            {
                Colour = Color.FromArgb(new Color4(0.2f, 0.2f, 0.2f, 1.0f).ToArgb()), DropShadowActive = true
            };
            _processedText  = QFontDrawingPrimitive.ProcessText(mainText, mainTextOptions, preProcessed, new SizeF(Width - 40, -1), QFontAlignment.Left);
            codeTextOptions = new QFontRenderOptions()
            {
                Colour = Color.FromArgb(new Color4(0.0f, 0.0f, 0.4f, 1.0f).ToArgb())
            };

            monoSpaced        = new QFont("Fonts/Anonymous.ttf", 10, new QFontBuilderConfiguration());
            monoSpacedOptions = new QFontRenderOptions()
            {
                Colour = Color.FromArgb(new Color4(0.1f, 0.1f, 0.1f, 1.0f).ToArgb()), DropShadowActive = true
            };

            GL.ClearColor(Color4.CornflowerBlue);
        }
Example #2
0
 private void PrintComment(QFont font, string comment, QFontAlignment alignment, ref float yOffset)
 {
     GL.PushMatrix();
     yOffset += 20;
     GL.Translate(30f, yOffset, 0f);
     font.Print(comment, Width - 60, alignment);
     yOffset += font.Measure(comment, Width - 60, alignment).Height;
     GL.PopMatrix();
 }
Example #3
0
        public void SetCurFontSize(FontSize size)
        {
            if (!font_mapping.ContainsKey(size))
            {
                SetFontProperty(size, m_fDefaultFontSize);
            }

            m_ofntCurFont = font_mapping[size].font;
        }
Example #4
0
        public static void DrawText(string text, QFont font, Vector4 color, Vector4 bounds,
                                    StringAlignment vAlign = StringAlignment.Near,
                                    StringAlignment hAlign = StringAlignment.Near)
        {
            var col = Color.FromArgb((byte)(color.W * 255),
                                     (byte)(color.X * 255), (byte)(color.Y * 255), (byte)(color.Z * 255));

            DrawText(text, font, col, new RectangleF(bounds.X, bounds.Y, bounds.Z, bounds.W), vAlign, hAlign);
        }
Example #5
0
        protected override void OnResize(EventArgs e)
        {
            base.OnResize(e);

            GL.Viewport(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height);
            QFont.InvalidateViewport();

            owner.OnResize();
        }
Example #6
0
        public void DrawString(EFonts _font, string _string, float _x, float _y, FColor _color)
        {
            var qFont = m_resourceProvider[_font];

            QFont.Begin();
            qFont.Options.Colour = new Color4(_color.R, _color.G, _color.B, _color.A);
            qFont.Print(_string, new OpenTK.Vector2(_x, _y));
            QFont.End();
        }
Example #7
0
        void DrawShapes(QPainter painter)
        {
            painter.SetRenderHint(QPainter.RenderHint.Antialiasing);
            painter.Pen   = new QPen(new QBrush(new QColor("Gray")), 1);
            painter.Brush = new QColor("Gray");

            var path = new QPainterPath();

            path.MoveTo(5, 5);
            path.CubicTo(40, 5, 50, 50, 99, 99);
            path.CubicTo(5, 99, 50, 50, 5, 5);
            painter.DrawPath(path);

            painter.DrawPie(130, 20, 90, 60, 30 * 16, 120 * 16);
            painter.DrawChord(240, 30, 90, 60, 0, 16 * 180);
            var rectangle = new QRect(new QPoint(20, 120), new QSize(80, 50));

            painter.DrawRoundedRect(rect: rectangle, xRadius: 10, yRadius: 10);

            // to be implemented
            //var points = new List<QPoint>();
            //points.Add ( new QPoint ( 130, 140 ) );
            //points.Add ( new QPoint ( 180, 170 ) );
            //points.Add ( new QPoint ( 180, 140 ) );
            //points.Add ( new QPoint ( 220, 110 ) );
            //points.Add ( new QPoint ( 140, 100 ) );

            //// http://doc.qt.io/qt-5/qpolygon.html#QPolygon-2 , we should be able to pase point list
            //var polygon = new QPolygon(points);
            //painter.DrawPolygon ( polygon );

            // this is workaround for DrawPolygon
            unsafe
            {
                var polygon = new QPolygon();
                var points  = new int[] { 130, 140, 180, 170, 180, 140, 220, 110, 140, 100 };
                fixed(int *point = points)
                {
                    polygon.SetPoints(points.Length / 2, ref *point);
                }

                painter.DrawPolygon(polygon);
            }

            painter.DrawRect(250, 110, 60, 60);

            var baseline  = new QPointF(20, 250);
            var font      = new QFont("Georgia", 55);
            var forntPath = new QPainterPath();

            forntPath.AddText(baseline, font, "Q");
            painter.DrawPath(forntPath);

            painter.DrawEllipse(140, 200, 60, 60);
            painter.DrawEllipse(240, 200, 90, 60);
        }
Example #8
0
        public void OnLoad(EventArgs e)
        {
            subtitleFont = new QFont("Resources/Fonts/Cousine-Regular-Latin.ttf", 24);
            subtitleFont.Options.Colour = new Color4(183, 148, 106, 0);

            GL.ClearColor(Color.Black);
            GL.Enable(EnableCap.Blend);
            GL.Enable(EnableCap.Texture2D);
            GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
        }
Example #9
0
        public override void Render(float x, float y, float width, float height)
        {
            float xx = x.UnScaleHorizontal();
            float yy = Client.window.Height - Scale.vUnPosScale(y) - height.UnScaleVerticlSize() * .50f;

            QFont.Begin();
            Client.window.Qfont.Options.Colour = color;
            Client.window.Qfont.Print(text + AppendText, Alignment, new Vector2(xx + offsetX, yy + offsetY));
            QFont.End();
        }
Example #10
0
        public static void DrawShadowText(string text, QFont font, Color color, Vector2 position)
        {
            var dpOpt = new QFontRenderOptions()
            {
                Colour = color, LockToPixel = false, DropShadowActive = true
            };

            DrawText(text, font, new RectangleF(position.X, position.Y, 9999, 9999),
                     StringAlignment.Near, StringAlignment.Near, dpOpt);
        }
Example #11
0
        private void PrintComment(QFont font, string comment, QFontAlignment alignment, ref float yOffset, QFontRenderOptions opts)
        {
            yOffset += 20;
            var pos = new Vector3(30f, Height - yOffset, 0f);
            var dp  = new QFontDrawingPrimitive(font, opts ?? new QFontRenderOptions());

            dp.Print(comment, pos, new SizeF(Width - 60, -1), alignment);
            yOffset += dp.Measure(comment, new SizeF(Width - 60, -1), alignment).Height;
            _drawing.DrawingPrimitives.Add(dp);
        }
Example #12
0
        /// <summary>Load resources here.</summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.Keyboard.KeyDown += KeyDown;


            /*
             * QFontBuilderConfiguration config = new QFontBuilderConfiguration();
             * config.PageWidth = 1024;
             * config.PageHeight = 1024;
             * config.GlyphMargin = 6;
             * QFont.CreateTextureFontFiles("BURNSTOW.TTF", 120, config, "metalFont");
             */


            heading2 = QFont.FromQFontFile("woodenFont.qfont", 1.0f, new QFontLoaderConfiguration(true));

            var builderConfig = new QFontBuilderConfiguration(true);

            builderConfig.ShadowConfig.blurRadius  = 1;                                         //reduce blur radius because font is very small
            builderConfig.TextGenerationRenderHint = TextGenerationRenderHint.ClearTypeGridFit; //best render hint for this font
            mainText = new QFont("Fonts/times.ttf", 14, builderConfig);


            heading1 = new QFont("Fonts/HappySans.ttf", 72, new QFontBuilderConfiguration(true));


            controlsText = new QFont("Fonts/HappySans.ttf", 32, new QFontBuilderConfiguration(true));


            codeText = new QFont("Fonts/Comfortaa-Regular.ttf", 12, FontStyle.Regular);

            heading1.Options.Colour           = new Color4(0.2f, 0.2f, 0.2f, 1.0f);
            mainText.Options.Colour           = new Color4(0.1f, 0.1f, 0.1f, 1.0f);
            mainText.Options.DropShadowActive = false;
            codeText.Options.Colour           = new Color4(0.0f, 0.0f, 0.4f, 1.0f);

            QFontBuilderConfiguration config2 = new QFontBuilderConfiguration();

            config2.SuperSampleLevels = 1;
            //   font = new QFont("Fonts/times.ttf", 16,config2);
            //   font.Options.Colour = new Color4(0.1f, 0.1f, 0.1f, 1.0f);
            //   font.Options.CharacterSpacing = 0.1f;


            monoSpaced = new QFont("Fonts/Anonymous.ttf", 10);
            monoSpaced.Options.Colour = new Color4(0.1f, 0.1f, 0.1f, 1.0f);

            Console.WriteLine(" Monospaced : " + monoSpaced.IsMonospacingActive);


            GL.ClearColor(1.0f, 1.0f, 1.0f, 0.0f);
            GL.Disable(EnableCap.DepthTest);
        }
Example #13
0
        public static void DrawText(string text, QFont font, Color color, RectangleF bounds,
                                    StringAlignment vAlign = StringAlignment.Near,
                                    StringAlignment hAlign = StringAlignment.Near)
        {
            var dpOpt = new QFontRenderOptions()
            {
                Colour = color, LockToPixel = true
            };

            DrawText(text, font, bounds, vAlign, hAlign, dpOpt);
        }
Example #14
0
        public override void OnRender(GUIHost host)
        {
            if (item_count != Items.Count)
            {
                Refresh();
            }

            base.OnRender(host);
            var y = (float)(topbordersize_pixels + Y_Abs);
            var x = (float)(leftbordersize_pixels + X_Abs);

            host.SetCurFontSize(Size);
            QFont currentFont = host.GetCurrentFont();

            QFont.Begin();
            var num = 0;

            for (var startRow = start_row; startRow < Items.Count && num < max_rows_on_screen; ++startRow)
            {
                if (startRow == mouse_over_row && !NoSelect)
                {
                    QFont.End();
                    Simple2DRenderer      simpleRenderer = host.GetSimpleRenderer();
                    Simple2DRenderer.Quad quad1;
                    quad1.x0    = x;
                    quad1.y0    = y;
                    quad1.x1    = x + text_region_width;
                    quad1.y1    = y + rowheight * 0.75f;
                    quad1.color = color_highlighted;
                    Simple2DRenderer.Quad quad2 = quad1;
                    simpleRenderer.DrawQuad(quad2);
                    QFont.Begin();
                }
                if (startRow == selected && !NoSelect)
                {
                    QFont.End();
                    Simple2DRenderer      simpleRenderer = host.GetSimpleRenderer();
                    Simple2DRenderer.Quad quad1;
                    quad1.x0    = x;
                    quad1.y0    = y;
                    quad1.x1    = x + text_region_width;
                    quad1.y1    = y + rowheight * 0.75f;
                    quad1.color = color_selected;
                    Simple2DRenderer.Quad quad2 = quad1;
                    simpleRenderer.DrawQuad(quad2);
                    QFont.Begin();
                }
                currentFont.Options.Colour = Color;
                currentFont.Print(Items[startRow].ToString(), text_region_width, new Vector2(x, y));
                y += rowheight;
                ++num;
            }
            QFont.End();
        }
Example #15
0
        public FontGroup(Font font)
        {
            _normal = new QFont(new Font(font, FontStyle.Regular));
            _normal.Options.Monospacing = QFontMonospacing.Yes;

            _bold = new QFont(new Font(font, FontStyle.Bold));
            _bold.Options.Monospacing = QFontMonospacing.Yes;

            _italic = new QFont(new Font(font, FontStyle.Italic));
            _italic.Options.Monospacing = QFontMonospacing.Yes;
        }
Example #16
0
        private void PrintCommentWithLine(QFont font, string comment, QFontAlignment alignment, float xOffset, ref float yOffset, QFontRenderOptions opts)
        {
            yOffset += 20;
            var dp = new QFontDrawingPrimitive(font, opts);

            dp.Print(comment, new Vector3(xOffset, Height - yOffset, 0f), new SizeF(Width - 60, -1), alignment);
            _drawing.DrawingPrimitives.Add(dp);
            var bounds = font.Measure(comment, new SizeF(Width - 60, float.MaxValue), alignment);

            yOffset += bounds.Height;
        }
Example #17
0
        private int GetCursorLocation(QFont font)
        {
            if (cursor <= 0)
            {
                return(0);
            }

            var text = Text.Substring(0, cursor);

            return((int)font.Measure(text).Width);
        }
Example #18
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            float size1 = 20;

            _quickFont = new QFont("COMICATE.TTF", size1, FontStyle.Regular);
            _quickFont.Options.Colour           = new Color4(0.1f, 0.1f, 0.1f, 1.0f);
            _quickFont.Options.DropShadowActive = true;
            GL.ClearColor(1.0f, 1.0f, 1.0f, 0.0f);
            GL.Disable(EnableCap.DepthTest);
        }
Example #19
0
        public void Initialize()
        {
            c          = new Container(8, 8, 14);
            t          = new Tetromino();
            t.Position = new Vector3(4, 12, 4);

            _myFont           = new QFont(@"C:\Users\Asus\Desktop\arial.ttf", 20, new QFontBuilderConfiguration(true));
            _drawing          = new QFontDrawing();
            _projectionMatrix = Matrix4.CreateOrthographicOffCenter(0, Settings.CURRENT_WIN_WIDTH, 0, Settings.CURRENT_WIN_HEIGHT
                                                                    , -1.0f, 1.0f);
        }
Example #20
0
        public void DrawNodeLabel(string text, Font font, Color color, RectangleF rect, NodeModel node, int depth)
        {
            if (!ClientRect.IntersectsWith(rect))
            {
                return;
            }

            QFont qfont = GetQFont(font);

            qfont.PrintToVBO(text, QFontAlignment.Left, new Vector3(rect.X, rect.Y, 0), color, rect.Size);
        }
Example #21
0
        public void OnLoad(EventArgs e)
        {
            titleFont                   = new QFont(@".\Resources\Fonts\anarchysans.ttf", 40);
            subtitleFont                = new QFont(@".\Resources\Fonts\anarchysans.ttf", 26);
            titleFont.Options.Colour    = Color4.Red;
            subtitleFont.Options.Colour = Color4.Red;

            GL.ClearColor(Color.Black);
            GL.Enable(EnableCap.Blend);
            GL.Enable(EnableCap.Texture2D);
            GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
        }
Example #22
0
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
            QFont.Begin();
            float width = _quickFont.Measure(_poem).Width;

            _quickFont.Print(_poem, width, QFontAlignment.Left, new Vector2(10, 40));
            GL.Disable(EnableCap.Texture2D);
            QFont.End();
            SwapBuffers();
        }
Example #23
0
        public static QFontDrawingPrimitive Create3DTextPrimitive(QFont font, Matrix4 transform, System.Drawing.Color textColor, float textScale)
        {
            var dp = new QFontDrawingPrimitive(font, new QFontRenderOptions()
            {
                Colour = textColor
            });
            var rotAdj = Matrix4.CreateRotationX(-((float)Math.PI / 2f));

            dp.ModelViewMatrix = Matrix4.CreateScale(new Vector3(textScale)) * rotAdj * transform * TextViewMatrix;
            UIRenderHelper.TextRenderer.DrawingPrimitives.Add(dp);
            return(dp);
        }
Example #24
0
        public static void DrawShadowText(string text, QFont font, Color color, Vector4 bounds,
                                          StringAlignment vAlign = StringAlignment.Near,
                                          StringAlignment hAlign = StringAlignment.Near)
        {
            var dpOpt = new QFontRenderOptions()
            {
                Colour = color, LockToPixel = false, DropShadowActive = true
            };

            DrawText(text, font, new RectangleF(bounds.X, bounds.Y, bounds.Z, bounds.W),
                     vAlign, hAlign, dpOpt);
        }
Example #25
0
        public static void DrawText(string text, QFont font, RectangleF bounds,
                                    StringAlignment vAlign,
                                    StringAlignment hAlign,
                                    QFontRenderOptions options)
        {
            if (!Freetype6Loaded)
            {
                return;
            }

            var textSize = font.Measure(text, bounds.Size, QFontAlignment.Left);

            textSize.Height += 2;
            var textPos = Vector2.Zero;

            switch (hAlign)
            {
            case StringAlignment.Near:
                textPos.X = bounds.X;
                break;

            case StringAlignment.Far:
                textPos.X = bounds.Right - textSize.Width;
                break;

            case StringAlignment.Center:
                textPos.X = bounds.Left + ((bounds.Width - textSize.Width) / 2f);
                break;
            }
            switch (vAlign)
            {
            case StringAlignment.Near:
                textPos.Y = bounds.Y;
                break;

            case StringAlignment.Far:
                textPos.Y = bounds.Y + bounds.Height - textSize.Height;
                break;

            case StringAlignment.Center:
                textPos.Y = bounds.Y + ((bounds.Height - textSize.Height) / 2f);
                break;
            }

            textPos.Y = ViewSize.Y - textPos.Y;

            var dp = new QFontDrawingPrimitive(font, options);

            dp.Print(text, new Vector3(textPos.X, textPos.Y, 0f), bounds.Size, QFontAlignment.Left);

            TextRenderer.DrawingPrimitives.Add(dp);
        }
Example #26
0
        private void PrintWithBounds(QFont font, string text, RectangleF bounds, QFontAlignment alignment, ref float yOffset)
        {
            var maxWidth = bounds.Width;

            var height = font.Measure(text, new SizeF(maxWidth, -1), alignment).Height;

            var dp = new QFontDrawingPrimitive(font);

            dp.Print(text, new Vector3(bounds.X, Height - yOffset, 0), new SizeF(maxWidth, float.MaxValue), alignment);
            _drawing.DrawingPrimitives.Add(dp);

            yOffset += height;
        }
Example #27
0
        public void DrawString(string text, Font font, Color color, float x, float y, float width, float height)
        {
            var rect = new RectangleF(x, y, width, height);

            if (!ClientRect.IntersectsWith(rect))
            {
                return;
            }

            QFont qfont = GetQFont(font);

            qfont.PrintToVBO(text, QFontAlignment.Left, new Vector3(x, y, 0), color, new SizeF(width, height));
        }
Example #28
0
        void PrintWithBounds(Graphics graphics, QFont font, string text, Rect bounds, QFontAlignment alignment, ref double yOffset)
        {
            double maxWidth = bounds.Width;

            double height = font.Measure(text, maxWidth, alignment).Height;

            bounds.Height = height;
            graphics.DrawRectangle(m_LinesPen, bounds - new Point(1, 0) + new Size(0, 1));

            font.Print(text, maxWidth, alignment, new Alt.Sketch.Vector2(bounds.X, bounds.Y));

            yOffset += height;
        }
        public void OnRender()
        {
            QFont.Begin();
            GL.PushMatrix();

            GL.Translate(offsetX, y - offsetY, 0);
            steps.Print(logic.Steps.ToString(), QFontAlignment.Left);
            GL.Translate(0, -2 * offsetY - 2, 0);
            steps.Print(step, QFontAlignment.Left);

            GL.PopMatrix();
            QFont.End();
        }
Example #30
0
        void PrintComment(Graphics graphics, QFont font, string comment, QFontAlignment alignment, ref double yOffset)
        {
            GraphicsState state = graphics.Save();

            yOffset += 20;
            graphics.TranslateTransform(30, yOffset);

            font.Print(comment, Width - 60, alignment);

            yOffset += font.Measure(comment, Width - 60, alignment).Height;

            graphics.Restore(state);
        }
        public void SetupUi(QWidget KeyManagerFrame)
        {
            if (KeyManagerFrame.ObjectName == "")
            KeyManagerFrame.ObjectName = "KeyManagerFrame";
            QSize Size = new QSize(787, 318);
            Size = Size.ExpandedTo(KeyManagerFrame.MinimumSizeHint);
            KeyManagerFrame.Size = Size;
            verticalLayout = new QVBoxLayout(KeyManagerFrame);
            verticalLayout.ObjectName = "verticalLayout";
            mStackedWidget = new QStackedWidget(KeyManagerFrame);
            mStackedWidget.ObjectName = "mStackedWidget";
            mMessagePage = new QWidget();
            mMessagePage.ObjectName = "mMessagePage";
            mMessagePaneLayout_3 = new QHBoxLayout(mMessagePage);
            mMessagePaneLayout_3.SetContentsMargins(0, 0, 0, 0);
            mMessagePaneLayout_3.ObjectName = "mMessagePaneLayout_3";
            mMessageLabel = new QLabel(mMessagePage);
            mMessageLabel.ObjectName = "mMessageLabel";
            QFont font = new QFont();
            font.PointSize = 12;
            mMessageLabel.Font = font;
            mMessageLabel.AcceptDrops = true;
            mMessageLabel.Alignment = Qt.AlignmentFlag.AlignCenter;

            mMessagePaneLayout_3.AddWidget(mMessageLabel);

            mStackedWidget.AddWidget(mMessagePage);
            mTablePage = new QWidget();
            mTablePage.ObjectName = "mTablePage";
            horizontalLayout_2 = new QHBoxLayout(mTablePage);
            horizontalLayout_2.SetContentsMargins(0, 0, 0, 0);
            horizontalLayout_2.ObjectName = "horizontalLayout_2";
            mTableWidget = new QTableWidget(mTablePage);
            mTableWidget.ObjectName = "mTableWidget";
            QFont font1 = new QFont();
            font1.PointSize = 8;
            mTableWidget.Font = font1;
            mTableWidget.FocusPolicy = Qt.FocusPolicy.NoFocus;
            mTableWidget.AcceptDrops = true;
            mTableWidget.EditTriggers = QAbstractItemView.EditTrigger.NoEditTriggers;
            mTableWidget.dragDropMode = QAbstractItemView.DragDropMode.DropOnly;
            mTableWidget.DefaultDropAction = Qt.DropAction.CopyAction;
            mTableWidget.AlternatingRowColors = true;
            mTableWidget.selectionMode = QAbstractItemView.SelectionMode.MultiSelection;
            mTableWidget.selectionBehavior = QAbstractItemView.SelectionBehavior.SelectRows;
            mTableWidget.ShowGrid = false;
            mTableWidget.WordWrap = false;
            mTableWidget.RowCount = 0;
            mTableWidget.ColumnCount = 6;
            mTableWidget.HorizontalHeader.StretchLastSection = true;
            mTableWidget.VerticalHeader.Visible = false;

            horizontalLayout_2.AddWidget(mTableWidget);

            mStackedWidget.AddWidget(mTablePage);

            verticalLayout.AddWidget(mStackedWidget);

            mButtonLayout = new QHBoxLayout();
            mButtonLayout.ObjectName = "mButtonLayout";
            mLockButton = new QPushButton(KeyManagerFrame);
            mLockButton.ObjectName = "mLockButton";
            mLockButton.Checkable = false;

            mButtonLayout.AddWidget(mLockButton);

            mUnlockButton = new QPushButton(KeyManagerFrame);
            mUnlockButton.ObjectName = "mUnlockButton";

            mButtonLayout.AddWidget(mUnlockButton);

            mAddButton = new QPushButton(KeyManagerFrame);
            mAddButton.ObjectName = "mAddButton";

            mButtonLayout.AddWidget(mAddButton);

            mRemoveButton = new QPushButton(KeyManagerFrame);
            mRemoveButton.ObjectName = "mRemoveButton";

            mButtonLayout.AddWidget(mRemoveButton);

            mRemoveAllButton = new QPushButton(KeyManagerFrame);
            mRemoveAllButton.ObjectName = "mRemoveAllButton";

            mButtonLayout.AddWidget(mRemoveAllButton);

            mRefreshButton = new QPushButton(KeyManagerFrame);
            mRefreshButton.ObjectName = "mRefreshButton";

            mButtonLayout.AddWidget(mRefreshButton);

            verticalLayout.AddLayout(mButtonLayout);

            RetranslateUi(KeyManagerFrame);

            mStackedWidget.CurrentIndex = 1;

            QMetaObject.ConnectSlotsByName(KeyManagerFrame);
        }
Example #32
0
    public void SetupUi(QDialog AboutDialog)
    {
        if (AboutDialog.ObjectName == "")
        AboutDialog.ObjectName = "AboutDialog";
        QSize Size = new QSize(660, 460);
        Size = Size.ExpandedTo(AboutDialog.MinimumSizeHint());
        AboutDialog.Size = Size;
        AboutDialog.MinimumSize = new QSize(660, 460);
        AboutDialog.WindowIcon = new QIcon(":/main/resources/Images/comex_256.png");
        AboutDialog.Modal = true;
        gridLayout = new QGridLayout(AboutDialog);
        gridLayout.ObjectName = "gridLayout";
        vboxLayout = new QVBoxLayout();
        vboxLayout.ObjectName = "vboxLayout";
        FrameTop = new QFrame(AboutDialog);
        FrameTop.ObjectName = "FrameTop";
        FrameTop.MinimumSize = new QSize(0, 64);
        FrameTop.AutoFillBackground = false;
        FrameTop.FrameShape = QFrame.Shape.StyledPanel;
        FrameTop.FrameShadow = QFrame.Shadow.Raised;
        gridLayout1 = new QGridLayout(FrameTop);
        gridLayout1.ObjectName = "gridLayout1";
        Logo = new QWidget(FrameTop);
        Logo.ObjectName = "Logo";
        Logo.MinimumSize = new QSize(48, 48);
        Logo.MaximumSize = new QSize(48, 48);
        Logo.StyleSheet = "background-image: url(:/main/resources/Images/comex_48.png);";

        gridLayout1.AddWidget(Logo, 0, 0, 1, 1);

        vboxLayout1 = new QVBoxLayout();
        vboxLayout1.ObjectName = "vboxLayout1";
        LblName = new QLabel(FrameTop);
        LblName.ObjectName = "LblName";
        QFont font = new QFont();
        font.SetBold(true);
        font.SetWeight(75);
        LblName.Font = font;
        LblName.Margin = 1;

        vboxLayout1.AddWidget(LblName);

        LblDesc = new QLabel(FrameTop);
        LblDesc.ObjectName = "LblDesc";
        LblDesc.Margin = 1;

        vboxLayout1.AddWidget(LblDesc);

        gridLayout1.AddLayout(vboxLayout1, 0, 1, 1, 1);

        vboxLayout.AddWidget(FrameTop);

        tabInfo = new QTabWidget(AboutDialog);
        tabInfo.ObjectName = "tabInfo";
        tabInfo.AutoFillBackground = false;
        Informations = new QWidget();
        Informations.ObjectName = "Informations";
        gridLayout2 = new QGridLayout(Informations);
        gridLayout2.ObjectName = "gridLayout2";
        TxtInfo = new QTextEdit(Informations);
        TxtInfo.ObjectName = "TxtInfo";
        TxtInfo.lineWrapMode = QTextEdit.LineWrapMode.NoWrap;
        TxtInfo.ReadOnly = true;

        gridLayout2.AddWidget(TxtInfo, 0, 0, 1, 1);

        tabInfo.AddTab(Informations, QApplication.Translate("AboutDialog", "Informazioni su", null, QApplication.Encoding.UnicodeUTF8));
        Components = new QWidget();
        Components.ObjectName = "Components";
        gridLayout3 = new QGridLayout(Components);
        gridLayout3.ObjectName = "gridLayout3";
        TxtThanks = new QTextEdit(Components);
        TxtThanks.ObjectName = "TxtThanks";
        TxtThanks.ReadOnly = true;

        gridLayout3.AddWidget(TxtThanks, 0, 0, 1, 1);

        tabInfo.AddTab(Components, QApplication.Translate("AboutDialog", "Componenti", null, QApplication.Encoding.UnicodeUTF8));

        vboxLayout.AddWidget(tabInfo);

        buttonBox = new QDialogButtonBox(AboutDialog);
        buttonBox.ObjectName = "buttonBox";
        buttonBox.StandardButtons = Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Ok");

        vboxLayout.AddWidget(buttonBox);

        gridLayout.AddLayout(vboxLayout, 0, 0, 1, 1);

        RetranslateUi(AboutDialog);

        tabInfo.CurrentIndex = 0;

        QMetaObject.ConnectSlotsByName(AboutDialog);
    }