コード例 #1
0
        /// <summary>
        /// Generate
        /// </summary>
        /// <returns></returns>
        public static QLayout GenerateLayout()
        {
            //var vbox = new QVBoxLayout(parentWidget);
            var vbox = new QVBoxLayout();

            vbox.AddWidget(new QLabel("Windows"));

            var vbox1 = new QVBoxLayout();

            vbox1.AddWidget(new QPushButton("Activate"));
            vbox1.AddWidget(new QPushButton("Close"), 0, AlignmentFlag.AlignTop);

            var hbox1 = new QHBoxLayout();

            hbox1.AddWidget(new QTextEdit()
            {
                Enabled = true
            });
            hbox1.AddLayout(vbox1);

            vbox.AddLayout(hbox1);

            var hbox2 = new QHBoxLayout();

            hbox2.AddWidget(new QPushButton("Help"));
            hbox2.AddStretch(1);
            hbox2.AddWidget(new QPushButton("OK"));

            vbox.AddLayout(hbox2, 1);

            return(vbox);
            //parentWidget.Layout = vbox;
        }
コード例 #2
0
        public void SetupUi(QWidget ConfirmConstraintWidget)
        {
            if (ConfirmConstraintWidget.ObjectName == "")
            {
                ConfirmConstraintWidget.ObjectName = "ConfirmConstraintWidget";
            }
            horizontalLayout         = new QHBoxLayout(ConfirmConstraintWidget);
            horizontalLayout.Spacing = 6;
            horizontalLayout.SetContentsMargins(0, 0, 0, 0);
            horizontalLayout.ObjectName     = "horizontalLayout";
            horizontalLayout.sizeConstraint = QLayout.SizeConstraint.SetNoConstraint;
            mCheckBox            = new QCheckBox(ConfirmConstraintWidget);
            mCheckBox.ObjectName = "mCheckBox";

            horizontalLayout.AddWidget(mCheckBox);

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

            horizontalLayout.AddItem(spacerItem);


            RetranslateUi(ConfirmConstraintWidget);

            QMetaObject.ConnectSlotsByName(ConfirmConstraintWidget);
        } // SetupUi
コード例 #3
0
        private QGroupBox InitToggleButtons()
        {
            var groupBox = new QGroupBox("Toggle Buttons", this);

            color                     = new QColor();
            redButton                 = new QPushButton("Red", this);
            greenButton               = new QPushButton("Green", this);
            blueButton                = new QPushButton("Blue", this);
            colorBoxWidget            = new QWidget(this);
            colorBoxWidget.StyleSheet = "QWidget { background-color: black }";

            redButton.Toggled   += OnToggled;
            greenButton.Toggled += OnToggled;
            blueButton.Toggled  += OnToggled;

            redButton.Checkable   = true;
            greenButton.Checkable = true;
            blueButton.Checkable  = true;

            QHBoxLayout hBox = new QHBoxLayout();
            QVBoxLayout vBox = new QVBoxLayout();

            vBox.AddWidget(redButton);
            vBox.AddWidget(greenButton);
            vBox.AddWidget(blueButton);

            hBox.AddLayout(vBox);
            hBox.AddWidget(colorBoxWidget);

            groupBox.Layout = hBox;

            return(groupBox);
        }
コード例 #4
0
        protected void SetupUi()
        {
            base.ObjectName  = "ChatWindow";
            this.Geometry    = new QRect(0, 0, 562, 331);
            this.WindowTitle = "Chat window";
            this.StyleSheet  = "";
            QHBoxLayout horizontalLayout;

            horizontalLayout            = new QHBoxLayout(this);
            horizontalLayout.Spacing    = 0;
            horizontalLayout.Margin     = 0;
            this.splitter_2             = new QSplitter(this);
            this.splitter_2.ObjectName  = "splitter_2";
            this.splitter_2.Orientation = Qt.Orientation.Horizontal;
            horizontalLayout.AddWidget(this.splitter_2);
            this.splitter            = new QSplitter(this.splitter_2);
            this.splitter.ObjectName = "splitter";
            QSizePolicy splitter_sizePolicy;

            splitter_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Expanding);
            splitter_sizePolicy.SetVerticalStretch(0);
            splitter_sizePolicy.SetHorizontalStretch(1);
            splitter_sizePolicy.SetHeightForWidth(this.splitter.SizePolicy.HasHeightForWidth());
            this.splitter.SizePolicy          = splitter_sizePolicy;
            this.splitter.Orientation         = Qt.Orientation.Vertical;
            this.splitter.OpaqueResize        = true;
            this.splitter.ChildrenCollapsible = false;
            this.splitter_2.AddWidget(this.splitter);
            this.m_ConversationWidget            = new Synapse.QtClient.Widgets.ConversationWidget(this.splitter);
            this.m_ConversationWidget.ObjectName = "m_ConversationWidget";
            this.m_ConversationWidget.Url        = new QUrl("about:blank");
            this.splitter.AddWidget(this.m_ConversationWidget);
            this.bottomContainer            = new QWidget(this.splitter);
            this.bottomContainer.ObjectName = "bottomContainer";
            QVBoxLayout verticalLayout;

            verticalLayout            = new QVBoxLayout(this.bottomContainer);
            verticalLayout.Spacing    = 0;
            verticalLayout.Margin     = 0;
            this.textEdit             = new Synapse.QtClient.Widgets.ConversationTextEdit(this.bottomContainer);
            this.textEdit.ObjectName  = "textEdit";
            this.textEdit.MinimumSize = new QSize(0, 40);
            this.textEdit.FrameShape  = QFrame.Shape.NoFrame;
            verticalLayout.AddWidget(this.textEdit);
            this.splitter.AddWidget(this.bottomContainer);
            this.rightContainer            = new QWidget(this.splitter_2);
            this.rightContainer.ObjectName = "rightContainer";
            QVBoxLayout verticalLayout_2;

            verticalLayout_2                 = new QVBoxLayout(this.rightContainer);
            verticalLayout_2.Margin          = 0;
            this.participantsGrid            = new Synapse.QtClient.Widgets.AvatarGrid <jabber.connection.RoomParticipant>(this.rightContainer);
            this.participantsGrid.ObjectName = "participantsGrid";
            this.participantsGrid.FrameShape = QFrame.Shape.NoFrame;
            this.participantsGrid.Alignment  = ((global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading") | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft")) | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignTop"));
            verticalLayout_2.AddWidget(this.participantsGrid);
            this.splitter_2.AddWidget(this.rightContainer);
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #5
0
ファイル: main.cs プロジェクト: micro-chen/qyoto
    public MyWidget(QWidget parent) : base(parent)
    {
        QPushButton quit = new QPushButton("&Quit");

        quit.Font = new QFont("Times", 18, (int)QFont.Weight.Bold);

        Connect(quit, SIGNAL("clicked()"), qApp, SLOT("quit()"));

        LCDRange angle = new LCDRange(null);

        angle.setRange(5,70);

        LCDRange force = new LCDRange(null);

        force.setRange(10,50);

        CannonField cannonField = new CannonField(null);

        Connect(angle,SIGNAL("valueChanged(int)"),
                cannonField,SLOT("setAngle(int)"));
        Connect(cannonField,SIGNAL("angleChanged(int)"),
                angle,SLOT("setValue(int)"));

        Connect(force,SIGNAL("valueChanged(int)"),
                cannonField,SLOT("setForce(int)"));
        Connect(cannonField,SIGNAL("forceChanged(int)"),
                force,SLOT("setValue(int)"));

        QPushButton shoot = new QPushButton("&Shoot");

        shoot.Font = new QFont("Times",18,(int)QFont.Weight.Bold);

        Connect(shoot,SIGNAL("clicked()"),cannonField,SLOT("shoot()"));

        QHBoxLayout topLayout = new QHBoxLayout();

        topLayout.AddWidget(shoot);
        topLayout.AddStretch(1);

        QVBoxLayout leftLayout = new QVBoxLayout();

        leftLayout.AddWidget(angle);
        leftLayout.AddWidget(force);

        QGridLayout gridLayout = new QGridLayout();

        gridLayout.AddWidget(quit,0,0);
        gridLayout.AddLayout(topLayout,0,1);
        gridLayout.AddLayout(leftLayout,1,0);
        gridLayout.AddWidget(cannonField,1,1,2,1);
        gridLayout.SetColumnStretch(1,10);
        SetLayout(gridLayout);

        angle.setValue(60);
        force.setValue(25);
        angle.SetFocus();
    }
コード例 #6
0
        protected void SetupUi()
        {
            base.ObjectName  = "DebugWindow";
            this.Geometry    = new QRect(0, 0, 518, 405);
            this.WindowTitle = "DebugWindow";
            QVBoxLayout verticalLayout;

            verticalLayout              = new QVBoxLayout(this);
            this.tabWidget              = new QTabWidget(this);
            this.tabWidget.ObjectName   = "tabWidget";
            this.tabWidget.CurrentIndex = 0;
            verticalLayout.AddWidget(this.tabWidget);
            this.tab            = new QWidget(this.tabWidget);
            this.tab.ObjectName = "tab";
            QVBoxLayout verticalLayout_3;

            verticalLayout_3             = new QVBoxLayout(this.tab);
            verticalLayout_3.Spacing     = 0;
            verticalLayout_3.Margin      = 0;
            this.m_XmlToolBox            = new QToolBox(this.tab);
            this.m_XmlToolBox.ObjectName = "m_XmlToolBox";
            QSizePolicy m_XmlToolBox_sizePolicy;

            m_XmlToolBox_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Expanding);
            m_XmlToolBox_sizePolicy.SetVerticalStretch(0);
            m_XmlToolBox_sizePolicy.SetHorizontalStretch(0);
            m_XmlToolBox_sizePolicy.SetHeightForWidth(this.m_XmlToolBox.SizePolicy.HasHeightForWidth());
            this.m_XmlToolBox.SizePolicy = m_XmlToolBox_sizePolicy;
            verticalLayout_3.AddWidget(this.m_XmlToolBox);
            this.line             = new QFrame(this.tab);
            this.line.ObjectName  = "line";
            this.line.FrameShape  = QFrame.Shape.HLine;
            this.line.FrameShadow = QFrame.Shadow.Sunken;
            verticalLayout_3.AddWidget(this.line);
            QHBoxLayout horizontalLayout;

            horizontalLayout = new QHBoxLayout();
            verticalLayout_3.AddLayout(horizontalLayout);
            horizontalLayout.sizeConstraint       = QLayout.SizeConstraint.SetDefaultConstraint;
            horizontalLayout.Margin               = 6;
            this.enableConsoleCheckBox            = new QCheckBox(this.tab);
            this.enableConsoleCheckBox.ObjectName = "enableConsoleCheckBox";
            this.enableConsoleCheckBox.Text       = "Enable";
            horizontalLayout.AddWidget(this.enableConsoleCheckBox);
            QSpacerItem horizontalSpacer;

            horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
            horizontalLayout.AddItem(horizontalSpacer);
            this.clearConsoleButton            = new QPushButton(this.tab);
            this.clearConsoleButton.ObjectName = "clearConsoleButton";
            this.clearConsoleButton.Text       = "Clear";
            horizontalLayout.AddWidget(this.clearConsoleButton);
            this.tabWidget.AddTab(this.tab, "XML Console");
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #7
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);
        }
