コード例 #1
0
        public override void InitUI()
        {
            StyleSheet = "QWidget { background-color: #7e7e7e }";

            var sky1_icon    = media.MediaGfxHelper.Sky1Pixmap;
            var sky2_icon    = media.MediaGfxHelper.Sky2Pixmap;
            var pancake_icon = media.MediaGfxHelper.PancakePixmap;

            var pancakeLabel = new QLabel(this);

            pancakeLabel.Pixmap = pancake_icon.ScaledToHeight(320);
            pancakeLabel.Resize(pancakeLabel.Pixmap.Size);
            pancakeLabel.Move(170, 50);

            var skyLabel = new QLabel(this);

            skyLabel.Pixmap = sky1_icon.ScaledToHeight(160);
            skyLabel.Resize(skyLabel.Pixmap.Size);
            skyLabel.Move(20, 20);

            var sky2Label = new QLabel(this);

            sky2Label.Pixmap = sky2_icon.ScaledToHeight(120);
            sky2Label.Resize(sky2Label.Pixmap.Size);
            sky2Label.Move(40, 180);
        }
コード例 #2
0
        private QGroupBox InitQComboBox()
        {
            var groupBox = new QGroupBox ("QComboBox", this);
            QVBoxLayout vBox = new QVBoxLayout ();
            QComboBox comboBox = new QComboBox (this);
            QLabel label = new QLabel ("Silence is a source of great strength.", this);

            comboBox.AddItem ("Silence is a source of great strength.");
            comboBox.AddItem ("From caring comes courage.");
            comboBox.AddItem ("Mastering yourself is true power.");
            comboBox.AddItem ("To the mind that is still, the whole universe surrenders.");
            comboBox.AddItem ("Be the chief but never the lord.");
            comboBox.AddItem ("He who is contented is rich.");
            comboBox.AddItem ("He who knows himself is enlightened.");

            comboBox.ActivatedText += (string obj) => {
                label.Text = obj;
            };

            vBox.AddWidget (comboBox);
            vBox.AddWidget (label);

            groupBox.Layout = vBox;
            return groupBox;
        }
コード例 #3
0
        public void SetupUi(QDialog PassphraseDialog)
        {
            if (PassphraseDialog.ObjectName == "")
            PassphraseDialog.ObjectName = "PassphraseDialog";
            QSize Size = new QSize(493, 118);
            Size = Size.ExpandedTo(PassphraseDialog.MinimumSizeHint);
            PassphraseDialog.Size = Size;
            verticalLayout = new QVBoxLayout(PassphraseDialog);
            verticalLayout.ObjectName = "verticalLayout";
            mMessageLabel = new QLabel(PassphraseDialog);
            mMessageLabel.ObjectName = "mMessageLabel";

            verticalLayout.AddWidget(mMessageLabel, 0, Qt.AlignmentFlag.AlignHCenter);

            mPassphraseLineEdit = new QLineEdit(PassphraseDialog);
            mPassphraseLineEdit.ObjectName = "mPassphraseLineEdit";
            mPassphraseLineEdit.echoMode = QLineEdit.EchoMode.Password;

            verticalLayout.AddWidget(mPassphraseLineEdit);

            mButtonBox = new QDialogButtonBox(PassphraseDialog);
            mButtonBox.ObjectName = "mButtonBox";
            mButtonBox.Orientation = Qt.Orientation.Horizontal;
            mButtonBox.StandardButtons = QDialogButtonBox.StandardButton.Cancel | QDialogButtonBox.StandardButton.Ok;

            verticalLayout.AddWidget(mButtonBox);

            RetranslateUi(PassphraseDialog);
            QObject.Connect(mButtonBox, Qt.SIGNAL("accepted()"), PassphraseDialog, Qt.SLOT("accept()"));
            QObject.Connect(mButtonBox, Qt.SIGNAL("rejected()"), PassphraseDialog, Qt.SLOT("reject()"));

            QMetaObject.ConnectSlotsByName(PassphraseDialog);
        }
コード例 #4
0
    private void Init()
    {
        QLCDNumber lcd = new QLCDNumber(2);

        lcd.segmentStyle = QLCDNumber.SegmentStyle.Filled;

        slider = new QSlider(Qt.Orientation.Horizontal);
        slider.SetRange(0, 99);
        slider.Value    = 0;
        label           = new QLabel();
        label.Alignment = (int)(Qt.AlignmentFlag.AlignHCenter | Qt.AlignmentFlag.AlignTop);
        label.SetSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed);

        Connect(slider, SIGNAL("valueChanged(int)"),
                lcd, SLOT("display(int)"));
        Connect(slider,SIGNAL("valueChanged(int)"),
                this,SIGNAL("ValueChanged(int)"));

        QVBoxLayout layout = new QVBoxLayout();

        layout.AddWidget(lcd);
        layout.AddWidget(slider);
        layout.AddWidget(label);
        SetLayout(layout);

        SetFocusProxy(slider);
    }
コード例 #5
0
    //===============================================
    // method
    //===============================================
    public unsafe void run(string[] args)
    {
        sGApp lApp = GManager.Instance().getData().app;

        int argc = 0;

        lApp.app = new QApplication(ref argc, null);

        QLabel lLabel = new QLabel();

        lLabel.Text      = "Bonjour tout le monde";
        lLabel.Alignment = AlignmentFlag.AlignCenter;

        QVBoxLayout lMainLayout = new QVBoxLayout();

        lMainLayout.AddWidget(lLabel);

        QWidget lWindow = new QWidget();

        lWindow.Layout = lMainLayout;
        lWindow.Resize(lApp.win_width, lApp.win_height);
        lWindow.WindowTitle = lApp.app_name;
        lWindow.Show();

        QApplication.Exec();
    }
コード例 #6
0
        private QGroupBox InitQComboBox()
        {
            var         groupBox = new QGroupBox("QComboBox", this);
            QVBoxLayout vBox     = new QVBoxLayout();
            QComboBox   comboBox = new QComboBox(this);
            QLabel      label    = new QLabel("Silence is a source of great strength.", this);

            comboBox.AddItem("Silence is a source of great strength.");
            comboBox.AddItem("From caring comes courage.");
            comboBox.AddItem("Mastering yourself is true power.");
            comboBox.AddItem("To the mind that is still, the whole universe surrenders.");
            comboBox.AddItem("Be the chief but never the lord.");
            comboBox.AddItem("He who is contented is rich.");
            comboBox.AddItem("He who knows himself is enlightened.");

            comboBox.ActivatedText += (string obj) => {
                label.Text = obj;
            };

            vBox.AddWidget(comboBox);
            vBox.AddWidget(label);

            groupBox.Layout = vBox;
            return(groupBox);
        }
コード例 #7
0
ファイル: Grid.cs プロジェクト: kuruntham/qyotoexamples
        private void InitUI()
        {
            QGridLayout grid = new QGridLayout(this);

            QLabel labelName = new QLabel("Name", this);
            QLineEdit lineEdit = new QLineEdit(this);
            QTextEdit textEdit = new QTextEdit(this);
            QPushButton btnOk = new QPushButton("Ok", this);
            QPushButton btnCancel = new QPushButton("Cancel", this);

            /*
             * In our scenario, the grid will have totally four columns and three rows. We would add
             * and make the widgets to span in the grid as needed.
             */

            //Add Name label at row 1 - Column 1
            grid.AddWidget(labelName, 0, 0);

            //Add line Edit at row 1 - Column 2 with row span 1 and column span 4
            grid.AddWidget(lineEdit, 0, 1 , 1, 3);

            //Add textEdit at row2 - column 1 with row span 1 and column span 4
            grid.AddWidget(textEdit, 1, 0, 1, 4);

            //Add a stretch at row 3 - column 2 to make the btn move right
            grid.SetColumnStretch(1, 1);

            //Add Ok Btn at row 3 - Column 3
            grid.AddWidget(btnOk, 2, 2);

            //Add Cancel Btn at row 3 - Column 4
            grid.AddWidget(btnCancel, 2, 3);
        }
コード例 #8
0
ファイル: ColorDialogDemo.cs プロジェクト: mcjt/QtSharpDemos
        public override void InitUI()
        {
            label = new QLabel("Click me to open dialog", this);

            var vbox = new QVBoxLayout(this);

            label.Alignment = QtCore.Qt.AlignmentFlag.AlignCenter;
            vbox.AddWidget(label);
        }
コード例 #9
0
    public static int Main(String[] args)
    {
        QApplication app   = new QApplication(args);
        QPushButton  hello = new QPushButton("Hello world!");
        QLabel       label = new QLabel(hello);

        hello.Resize(100, 30);
        hello.Show();
        return(QApplication.Exec());
    }
コード例 #10
0
    private IEnumerator OpenQuestion()
    {
        //3 Question框打开
        questionContainer.SetActive(true);
        float t = 0, alpha = 0;

        while (t < 1)
        {
            t = Mathf.MoveTowards(t, 1, 1 / 0.5f * Time.fixedDeltaTime);
            float scale = 2 - t;
            if (t < 0.5)
            {
                alpha = t * 2;
            }
            questionContainer.transform.localScale            = new Vector3(scale, scale, 1);
            questionContainer.GetComponent <UIWidget>().alpha = alpha;
            yield return(null);
        }
        yield return(new WaitForSeconds(0.2f));

        //显示question 并闪烁
        QLabel.SetActive(true);
        for (int i = 0; i < 4; i++)
        {
            QLabel.GetComponent <UILabel>().color = Color.gray;
            yield return(new WaitForSeconds(0.1f));

            QLabel.GetComponent <UILabel>().color = Color.white;
            yield return(new WaitForSeconds(0.1f));
        }
        //移动Qustion到指定位置
        float x = 0;

        while (x > -225)
        {
            x = Mathf.MoveTowards(x, -225, 225 / 0.2f * Time.fixedDeltaTime);
            QLabel.transform.localPosition = new Vector3(x, QLabel.transform.localPosition.y);
            yield return(null);
        }
        //4 题目显示
        questionLabel.GetComponent <UILabel>().text = reasoningEvent.question;
        questionLabel.SetActive(true);
        TypewriterEffect te = questionLabel.GetComponent <TypewriterEffect>();

        while (te.isActive)
        {
            yield return(null);
        }
        yield return(new WaitForSeconds(0.5f));

        //5 选项依次显示
        StartCoroutine(ifevi ? ShowEvidence() : ShowChoice());
        //6 *血条展示
        hpmpManager.ShowBar();
    }
コード例 #11
0
ファイル: AboutDialog.cs プロジェクト: xlizzard/synapse
        protected void SetupUi()
        {
            base.ObjectName  = "AboutDialog";
            this.Geometry    = new QRect(0, 0, 384, 492);
            this.MinimumSize = new QSize(384, 0);
            this.WindowTitle = "About Synapse";
            this.StyleSheet  = "#AboutDialog {\n\tmax-width: 384px;\n\tbackground: #010409 url(resource:/oceanbg.png) no-repeat top center;\n}\n\nQWidget {\n\tcolor: white;\n}\n\nQGraphicsView, QTextBrowser {\n\tbackground: transparent;\n}\n\nQPushButton[flat=\"false\"] {\n\tborder: 1px solid #2B2D31;\n\tborder-radius: 3px;\n\tbackground-color: #2B2D31;\n\tpadding: 3px;\n}\n\n#textLabel {\n\tmargin-bottom: 12px;\n}\n\nQScrollBar:vertical {\n\tborder: 0px;\n\tbackground: transparent;\n\twidth: 15px;\n\tmargin: 0px;\n}\n\nQScrollBar::handle:vertical {\n\tbackground: #4F4F4F;\n\tmin-height: 20px;\n\tborder: 1px solid #4F4F4F;\n\tborder-radius: 5px;\n}\n\nQScrollBar::add-line:vertical {\n\theight: 0px;\n\tborder: 0px;\n}\n\nQScrollBar::sub-line:vertical {\n\theight: 0px;\n}\n\nQScrollBar::add-page:vertical, \nQScrollBar::sub-page:vertical {\n\tbackground: none;\n}";
            QVBoxLayout verticalLayout;

            verticalLayout         = new QVBoxLayout(this);
            verticalLayout.Spacing = 6;
            verticalLayout.Margin  = 6;
            this.widget            = new QWidget(this);
            this.widget.ObjectName = "widget";
            QHBoxLayout horizontalLayout;

            horizontalLayout              = new QHBoxLayout(this.widget);
            horizontalLayout.Margin       = 0;
            this.graphicsView             = new QGraphicsView(this.widget);
            this.graphicsView.ObjectName  = "graphicsView";
            this.graphicsView.MinimumSize = new QSize(0, 250);
            this.graphicsView.FrameShape  = QFrame.Shape.NoFrame;
            horizontalLayout.AddWidget(this.graphicsView);
            verticalLayout.AddWidget(this.widget);
            this.textLabel            = new QLabel(this);
            this.textLabel.ObjectName = "textLabel";
            this.textLabel.Text       = "";
            this.textLabel.Alignment  = global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignCenter");
            verticalLayout.AddWidget(this.textLabel);
            this.textBrowser             = new QTextBrowser(this);
            this.textBrowser.ObjectName  = "textBrowser";
            this.textBrowser.MaximumSize = new QSize(16777215, 120);
            this.textBrowser.FrameShape  = QFrame.Shape.NoFrame;
            this.textBrowser.FrameShadow = QFrame.Shadow.Plain;
            this.textBrowser.Html        = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'Bitstream Vera Sans'; font-size:9pt; font-weight:400; font-style:normal;\">\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Created By</span></p>\n<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;\"></p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;\"><a href=\"#message-eric\"><span style=\" font-weight:400; text-decoration: underline; color:#ffffff;\">Eric Butler</span></a></p>\n<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Special Thanks To</span></p>\n<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;\"></p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;\"><span style=\" font-weight:400;\">Chris Hergert</span></p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Allison Hughes</p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Arno Rehn</p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Darryl Ring</p></body></html>";
            verticalLayout.AddWidget(this.textBrowser);
            QHBoxLayout horizontalLayout_2;

            horizontalLayout_2 = new QHBoxLayout();
            verticalLayout.AddLayout(horizontalLayout_2);
            this.sendFeedbackButton            = new QPushButton(this);
            this.sendFeedbackButton.ObjectName = "sendFeedbackButton";
            this.sendFeedbackButton.Text       = "Send Feedback";
            horizontalLayout_2.AddWidget(this.sendFeedbackButton);
            this.buttonBox                 = new QDialogButtonBox(this);
            this.buttonBox.ObjectName      = "buttonBox";
            this.buttonBox.Orientation     = Qt.Orientation.Horizontal;
            this.buttonBox.StandardButtons = global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Close");
            horizontalLayout_2.AddWidget(this.buttonBox);
            QObject.Connect(buttonBox, Qt.SIGNAL("rejected()"), this, Qt.SLOT("reject()"));
            QObject.Connect(buttonBox,Qt.SIGNAL("accepted()"),this,Qt.SLOT("accept()"));
            QObject.Connect(buttonBox,Qt.SIGNAL("accepted()"),this,Qt.SLOT("accept()"));
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #12
0
        public void SetupUi(QWidget LifetimeConstraintWidget)
        {
            if (LifetimeConstraintWidget.ObjectName == "")
            {
                LifetimeConstraintWidget.ObjectName = "LifetimeConstraintWidget";
            }
            QSize Size = new QSize(283, 48);

            Size = Size.ExpandedTo(LifetimeConstraintWidget.MinimumSizeHint);
            LifetimeConstraintWidget.Size = Size;
            horizontalLayout = new QHBoxLayout(LifetimeConstraintWidget);
            horizontalLayout.SetContentsMargins(0, 0, 0, 0);
            horizontalLayout.ObjectName     = "horizontalLayout";
            horizontalLayout.sizeConstraint = QLayout.SizeConstraint.SetNoConstraint;
            mCheckBox            = new QCheckBox(LifetimeConstraintWidget);
            mCheckBox.ObjectName = "mCheckBox";
            QSizePolicy sizePolicy = new QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed);

            sizePolicy.SetHorizontalStretch(0);
            sizePolicy.SetVerticalStretch(0);
            sizePolicy.SetHeightForWidth(mCheckBox.SizePolicy.HasHeightForWidth);
            mCheckBox.SizePolicy = sizePolicy;

            horizontalLayout.AddWidget(mCheckBox);

            mLineEdit            = new QLineEdit(LifetimeConstraintWidget);
            mLineEdit.ObjectName = "mLineEdit";
            mLineEdit.Enabled    = false;
            sizePolicy.SetHeightForWidth(mLineEdit.SizePolicy.HasHeightForWidth);
            mLineEdit.SizePolicy       = sizePolicy;
            mLineEdit.MaximumSize      = new QSize(40, 16777215);
            mLineEdit.InputMethodHints = Qt.InputMethodHint.ImhPreferNumbers;

            horizontalLayout.AddWidget(mLineEdit);

            mSecondsLable            = new QLabel(LifetimeConstraintWidget);
            mSecondsLable.ObjectName = "mSecondsLable";
            mSecondsLable.Enabled    = false;

            horizontalLayout.AddWidget(mSecondsLable);

            spacerItem = new QSpacerItem(90, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);

            horizontalLayout.AddItem(spacerItem);


            RetranslateUi(LifetimeConstraintWidget);
            QObject.Connect(mCheckBox, Qt.SIGNAL("toggled(bool)"), mLineEdit, Qt.SLOT("setEnabled(bool)"));
            QObject.Connect(mCheckBox,Qt.SIGNAL("toggled(bool)"),mSecondsLable,Qt.SLOT("setEnabled(bool)"));
            QObject.Connect(mCheckBox,Qt.SIGNAL("toggled(bool)"),mLineEdit,Qt.SLOT("setFocus()"));

            QMetaObject.ConnectSlotsByName(LifetimeConstraintWidget);
        } // SetupUi