コード例 #8
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
コード例 #9
0
            public TabBar(MainTabWidget parent) : base(parent)
            {
                base.SetStyleSheet(Util.ReadResource("mainwindow-tabs.qss"));
                var layout = new QHBoxLayout(this);

                layout.sizeConstraint = QLayout.SizeConstraint.SetNoConstraint;
                layout.Spacing        = 0;
                layout.Margin         = 0;
                layout.AddStretch(1);
                layout.AddWidget(new QSizeGrip(this), 0, (uint)AlignmentFlag.AlignBottom);

                base.MinimumWidth = 0;
            }
コード例 #10
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);
        }
コード例 #11
0
        private void InitUI()
        {
            QVBoxLayout vBox = new QVBoxLayout(this);
            QHBoxLayout hBox = new QHBoxLayout();

            QPushButton okBtn    = new QPushButton("Ok", this);
            QPushButton applyBtn = new QPushButton("Apply", this);

            hBox.AddWidget(okBtn, 1, AlignmentFlag.AlignRight);
            hBox.AddWidget(applyBtn);

            vBox.AddStretch(1);
            vBox.AddLayout(hBox);
        }
コード例 #12
0
        private void InitUI()
        {
            QVBoxLayout vBox = new QVBoxLayout (this);
            QHBoxLayout hBox = new QHBoxLayout ();

            QPushButton okBtn = new QPushButton ("Ok", this);
            QPushButton applyBtn = new QPushButton ("Apply", this);

            hBox.AddWidget (okBtn, 1, AlignmentFlag.AlignRight);
            hBox.AddWidget (applyBtn);

            vBox.AddStretch (1);
            vBox.AddLayout (hBox);
        }
コード例 #13
0
ファイル: MyWidget.cs プロジェクト: kuruntham/qyotoexamples
        private void InitiUI()
        {
            QPushButton okBtn = new QPushButton("Ok", this);
            QPushButton cancelBtn = new QPushButton("Cancel", this);

            QVBoxLayout vBoxLayout = new QVBoxLayout(this);
            QHBoxLayout hBoxLayout = new QHBoxLayout();

            hBoxLayout.AddStretch(1);
            hBoxLayout.AddWidget(okBtn);
            hBoxLayout.AddWidget(cancelBtn);

            vBoxLayout.AddStretch(1);
            vBoxLayout.AddLayout(hBoxLayout);
        }
コード例 #14
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);
        }
コード例 #15
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);
        }
コード例 #16
0
        protected void SetupUi()
        {
            base.ObjectName  = "ProfileWindow";
            this.Geometry    = new QRect(0, 0, 512, 436);
            this.WindowTitle = "ProfileWindow";
            QHBoxLayout horizontalLayout;

            horizontalLayout         = new QHBoxLayout(this);
            horizontalLayout.Spacing = 0;
            horizontalLayout.Margin  = 0;
            this.webView             = new QWebView(this);
            this.webView.ObjectName  = "webView";
            this.webView.Url         = new QUrl("about:blank");
            horizontalLayout.AddWidget(this.webView);
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #17
0
ファイル: AddOctyDialog.cs プロジェクト: xlizzard/synapse
        protected void SetupUi()
        {
            base.ObjectName  = "AddOctyDialog";
            this.Geometry    = new QRect(0, 0, 597, 409);
            this.WindowTitle = "Synapse is ready to go!";
            QHBoxLayout horizontalLayout;

            horizontalLayout         = new QHBoxLayout(this);
            horizontalLayout.Spacing = 0;
            horizontalLayout.Margin  = 0;
            this.webView             = new QWebView(this);
            this.webView.ObjectName  = "webView";
            this.webView.Url         = new QUrl("about:blank");
            horizontalLayout.AddWidget(this.webView);
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #18
0
        /// <summary>
        /// Generate
        /// </summary>
        /// <returns></returns>
        QLayout GenerateLayout()
        {
            //var vbox = new QVBoxLayout(parentWidget);
            var vbox = new QVBoxLayout();

            // demo list
            var splitter = new QSplitter();

            var vbox1 = new QVBoxLayout();
            // https://doc.qt.io/qt-5/qgroupbox.html#details

            // demo container
            var demoBox = new QGroupBox("demos");

            demoBox.Layout = new QHBoxLayout();

            this.demoWidgetContainer = demoBox;

            this._treeView = InitTreeView();

            GetDemoWidgetsList(this._treeView);

            splitter.AddWidget(this._treeView);
            splitter.AddWidget(demoBox);

            vbox.AddWidget(splitter);

            var bottomLayout = new QHBoxLayout();

            bottomLayout.AddWidget(new QPushButton("Help"));
            bottomLayout.AddWidget(new QPushButton("Activate"));
            var quitButton = new QPushButton("Quit");

            quitButton.Pressed += CloseButton_Pressed;
            bottomLayout.AddWidget(quitButton, 0, AlignmentFlag.AlignTop);

            bottomLayout.AddStretch(1);
            bottomLayout.AddWidget(new QPushButton("OK"));

            vbox.AddLayout(bottomLayout, 1);

            return(vbox);
        }
コード例 #19
0
        public override void InitUI()
        {
            var vbox = new QVBoxLayout(this);
            var hbox = new QHBoxLayout();

            var ok = new QPushButton("OK", this);

            ok.Clicked += Ok_Clicked;
            var apply = new QPushButton("Apply", this);

            apply.Clicked += Apply_Clicked;

            // Align buttonst to right
            hbox.AddWidget(ok, 1, AlignmentFlag.AlignRight);
            hbox.AddWidget(apply);

            vbox.AddWidget(textEditor);
            //vbox.AddStretch( 1 ); // blank space
            vbox.AddLayout(hbox);
        }
コード例 #20
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);
        }
コード例 #21
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);
            }
コード例 #22
0
        public void SetupUi(QWidget ConfirmConstraintWidget)
        {
            if (ConfirmConstraintWidget.ObjectName == "")
            ConfirmConstraintWidget.ObjectName = "ConfirmConstraintWidget";
            horizontalLayout = new QHBoxLayout(ConfirmConstraintWidget);
            horizontalLayout.Spacing = 6;
            horizontalLayout.SetContentsMargins(0, 0, 0, 0);
            horizontalLayout.ObjectName = "horizontalLayout";
            horizontalLayout.sizeConstraint = QLayout.SizeConstraint.SetNoConstraint;
            mCheckBox = new QCheckBox(ConfirmConstraintWidget);
            mCheckBox.ObjectName = "mCheckBox";

            horizontalLayout.AddWidget(mCheckBox);

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

            horizontalLayout.AddItem(spacerItem);

            RetranslateUi(ConfirmConstraintWidget);

            QMetaObject.ConnectSlotsByName(ConfirmConstraintWidget);
        }
コード例 #23
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);
        }
コード例 #24
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;
        }
コード例 #25
0
ファイル: MyWidget.cs プロジェクト: kuruntham/qyotoexamples
        public MyWidget()
        {
            Resize(300, 300);
            QVBoxLayout vBox1 = new QVBoxLayout(this);
            QHBoxLayout hBox = new QHBoxLayout();
            vBox1.AddLayout(hBox);

            QLineEdit txtCode = new QLineEdit(this);
            QLineEdit txtName = new QLineEdit(this);

            hBox.AddWidget(txtCode);
            hBox.AddWidget(txtName);

            tableView = new QTableView();
            tableView.MinimumHeight = 200;
            tableView.MinimumWidth = 300;
            tableModel = new TableModel();
            completer = new QCompleter(tableModel);
            completer.Popup = tableView;
            completer.CompletionColumn = 0;
            //completer.MaxVisibleItems = 5;

            tableView.HorizontalHeader.StretchLastSection = false;
            tableView.HorizontalHeader.Hide();
            tableView.VerticalHeader.Hide();
            tableView.VerticalHeader.SetResizeMode(QHeaderView.ResizeMode.Fixed);
            tableView.VerticalHeader.DefaultSectionSize = 24;
            tableView.EditTriggers = QAbstractItemView.EditTrigger.NoEditTriggers;
            tableView.HorizontalHeader.SetResizeMode(0, QHeaderView.ResizeMode.ResizeToContents);
            tableView.HorizontalHeader.SetResizeMode(1, QHeaderView.ResizeMode.Stretch);
            tableView.selectionBehavior = QAbstractItemView.SelectionBehavior.SelectRows;

            txtCode.Completer = completer;

            Show();
        }
コード例 #26
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;
        }
コード例 #27
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);
        }