コード例 #13
0
        protected void SetupUi()
        {
            base.ObjectName  = "WebIdentityConfiguratorWidget";
            this.Geometry    = new QRect(0, 0, 540, 61);
            this.WindowTitle = "WebIdentityConfiguratorWidget";
            QVBoxLayout verticalLayout_2;

            verticalLayout_2         = new QVBoxLayout(this);
            verticalLayout_2.Spacing = 6;
            verticalLayout_2.Margin  = 0;
            QHBoxLayout horizontalLayout;

            horizontalLayout = new QHBoxLayout();
            verticalLayout_2.AddLayout(horizontalLayout);
            horizontalLayout.Spacing   = 6;
            this.iconLabel             = new QLabel(this);
            this.iconLabel.ObjectName  = "iconLabel";
            this.iconLabel.MinimumSize = new QSize(48, 0);
            this.iconLabel.Text        = "";
            horizontalLayout.AddWidget(this.iconLabel);
            this.nameLabel            = new QLabel(this);
            this.nameLabel.ObjectName = "nameLabel";
            QSizePolicy nameLabel_sizePolicy;

            nameLabel_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Preferred);
            nameLabel_sizePolicy.SetVerticalStretch(0);
            nameLabel_sizePolicy.SetHorizontalStretch(0);
            nameLabel_sizePolicy.SetHeightForWidth(this.nameLabel.SizePolicy.HasHeightForWidth());
            this.nameLabel.SizePolicy = nameLabel_sizePolicy;
            this.nameLabel.Text       = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'Bitstream Vera Sans'; font-size:9pt; font-weight:400; font-style:normal;\">\n<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Addin Name</span></p>\n<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;\"><span style=\" font-weight:400;\">Addin description.</span></p></body></html>";
            this.nameLabel.Alignment  = ((global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading") | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft")) | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignVCenter"));
            this.nameLabel.WordWrap   = true;
            horizontalLayout.AddWidget(this.nameLabel);
            this.widget            = new QWidget(this);
            this.widget.ObjectName = "widget";
            QVBoxLayout verticalLayout;

            verticalLayout                  = new QVBoxLayout(this.widget);
            verticalLayout.Margin           = 0;
            this.configureButton            = new QPushButton(this.widget);
            this.configureButton.ObjectName = "configureButton";
            this.configureButton.Text       = "Configure...";
            verticalLayout.AddWidget(this.configureButton);
            horizontalLayout.AddWidget(this.widget);
            this.line             = new QFrame(this);
            this.line.ObjectName  = "line";
            this.line.FrameShape  = QFrame.Shape.HLine;
            this.line.FrameShadow = QFrame.Shadow.Sunken;
            verticalLayout_2.AddWidget(this.line);
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #14
0
        public QuickLabelControl()
        {
            //adapt the label size to the paper
            //PrintDocument engine = new PrintDocument();

            //var selectedPrinter = Settings.PrinterSettings.Printer;
            //engine.PrinterSettings.PrinterName = selectedPrinter;

            //var selectedPaper = Settings.PrinterSettings.Paper;

            //for (int index = 0; index < engine.PrinterSettings.PaperSizes.Count; index++)
            //{
            //    if (engine.PrinterSettings.PaperSizes[index].PaperName == selectedPaper)
            //    {
            //        PaperSize size = engine.PrinterSettings.PaperSizes[index];
            //        this.Height = size.Height;
            //        this.Width = size.Width;
            //        this.Refresh();
            //        break;
            //    }
            //}

            Label = new QLabel(
                new QuickLabelData
            {
                Adres = new Adres
                {
                    Bedrijfsnaam   = "Bakkerij het stoepje",
                    Contactpersoon = "Peter Bakker",
                    Huisnummer     = "124",
                    Huisletter     = "b",
                    Huistoevoeging = "hs",
                    Postcode       = "1234AB",
                    Straatnaam     = "Markt",
                    Plaatsnaam     = "Gouda"
                },
                Aantal    = 3,
                Container = new Entities.Container
                {
                    Fractie      = "Restafval",
                    Omschrijving = "rolcontainer",
                    Typenummer   = "fdf",
                    Volume       = "240 liter"
                }
            });
            Label.Font = new Font("Arial", 10);
            //Label.Size = this.Size;
            InitializeComponent();
        }
コード例 #15
0
        public override void OnStart(QGetContent get)
        {
            Square = get.Texture("penis");
            font   = get.Font("arial");
            euro   = get.Texture("asdf");

            Arial  = new QLabel(font);
            sprite = new QSprite(this, "penis");
            Instantiate(new QDemoObject2());

            Console.Label = Arial;
            Console.Color = QColor.DarkGoldenrod;

            Coroutine.Start(Thing());
        }
コード例 #16
0
        protected void SetupUi()
        {
            base.ObjectName = "AccountStatusWidget";
            this.Geometry   = new QRect(0, 0, 416, 47);
            QSizePolicy AccountStatusWidget_sizePolicy;

            AccountStatusWidget_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Minimum);
            AccountStatusWidget_sizePolicy.SetVerticalStretch(0);
            AccountStatusWidget_sizePolicy.SetHorizontalStretch(0);
            AccountStatusWidget_sizePolicy.SetHeightForWidth(this.SizePolicy.HasHeightForWidth());
            this.SizePolicy  = AccountStatusWidget_sizePolicy;
            this.WindowTitle = "Form";
            QHBoxLayout horizontalLayout;

            horizontalLayout         = new QHBoxLayout(this);
            horizontalLayout.Spacing = 6;
            horizontalLayout.SetContentsMargins(6, 0, 6, 6);
            this.m_AvatarLabel            = new Synapse.QtClient.Widgets.AvatarLabel(this);
            this.m_AvatarLabel.ObjectName = "m_AvatarLabel";
            QSizePolicy m_AvatarLabel_sizePolicy;

            m_AvatarLabel_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed);
            m_AvatarLabel_sizePolicy.SetVerticalStretch(0);
            m_AvatarLabel_sizePolicy.SetHorizontalStretch(0);
            m_AvatarLabel_sizePolicy.SetHeightForWidth(this.m_AvatarLabel.SizePolicy.HasHeightForWidth());
            this.m_AvatarLabel.SizePolicy  = m_AvatarLabel_sizePolicy;
            this.m_AvatarLabel.MinimumSize = new QSize(36, 36);
            this.m_AvatarLabel.MaximumSize = new QSize(32, 32);
            horizontalLayout.AddWidget(this.m_AvatarLabel);
            QVBoxLayout verticalLayout;

            verticalLayout = new QVBoxLayout();
            horizontalLayout.AddLayout(verticalLayout);
            verticalLayout.Spacing      = 0;
            this.m_NameLabel            = new Synapse.QtClient.Widgets.FadingQLabel(this);
            this.m_NameLabel.ObjectName = "m_NameLabel";
            this.m_NameLabel.Text       = "test@localhost";
            this.m_NameLabel.TextFormat = Qt.TextFormat.RichText;
            verticalLayout.AddWidget(this.m_NameLabel);
            this.m_StatusLabel                      = new QLabel(this);
            this.m_StatusLabel.ObjectName           = "m_StatusLabel";
            this.m_StatusLabel.Text                 = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;\">\n<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><a href=\"#show-presence-menu\"><span style=\" text-decoration: underline; color:#0057ae;\">Offline</span></a></p></body></html>";
            this.m_StatusLabel.ScaledContents       = false;
            this.m_StatusLabel.OpenExternalLinks    = false;
            this.m_StatusLabel.TextInteractionFlags = global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "LinksAccessibleByMouse");
            verticalLayout.AddWidget(this.m_StatusLabel);
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #17
0
        public void SetupUi(QWidget LifetimeConstraintWidget)
        {
            if (LifetimeConstraintWidget.ObjectName == "")
            LifetimeConstraintWidget.ObjectName = "LifetimeConstraintWidget";
            QSize Size = new QSize(283, 48);
            Size = Size.ExpandedTo(LifetimeConstraintWidget.MinimumSizeHint);
            LifetimeConstraintWidget.Size = Size;
            horizontalLayout = new QHBoxLayout(LifetimeConstraintWidget);
            horizontalLayout.SetContentsMargins(0, 0, 0, 0);
            horizontalLayout.ObjectName = "horizontalLayout";
            horizontalLayout.sizeConstraint = QLayout.SizeConstraint.SetNoConstraint;
            mCheckBox = new QCheckBox(LifetimeConstraintWidget);
            mCheckBox.ObjectName = "mCheckBox";
            QSizePolicy sizePolicy = new QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed);
            sizePolicy.SetHorizontalStretch(0);
            sizePolicy.SetVerticalStretch(0);
            sizePolicy.SetHeightForWidth(mCheckBox.SizePolicy.HasHeightForWidth);
            mCheckBox.SizePolicy = sizePolicy;

            horizontalLayout.AddWidget(mCheckBox);

            mLineEdit = new QLineEdit(LifetimeConstraintWidget);
            mLineEdit.ObjectName = "mLineEdit";
            mLineEdit.Enabled = false;
            sizePolicy.SetHeightForWidth(mLineEdit.SizePolicy.HasHeightForWidth);
            mLineEdit.SizePolicy = sizePolicy;
            mLineEdit.MaximumSize = new QSize(40, 16777215);
            mLineEdit.InputMethodHints = Qt.InputMethodHint.ImhPreferNumbers;

            horizontalLayout.AddWidget(mLineEdit);

            mSecondsLable = new QLabel(LifetimeConstraintWidget);
            mSecondsLable.ObjectName = "mSecondsLable";
            mSecondsLable.Enabled = false;

            horizontalLayout.AddWidget(mSecondsLable);

            spacerItem = new QSpacerItem(90, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);

            horizontalLayout.AddItem(spacerItem);

            RetranslateUi(LifetimeConstraintWidget);
            QObject.Connect(mCheckBox, Qt.SIGNAL("toggled(bool)"), mLineEdit, Qt.SLOT("setEnabled(bool)"));
            QObject.Connect(mCheckBox, Qt.SIGNAL("toggled(bool)"), mSecondsLable, Qt.SLOT("setEnabled(bool)"));
            QObject.Connect(mCheckBox, Qt.SIGNAL("toggled(bool)"), mLineEdit, Qt.SLOT("setFocus()"));

            QMetaObject.ConnectSlotsByName(LifetimeConstraintWidget);
        }
コード例 #18
0
        private void GenereerAanvraag_Click(object sender, EventArgs e)
        {
            var  quickLabelData = labelManager.GetRandom();
            Font font           = GetFont();

            label      = new QLabel(quickLabelData);
            label.Font = font;
            quickLabelControl.Label = label;
            var paperSize = PrinterHelper.GetPaperSize(printer, config.Printer);
            var size      = new Size(paperSize.Width, paperSize.Height);

            this.label.Size        = size;
            label.Landscape        = config.Printer.Landscape;
            quickLabelControl.Size = size;
            quickLabelControl.Refresh();
        }
コード例 #19
0
    private IEnumerator CloseQuestion()
    {
        //淡出
        float alpha = 1;

        while (alpha > 0)
        {
            alpha = Mathf.MoveTowards(alpha, 0, 1 / 0.3f * Time.fixedDeltaTime);
            questionContainer.GetComponent <UIWidget>().alpha = alpha;
            yield return(null);
        }
        //复原其他状态
        QLabel.transform.localPosition = Vector3.zero;
        QLabel.SetActive(true);
        questionContainer.transform.localScale = new Vector3(2, 2, 1);
        questionContainer.SetActive(false);
    }
コード例 #20
0
        private void InitUI()
        {
            //StyleSheet = "QWidget { background-color : #414141 }";

            QPixmap image1 = new QPixmap ("images/periya_kovil.jpeg");
            QPixmap image2 = new QPixmap ("images/western_ghats.jpeg");

            QLabel label1 = new QLabel (this);
            label1.Pixmap = image1;
            label1.Move (20, 20);
            label1.ToolTip = "தஞ்சை பெரிய கோவில் - Tanjore Temple";

            QLabel label2 = new QLabel (this);
            label2.Pixmap = image2;
            label2.ToolTip = "மேற்கு தொடர்ச்சி மலை - Western Ghats";
            label2.Move (320, 20);
        }