コード例 #28
0
    public GameBoard(QWidget parent) : base(parent)
    {
        QPushButton quit = new QPushButton("&Quit");

        quit.Font = new QFont("Times", 18, (int)QFont.Weight.Bold);

        Connect(quit, SIGNAL("clicked()"), qApp, SLOT("quit()"));

        LCDRange angle = new LCDRange(Tr("ANGLE"));

        angle.setRange(5,70);

        LCDRange force = new LCDRange(Tr("FORCE"));

        force.setRange(10,50);

        cannonField = new CannonField();

        Connect(angle,SIGNAL("valueChanged(int)"),
                cannonField,SLOT("setAngle(int)"));
        Connect(cannonField,SIGNAL("angleChanged(int)"),
                angle,SLOT("setValue(int)"));

        Connect(force,SIGNAL("valueChanged(int)"),
                cannonField,SLOT("setForce(int)"));
        Connect(cannonField,SIGNAL("forceChanged(int)"),
                force,SLOT("setValue(int)"));

        Connect(cannonField,SIGNAL("hit()"),
                this,SLOT("hit()"));
        Connect(cannonField,SIGNAL("missed()"),
                this,SLOT("missed()"));

        QPushButton shoot = new QPushButton("&Shoot");

        shoot.Font = new QFont("Times",18,(int)QFont.Weight.Bold);

        Connect(shoot,SIGNAL("clicked()"),
                this,SLOT("fire()"));
        Connect(cannonField,SIGNAL("canShoot(bool)"),
                shoot,SLOT("setEnabled(bool)"));

        QPushButton restart = new QPushButton(Tr("&New Game"));

        restart.Font = new QFont("Times",18,(int)QFont.Weight.Bold);

        Connect(restart,SIGNAL("clicked()"),this,SLOT("newGame()"));

        hits = new QLCDNumber(2);
        hits.segmentStyle = QLCDNumber.SegmentStyle.Filled;

        shotsLeft = new QLCDNumber(2);
        shotsLeft.segmentStyle = QLCDNumber.SegmentStyle.Filled;

        QLabel hitsLabel      = new QLabel(Tr("HITS"));
        QLabel shotsLeftLabel = new QLabel(Tr("SHOTS LEFT"));

        QHBoxLayout topLayout = new QHBoxLayout();

        topLayout.AddWidget(shoot);
        topLayout.AddWidget(hits);
        topLayout.AddWidget(hitsLabel);
        topLayout.AddWidget(shotsLeft);
        topLayout.AddWidget(shotsLeftLabel);
        topLayout.AddStretch(1);
        topLayout.AddWidget(restart);

        QVBoxLayout leftLayout = new QVBoxLayout();

        leftLayout.AddWidget(angle);
        leftLayout.AddWidget(force);

        QGridLayout gridLayout = new QGridLayout();

        gridLayout.AddWidget(quit,0,0);
        gridLayout.AddLayout(topLayout,0,1);
        gridLayout.AddLayout(leftLayout,1,0);
        gridLayout.AddWidget(cannonField,1,1,2,1);
        gridLayout.SetColumnStretch(1,10);
        SetLayout(gridLayout);

        angle.setValue(60);
        force.setValue(25);
        angle.SetFocus();

        newGame();
    }
コード例 #29
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);
            }
コード例 #30
0
ファイル: AddFriendWindow.cs プロジェクト: xlizzard/synapse
        protected void SetupUi()
        {
            base.ObjectName  = "AddFriendWindow";
            this.Geometry    = new QRect(0, 0, 285, 349);
            this.WindowTitle = "AddFriend";
            QVBoxLayout verticalLayout;

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

            horizontalLayout = new QHBoxLayout();
            verticalLayout.AddLayout(horizontalLayout);
            QSpacerItem horizontalSpacer;

            horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
            horizontalLayout.AddItem(horizontalSpacer);
            this.closeButton            = new QPushButton(this);
            this.closeButton.ObjectName = "closeButton";
            this.closeButton.BaseSize   = new QSize(0, 0);
            this.closeButton.Text       = "";
            horizontalLayout.AddWidget(this.closeButton);
            this.stackedWidget              = new QStackedWidget(this);
            this.stackedWidget.ObjectName   = "stackedWidget";
            this.stackedWidget.CurrentIndex = 0;
            verticalLayout.AddWidget(this.stackedWidget);
            this.page            = new QWidget(this.stackedWidget);
            this.page.ObjectName = "page";
            QVBoxLayout verticalLayout_2;

            verticalLayout_2        = new QVBoxLayout(this.page);
            verticalLayout_2.Margin = 6;
            QSpacerItem verticalSpacer_2;

            verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
            verticalLayout_2.AddItem(verticalSpacer_2);
            this.pushButton            = new QPushButton(this.page);
            this.pushButton.ObjectName = "pushButton";
            this.pushButton.Text       = "Search && Add friends automatically...";
            verticalLayout_2.AddWidget(this.pushButton);
            this.pushButton_3            = new QPushButton(this.page);
            this.pushButton_3.ObjectName = "pushButton_3";
            this.pushButton_3.Text       = "Search for friends...";
            verticalLayout_2.AddWidget(this.pushButton_3);
            this.enterJidButton            = new QPushButton(this.page);
            this.enterJidButton.ObjectName = "enterJidButton";
            this.enterJidButton.Text       = "Enter friend's JID...";
            verticalLayout_2.AddWidget(this.enterJidButton);
            QSpacerItem verticalSpacer;

            verticalSpacer = new QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
            verticalLayout_2.AddItem(verticalSpacer);
            this.stackedWidget.AddWidget(this.page);
            this.page_2            = new QWidget(this.stackedWidget);
            this.page_2.ObjectName = "page_2";
            QVBoxLayout verticalLayout_3;

            verticalLayout_3        = new QVBoxLayout(this.page_2);
            verticalLayout_3.Margin = 6;
            QSpacerItem verticalSpacer_3;

            verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
            verticalLayout_3.AddItem(verticalSpacer_3);
            this.label_2            = new QLabel(this.page_2);
            this.label_2.ObjectName = "label_2";
            this.label_2.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;\">Add Friend</span></p></body></html>";
            verticalLayout_3.AddWidget(this.label_2);
            QGridLayout gridLayout;

            gridLayout = new QGridLayout();
            verticalLayout_3.AddLayout(gridLayout);
            this.label            = new QLabel(this.page_2);
            this.label.ObjectName = "label";
            this.label.Text       = "JID:";
            gridLayout.AddWidget(this.label, 0, 0, 1, 1);
            this.jidLineEdit            = new QLineEdit(this.page_2);
            this.jidLineEdit.ObjectName = "jidLineEdit";
            gridLayout.AddWidget(this.jidLineEdit, 0, 1, 1, 1);
            this.label_4            = new QLabel(this.page_2);
            this.label_4.ObjectName = "label_4";
            this.label_4.Text       = "Name:";
            gridLayout.AddWidget(this.label_4, 1, 0, 1, 1);
            this.nameLineEdit            = new QLineEdit(this.page_2);
            this.nameLineEdit.ObjectName = "nameLineEdit";
            gridLayout.AddWidget(this.nameLineEdit, 1, 1, 1, 1);
            this.label_3            = new QLabel(this.page_2);
            this.label_3.ObjectName = "label_3";
            this.label_3.Text       = "Add to Group(s):";
            verticalLayout_3.AddWidget(this.label_3);
            this.groupsWidget            = new Synapse.QtClient.Widgets.EditGroupsWidget(this.page_2);
            this.groupsWidget.ObjectName = "groupsWidget";
            verticalLayout_3.AddWidget(this.groupsWidget);
            this.buttonBox                 = new QDialogButtonBox(this.page_2);
            this.buttonBox.ObjectName      = "buttonBox";
            this.buttonBox.StandardButtons = global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "NoButton");
            verticalLayout_3.AddWidget(this.buttonBox);
            QSpacerItem verticalSpacer_4;

            verticalSpacer_4 = new QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
            verticalLayout_3.AddItem(verticalSpacer_4);
            this.stackedWidget.AddWidget(this.page_2);
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #31
0
        protected void SetupUi()
        {
            base.ObjectName  = "ErrorDialog";
            this.Geometry    = new QRect(0, 0, 400, 322);
            this.WindowTitle = "ErrorDialog";
            QVBoxLayout verticalLayout_2;

            verticalLayout_2 = new QVBoxLayout(this);
            verticalLayout_2.sizeConstraint = QLayout.SizeConstraint.SetFixedSize;
            verticalLayout_2.Margin         = 6;
            QHBoxLayout horizontalLayout_2;

            horizontalLayout_2 = new QHBoxLayout();
            verticalLayout_2.AddLayout(horizontalLayout_2);
            horizontalLayout_2.sizeConstraint = QLayout.SizeConstraint.SetFixedSize;
            this.iconLabel            = new QLabel(this);
            this.iconLabel.ObjectName = "iconLabel";
            QSizePolicy iconLabel_sizePolicy;

            iconLabel_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            iconLabel_sizePolicy.SetVerticalStretch(0);
            iconLabel_sizePolicy.SetHorizontalStretch(0);
            iconLabel_sizePolicy.SetHeightForWidth(this.iconLabel.SizePolicy.HasHeightForWidth());
            this.iconLabel.SizePolicy  = iconLabel_sizePolicy;
            this.iconLabel.MinimumSize = new QSize(48, 48);
            this.iconLabel.Text        = "";
            this.iconLabel.Alignment   = ((global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading") | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft")) | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignTop"));
            horizontalLayout_2.AddWidget(this.iconLabel);
            QVBoxLayout verticalLayout;

            verticalLayout = new QVBoxLayout();
            horizontalLayout_2.AddLayout(verticalLayout);
            verticalLayout.Spacing        = 6;
            verticalLayout.sizeConstraint = QLayout.SizeConstraint.SetFixedSize;
            this.titleLabel            = new QLabel(this);
            this.titleLabel.ObjectName = "titleLabel";
            QSizePolicy titleLabel_sizePolicy;

            titleLabel_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            titleLabel_sizePolicy.SetVerticalStretch(0);
            titleLabel_sizePolicy.SetHorizontalStretch(0);
            titleLabel_sizePolicy.SetHeightForWidth(this.titleLabel.SizePolicy.HasHeightForWidth());
            this.titleLabel.SizePolicy = titleLabel_sizePolicy;
            this.titleLabel.Text       = "<b>Title</b>";
            this.titleLabel.WordWrap   = true;
            verticalLayout.AddWidget(this.titleLabel);
            this.messageLabel            = new QLabel(this);
            this.messageLabel.ObjectName = "messageLabel";
            QSizePolicy messageLabel_sizePolicy;

            messageLabel_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            messageLabel_sizePolicy.SetVerticalStretch(0);
            messageLabel_sizePolicy.SetHorizontalStretch(0);
            messageLabel_sizePolicy.SetHeightForWidth(this.messageLabel.SizePolicy.HasHeightForWidth());
            this.messageLabel.SizePolicy = messageLabel_sizePolicy;
            this.messageLabel.Text       = "Message";
            this.messageLabel.WordWrap   = true;
            verticalLayout.AddWidget(this.messageLabel);
            this.showDetailsButtonContainer            = new QWidget(this);
            this.showDetailsButtonContainer.ObjectName = "showDetailsButtonContainer";
            QSizePolicy showDetailsButtonContainer_sizePolicy;

            showDetailsButtonContainer_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            showDetailsButtonContainer_sizePolicy.SetVerticalStretch(0);
            showDetailsButtonContainer_sizePolicy.SetHorizontalStretch(0);
            showDetailsButtonContainer_sizePolicy.SetHeightForWidth(this.showDetailsButtonContainer.SizePolicy.HasHeightForWidth());
            this.showDetailsButtonContainer.SizePolicy = showDetailsButtonContainer_sizePolicy;
            QHBoxLayout horizontalLayout;

            horizontalLayout                  = new QHBoxLayout(this.showDetailsButtonContainer);
            horizontalLayout.Margin           = 0;
            this.showDetailsButton            = new QPushButton(this.showDetailsButtonContainer);
            this.showDetailsButton.ObjectName = "showDetailsButton";
            this.showDetailsButton.Text       = "Show Details";
            this.showDetailsButton.Checkable  = true;
            horizontalLayout.AddWidget(this.showDetailsButton);
            QSpacerItem horizontalSpacer;

            horizontalSpacer = new QSpacerItem(223, 17, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
            horizontalLayout.AddItem(horizontalSpacer);
            verticalLayout.AddWidget(this.showDetailsButtonContainer);
            this.detailsTextEdit            = new QPlainTextEdit(this);
            this.detailsTextEdit.ObjectName = "detailsTextEdit";
            this.detailsTextEdit.ReadOnly   = true;
            verticalLayout.AddWidget(this.detailsTextEdit);
            this.buttonBox                 = new QDialogButtonBox(this);
            this.buttonBox.ObjectName      = "buttonBox";
            this.buttonBox.Orientation     = Qt.Orientation.Horizontal;
            this.buttonBox.StandardButtons = global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Close");
            verticalLayout_2.AddWidget(this.buttonBox);
            QObject.Connect(buttonBox, Qt.SIGNAL("accepted()"), this, Qt.SLOT("accept()"));
            QObject.Connect(buttonBox,Qt.SIGNAL("rejected()"),this,Qt.SLOT("reject()"));
            QObject.Connect(showDetailsButton,Qt.SIGNAL("toggled(bool)"),detailsTextEdit,Qt.SLOT("setVisible(bool)"));
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #32
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);
        }
コード例 #33
0
ファイル: EditAccountDialog.cs プロジェクト: xlizzard/synapse
 protected void SetupUi() {
     base.ObjectName = "EditAccountDialog";
     this.Geometry = new QRect(0, 0, 343, 261);
     this.WindowTitle = "Edit Account";
     this.Modal = true;
     QVBoxLayout verticalLayout;
     verticalLayout = new QVBoxLayout(this);
     verticalLayout.Margin = 6;
     this.tabWidget = new QTabWidget(this);
     this.tabWidget.ObjectName = "tabWidget";
     this.tabWidget.Enabled = true;
     this.tabWidget.CurrentIndex = 3;
     verticalLayout.AddWidget(this.tabWidget);
     this.tab = new QWidget(this.tabWidget);
     this.tab.ObjectName = "tab";
     QVBoxLayout verticalLayout_2;
     verticalLayout_2 = new QVBoxLayout(this.tab);
     verticalLayout_2.Margin = 6;
     QFormLayout formLayout;
     formLayout = new QFormLayout();
     verticalLayout_2.AddLayout(formLayout);
     this.label = new QLabel(this.tab);
     this.label.ObjectName = "label";
     this.label.Text = "Jabber ID:";
     formLayout.SetWidget(0, QFormLayout.ItemRole.LabelRole, this.label);
     this.jidLineEdit = new QLineEdit(this.tab);
     this.jidLineEdit.ObjectName = "jidLineEdit";
     formLayout.SetWidget(0, QFormLayout.ItemRole.FieldRole, this.jidLineEdit);
     this.label_2 = new QLabel(this.tab);
     this.label_2.ObjectName = "label_2";
     this.label_2.Text = "Password:"******"passwordLineEdit";
     this.passwordLineEdit.echoMode = QLineEdit.EchoMode.Password;
     formLayout.SetWidget(1, QFormLayout.ItemRole.FieldRole, this.passwordLineEdit);
     this.label_3 = new QLabel(this.tab);
     this.label_3.ObjectName = "label_3";
     this.label_3.Text = "Resource:";
     formLayout.SetWidget(2, QFormLayout.ItemRole.LabelRole, this.label_3);
     this.resourceCombo = new QComboBox(this.tab);
     this.resourceCombo.ObjectName = "resourceCombo";
     this.resourceCombo.Editable = true;
     formLayout.SetWidget(2, QFormLayout.ItemRole.FieldRole, this.resourceCombo);
     this.resourceCombo.InsertItems(0, new System.Collections.Generic.List<string>(new string[] {
                     "Home Computer",
                     "Work Computer",
                     "Laptop"}));
     QSpacerItem verticalSpacer;
     verticalSpacer = new QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
     verticalLayout_2.AddItem(verticalSpacer);
     this.widget = new QWidget(this.tab);
     this.widget.ObjectName = "widget";
     QHBoxLayout horizontalLayout;
     horizontalLayout = new QHBoxLayout(this.widget);
     horizontalLayout.Margin = 0;
     this.pushButton = new QPushButton(this.widget);
     this.pushButton.ObjectName = "pushButton";
     this.pushButton.Enabled = false;
     this.pushButton.Text = "Change Password...";
     horizontalLayout.AddWidget(this.pushButton);
     QSpacerItem horizontalSpacer;
     horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
     horizontalLayout.AddItem(horizontalSpacer);
     verticalLayout_2.AddWidget(this.widget);
     this.tabWidget.AddTab(this.tab, "Account");
     this.tab_4 = new QWidget(this.tabWidget);
     this.tab_4.ObjectName = "tab_4";
     QVBoxLayout verticalLayout_3;
     verticalLayout_3 = new QVBoxLayout(this.tab_4);
     verticalLayout_3.Margin = 6;
     this.label_5 = new QLabel(this.tab_4);
     this.label_5.ObjectName = "label_5";
     this.label_5.Text = "Synapse will attempt to automatically discover your connect server if you leave this field blank.";
     this.label_5.WordWrap = true;
     verticalLayout_3.AddWidget(this.label_5);
     QFormLayout formLayout_2;
     formLayout_2 = new QFormLayout();
     verticalLayout_3.AddLayout(formLayout_2);
     this.label_4 = new QLabel(this.tab_4);
     this.label_4.ObjectName = "label_4";
     this.label_4.Text = "Connect Server:";
     formLayout_2.SetWidget(0, QFormLayout.ItemRole.LabelRole, this.label_4);
     this.serverLineEdit = new QLineEdit(this.tab_4);
     this.serverLineEdit.ObjectName = "serverLineEdit";
     formLayout_2.SetWidget(0, QFormLayout.ItemRole.FieldRole, this.serverLineEdit);
     this.label_6 = new QLabel(this.tab_4);
     this.label_6.ObjectName = "label_6";
     this.label_6.Text = "Port:";
     formLayout_2.SetWidget(1, QFormLayout.ItemRole.LabelRole, this.label_6);
     this.portSpinBox = new QSpinBox(this.tab_4);
     this.portSpinBox.ObjectName = "portSpinBox";
     this.portSpinBox.Maximum = 9999999;
     this.portSpinBox.SingleStep = 1;
     this.portSpinBox.Value = 5222;
     formLayout_2.SetWidget(1, QFormLayout.ItemRole.FieldRole, this.portSpinBox);
     this.label_7 = new QLabel(this.tab_4);
     this.label_7.ObjectName = "label_7";
     this.label_7.Enabled = false;
     this.label_7.Text = "Note that the server must support TLS encryption.";
     this.label_7.Alignment = ((global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading") | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft")) | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignVCenter"));
     verticalLayout_3.AddWidget(this.label_7);
     QSpacerItem verticalSpacer_2;
     verticalSpacer_2 = new QSpacerItem(20, 170, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
     verticalLayout_3.AddItem(verticalSpacer_2);
     this.tabWidget.AddTab(this.tab_4, "Server");
     this.tab_2 = new QWidget(this.tabWidget);
     this.tab_2.ObjectName = "tab_2";
     QVBoxLayout verticalLayout_4;
     verticalLayout_4 = new QVBoxLayout(this.tab_2);
     verticalLayout_4.Margin = 6;
     this.autoConnectCheckBox = new QCheckBox(this.tab_2);
     this.autoConnectCheckBox.ObjectName = "autoConnectCheckBox";
     this.autoConnectCheckBox.Text = "Connect Automatically";
     verticalLayout_4.AddWidget(this.autoConnectCheckBox);
     QSpacerItem verticalSpacer_3;
     verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
     verticalLayout_4.AddItem(verticalSpacer_3);
     this.tabWidget.AddTab(this.tab_2, "Options");
     this.tab_3 = new QWidget(this.tabWidget);
     this.tab_3.ObjectName = "tab_3";
     QVBoxLayout verticalLayout_5;
     verticalLayout_5 = new QVBoxLayout(this.tab_3);
     verticalLayout_5.Margin = 6;
     QFormLayout formLayout_3;
     formLayout_3 = new QFormLayout();
     verticalLayout_5.AddLayout(formLayout_3);
     formLayout_3.fieldGrowthPolicy = QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow;
     this.label_9 = new QLabel(this.tab_3);
     this.label_9.ObjectName = "label_9";
     this.label_9.Text = "&Type:";
     formLayout_3.SetWidget(0, QFormLayout.ItemRole.LabelRole, this.label_9);
     this.comboBox = new QComboBox(this.tab_3);
     this.comboBox.ObjectName = "comboBox";
     formLayout_3.SetWidget(0, QFormLayout.ItemRole.FieldRole, this.comboBox);
     this.comboBox.InsertItems(0, new System.Collections.Generic.List<string>(new string[] {
                     "Use System Settings (DOES NOT WORK)",
                     "No Proxy",
                     "HTTP",
                     "SOCKS4",
                     "SOCKS5"}));
     this.proxyHostLabel = new QLabel(this.tab_3);
     this.proxyHostLabel.ObjectName = "proxyHostLabel";
     this.proxyHostLabel.Enabled = true;
     this.proxyHostLabel.Text = "&Host:";
     formLayout_3.SetWidget(2, QFormLayout.ItemRole.LabelRole, this.proxyHostLabel);
     this.proxyHostLineEdit = new QLineEdit(this.tab_3);
     this.proxyHostLineEdit.ObjectName = "proxyHostLineEdit";
     this.proxyHostLineEdit.Enabled = true;
     formLayout_3.SetWidget(2, QFormLayout.ItemRole.FieldRole, this.proxyHostLineEdit);
     this.proxyPortLabel = new QLabel(this.tab_3);
     this.proxyPortLabel.ObjectName = "proxyPortLabel";
     this.proxyPortLabel.Enabled = true;
     this.proxyPortLabel.Text = "&Port:";
     formLayout_3.SetWidget(3, QFormLayout.ItemRole.LabelRole, this.proxyPortLabel);
     this.proxyPortSpinBox = new QSpinBox(this.tab_3);
     this.proxyPortSpinBox.ObjectName = "proxyPortSpinBox";
     this.proxyPortSpinBox.Enabled = true;
     this.proxyPortSpinBox.Maximum = 66666;
     formLayout_3.SetWidget(3, QFormLayout.ItemRole.FieldRole, this.proxyPortSpinBox);
     this.proxyUserLabel = new QLabel(this.tab_3);
     this.proxyUserLabel.ObjectName = "proxyUserLabel";
     this.proxyUserLabel.Enabled = true;
     this.proxyUserLabel.Text = "&Username:"******"proxyUserLineEdit";
     this.proxyUserLineEdit.Enabled = true;
     formLayout_3.SetWidget(4, QFormLayout.ItemRole.FieldRole, this.proxyUserLineEdit);
     this.proxyPassLabel = new QLabel(this.tab_3);
     this.proxyPassLabel.ObjectName = "proxyPassLabel";
     this.proxyPassLabel.Enabled = true;
     this.proxyPassLabel.Text = "Pa&ssword:";
     formLayout_3.SetWidget(5, QFormLayout.ItemRole.LabelRole, this.proxyPassLabel);
     this.proxyPassLineEdit = new QLineEdit(this.tab_3);
     this.proxyPassLineEdit.ObjectName = "proxyPassLineEdit";
     this.proxyPassLineEdit.Enabled = true;
     formLayout_3.SetWidget(5, QFormLayout.ItemRole.FieldRole, this.proxyPassLineEdit);
     this.line = new QFrame(this.tab_3);
     this.line.ObjectName = "line";
     this.line.FrameShape = QFrame.Shape.HLine;
     this.line.FrameShadow = QFrame.Shadow.Sunken;
     formLayout_3.SetWidget(1, QFormLayout.ItemRole.LabelRole, this.line);
     QSpacerItem verticalSpacer_4;
     verticalSpacer_4 = new QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding);
     verticalLayout_5.AddItem(verticalSpacer_4);
     this.tabWidget.AddTab(this.tab_3, "Proxy");
     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);
     this.label_9.SetBuddy(comboBox);
     this.proxyHostLabel.SetBuddy(proxyHostLineEdit);
     this.proxyPortLabel.SetBuddy(proxyPortSpinBox);
     this.proxyUserLabel.SetBuddy(proxyUserLineEdit);
     this.proxyPassLabel.SetBuddy(proxyPassLineEdit);
 }