コード例 #21
0
        private QGroupBox InitQLineEdit()
        {
            QGroupBox   groupBox = new QGroupBox("QLineEdit", this);
            QVBoxLayout vBox     = new QVBoxLayout();
            QLabel      label    = new QLabel("Change the text in Line Edit", this);
            QLineEdit   lineEdit = new QLineEdit(this);

            lineEdit.TextChanged += (string txt) => {
                label.Text = txt;
                label.AdjustSize();
            };
            vBox.AddWidget(lineEdit);
            vBox.AddWidget(label);

            groupBox.Layout = vBox;
            return(groupBox);
        }
コード例 #22
0
    public void SetupUi(QDialog SelectWriteModeDialog)
    {
        if (SelectWriteModeDialog.ObjectName == "")
        {
            SelectWriteModeDialog.ObjectName = "SelectWriteModeDialog";
        }
        QSize Size = new QSize(443, 125);

        Size = Size.ExpandedTo(SelectWriteModeDialog.MinimumSizeHint());
        SelectWriteModeDialog.Size       = Size;
        SelectWriteModeDialog.WindowIcon = new QIcon(":/main/resources/monosim_128.png");
        gridLayout            = new QGridLayout(SelectWriteModeDialog);
        gridLayout.ObjectName = "gridLayout";
        LblTitle            = new QLabel(SelectWriteModeDialog);
        LblTitle.ObjectName = "LblTitle";
        LblTitle.Alignment  = Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading") | Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft") | Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignTop");

        gridLayout.AddWidget(LblTitle, 0, 0, 1, 4);

        BtnCancel            = new QPushButton(SelectWriteModeDialog);
        BtnCancel.ObjectName = "BtnCancel";

        gridLayout.AddWidget(BtnCancel, 1, 0, 1, 1);

        spacerItem = new QSpacerItem(152, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);

        gridLayout.AddItem(spacerItem, 1, 1, 1, 1);

        BtnOverride            = new QPushButton(SelectWriteModeDialog);
        BtnOverride.ObjectName = "BtnOverride";
        BtnOverride.icon       = new QIcon(":/toolbar/resources/qt/draw-eraser.png");

        gridLayout.AddWidget(BtnOverride, 1, 2, 1, 1);

        BtnAppend            = new QPushButton(SelectWriteModeDialog);
        BtnAppend.ObjectName = "BtnAppend";
        BtnAppend.icon       = new QIcon(":/toolbar/resources/qt/list-add.png");

        gridLayout.AddWidget(BtnAppend, 1, 3, 1, 1);


        RetranslateUi(SelectWriteModeDialog);

        QMetaObject.ConnectSlotsByName(SelectWriteModeDialog);
    } // SetupUi
コード例 #23
0
        private void InitUI()
        {
            QGridLayout grid = new QGridLayout(this);

            QLabel    nameLabel = new QLabel("Name", this);
            QLineEdit nameEdit  = new QLineEdit(this);
            QTextEdit textEdit  = new QTextEdit(this);

            QPushButton okButton    = new QPushButton("Ok", this);
            QPushButton closeButton = new QPushButton("Close", this);

            grid.AddWidget(nameLabel, 0, 0);
            grid.AddWidget(nameEdit, 0, 1, 1, 3);
            grid.AddWidget(textEdit, 1, 0, 2, 4);
            grid.SetColumnStretch(1, 1);
            grid.AddWidget(okButton, 4, 2);
            grid.AddWidget(closeButton, 4, 3);
        }
コード例 #24
0
        private void InitUI()
        {
            QGridLayout grid = new QGridLayout (this);

            QLabel nameLabel = new QLabel ("Name", this);
            QLineEdit nameEdit = new QLineEdit (this);
            QTextEdit textEdit = new QTextEdit (this);

            QPushButton okButton = new QPushButton ("Ok", this);
            QPushButton closeButton = new QPushButton ("Close", this);

            grid.AddWidget (nameLabel, 0, 0);
            grid.AddWidget (nameEdit, 0, 1, 1, 3);
            grid.AddWidget (textEdit, 1, 0, 2, 4);
            grid.SetColumnStretch (1, 1);
            grid.AddWidget (okButton, 4, 2);
            grid.AddWidget (closeButton, 4, 3);
        }
コード例 #25
0
        private void InitUI()
        {
            //StyleSheet = "QWidget { background-color : #414141 }";

            QPixmap image1 = new QPixmap("images/periya_kovil.jpeg");
            QPixmap image2 = new QPixmap("images/western_ghats.jpeg");

            QLabel label1 = new QLabel(this);

            label1.Pixmap = image1;
            label1.Move(20, 20);
            label1.ToolTip = "தஞ்சை பெரிய கோவில் - Tanjore Temple";

            QLabel label2 = new QLabel(this);

            label2.Pixmap  = image2;
            label2.ToolTip = "மேற்கு தொடர்ச்சி மலை - Western Ghats";
            label2.Move(320, 20);
        }
コード例 #26
0
        private void PrintAanvragen_Click(object sender, EventArgs e)
        {
            aantalForm = new AantalForm();
            aantalForm.ShowDialog();
            if (aantalForm.Aantal == null)
            {
                return;
            }

            List <QLabel> labels = new List <QLabel>();

            for (int index = 0; index < aantalForm.Aantal; index++)
            {
                var label  = labelManager.GetRandom();
                var qLabel = new QLabel(label);
                qLabel.Font = GetFont();
                labels.Add(qLabel);
            }
            PrintLabels(labels);
        }
コード例 #27
0
ファイル: MyWidget.cs プロジェクト: kuruntham/qyotoexamples
        private void InitUI()
        {
            StyleSheet = "QWidget {background-color:#414141}";

            QPixmap img1 = new QPixmap ("img1.jpg");
            QPixmap img2 = new QPixmap ("img2.jpg");
            QPixmap img3 = new QPixmap ("img3.jpg");

            QLabel label1 = new QLabel (this);
            label1.Pixmap = img1;
            label1.Move (20, 20);

            QLabel label2 = new QLabel (this);
            label2.Pixmap = img2;
            label2.Move (40	, 160);

            QLabel label3 = new QLabel (this);
            label3.Pixmap = img3;
            label3.Move (170, 50);
        }
コード例 #28
0
        public void InitUI()
        {
            QVBoxLayout vBox = new QVBoxLayout(this);
            tableWidget = new QTableWidget();

            tableWidget.ColumnCount = 3;
            tableWidget.SetHorizontalHeaderItem(0, new QTableWidgetItem("Code"));
            tableWidget.SetHorizontalHeaderItem(1, new QTableWidgetItem("Product"));
            tableWidget.SetHorizontalHeaderItem(2, new QTableWidgetItem("Id"));
            tableWidget.SetColumnHidden(2, true);

            tableWidget.HorizontalHeader.StretchLastSection = true;
            tableWidget.VerticalHeader.Hide();
            tableWidget.selectionBehavior = QAbstractItemView.SelectionBehavior.SelectRows;
            tableWidget.EditTriggers = QAbstractItemView.EditTrigger.NoEditTriggers;

            tableWidget.ItemSelectionChanged += OnItemSelectionChanged;

            this.KeyReleaseEvent += OnWidgetKeyReleaseEvent;

            QHBoxLayout hBox1 = new QHBoxLayout();
            QHBoxLayout hBox2 = new QHBoxLayout();

            QLabel lbl1 = new QLabel("Selected Code : ", this);
            lblSelectedCode = new QLabel("",this);

            QLabel lbl2 = new QLabel("Selected Product : ", this);
            lblSelectedName = new QLabel("",this);

            hBox1.AddWidget(lbl1);
            hBox1.AddWidget(lblSelectedCode);

            hBox2.AddWidget(lbl2);
            hBox2.AddWidget(lblSelectedName);

            PopulateTable();

            vBox.AddWidget(tableWidget);
            vBox.AddItem(hBox1);
            vBox.AddItem(hBox2);
        }
コード例 #29
0
            public InfoPopup(AvatarGrid <T> grid)
            {
                m_Grid           = grid;
                base.WindowFlags = (uint)Qt.WindowType.FramelessWindowHint | (uint)Qt.WindowType.ToolTip;
                base.SetMinimumSize(260, 95);
                base.SetStyleSheet("background: black; color: white");

                m_GraphicsView            = new MyGraphicsView(this);
                m_GraphicsView.FrameShape = QFrame.Shape.NoFrame;
                m_GraphicsView.HorizontalScrollBarPolicy = Qt.ScrollBarPolicy.ScrollBarAlwaysOff;
                m_GraphicsView.VerticalScrollBarPolicy   = Qt.ScrollBarPolicy.ScrollBarAlwaysOff;
                m_GraphicsView.SetMaximumSize(60, 60);
                m_GraphicsView.SetMinimumSize(60, 60);

                m_Scene = new QGraphicsScene(m_GraphicsView);

                m_PixmapItem = new ResizableGraphicsPixmapItem();
                m_Scene.AddItem(m_PixmapItem);

                m_GraphicsView.SetScene(m_Scene);

                m_Label            = new QLabel(this);
                m_Label.Alignment  = (uint)Qt.AlignmentFlag.AlignTop | (uint)Qt.AlignmentFlag.AlignLeft;
                m_Label.TextFormat = Qt.TextFormat.RichText;
                m_Label.WordWrap   = true;
                m_Label.SizePolicy = new QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding);

                var leftLayout = new QVBoxLayout();

                leftLayout.AddWidget(m_GraphicsView);
                leftLayout.AddStretch();

                var layout = new QHBoxLayout(this);

                layout.Margin  = 6;
                layout.Spacing = 6;
                layout.AddLayout(leftLayout);
                layout.AddWidget(m_Label);

                this.InstallEventFilter(this);
            }