コード例 #34
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);
        } // SetupUi
コード例 #35
0
        public TabbedChatsWindow()
        {
            // FIXME: This doesn't work very well in most themes...
            //this.SetStyleSheet("QTabWidget::pane { border: 0px; }");

            // The tab widget messes up this background color.
            this.SetStyleSheet("QTabWidget > QWidget { background: palette(window); }");

            m_Tabs             = new QTabWidget();
            m_Tabs.tabPosition = QTabWidget.TabPosition.South;

            QToolButton newTabButton = new QToolButton(m_Tabs);

            newTabButton.AutoRaise = true;
            newTabButton.SetDefaultAction(new QAction(Gui.LoadIcon("tab-new", 16), "New Tab", newTabButton));
            newTabButton.SetToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly);
            QObject.Connect <QAction>(newTabButton, Qt.SIGNAL("triggered(QAction*)"), HandleNewTab);
            m_Tabs.SetCornerWidget(newTabButton, Qt.Corner.BottomLeftCorner);

            QHBoxLayout rightButtonsLayout = new QHBoxLayout();

            rightButtonsLayout.SetContentsMargins(0, 0, 0, 0);
            rightButtonsLayout.Spacing = 0;

            QToolButton closeTabButton = new QToolButton(m_Tabs);

            closeTabButton.SetToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly);
            closeTabButton.AutoRaise = true;
            closeTabButton.SetDefaultAction(new QAction(Gui.LoadIcon("window-close", 16), "Close Tab", closeTabButton));
            QObject.Connect <QAction>(closeTabButton, Qt.SIGNAL("triggered(QAction*)"), HandleCloseTab);
            rightButtonsLayout.AddWidget(closeTabButton);

            QMenu menu = new QMenu(this);

            menu.AddAction(new QIcon(), "No Recently Closed Tabs");

            QToolButton trashButton = new QToolButton(m_Tabs);

            trashButton.SetToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly);
            trashButton.AutoRaise = true;
            trashButton.PopupMode = QToolButton.ToolButtonPopupMode.InstantPopup;
            trashButton.SetMenu(menu);
            trashButton.SetDefaultAction(new QAction(Gui.LoadIcon("user-trash", 16), "Recently Closed Tabs", trashButton));
            rightButtonsLayout.AddWidget(trashButton);

            // FIXME: This looks bad.
            //rightButtonsLayout.AddWidget(new QSizeGrip(this));

            QWidget rightButtonsContainer = new QWidget(m_Tabs);

            rightButtonsContainer.SetLayout(rightButtonsLayout);
            m_Tabs.SetCornerWidget(rightButtonsContainer, Qt.Corner.BottomRightCorner);

            QVBoxLayout layout = new QVBoxLayout(this);

            layout.SetContentsMargins(0, 0, 0, 0);
            layout.AddWidget(m_Tabs, 1, 0);
            this.SetLayout(layout);

            QObject.Connect <int>(m_Tabs, Qt.SIGNAL("currentChanged(int)"), HandleCurrentChanged);

            this.SetGeometry(0, 0, 445, 370);
            Gui.CenterWidgetOnScreen(this);

            QAction closeAction = new QAction(this);

            QObject.Connect <bool>(closeAction, Qt.SIGNAL("triggered(bool)"), HandleCloseActionTriggered);
            closeAction.Shortcut = new QKeySequence("Ctrl+w");
            this.AddAction(closeAction);

            0.UpTo(9).ForEach(num => {
                QAction action  = new QAction(this);
                action.Shortcut = new QKeySequence("Alt+" + num.ToString());
                QObject.Connect(action, Qt.SIGNAL("triggered(bool)"), delegate {
                    m_Tabs.CurrentIndex = num - 1;
                });
                this.AddAction(action);
            });

            QAction nextTabAction = new QAction(this);

            nextTabAction.Shortcut = new QKeySequence(QKeySequence.StandardKey.NextChild);
            QObject.Connect(nextTabAction, Qt.SIGNAL("triggered(bool)"), delegate {
                if (m_Tabs.CurrentIndex == m_Tabs.Count - 1)
                {
                    m_Tabs.CurrentIndex = 0;
                }
                else
                {
                    m_Tabs.CurrentIndex += 1;
                }
            });
            this.AddAction(nextTabAction);

            QAction prevTabAction = new QAction(this);

            prevTabAction.Shortcut = new QKeySequence(QKeySequence.StandardKey.PreviousChild);
            QObject.Connect(prevTabAction, Qt.SIGNAL("triggered(bool)"), delegate {
                if (m_Tabs.CurrentIndex == 0)
                {
                    m_Tabs.CurrentIndex = m_Tabs.Count - 1;
                }
                else
                {
                    m_Tabs.CurrentIndex -= 1;
                }
            });

            var accountService = ServiceManager.Get <AccountService>();

            accountService.AccountAdded   += HandleAccountAdded;
            accountService.AccountRemoved += HandleAccountRemoved;
            foreach (Account account in accountService.Accounts)
            {
                HandleAccountAdded(account);
            }

            var settingsService = ServiceManager.Get <SettingsService>();

            if (settingsService.Has("ChatsWindowGeometry"))
            {
                var geometry = settingsService.Get <byte[]>("ChatsWindowGeometry");
                base.RestoreGeometry(QByteArrayConverter.FromArray(geometry));
            }
        }
コード例 #36
0
ファイル: ChatWindow.cs プロジェクト: xlizzard/synapse
        internal ChatWindow(IChatHandler handler)
        {
            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }
            m_Handler = handler;

            var settingsService = ServiceManager.Get <SettingsService>();

            SetupUi();

            if (handler is MucHandler)
            {
                m_ParticipantsMenu = new QMenu(this);
                QObject.Connect(m_ParticipantsMenu, Qt.SIGNAL("aboutToShow()"), HandleMenuAboutToShow);
                QObject.Connect(m_ParticipantsMenu, Qt.SIGNAL("aboutToHide()"), HandleMenuAboutToHide);

                var mucHandler = (MucHandler)handler;
                participantsGrid.Model             = mucHandler.GridModel;
                participantsGrid.ContextMenuPolicy = Qt.ContextMenuPolicy.CustomContextMenu;
                participantsGrid.ItemActivated    += HandleItemActivated;

                participantsGrid.ListMode = settingsService.Get <bool>("MucListMode");
                if (settingsService.Has("MucIconSize"))
                {
                    participantsGrid.IconSize = settingsService.Get <int>("MucIconSize");
                }

                var group = new QActionGroup(this);

                var gridModeAction = new QAction("View as Grid", this);
                QObject.Connect(gridModeAction, Qt.SIGNAL("triggered()"), HandleGridModeActionTriggered);
                gridModeAction.SetActionGroup(group);
                gridModeAction.Checkable = true;
                gridModeAction.Checked   = true;
                m_ParticipantsMenu.AddAction(gridModeAction);

                var listModeAction = new QAction("View as List", this);
                QObject.Connect(listModeAction, Qt.SIGNAL("triggered()"), HandleListModeActionTriggered);
                listModeAction.SetActionGroup(group);
                listModeAction.Checkable = true;
                listModeAction.Checked   = participantsGrid.ListMode;
                m_ParticipantsMenu.AddAction(listModeAction);

                var separatorAction = new QAction(participantsGrid);
                separatorAction.SetSeparator(true);
                m_ParticipantsMenu.AddAction(separatorAction);

                var sliderAction = new AvatarGridZoomAction <jabber.connection.RoomParticipant>(participantsGrid);
                sliderAction.ValueChanged += delegate(int value) {
                    participantsGrid.IconSize = value;
                    settingsService.Set("MucIconSize", value);
                };
                m_ParticipantsMenu.AddAction(sliderAction);

                m_ParticipantItemMenu = new QMenu(this);
                QObject.Connect(m_ParticipantItemMenu, Qt.SIGNAL("aboutToShow()"), HandleMenuAboutToShow);
                QObject.Connect(m_ParticipantItemMenu, Qt.SIGNAL("aboutToHide()"), HandleMenuAboutToHide);

                var mucViewProfileAction = new QAction("View Profile", this);
                QObject.Connect(mucViewProfileAction, Qt.SIGNAL("triggered()"), HandleMucViewProfileActionTriggered);
                m_ParticipantItemMenu.AddAction(mucViewProfileAction);

                var mucPrivateMessageAction = new QAction("IM", this);
                QObject.Connect(mucPrivateMessageAction, Qt.SIGNAL("triggered()"), HandleMucPrivateMessageTriggered);
                m_ParticipantItemMenu.AddAction(mucPrivateMessageAction);

                var mucSendFileAction = new QAction("Send File...", this);
                QObject.Connect(mucSendFileAction, Qt.SIGNAL("triggered()"), HandleMucSendFileActionTriggered);
                m_ParticipantItemMenu.AddAction(mucSendFileAction);

                var mucViewHistoryAction = new QAction("View History", this);
                QObject.Connect(mucViewHistoryAction, Qt.SIGNAL("triggered()"), HandleMucViewHistoryActionTriggered);
                m_ParticipantItemMenu.AddAction(mucViewHistoryAction);

                m_ModeratorActionsMenu = new QMenu("Moderator Actions", this);

                var roomRoleActionGroup = new QActionGroup(this);
                QObject.Connect(roomRoleActionGroup, Qt.SIGNAL("triggered(QAction*)"), this, Qt.SLOT("HandleRoomRoleActionGroupTriggered(QAction*)"));

                m_ModeratorAction = new QAction("Moderator",this);
                roomRoleActionGroup.AddAction(m_ModeratorAction);
                m_ModeratorAction.Checkable = true;
                m_ModeratorActionsMenu.AddAction(m_ModeratorAction);

                m_ParticipantAction = new QAction("Participant",this);
                roomRoleActionGroup.AddAction(m_ParticipantAction);
                m_ParticipantAction.Checkable = true;
                m_ModeratorActionsMenu.AddAction(m_ParticipantAction);

                m_VisitorAction = new QAction("Visitor",this);
                roomRoleActionGroup.AddAction(m_VisitorAction);
                m_VisitorAction.Checkable = true;
                m_ModeratorActionsMenu.AddAction(m_VisitorAction);

                m_ModeratorActionsMenu.AddSeparator();

                var mucKickAction = new QAction("Kick...",this);
                QObject.Connect(mucKickAction,Qt.SIGNAL("triggered()"),HandleMucKickActionTriggered);
                m_ModeratorActionsMenu.AddAction(mucKickAction);

                var mucBanAction = new QAction("Ban...",this);
                QObject.Connect(mucBanAction,Qt.SIGNAL("triggered()"),HandleMucBanActionTriggered);
                m_ModeratorActionsMenu.AddAction(mucBanAction);

                m_ModeratorActionsMenu.AddSeparator();

                m_ChangeAffiliationAction = new QAction("Change Affiliation...",this);
                QObject.Connect(m_ChangeAffiliationAction,Qt.SIGNAL("triggered()"),HandleChangeAffiliationTriggered);
                m_ModeratorActionsMenu.AddAction(m_ChangeAffiliationAction);

                m_ParticipantItemMenu.AddSeparator();
                m_ParticipantItemMenu.AddMenu(m_ModeratorActionsMenu);

                m_ParticipantItemMenu.AddSeparator();

                m_AddAsFriendAction = new QAction("Add as Friend",this);
                m_ParticipantItemMenu.AddAction(m_AddAsFriendAction);

                this.WindowTitle = mucHandler.Room.JID.User;                 // FIXME: Show only "user" in tab, show full room jid in title?
                this.WindowIcon  = Gui.LoadIcon("internet-group-chat");
            }
            else
            {
                var chatHandler = (ChatHandler)handler;
                rightContainer.Hide();

                if (((ChatHandler)handler).IsMucMessage)
                {
                    this.WindowTitle = chatHandler.Jid.Resource;
                }
                else
                {
                    this.WindowTitle = chatHandler.Account.GetDisplayName(chatHandler.Jid);
                }
                this.WindowIcon = new QIcon((QPixmap)Synapse.Xmpp.AvatarManager.GetAvatar(chatHandler.Jid));
            }

            m_ConversationWidget.ChatHandler = handler;

            handler.ReadyChanged += HandleReadyChanged;

            splitter.SetStretchFactor(1,0);
            splitter_2.SetStretchFactor(1,0);

            if (settingsService.Has("MucSplitterState"))
            {
                byte[] state = settingsService.Get <byte[]>("MucSplitterState");
                splitter_2.RestoreState(QByteArrayConverter.FromArray(state));
            }

            KeyPressEater eater = new KeyPressEater(this);

            eater.KeyEvent += HandleKeyEvent;
            textEdit.InstallEventFilter(eater);

            QToolBar toolbar = new QToolBar(this);

            toolbar.IconSize = new QSize(16,16);

            var formatMenuButton = new QToolButton(this);

            var formatMenu = new QMenu(this);

            QObject.Connect <QAction>(formatMenu,Qt.SIGNAL("triggered(QAction*)"),HandleFormatMenuActionTriggered);
            formatMenuButton.ToolButtonStyle = ToolButtonStyle.ToolButtonTextBesideIcon;
            formatMenuButton.Text            = "Format";
            formatMenuButton.icon            = Gui.LoadIcon("preferences-desktop-font",16);
            formatMenuButton.PopupMode       = QToolButton.ToolButtonPopupMode.InstantPopup;
            formatMenuButton.SetMenu(formatMenu);
            toolbar.AddWidget(formatMenuButton);

            m_BoldAction           = new QAction(Gui.LoadIcon("format-text-bold",16),"Bold",this);
            m_BoldAction.Shortcut  = "Ctrl+B";
            m_BoldAction.Checkable = true;
            formatMenu.AddAction(m_BoldAction);

            m_ItalicAction           = new QAction(Gui.LoadIcon("format-text-italic",16),"Italic",this);
            m_ItalicAction.Shortcut  = "Ctrl+I";
            m_ItalicAction.Checkable = true;
            formatMenu.AddAction(m_ItalicAction);

            m_UnderlineAction           = new QAction(Gui.LoadIcon("format-text-underline",16),"Underline",this);
            m_UnderlineAction.Shortcut  = "Ctrl+U";
            m_UnderlineAction.Checkable = true;
            formatMenu.AddAction(m_UnderlineAction);

            m_StrikethroughAction           = new QAction(Gui.LoadIcon("format-text-strikethrough",16),"Strikethrough",this);
            m_StrikethroughAction.Shortcut  = "Ctrl+S";
            m_StrikethroughAction.Checkable = true;
            formatMenu.AddAction(m_StrikethroughAction);

            formatMenu.AddSeparator();

            m_ClearFormattingAction = new QAction(Gui.LoadIcon("edit-clear",16),"Clear Formatting",this);
            formatMenu.AddAction(m_ClearFormattingAction);

            var insertMenu       = new QMenu(this);
            var insertMenuButton = new QToolButton(this);

            insertMenuButton.ToolButtonStyle = ToolButtonStyle.ToolButtonTextBesideIcon;
            insertMenuButton.Text            = "Insert";
            insertMenuButton.icon            = Gui.LoadIcon("image-x-generic",16);
            insertMenuButton.PopupMode       = QToolButton.ToolButtonPopupMode.InstantPopup;
            insertMenuButton.SetMenu(insertMenu);
            toolbar.AddWidget(insertMenuButton);

            m_InsertPhotoAction = new QAction(Gui.LoadIcon("insert-image",16),"Photo...",this);
            QObject.Connect(m_InsertPhotoAction,Qt.SIGNAL("triggered()"),HandleInsertImageActionTriggered);
            insertMenu.AddAction(m_InsertPhotoAction);

            m_InsertLinkAction = new QAction(Gui.LoadIcon("insert-link",16),"Link...",this);
            QObject.Connect(m_InsertLinkAction,Qt.SIGNAL("triggered()"),HandleInsertLinkActionTriggered);
            insertMenu.AddAction(m_InsertLinkAction);

            foreach (IActionCodon node in AddinManager.GetExtensionNodes("/Synapse/QtClient/ChatWindow/InsertActions"))
            {
                insertMenu.AddAction((QAction)node.CreateInstance(this));
            }

            toolbar.AddSeparator();

            var activitiesMenu       = new QMenu(this);
            var activitiesMenuButton = new QToolButton(this);

            activitiesMenuButton.ToolButtonStyle = ToolButtonStyle.ToolButtonTextBesideIcon;
            activitiesMenuButton.Text            = "Activities";
            activitiesMenuButton.icon            = Gui.LoadIcon("applications-games",16);   // FIXME: Not a good icon.
            activitiesMenuButton.PopupMode       = QToolButton.ToolButtonPopupMode.InstantPopup;
            activitiesMenuButton.SetMenu(activitiesMenu);
            toolbar.AddWidget(activitiesMenuButton);

            m_InviteToMucAction = new QAction(Gui.LoadIcon("internet-group-chat",16),"Invite to Conference...",this);
            QObject.Connect(m_InviteToMucAction,Qt.SIGNAL("triggered()"),HandleInviteToMucActionTriggered);
            activitiesMenu.AddAction(m_InviteToMucAction);
            activitiesMenu.AddSeparator();

            activitiesMenu.AddAction(Gui.LoadIcon("applications-graphics",16),"Launch Whiteboard...");
            activitiesMenu.AddAction(Gui.LoadIcon("user-desktop",16),"Share Desktop...");

            var spacerWidget = new QWidget(toolbar);

            spacerWidget.SetSizePolicy(QSizePolicy.Policy.Expanding,QSizePolicy.Policy.Fixed);
            toolbar.AddWidget(spacerWidget);

            var toContainer = new QWidget(toolbar);
            var layout      = new QHBoxLayout(toContainer);

            layout.SetContentsMargins(0,0,4,0);

            m_ToComboBox = new QComboBox(toContainer);

            layout.AddWidget(new QLabel("To:",toContainer));
            layout.AddWidget(m_ToComboBox);

            QAction toWidgetAction = (QWidgetAction)toolbar.AddWidget(toContainer);

            m_ToComboBox.AddItem("Automatic","auto");
            m_ToComboBox.InsertSeparator(1);

            ((QVBoxLayout)bottomContainer.Layout()).InsertWidget(0,toolbar);

            if (handler is ChatHandler)
            {
                var chatHandler = (ChatHandler)handler;
                handler.Account.Client.OnPresence += delegate(object sender,Presence pres) {
                    if (pres.From.Bare != chatHandler.Jid.Bare || pres.Priority == "-1")
                    {
                        return;
                    }
                    QApplication.Invoke(delegate {
                        if (!String.IsNullOrEmpty(pres.From.Resource))
                        {
                            if (pres.Type == PresenceType.available)
                            {
                                string text = String.Format("{0} ({1})",Helper.GetResourceDisplay(pres),Helper.GetPresenceDisplay(pres));
                                int i       = m_ToComboBox.FindData(pres.From.Resource);
                                if (i == -1)
                                {
                                    m_ToComboBox.AddItem(text,pres.From.Resource);
                                }
                                else
                                {
                                    m_ToComboBox.SetItemText(i,text);
                                }
                            }
                            else if (pres.Type == PresenceType.unavailable)
                            {
                                int i = m_ToComboBox.FindData(pres.From.Resource);
                                if (i > -1)
                                {
                                    m_ToComboBox.RemoveItem(i);
                                    m_ToComboBox.CurrentIndex = 0;
                                }
                            }
                        }

                        if (chatHandler.IsMucMessage)
                        {
                            toWidgetAction.Visible = false;
                        }
                        else
                        {
                            string title = null;
                            if (handler.Account.PresenceManager[pres.From.BareJID] == null)
                            {
                                title = String.Format("{0} (Offline)",chatHandler.Account.GetDisplayName(chatHandler.Jid));
                            }
                            else
                            {
                                title = chatHandler.Account.GetDisplayName(chatHandler.Jid);
                            }
                            Gui.TabbedChatsWindow.SetTabTitle(this,title);
                        }
                    });
                };

                foreach (var presence in chatHandler.Account.PresenceManager.GetAll(chatHandler.Jid))
                {
                    if (presence.Priority != "-1" && !String.IsNullOrEmpty(presence.From.Resource))
                    {
                        string text = String.Format("{0} ({1})",Helper.GetResourceDisplay(presence),Helper.GetPresenceDisplay(presence));
                        m_ToComboBox.AddItem(text,presence.From.Resource);
                    }
                }

                // FIXME: Make this a menu with "View Profile" and "View History".
                var viewProfileAction = new QAction(Gui.LoadIcon("info",16),"View Profile",this);
                QObject.Connect(viewProfileAction,Qt.SIGNAL("triggered()"),HandleViewProfileActionTriggered);
                toolbar.AddAction(viewProfileAction);
            }
            else
            {
                toWidgetAction.Visible = false;
            }

            QObject.Connect <bool>(m_ConversationWidget.Page(),Qt.SIGNAL("loadFinished(bool)"),delegate(bool ok) {
                if (!ok)
                {
                    throw new Exception("Failed to load chat html.");
                }
                handler.NewContent += HandleNewContent;
                m_Handler.FireQueued();
            });

            var settings = ServiceManager.Get <SettingsService>();

            m_ConversationWidget.ShowHeader    = settings.Get <bool>("MessageShowHeader");
            m_ConversationWidget.ShowUserIcons = settings.Get <bool>("MessageShowAvatars");
            m_ConversationWidget.LoadTheme(settings.Get <string>("MessageTheme"),settings.Get <string>("MessageThemeVariant"));
        }