コード例 #30
0
        //public ComboBoxDemo()
        //{
        //	WindowTitle = "ComboBox Demo";

        //	InitUI();

        //	Resize(250, 200);
        //	Move(100, 100);
        //	Show();
        //}

        public override void InitUI()
        {
            var layout = new QVBoxLayout(this);

            label = new QLabel("Selected");
            label.AdjustSize();

            layout.AddWidget(label);

            var combo = new QComboBox(this);

            combo.AddItem("Ubuntu");
            combo.AddItem("Arch");
            combo.AddItem("Fedora");
            combo.AddItem("Red Hat");
            combo.AddItem("Gentoo");

            layout.AddWidget(combo);

            combo.ActivatedText += OnActivated;
        }
コード例 #31
0
    public void SetupUi(QDialog ScanningDialog)
    {
        if (ScanningDialog.ObjectName == "")
        ScanningDialog.ObjectName = "ScanningDialog";
        QSize Size = new QSize(750, 100);
        Size = Size.ExpandedTo(ScanningDialog.MinimumSizeHint());
        ScanningDialog.Size = Size;
        ScanningDialog.MinimumSize = new QSize(750, 100);
        ScanningDialog.MaximumSize = new QSize(750, 100);
        ScanningDialog.WindowIcon = new QIcon(":/main/themonospot_48.png");
        ScanningDialog.Modal = true;
        vboxLayout = new QVBoxLayout(ScanningDialog);
        vboxLayout.ObjectName = "vboxLayout";
        lblOperation = new QLabel(ScanningDialog);
        lblOperation.ObjectName = "lblOperation";
        lblOperation.Alignment = Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignCenter");
        lblOperation.Margin = 1;

        vboxLayout.AddWidget(lblOperation);

        lblFileName = new QLabel(ScanningDialog);
        lblFileName.ObjectName = "lblFileName";
        lblFileName.Alignment = Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignCenter");
        lblFileName.WordWrap = true;
        lblFileName.Margin = 1;

        vboxLayout.AddWidget(lblFileName);

        buttonBox = new QDialogButtonBox(ScanningDialog);
        buttonBox.ObjectName = "buttonBox";
        buttonBox.Orientation = Qt.Orientation.Horizontal;
        buttonBox.StandardButtons = Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Cancel");
        buttonBox.CenterButtons = true;

        vboxLayout.AddWidget(buttonBox);

        RetranslateUi(ScanningDialog);

        QMetaObject.ConnectSlotsByName(ScanningDialog);
    }