コード例 #37
0
        private QGroupBox InitToggleButtons()
        {
            var groupBox = new QGroupBox ("Toggle Buttons", this);
            color = new QColor ();
            redButton = new QPushButton ("Red", this);
            greenButton = new QPushButton ("Green", this);
            blueButton = new QPushButton ("Blue", this);
            colorBoxWidget = new QWidget (this);
            colorBoxWidget.StyleSheet = "QWidget { background-color: black }";

            redButton.Toggled += OnToggled;
            greenButton.Toggled += OnToggled;
            blueButton.Toggled += OnToggled;

            redButton.Checkable = true;
            greenButton.Checkable = true;
            blueButton.Checkable = true;

            QHBoxLayout hBox = new QHBoxLayout ();
            QVBoxLayout vBox = new QVBoxLayout ();

            vBox.AddWidget (redButton);
            vBox.AddWidget (greenButton);
            vBox.AddWidget (blueButton);

            hBox.AddLayout (vBox);
            hBox.AddWidget (colorBoxWidget);

            groupBox.Layout = hBox;

            return groupBox;
        }
コード例 #38
0
ファイル: gui.cs プロジェクト: hoangduit/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.
    }
コード例 #39
0
        protected void SetupUi()
        {
            base.ObjectName = "NoAccountsWidget";
            this.Geometry   = new QRect(0, 0, 341, 485);
            QSizePolicy NoAccountsWidget_sizePolicy;

            NoAccountsWidget_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Minimum);
            NoAccountsWidget_sizePolicy.SetVerticalStretch(0);
            NoAccountsWidget_sizePolicy.SetHorizontalStretch(0);
            NoAccountsWidget_sizePolicy.SetHeightForWidth(this.SizePolicy.HasHeightForWidth());
            this.SizePolicy  = NoAccountsWidget_sizePolicy;
            this.WindowTitle = "Form";
            QVBoxLayout verticalLayout;

            verticalLayout                 = new QVBoxLayout(this);
            verticalLayout.Spacing         = 6;
            verticalLayout.Margin          = 6;
            this.m_GraphicsView            = new QGraphicsView(this);
            this.m_GraphicsView.ObjectName = "m_GraphicsView";
            QSizePolicy m_GraphicsView_sizePolicy;

            m_GraphicsView_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed);
            m_GraphicsView_sizePolicy.SetVerticalStretch(0);
            m_GraphicsView_sizePolicy.SetHorizontalStretch(0);
            m_GraphicsView_sizePolicy.SetHeightForWidth(this.m_GraphicsView.SizePolicy.HasHeightForWidth());
            this.m_GraphicsView.SizePolicy  = m_GraphicsView_sizePolicy;
            this.m_GraphicsView.MinimumSize = new QSize(0, 300);
            this.m_GraphicsView.FrameShape  = QFrame.Shape.NoFrame;
            verticalLayout.AddWidget(this.m_GraphicsView);
            this.stackedWidget              = new QStackedWidget(this);
            this.stackedWidget.ObjectName   = "stackedWidget";
            this.stackedWidget.CurrentIndex = 1;
            verticalLayout.AddWidget(this.stackedWidget);
            this.page_3            = new QWidget(this.stackedWidget);
            this.page_3.ObjectName = "page_3";
            QVBoxLayout verticalLayout_2;

            verticalLayout_2         = new QVBoxLayout(this.page_3);
            verticalLayout_2.Spacing = 6;
            verticalLayout_2.Margin  = 0;
            this.m_Label             = new QLabel(this.page_3);
            this.m_Label.ObjectName  = "m_Label";
            QSizePolicy m_Label_sizePolicy;

            m_Label_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum);
            m_Label_sizePolicy.SetVerticalStretch(0);
            m_Label_sizePolicy.SetHorizontalStretch(0);
            m_Label_sizePolicy.SetHeightForWidth(this.m_Label.SizePolicy.HasHeightForWidth());
            this.m_Label.SizePolicy = m_Label_sizePolicy;
            this.m_Label.Text       = "<p><strong>Welcome.</strong><br/>Click <em>Add Account</em> below to begin.";
            this.m_Label.Alignment  = ((global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignBottom") | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading")) | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft"));
            verticalLayout_2.AddWidget(this.m_Label);
            QHBoxLayout horizontalLayout_2;

            horizontalLayout_2 = new QHBoxLayout();
            verticalLayout_2.AddLayout(horizontalLayout_2);
            QSpacerItem horizontalSpacer_2;

            horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
            horizontalLayout_2.AddItem(horizontalSpacer_2);
            this.quitButton1            = new QPushButton(this.page_3);
            this.quitButton1.ObjectName = "quitButton1";
            this.quitButton1.Text       = "Quit";
            horizontalLayout_2.AddWidget(this.quitButton1);
            this.addAccountButton            = new QPushButton(this.page_3);
            this.addAccountButton.ObjectName = "addAccountButton";
            this.addAccountButton.Text       = "Add Account";
            horizontalLayout_2.AddWidget(this.addAccountButton);
            this.stackedWidget.AddWidget(this.page_3);
            this.page_4            = new QWidget(this.stackedWidget);
            this.page_4.ObjectName = "page_4";
            QVBoxLayout verticalLayout_3;

            verticalLayout_3        = new QVBoxLayout(this.page_4);
            verticalLayout_3.Margin = 0;
            this.label_3            = new QLabel(this.page_4);
            this.label_3.ObjectName = "label_3";
            this.label_3.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:8pt; 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;\">Add Account</span></p></body></html>";
            this.label_3.Alignment  = ((global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignBottom") | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading")) | global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft"));
            verticalLayout_3.AddWidget(this.label_3);
            QGridLayout gridLayout;

            gridLayout = new QGridLayout();
            verticalLayout_3.AddLayout(gridLayout);
            this.label            = new QLabel(this.page_4);
            this.label.ObjectName = "label";
            this.label.Text       = "Jabber ID:";
            gridLayout.AddWidget(this.label, 0, 0, 1, 1);
            this.m_LoginLineEdit            = new QLineEdit(this.page_4);
            this.m_LoginLineEdit.ObjectName = "m_LoginLineEdit";
            gridLayout.AddWidget(this.m_LoginLineEdit, 0, 1, 1, 1);
            this.label_2            = new QLabel(this.page_4);
            this.label_2.ObjectName = "label_2";
            this.label_2.Text       = "Password:"******"m_PasswordLineEdit";
            this.m_PasswordLineEdit.echoMode   = QLineEdit.EchoMode.Password;
            gridLayout.AddWidget(this.m_PasswordLineEdit, 1, 1, 1, 1);
            QHBoxLayout horizontalLayout;

            horizontalLayout = new QHBoxLayout();
            verticalLayout_3.AddLayout(horizontalLayout);
            horizontalLayout.sizeConstraint = QLayout.SizeConstraint.SetDefaultConstraint;
            QSpacerItem horizontalSpacer;

            horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
            horizontalLayout.AddItem(horizontalSpacer);
            this.quitButton2            = new QPushButton(this.page_4);
            this.quitButton2.ObjectName = "quitButton2";
            this.quitButton2.Text       = "Quit";
            horizontalLayout.AddWidget(this.quitButton2);
            this.saveAccountButton             = new QPushButton(this.page_4);
            this.saveAccountButton.ObjectName  = "saveAccountButton";
            this.saveAccountButton.Text        = "OK";
            this.saveAccountButton.AutoDefault = true;
            this.saveAccountButton.Default     = true;
            horizontalLayout.AddWidget(this.saveAccountButton);
            this.stackedWidget.AddWidget(this.page_4);
            QObject.Connect(m_PasswordLineEdit, Qt.SIGNAL("returnPressed()"), saveAccountButton, Qt.SLOT("click()"));
            QObject.Connect(m_LoginLineEdit,Qt.SIGNAL("returnPressed()"),saveAccountButton,Qt.SLOT("click()"));
            QMetaObject.ConnectSlotsByName(this);
            this.label.SetBuddy(m_LoginLineEdit);
            this.label_2.SetBuddy(m_PasswordLineEdit);
        }