コード例 #32
0
ファイル: EditGroupsWindow.cs プロジェクト: xlizzard/synapse
        protected void SetupUi()
        {
            base.ObjectName  = "EditGroupsWindow";
            this.Geometry    = new QRect(0, 0, 250, 344);
            this.WindowTitle = "EditGroupsWindow";
            QVBoxLayout verticalLayout;

            verticalLayout        = new QVBoxLayout(this);
            verticalLayout.Margin = 6;
            QSpacerItem verticalSpacer;

            verticalSpacer = new QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
            verticalLayout.AddItem(verticalSpacer);
            this.label            = new QLabel(this);
            this.label.ObjectName = "label";
            QSizePolicy label_sizePolicy;

            label_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            label_sizePolicy.SetVerticalStretch(0);
            label_sizePolicy.SetHorizontalStretch(0);
            label_sizePolicy.SetHeightForWidth(this.label.SizePolicy.HasHeightForWidth());
            this.label.SizePolicy = label_sizePolicy;
            this.label.Text       = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;\">\n<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Edit Groups</span></p></body></html>";
            verticalLayout.AddWidget(this.label);
            this.jidLabel            = new QLabel(this);
            this.jidLabel.ObjectName = "jidLabel";
            this.jidLabel.Text       = "";
            verticalLayout.AddWidget(this.jidLabel);
            this.groupsWidget            = new Synapse.QtClient.Widgets.EditGroupsWidget(this);
            this.groupsWidget.ObjectName = "groupsWidget";
            verticalLayout.AddWidget(this.groupsWidget);
            this.buttonBox            = new QDialogButtonBox(this);
            this.buttonBox.ObjectName = "buttonBox";
            verticalLayout.AddWidget(this.buttonBox);
            QSpacerItem verticalSpacer_2;

            verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
            verticalLayout.AddItem(verticalSpacer_2);
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #33
0
        private QGroupBox InitQLabel()
        {
            String str = @"Little boxes on the hillside,
Little boxes made of ticky tacky,
Little boxes on the hillside,
Little boxes all the same.

There's a green one and a pink one 
And a blue one and a yellow one,
And they're all made out of ticky tacky
And they all look just the same.";

            QGroupBox   groupBox = new QGroupBox("QLabel", this);
            QVBoxLayout vBox     = new QVBoxLayout();
            QLabel      label    = new QLabel(str, this);

            label.Font = new QFont("Myriad Pro", 9);
            vBox.AddWidget(label);
            groupBox.Layout = vBox;

            return(groupBox);
        }
コード例 #34
0
ファイル: EditGroupsWidget.cs プロジェクト: xlizzard/synapse
        protected void SetupUi()
        {
            base.ObjectName  = "EditGroupsWidget";
            this.Geometry    = new QRect(0, 0, 212, 239);
            this.WindowTitle = "EditGroupsWidget";
            QVBoxLayout verticalLayout;

            verticalLayout             = new QVBoxLayout(this);
            verticalLayout.Spacing     = 3;
            verticalLayout.Margin      = 0;
            this.listWidget            = new QListWidget(this);
            this.listWidget.ObjectName = "listWidget";
            QSizePolicy listWidget_sizePolicy;

            listWidget_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding);
            listWidget_sizePolicy.SetVerticalStretch(0);
            listWidget_sizePolicy.SetHorizontalStretch(0);
            listWidget_sizePolicy.SetHeightForWidth(this.listWidget.SizePolicy.HasHeightForWidth());
            this.listWidget.SizePolicy  = listWidget_sizePolicy;
            this.listWidget.MinimumSize = new QSize(0, 50);
            this.listWidget.FrameShape  = QFrame.Shape.NoFrame;
            verticalLayout.AddWidget(this.listWidget);
            QGridLayout gridLayout;

            gridLayout = new QGridLayout();
            verticalLayout.AddLayout(gridLayout);
            this.label_2            = new QLabel(this);
            this.label_2.ObjectName = "label_2";
            this.label_2.Text       = "Add Group:";
            gridLayout.AddWidget(this.label_2, 0, 0, 1, 1);
            this.lineEdit            = new QLineEdit(this);
            this.lineEdit.ObjectName = "lineEdit";
            gridLayout.AddWidget(this.lineEdit, 0, 1, 1, 1);
            this.addButton            = new QPushButton(this);
            this.addButton.ObjectName = "addButton";
            this.addButton.Text       = "";
            gridLayout.AddWidget(this.addButton, 0, 2, 1, 1);
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #35
0
        public void SetupUi(QDialog PassphraseDialog)
        {
            if (PassphraseDialog.ObjectName == "")
            {
                PassphraseDialog.ObjectName = "PassphraseDialog";
            }
            QSize Size = new QSize(493, 118);

            Size = Size.ExpandedTo(PassphraseDialog.MinimumSizeHint);
            PassphraseDialog.Size     = Size;
            verticalLayout            = new QVBoxLayout(PassphraseDialog);
            verticalLayout.ObjectName = "verticalLayout";
            mMessageLabel             = new QLabel(PassphraseDialog);
            mMessageLabel.ObjectName  = "mMessageLabel";

            verticalLayout.AddWidget(mMessageLabel, 0, Qt.AlignmentFlag.AlignHCenter);

            mPassphraseLineEdit            = new QLineEdit(PassphraseDialog);
            mPassphraseLineEdit.ObjectName = "mPassphraseLineEdit";
            mPassphraseLineEdit.echoMode   = QLineEdit.EchoMode.Password;

            verticalLayout.AddWidget(mPassphraseLineEdit);

            mButtonBox                 = new QDialogButtonBox(PassphraseDialog);
            mButtonBox.ObjectName      = "mButtonBox";
            mButtonBox.Orientation     = Qt.Orientation.Horizontal;
            mButtonBox.StandardButtons = QDialogButtonBox.StandardButton.Cancel | QDialogButtonBox.StandardButton.Ok;

            verticalLayout.AddWidget(mButtonBox);


            RetranslateUi(PassphraseDialog);
            QObject.Connect(mButtonBox, Qt.SIGNAL("accepted()"), PassphraseDialog, Qt.SLOT("accept()"));
            QObject.Connect(mButtonBox,Qt.SIGNAL("rejected()"),PassphraseDialog,Qt.SLOT("reject()"));

            QMetaObject.ConnectSlotsByName(PassphraseDialog);
        } // SetupUi
コード例 #36
0
ファイル: MyWidget.cs プロジェクト: kuruntham/qyotoexamples
        private void InitUI()
        {
            //Main Vertical box
            QVBoxLayout vBox = new QVBoxLayout(this);

            //Row 1
            QLabel labelWind = new QLabel("Windows",this);
            vBox.AddWidget(labelWind);

            //Row2
            QHBoxLayout hBoxR2 = new QHBoxLayout();
            vBox.AddItem(hBoxR2);

            //Row2 Column 1
            QTextEdit textEdit = new QTextEdit(this);
            textEdit.Enabled = false;
            hBoxR2.AddWidget(textEdit);

            //Row2 Column 2
            QVBoxLayout vBox1 = new QVBoxLayout();
            QPushButton btnActivate = new QPushButton("Activate", this);
            QPushButton btnClose = new QPushButton("Close", this);
            vBox1.ContentsMargins = new QMargins(5,0,5,5);
            vBox1.AddWidget(btnActivate);
            vBox1.AddWidget(btnClose);
            vBox1.AddStretch(1);
            hBoxR2.AddItem(vBox1);

            //Row3
            QHBoxLayout hBoxR3 = new QHBoxLayout();
            vBox.AddItem(hBoxR3);
            QPushButton btnHelp = new QPushButton("Help", this);
            QPushButton btnOk = new QPushButton("Ok", this);
            hBoxR3.AddWidget(btnHelp);
            hBoxR3.AddStretch(1);
            hBoxR3.AddWidget(btnOk);
        }
コード例 #37
0
        private void InitUI()
        {
            QVBoxLayout vBox = new QVBoxLayout(this);

            QVBoxLayout vBox1 = new QVBoxLayout();

            QHBoxLayout hBox1 = new QHBoxLayout();
            QHBoxLayout hBox2 = new QHBoxLayout();

            QLabel    winLabel = new QLabel("Windows", this);
            QTextEdit textEdit = new QTextEdit(this);

            textEdit.Enabled = false;

            QPushButton activateButton = new QPushButton("Activate", this);
            QPushButton closeButton    = new QPushButton("Close", this);
            QPushButton helpButton     = new QPushButton("Help", this);
            QPushButton okButton       = new QPushButton("Ok", this);

            vBox.AddWidget(winLabel);

            vBox1.AddWidget(activateButton);
            vBox1.AddWidget(closeButton, 0, AlignmentFlag.AlignTop);

            hBox1.AddWidget(textEdit);
            hBox1.AddLayout(vBox1);

            vBox.AddLayout(hBox1);

            hBox2.AddWidget(helpButton);
            hBox2.AddStretch(1);
            hBox2.AddWidget(okButton);

            vBox.AddLayout(hBox2, 1);

            Layout = vBox;
        }
コード例 #38
0
        protected void SetupUi()
        {
            base.ObjectName  = "InsertLinkDialog";
            this.Geometry    = new QRect(0, 0, 287, 110);
            this.WindowTitle = "Insert Link";
            QVBoxLayout verticalLayout;

            verticalLayout        = new QVBoxLayout(this);
            verticalLayout.Margin = 6;
            QFormLayout formLayout;

            formLayout = new QFormLayout();
            verticalLayout.AddLayout(formLayout);
            this.label_2            = new QLabel(this);
            this.label_2.ObjectName = "label_2";
            this.label_2.Text       = "URL:";
            formLayout.SetWidget(0, QFormLayout.ItemRole.LabelRole, this.label_2);
            this.urlLineEdit            = new QLineEdit(this);
            this.urlLineEdit.ObjectName = "urlLineEdit";
            formLayout.SetWidget(0, QFormLayout.ItemRole.FieldRole, this.urlLineEdit);
            this.label            = new QLabel(this);
            this.label.ObjectName = "label";
            this.label.Text       = "Text:";
            formLayout.SetWidget(1, QFormLayout.ItemRole.LabelRole, this.label);
            this.textLineEdit            = new QLineEdit(this);
            this.textLineEdit.ObjectName = "textLineEdit";
            formLayout.SetWidget(1, QFormLayout.ItemRole.FieldRole, this.textLineEdit);
            this.buttonBox                 = new QDialogButtonBox(this);
            this.buttonBox.ObjectName      = "buttonBox";
            this.buttonBox.Orientation     = Qt.Orientation.Horizontal;
            this.buttonBox.StandardButtons = (global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Cancel") | global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Ok"));
            verticalLayout.AddWidget(this.buttonBox);
            QObject.Connect(buttonBox, Qt.SIGNAL("accepted()"), this, Qt.SLOT("accept()"));
            QObject.Connect(buttonBox,Qt.SIGNAL("rejected()"),this,Qt.SLOT("reject()"));
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #39
0
        private void InitUI()
        {
            QVBoxLayout vBox = new QVBoxLayout (this);

            QVBoxLayout vBox1 = new QVBoxLayout ();

            QHBoxLayout hBox1 = new QHBoxLayout ();
            QHBoxLayout hBox2 = new QHBoxLayout ();

            QLabel winLabel = new QLabel ("Windows", this);
            QTextEdit textEdit = new QTextEdit (this);
            textEdit.Enabled = false;

            QPushButton activateButton = new QPushButton ("Activate", this);
            QPushButton closeButton = new QPushButton ("Close", this);
            QPushButton helpButton = new QPushButton ("Help", this);
            QPushButton okButton = new QPushButton ("Ok", this);

            vBox.AddWidget (winLabel);

            vBox1.AddWidget (activateButton);
            vBox1.AddWidget (closeButton, 0, AlignmentFlag.AlignTop);

            hBox1.AddWidget (textEdit);
            hBox1.AddLayout (vBox1);

            vBox.AddLayout (hBox1);

            hBox2.AddWidget (helpButton);
            hBox2.AddStretch (1);
            hBox2.AddWidget (okButton);

            vBox.AddLayout (hBox2, 1);

            Layout = vBox;
        }
コード例 #40
0
        protected void SetupUi()
        {
            base.ObjectName     = "TwitterConfigurationDialog";
            this.WindowModality = Qt.WindowModality.NonModal;
            this.Geometry       = new QRect(0, 0, 313, 137);
            this.WindowTitle    = "Twitter Configuration";
            this.Modal          = true;
            QVBoxLayout verticalLayout;

            verticalLayout        = new QVBoxLayout(this);
            verticalLayout.Margin = 6;
            QHBoxLayout horizontalLayout;

            horizontalLayout = new QHBoxLayout();
            verticalLayout.AddLayout(horizontalLayout);
            this.logoLabel             = new QLabel(this);
            this.logoLabel.ObjectName  = "logoLabel";
            this.logoLabel.MinimumSize = new QSize(48, 0);
            this.logoLabel.Text        = "";
            horizontalLayout.AddWidget(this.logoLabel);
            QVBoxLayout verticalLayout_2;

            verticalLayout_2 = new QVBoxLayout();
            horizontalLayout.AddLayout(verticalLayout_2);
            this.label            = new QLabel(this);
            this.label.ObjectName = "label";
            QSizePolicy label_sizePolicy;

            label_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            label_sizePolicy.SetVerticalStretch(0);
            label_sizePolicy.SetHorizontalStretch(0);
            label_sizePolicy.SetHeightForWidth(this.label.SizePolicy.HasHeightForWidth());
            this.label.SizePolicy = label_sizePolicy;
            this.label.Text       = "Enter your Twitter account information:";
            verticalLayout_2.AddWidget(this.label);
            QGridLayout gridLayout_2;

            gridLayout_2 = new QGridLayout();
            verticalLayout_2.AddLayout(gridLayout_2);
            gridLayout_2.sizeConstraint = QLayout.SizeConstraint.SetMaximumSize;
            this.label_2            = new QLabel(this);
            this.label_2.ObjectName = "label_2";
            this.label_2.Text       = "Username:"******"usernameLineEdit";
            gridLayout_2.AddWidget(this.usernameLineEdit, 0, 1, 1, 1);
            this.label_3            = new QLabel(this);
            this.label_3.ObjectName = "label_3";
            this.label_3.Text       = "Password:"******"passwordLineEdit";
            this.passwordLineEdit.echoMode   = QLineEdit.EchoMode.Password;
            gridLayout_2.AddWidget(this.passwordLineEdit, 1, 1, 1, 1);
            this.buttonBox                 = new QDialogButtonBox(this);
            this.buttonBox.ObjectName      = "buttonBox";
            this.buttonBox.Orientation     = Qt.Orientation.Horizontal;
            this.buttonBox.StandardButtons = (global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Cancel") | global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Ok"));
            verticalLayout.AddWidget(this.buttonBox);
            QObject.Connect(buttonBox, Qt.SIGNAL("accepted()"), this, Qt.SLOT("accept()"));
            QObject.Connect(buttonBox,Qt.SIGNAL("rejected()"),this,Qt.SLOT("reject()"));
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #41
0
            public NotificationItemWidget(IActivityFeedItem item, QWidget parent) : base(parent)
            {
                m_Item = item;
                item.ActionTriggered += HandleActionTriggered;

                QHBoxLayout layout = new QHBoxLayout(this);

                layout.Margin = 3;

                var service = ServiceManager.Get <ActivityFeedService>();
                ActivityFeedItemTemplate template = service.Templates[item.Type];

                var builder = new StringBuilder();

                builder.AppendFormat("<span style=\"font-size: 9pt;\">");
                builder.AppendFormat("<b>{0}</b>", item.FromName);
                builder.Append(" ");
                builder.AppendFormat(template.SingularText, "<b>{0}</b>".FormatWith(item.ActionItem));

                if (!String.IsNullOrEmpty(item.Content))
                {
                    builder.Append(":");
                    builder.Append("<p style=\"margin-left: 20px; margin-top: 0px; margin-bottom: 0px;\">");
                    builder.Append(item.Content);
                    builder.Append("</p>");
                }
                else
                {
                    builder.Append(".");
                }

                if (template.Actions != null && template.Actions.Length > 0)
                {
                    builder.Append("<br/>");
                    foreach (var action in template.Actions)
                    {
                        builder.AppendFormat("<a style=\"color: white\" href=\"{0}\">{1}</a> ", action.Name, action.Label);
                    }
                }

                builder.Append("</span>");

                QLabel label = new QLabel(builder.ToString(), this);

                QObject.Connect(label, Qt.SIGNAL("linkActivated(const QString &)"), delegate(string link) {
                    m_Item.TriggerAction(link);
                });

                label.MinimumWidth = 1;
                label.WordWrap     = true;
                layout.AddWidget(label, 1);

                if (item is XmppActivityFeedItem)
                {
                    label.ToolTip = String.Format("From: {0}", ((XmppActivityFeedItem)item).FromJid);
                }

                QPushButton closeButton = new QPushButton(this);

                QObject.Connect(closeButton, Qt.SIGNAL("clicked()"), delegate {
                    Close();
                });
                closeButton.icon = Gui.LoadIcon("window-close", 16);
                layout.AddWidget(closeButton, 0);
            }
コード例 #42
0
ファイル: AboutDialog.cs プロジェクト: koradeh/comex-project
    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);
    }
コード例 #43
0
        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);
        }
コード例 #44
0
ファイル: MainWindow.cs プロジェクト: koradeh/comex-project
    public void SetupUi(QMainWindow MainWindow)
    {
        if (MainWindow.ObjectName == "")
        MainWindow.ObjectName = "MainWindow";
        QSize Size = new QSize(631, 570);
        Size = Size.ExpandedTo(MainWindow.MinimumSizeHint());
        MainWindow.Size = Size;
        MainWindow.MinimumSize = new QSize(600, 550);
        MainWindow.WindowIcon = new QIcon(":/main/resources/Images/comex_256.png");
        action_Open = new QAction(MainWindow);
        action_Open.ObjectName = "action_Open";
        action_Open.icon = new QIcon(":/main/resources/Images/document-open.png");
        action_Close = new QAction(MainWindow);
        action_Close.ObjectName = "action_Close";
        action_Close.Enabled = false;
        action_Close.icon = new QIcon(":/main/resources/Images/document-close.png");
        action_Exit = new QAction(MainWindow);
        action_Exit.ObjectName = "action_Exit";
        action_Exit.icon = new QIcon(":/main/resources/Images/application-exit.png");
        action_Info = new QAction(MainWindow);
        action_Info.ObjectName = "action_Info";
        action_Info.icon = new QIcon(":/main/resources/Images/dialog-information.png");
        action_ATR = new QAction(MainWindow);
        action_ATR.ObjectName = "action_ATR";
        action_ATR.icon = new QIcon(":/main/resources/Images/quickopen.png");
        action_Exec_Command = new QAction(MainWindow);
        action_Exec_Command.ObjectName = "action_Exec_Command";
        action_SerialSettings = new QAction(MainWindow);
        action_SerialSettings.ObjectName = "action_SerialSettings";
        action_SerialSettings.icon = new QIcon(":/main/resources/Images/configure.png");
        centralwidget = new QWidget(MainWindow);
        centralwidget.ObjectName = "centralwidget";
        gridLayout = new QGridLayout(centralwidget);
        gridLayout.ObjectName = "gridLayout";
        FrameATR = new QGroupBox(centralwidget);
        FrameATR.ObjectName = "FrameATR";
        QSizePolicy sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed);
        sizePolicy.SetHorizontalStretch(0);
        sizePolicy.SetVerticalStretch(0);
        sizePolicy.SetHeightForWidth(FrameATR.SizePolicy.HasHeightForWidth());
        FrameATR.SizePolicy = sizePolicy;
        gridLayout1 = new QGridLayout(FrameATR);
        gridLayout1.ObjectName = "gridLayout1";
        TxtATR = new QLineEdit(FrameATR);
        TxtATR.ObjectName = "TxtATR";
        TxtATR.StyleSheet = "color: rgb(30, 109, 30);";
        TxtATR.ReadOnly = true;

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

        gridLayout.AddWidget(FrameATR, 0, 0, 1, 1);

        FrameFile = new QGroupBox(centralwidget);
        FrameFile.ObjectName = "FrameFile";
        gridLayout2 = new QGridLayout(FrameFile);
        gridLayout2.ObjectName = "gridLayout2";
        LstCommands = new QListWidget(FrameFile);
        LstCommands.ObjectName = "LstCommands";
        LstCommands.EditTriggers = Qyoto.Qyoto.GetCPPEnumValue("QAbstractItemView", "NoEditTriggers");

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

        gridLayout.AddWidget(FrameFile, 1, 0, 1, 1);

        FrameExchange = new QGroupBox(centralwidget);
        FrameExchange.ObjectName = "FrameExchange";
        sizePolicy.SetHeightForWidth(FrameExchange.SizePolicy.HasHeightForWidth());
        FrameExchange.SizePolicy = sizePolicy;
        gridLayout3 = new QGridLayout(FrameExchange);
        gridLayout3.ObjectName = "gridLayout3";
        LblCommand = new QLabel(FrameExchange);
        LblCommand.ObjectName = "LblCommand";

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

        TxtCmd = new QLineEdit(FrameExchange);
        TxtCmd.ObjectName = "TxtCmd";
        TxtCmd.StyleSheet = "color: rgb(30, 109, 30);";

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

        BtnSend = new QPushButton(FrameExchange);
        BtnSend.ObjectName = "BtnSend";
        BtnSend.icon = new QIcon(":/main/resources/Images/arrow-right.png");

        gridLayout3.AddWidget(BtnSend, 0, 2, 1, 1);

        LblResponse = new QLabel(FrameExchange);
        LblResponse.ObjectName = "LblResponse";

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

        TxtResp = new QLineEdit(FrameExchange);
        TxtResp.ObjectName = "TxtResp";
        TxtResp.StyleSheet = "color: rgb(0, 0, 255);";
        TxtResp.ReadOnly = true;

        gridLayout3.AddWidget(TxtResp, 1, 1, 1, 1);

        gridLayout.AddWidget(FrameExchange, 2, 0, 1, 1);

        MainWindow.SetCentralWidget(centralwidget);
        menubar = new QMenuBar(MainWindow);
        menubar.ObjectName = "menubar";
        menubar.Geometry = new QRect(0, 0, 631, 24);
        menu_File = new QMenu(menubar);
        menu_File.ObjectName = "menu_File";
        menu_Reader = new QMenu(menubar);
        menu_Reader.ObjectName = "menu_Reader";
        menu_About = new QMenu(menubar);
        menu_About.ObjectName = "menu_About";
        MainWindow.SetMenuBar(menubar);
        statusbar = new QStatusBar(MainWindow);
        statusbar.ObjectName = "statusbar";
        MainWindow.SetStatusBar(statusbar);
        toolBar = new QToolBar(MainWindow);
        toolBar.ObjectName = "toolBar";
        toolBar.Movable = false;
        toolBar.ToolButtonStyle = Qt.ToolButtonStyle.ToolButtonTextBesideIcon;
        toolBar.Floatable = false;
        MainWindow.AddToolBar(Qt.ToolBarArea.TopToolBarArea, toolBar);

        menubar.AddAction(menu_File.MenuAction());
        menubar.AddAction(menu_Reader.MenuAction());
        menubar.AddAction(menu_About.MenuAction());
        menu_File.AddAction(action_Open);
        menu_File.AddAction(action_Close);
        menu_File.AddSeparator();
        menu_File.AddAction(action_SerialSettings);
        menu_File.AddSeparator();
        menu_File.AddAction(action_Exit);
        menu_About.AddAction(action_Info);
        toolBar.AddAction(action_Open);
        toolBar.AddAction(action_Close);
        toolBar.AddAction(action_SerialSettings);
        toolBar.AddAction(action_ATR);
        toolBar.AddAction(action_Info);
        toolBar.AddSeparator();
        toolBar.AddAction(action_Exit);

        RetranslateUi(MainWindow);

        QMetaObject.ConnectSlotsByName(MainWindow);
    }
コード例 #45
0
ファイル: gui.cs プロジェクト: jyale/group-chat
    public Gui(Net net)
    {
        net.newMsg += this.addMessage;

        // copy the net object so all methods can access it
        netCpy = net;

        setWindowTitle("Group-chat");

        // Read-only text box where we display messages from everyone.
        // This widget expands both horizontally and vertically.

        // MULTI line text edit
        textview = new QTextEdit(this);
        textview.setReadOnly(true);

        // Small text-entry box the user can enter messages.
        // This widget normally expands only horizontally,
        // leaving extra vertical space for the textview widget.
        //
        // Challenge!  Change this into a read/write QTextEdit,
        // so that the user can easily enter multi-line messages.

        // single line text edit
        textline = new QLineEdit(this);

        // Create the list of nodes
        //table = new QListView(this);

          		model = new QStringListModel();
        //model.setStringList(net.peerNames);

        // Lay out the widgets to appear in the main window.
        // For Qt widget and layout concepts see:
        // http://doc.trolltech.com/4.6/widgets-and-layouts.html

        // Q Vertical Box layout
        QVBoxLayout layout = new QVBoxLayout();
        layout.addWidget(textview);
        layout.addWidget(textline);

        // add objectst to layout tehn

        QVBoxLayout peerLayout = new QVBoxLayout();

        QLabel title = new QLabel("List of peers:");
        peerLayout.addWidget(title);

        for(int i=0; i< net.peerList.size(); i++){
            String peerName = (String)net.peerList.get(i);
            Console.WriteLine(peerName);
            QLabel label = new QLabel(peerName);
            peerLayout.addWidget(label);
        }

        QPushButton button = new QPushButton("Add Peer");

        QPushButton sendButton = new QPushButton("Send Message");
        sendButton.clicked.connect(this,"gotReturnPressed()");

        button.clicked.connect(this,"addPeer()");

        QVBoxLayout buttonLay = new QVBoxLayout();
        buttonLay.addWidget(sendButton);
        buttonLay.addWidget(button);
        QWidget buttonW = new QWidget(this);
        buttonW.setLayout(buttonLay);

        QWidget peers = new QWidget(this);
        peers.setLayout(peerLayout);

        QWidget msgAndInput = new QWidget(this);
        msgAndInput.setLayout(layout);

        QHBoxLayout window = new QHBoxLayout();
        window.addWidget(peers);
        window.addWidget(msgAndInput);
        window.addWidget(buttonW);

        base.setLayout(window);

        //layout.addWidget(table);

        // base is like "this" in Java, base object of GUI
        //base.setLayout(layout);

        // Register a callback on the textline's returnPressed signal
        // so that we can send the message entered by the user.
        // Note that here we're using a Qt signal, not a C# event.
        // The Qt Jambi bindings for C# don't support custom signals,
        // only the the signals built-in to "native" Qt objects.
        // Thus, any new signals we need to define should be C# events;
        // see the example below.

        // removed this functionality and replaced with a button

        //textline.returnPressed.connect(this, "gotReturnPressed()");

        // Lab 1: Insert code here to add some kind of GUI facility
        // allowing the user to view the list of peers available,
        // as maintained by the Net instance provided above.
        // You might do this simply by adding a widget to this dialog,
        // or by adding a button or menu that opens a new dialog
        // to display the list of peers, or whatever method you prefer.
    }