コード例 #40
0
        protected void SetupUi()
        {
            base.ObjectName  = "MainWindow";
            this.Geometry    = new QRect(0, 0, 236, 483);
            this.WindowTitle = "Synapse";
            QVBoxLayout verticalLayout;

            verticalLayout                  = new QVBoxLayout(this);
            verticalLayout.Spacing          = 0;
            verticalLayout.Margin           = 0;
            this.containerWidget            = new QWidget(this);
            this.containerWidget.ObjectName = "containerWidget";
            QVBoxLayout verticalLayout_2;

            verticalLayout_2             = new QVBoxLayout(this.containerWidget);
            verticalLayout_2.Spacing     = 0;
            verticalLayout_2.Margin      = 0;
            this.headerWidget            = new QWidget(this.containerWidget);
            this.headerWidget.ObjectName = "headerWidget";
            QHBoxLayout horizontalLayout_3;

            horizontalLayout_3         = new QHBoxLayout(this.headerWidget);
            horizontalLayout_3.Spacing = 3;
            horizontalLayout_3.SetContentsMargins(0, 0, 3, 0);
            this.headerLabel            = new QLabel(this.headerWidget);
            this.headerLabel.ObjectName = "headerLabel";
            QSizePolicy headerLabel_sizePolicy;

            headerLabel_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum);
            headerLabel_sizePolicy.SetVerticalStretch(0);
            headerLabel_sizePolicy.SetHorizontalStretch(0);
            headerLabel_sizePolicy.SetHeightForWidth(this.headerLabel.SizePolicy.HasHeightForWidth());
            this.headerLabel.SizePolicy = headerLabel_sizePolicy;
            this.headerLabel.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:33px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Synapse</span></p></body></html>";
            this.headerLabel.Alignment  = global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignCenter");
            this.headerLabel.Margin     = 3;
            horizontalLayout_3.AddWidget(this.headerLabel);
            this.menuButton            = new QPushButton(this.headerWidget);
            this.menuButton.ObjectName = "menuButton";
            QSizePolicy menuButton_sizePolicy;

            menuButton_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed);
            menuButton_sizePolicy.SetVerticalStretch(0);
            menuButton_sizePolicy.SetHorizontalStretch(0);
            menuButton_sizePolicy.SetHeightForWidth(this.menuButton.SizePolicy.HasHeightForWidth());
            this.menuButton.SizePolicy  = menuButton_sizePolicy;
            this.menuButton.MinimumSize = new QSize(12, 12);
            this.menuButton.MaximumSize = new QSize(12, 12);
            this.menuButton.FocusPolicy = Qt.FocusPolicy.TabFocus;
            this.menuButton.Text        = "";
            this.menuButton.IconSize    = new QSize(7, 7);
            this.menuButton.Flat        = true;
            horizontalLayout_3.AddWidget(this.menuButton);
            this.closeButton            = new QPushButton(this.headerWidget);
            this.closeButton.ObjectName = "closeButton";
            QSizePolicy closeButton_sizePolicy;

            closeButton_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed);
            closeButton_sizePolicy.SetVerticalStretch(0);
            closeButton_sizePolicy.SetHorizontalStretch(0);
            closeButton_sizePolicy.SetHeightForWidth(this.closeButton.SizePolicy.HasHeightForWidth());
            this.closeButton.SizePolicy  = closeButton_sizePolicy;
            this.closeButton.MinimumSize = new QSize(12, 12);
            this.closeButton.MaximumSize = new QSize(12, 12);
            this.closeButton.FocusPolicy = Qt.FocusPolicy.TabFocus;
            this.closeButton.Text        = "";
            this.closeButton.IconSize    = new QSize(7, 7);
            this.closeButton.Flat        = true;
            horizontalLayout_3.AddWidget(this.closeButton);
            verticalLayout_2.AddWidget(this.headerWidget);
            this.stackedWidget              = new Synapse.QtClient.Widgets.LightboxContainerWidget(this.containerWidget);
            this.stackedWidget.ObjectName   = "stackedWidget";
            this.stackedWidget.CurrentIndex = 0;
            verticalLayout_2.AddWidget(this.stackedWidget);
            this.page            = new QWidget(this.stackedWidget);
            this.page.ObjectName = "page";
            QHBoxLayout horizontalLayout;

            horizontalLayout              = new QHBoxLayout(this.page);
            horizontalLayout.Spacing      = 0;
            horizontalLayout.Margin       = 0;
            this.contentWidget            = new QWidget(this.page);
            this.contentWidget.ObjectName = "contentWidget";
            QSizePolicy contentWidget_sizePolicy;

            contentWidget_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Expanding);
            contentWidget_sizePolicy.SetVerticalStretch(0);
            contentWidget_sizePolicy.SetHorizontalStretch(0);
            contentWidget_sizePolicy.SetHeightForWidth(this.contentWidget.SizePolicy.HasHeightForWidth());
            this.contentWidget.SizePolicy = contentWidget_sizePolicy;
            horizontalLayout.AddWidget(this.contentWidget);
            this.stackedWidget.AddWidget(this.page);
            verticalLayout.AddWidget(this.containerWidget);
            QMetaObject.ConnectSlotsByName(this);
        }
コード例 #41
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);
        }
コード例 #42
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.
    }