コード例 #46
0
    public void SetupUi(QDialog SettingsDialog)
    {
        if (SettingsDialog.ObjectName == "")
        SettingsDialog.ObjectName = "SettingsDialog";
        QSize Size = new QSize(320, 280);
        Size = Size.ExpandedTo(SettingsDialog.MinimumSizeHint());
        SettingsDialog.Size = Size;
        SettingsDialog.MinimumSize = new QSize(320, 280);
        SettingsDialog.Modal = true;
        gridLayout = new QGridLayout(SettingsDialog);
        gridLayout.ObjectName = "gridLayout";
        FrameSettings = new QGroupBox(SettingsDialog);
        FrameSettings.ObjectName = "FrameSettings";
        gridLayout1 = new QGridLayout(FrameSettings);
        gridLayout1.ObjectName = "gridLayout1";
        LblPortSpeedReset = new QLabel(FrameSettings);
        LblPortSpeedReset.ObjectName = "LblPortSpeedReset";
        QSizePolicy sizePolicy = new QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Preferred);
        sizePolicy.SetHorizontalStretch(0);
        sizePolicy.SetVerticalStretch(0);
        sizePolicy.SetHeightForWidth(LblPortSpeedReset.SizePolicy.HasHeightForWidth());
        LblPortSpeedReset.SizePolicy = sizePolicy;

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

        CmbPortSpeedReset = new QComboBox(FrameSettings);
        CmbPortSpeedReset.ObjectName = "CmbPortSpeedReset";

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

        LblPortSpeed = new QLabel(FrameSettings);
        LblPortSpeed.ObjectName = "LblPortSpeed";
        sizePolicy.SetHeightForWidth(LblPortSpeed.SizePolicy.HasHeightForWidth());
        LblPortSpeed.SizePolicy = sizePolicy;

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

        CmbPortSpeed = new QComboBox(FrameSettings);
        CmbPortSpeed.ObjectName = "CmbPortSpeed";

        gridLayout1.AddWidget(CmbPortSpeed, 1, 1, 1, 1);

        LblDataBits = new QLabel(FrameSettings);
        LblDataBits.ObjectName = "LblDataBits";
        sizePolicy.SetHeightForWidth(LblDataBits.SizePolicy.HasHeightForWidth());
        LblDataBits.SizePolicy = sizePolicy;

        gridLayout1.AddWidget(LblDataBits, 2, 0, 1, 1);

        CmbDataBits = new QComboBox(FrameSettings);
        CmbDataBits.ObjectName = "CmbDataBits";

        gridLayout1.AddWidget(CmbDataBits, 2, 1, 1, 1);

        LblStopBits = new QLabel(FrameSettings);
        LblStopBits.ObjectName = "LblStopBits";
        sizePolicy.SetHeightForWidth(LblStopBits.SizePolicy.HasHeightForWidth());
        LblStopBits.SizePolicy = sizePolicy;

        gridLayout1.AddWidget(LblStopBits, 3, 0, 1, 1);

        CmbStopBits = new QComboBox(FrameSettings);
        CmbStopBits.ObjectName = "CmbStopBits";

        gridLayout1.AddWidget(CmbStopBits, 3, 1, 1, 1);

        LblParity = new QLabel(FrameSettings);
        LblParity.ObjectName = "LblParity";
        sizePolicy.SetHeightForWidth(LblParity.SizePolicy.HasHeightForWidth());
        LblParity.SizePolicy = sizePolicy;

        gridLayout1.AddWidget(LblParity, 4, 0, 1, 1);

        CmbParity = new QComboBox(FrameSettings);
        CmbParity.ObjectName = "CmbParity";

        gridLayout1.AddWidget(CmbParity, 4, 1, 1, 1);

        LblConvention = new QLabel(FrameSettings);
        LblConvention.ObjectName = "LblConvention";
        sizePolicy.SetHeightForWidth(LblConvention.SizePolicy.HasHeightForWidth());
        LblConvention.SizePolicy = sizePolicy;

        gridLayout1.AddWidget(LblConvention, 5, 0, 1, 1);

        CmbConvention = new QComboBox(FrameSettings);
        CmbConvention.ObjectName = "CmbConvention";

        gridLayout1.AddWidget(CmbConvention, 5, 1, 1, 1);

        gridLayout.AddWidget(FrameSettings, 1, 0, 1, 1);

        Buttons = new QDialogButtonBox(SettingsDialog);
        Buttons.ObjectName = "Buttons";
        Buttons.Orientation = Qt.Orientation.Horizontal;
        Buttons.StandardButtons = Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Cancel") | Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Ok");

        gridLayout.AddWidget(Buttons, 2, 0, 1, 1);

        RetranslateUi(SettingsDialog);

        QMetaObject.ConnectSlotsByName(SettingsDialog);
    }
コード例 #47
0
        private QGroupBox InitQLineEdit()
        {
            QGroupBox groupBox = new QGroupBox ("QLineEdit", this);
            QVBoxLayout vBox = new QVBoxLayout ();
            QLabel label = new QLabel ("Change the text in Line Edit", this);
            QLineEdit lineEdit = new QLineEdit (this);
            lineEdit.TextChanged += (string txt) => {
                label.Text = txt;
                label.AdjustSize();
            };
            vBox.AddWidget (lineEdit);
            vBox.AddWidget (label);

            groupBox.Layout = vBox;
            return groupBox;
        }
コード例 #48
0
        private QGroupBox InitQLabel()
        {
            String str = @"Little boxes on the hillside,
            Little boxes made of ticky tacky,
            Little boxes on the hillside,
            Little boxes all the same.

            There's a green one and a pink one
            And a blue one and a yellow one,
            And they're all made out of ticky tacky
            And they all look just the same.";

            QGroupBox groupBox = new QGroupBox ("QLabel", this);
            QVBoxLayout vBox = new QVBoxLayout ();
            QLabel label = new QLabel (str, this);
            label.Font = new QFont("Myriad Pro", 9);
            vBox.AddWidget (label);
            groupBox.Layout = vBox;

            return groupBox;
        }
コード例 #49
0
ファイル: MyWidget.cs プロジェクト: kuruntham/qyotoexamples
        private void InitUI()
        {
            QLabel labelCode = new QLabel("Code",this);
            QLabel labelName = new QLabel("Name", this);
            QLabel labelUnit = new QLabel("Price", this);
            QLabel labelPrice = new QLabel("Unit Price", this);

            labelErrorCode = new QLabel("", this);
            labelErrorCode.ObjectName = "errorCode";

            labelErrorName = new QLabel("", this);
            labelErrorName.ObjectName = "errorName";

            labelErrorUnit = new QLabel("", this);
            labelErrorUnit.ObjectName = "errorUnit";

            labelErrorPrice = new QLabel("", this);
            labelErrorPrice.ObjectName = "errorPrice";

            StyleSheet = @"QLabel#errorCode{color:#ff0000}
                QLabel#errorName{color:#ff0000}
                QLabel#errorUnit{color:#ff0000}
                QLabel#errorPrice{color:#ff0000}
            ";

            txtCode = new QLineEdit(this);
            txtName = new QLineEdit(this);
            cmbUnit = new QComboBox(this);
            txtPrice = new QLineEdit(this);

            txtCode.TextEdited += OnTextCodeEdited;
            txtName.TextEdited += OnTextNameEdited;
            txtPrice.TextEdited += OnTextPriceEdited;

            txtCode.FocusOutEvent += OnTextCodeFocusOut;
            txtName.FocusOutEvent += OnTextNameFocusOut;
            txtPrice.FocusOutEvent += OnTextPriceFocusOut;

            QPushButton btnSave = new QPushButton("Save", this);
            QPushButton btnReset = new QPushButton("Reset", this);

            btnSave.Clicked += OnBtnSaveClicked;
            btnReset.Clicked += OnBtnResetClicked;

            //Layouts
            QVBoxLayout topVLayout = new QVBoxLayout(this);
            QHBoxLayout topHLayout = new QHBoxLayout();

            QFormLayout formLayout = new QFormLayout();

            QVBoxLayout vBoxCode = new QVBoxLayout();
            QVBoxLayout vBoxName = new QVBoxLayout();
            QVBoxLayout vBoxUnit = new QVBoxLayout();
            QVBoxLayout vBoxPrice = new QVBoxLayout();

            QHBoxLayout btnHLayout = new QHBoxLayout();

            QGroupBox groupBox = new QGroupBox("Product",this);
            groupBox.MinimumWidth = 250;

            QVBoxLayout grpBoxVLayout = new QVBoxLayout();

            vBoxCode.AddWidget(txtCode);
            vBoxCode.AddWidget(labelErrorCode);

            vBoxName.AddWidget(txtName);
            vBoxName.AddWidget(labelErrorName);

            vBoxUnit.AddWidget(cmbUnit);
            vBoxUnit.AddWidget(labelErrorUnit);

            vBoxPrice.AddWidget(txtPrice);
            vBoxPrice.AddWidget(labelErrorPrice);

            formLayout.HorizontalSpacing = 5;
            formLayout.VerticalSpacing = 10;
            formLayout.AddRow(labelCode, vBoxCode);
            formLayout.AddRow(labelName, vBoxName);
            formLayout.AddRow(labelUnit, vBoxUnit);
            formLayout.AddRow(labelPrice, vBoxPrice);

            btnHLayout.AddStretch(1);
            btnHLayout.AddWidget(btnSave);
            btnHLayout.AddWidget(btnReset);

            grpBoxVLayout.AddItem(formLayout);
            grpBoxVLayout.AddItem(btnHLayout);

            cmbUnit.AddItem("Litre", "L");
            cmbUnit.AddItem("Kilogram","K");
            cmbUnit.AddItem("Gram", "G");
            cmbUnit.AddItem("Packet", "P");

            groupBox.Layout = grpBoxVLayout;

            topHLayout.AddStretch(1);
            topHLayout.AddWidget(groupBox);
            topHLayout.AddStretch(1);

            topVLayout.AddStretch(1);
            topVLayout.AddItem(topHLayout);
            topVLayout.AddStretch(1);
        }