public MyWidget(QWidget parent) : base(parent) { QPushButton quit = new QPushButton(Tr("Quit")); quit.Font = new QFont("Times", 18, (int)QFont.Weight.Bold); QLCDNumber lcd = new QLCDNumber(2); lcd.segmentStyle = QLCDNumber.SegmentStyle.Filled; QSlider slider = new QSlider(Qt.Orientation.Horizontal); slider.SetRange(0, 99); slider.Value = 0; Connect(quit, SIGNAL("clicked()"), qApp, SLOT("quit()")); Connect(slider,SIGNAL("valueChanged(int)"), lcd,SLOT("display(int)")); QVBoxLayout layout = new QVBoxLayout(); layout.AddWidget(quit); layout.AddWidget(lcd); layout.AddWidget(slider); SetLayout(layout); }
public void InitUI() { QPushButton quit = new QPushButton ("Quit", this); //Connect (quit, SIGNAL("clicked()"), qApp, SLOT("quit()")); quit.Clicked += OnQuitButtonClicked; quit.SetGeometry (50, 40, 80, 30); }
public MyWidget(QWidget parent) : base(parent) { QPushButton quit = new QPushButton("Quit"); Connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()")); LCDRange angle = new LCDRange(); angle.SetRange(5,70); CannonField field = new CannonField(); Connect(angle,SIGNAL("valueChanged(int)"),field,SLOT("setAngle(int)")); Connect(field,SIGNAL("angleChanged(int)"),angle,SLOT("setValue(int)")); QGridLayout gridLayout = new QGridLayout(); gridLayout.AddWidget(quit,0,0); gridLayout.AddWidget(angle,1,0); gridLayout.AddWidget(field,1,1,2,1); gridLayout.SetColumnStretch(1,10); SetLayout(gridLayout); angle.SetValue(60); angle.SetFocus(); }
private void InitUI() { QGridLayout grid = new QGridLayout(this); QLabel labelName = new QLabel("Name", this); QLineEdit lineEdit = new QLineEdit(this); QTextEdit textEdit = new QTextEdit(this); QPushButton btnOk = new QPushButton("Ok", this); QPushButton btnCancel = new QPushButton("Cancel", this); /* * In our scenario, the grid will have totally four columns and three rows. We would add * and make the widgets to span in the grid as needed. */ //Add Name label at row 1 - Column 1 grid.AddWidget(labelName, 0, 0); //Add line Edit at row 1 - Column 2 with row span 1 and column span 4 grid.AddWidget(lineEdit, 0, 1 , 1, 3); //Add textEdit at row2 - column 1 with row span 1 and column span 4 grid.AddWidget(textEdit, 1, 0, 1, 4); //Add a stretch at row 3 - column 2 to make the btn move right grid.SetColumnStretch(1, 1); //Add Ok Btn at row 3 - Column 3 grid.AddWidget(btnOk, 2, 2); //Add Cancel Btn at row 3 - Column 4 grid.AddWidget(btnCancel, 2, 3); }
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); }
public MyWidget(QWidget parent) : base(parent) { QPushButton quit = new QPushButton("Quit",this); quit.Font = new QFont("Times",18,(int)QFont.Weight.Bold); Connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()")); QGridLayout grid = new QGridLayout(); for (int row = 0; row < 3; row++) { for (int column = 0; column < 3; column++) { LCDRange lcdRange = new LCDRange(); grid.AddWidget(lcdRange,row,column); } } QVBoxLayout layout = new QVBoxLayout(); layout.AddWidget(quit); layout.AddLayout(grid); SetLayout(layout); }
public MyWidget(QWidget parent) : base(parent) { QPushButton quit = new QPushButton("Quit"); Connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()")); QGridLayout grid = new QGridLayout(); LCDRange previousRange = null; for (int row = 0; row < 3; ++row) { for (int column = 0; column < 3; ++column) { LCDRange lcdRange = new LCDRange(); grid.AddWidget(lcdRange,row,column); if (previousRange != null) { Connect(lcdRange,SIGNAL("valueChanged(int)"), previousRange,SLOT("setValue(int)")); } previousRange = lcdRange; } } QVBoxLayout layout = new QVBoxLayout(); layout.AddWidget(quit); layout.AddLayout(grid); SetLayout(layout); }
public void SetupUi(QWidget Form) { if (Form.ObjectName == "") { Form.ObjectName = "Form"; } QSize Size = new QSize(887, 679); Size = Size.ExpandedTo(Form.MinimumSizeHint()); Form.Size = Size; vboxLayout = new QVBoxLayout(Form); vboxLayout.ObjectName = "vboxLayout"; tabWidget = new QTabWidget(Form); tabWidget.ObjectName = "tabWidget"; tab = new QWidget(); tab.ObjectName = "tab"; tabWidget.AddTab(tab, QApplication.Translate("Form", "Tab 1", null, QApplication.Encoding.UnicodeUTF8)); tab_2 = new QWidget(); tab_2.ObjectName = "tab_2"; vboxLayout1 = new QVBoxLayout(tab_2); vboxLayout1.ObjectName = "vboxLayout1"; listView = new QListView(tab_2); listView.ObjectName = "listView"; vboxLayout1.AddWidget(listView); groupBox = new QGroupBox(tab_2); groupBox.ObjectName = "groupBox"; groupBox.MinimumSize = new QSize(0, 64); pushButton = new QPushButton(groupBox); pushButton.ObjectName = "pushButton"; pushButton.Geometry = new QRect(690, 6, 151, 51); radioButton = new QRadioButton(groupBox); radioButton.ObjectName = "radioButton"; radioButton.Geometry = new QRect(120, 10, 109, 22); radioButton_2 = new QRadioButton(groupBox); radioButton_2.ObjectName = "radioButton_2"; radioButton_2.Geometry = new QRect(120, 40, 109, 22); lineEdit = new QLineEdit(groupBox); lineEdit.ObjectName = "lineEdit"; lineEdit.Geometry = new QRect(280, 20, 371, 27); vboxLayout1.AddWidget(groupBox); tabWidget.AddTab(tab_2, QApplication.Translate("Form", "Join", null, QApplication.Encoding.UnicodeUTF8)); tab_3 = new QWidget(); tab_3.ObjectName = "tab_3"; tabWidget.AddTab(tab_3, QApplication.Translate("Form", "Page", null, QApplication.Encoding.UnicodeUTF8)); vboxLayout.AddWidget(tabWidget); RetranslateUi(Form); tabWidget.CurrentIndex = 1; QMetaObject.ConnectSlotsByName(Form); } // SetupUi
private void InitUI() { QPushButton button = new QPushButton ("Quit", this); button.SetGeometry (50, 40, 80, 20); button.Clicked += (obj) => { QApplication.Quit(); }; }
private void InitUI() { QPushButton button = new QPushButton("Quit", this); button.SetGeometry(50, 40, 80, 20); button.Clicked += (obj) => { QApplication.Quit(); }; }
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(); }
public static int Main(String[] args) { QApplication app = new QApplication(args); QPushButton hello = new QPushButton("Hello world!"); QLabel label = new QLabel(hello); hello.Resize(100, 30); hello.Show(); return(QApplication.Exec()); }
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); }
public void SetupUi(QWidget Form) { if (Form.ObjectName == "") Form.ObjectName = "Form"; QSize Size = new QSize(887, 679); Size = Size.ExpandedTo(Form.MinimumSizeHint()); Form.Size = Size; vboxLayout = new QVBoxLayout(Form); vboxLayout.ObjectName = "vboxLayout"; tabWidget = new QTabWidget(Form); tabWidget.ObjectName = "tabWidget"; tab = new QWidget(); tab.ObjectName = "tab"; tabWidget.AddTab(tab, QApplication.Translate("Form", "Tab 1", null, QApplication.Encoding.UnicodeUTF8)); tab_2 = new QWidget(); tab_2.ObjectName = "tab_2"; vboxLayout1 = new QVBoxLayout(tab_2); vboxLayout1.ObjectName = "vboxLayout1"; listView = new QListView(tab_2); listView.ObjectName = "listView"; vboxLayout1.AddWidget(listView); groupBox = new QGroupBox(tab_2); groupBox.ObjectName = "groupBox"; groupBox.MinimumSize = new QSize(0, 64); pushButton = new QPushButton(groupBox); pushButton.ObjectName = "pushButton"; pushButton.Geometry = new QRect(690, 6, 151, 51); radioButton = new QRadioButton(groupBox); radioButton.ObjectName = "radioButton"; radioButton.Geometry = new QRect(120, 10, 109, 22); radioButton_2 = new QRadioButton(groupBox); radioButton_2.ObjectName = "radioButton_2"; radioButton_2.Geometry = new QRect(120, 40, 109, 22); lineEdit = new QLineEdit(groupBox); lineEdit.ObjectName = "lineEdit"; lineEdit.Geometry = new QRect(280, 20, 371, 27); vboxLayout1.AddWidget(groupBox); tabWidget.AddTab(tab_2, QApplication.Translate("Form", "Join", null, QApplication.Encoding.UnicodeUTF8)); tab_3 = new QWidget(); tab_3.ObjectName = "tab_3"; tabWidget.AddTab(tab_3, QApplication.Translate("Form", "Page", null, QApplication.Encoding.UnicodeUTF8)); vboxLayout.AddWidget(tabWidget); RetranslateUi(Form); tabWidget.CurrentIndex = 1; QMetaObject.ConnectSlotsByName(Form); }
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); }
public Window() { layout = new QVBoxLayout(this); browser = new QTextBrowser(this); button = new QPushButton("Toggle Text", this); Connect(button, SIGNAL("clicked()"), this, SLOT("toggleText()")); toggled = false; layout.AddWidget(browser); layout.AddWidget(button); SetLayout(layout); }
public static int Main(string[] args) { QApplication app = new QApplication(args, true); QMainWindow window = new QMainWindow(); QPushButton button = new QPushButton("Quit", window); window.SetCentralWidget(button); window.Show(); Connect(button, SIGNAL("clicked()"), app, SLOT("quit()")); return(QApplication.Exec()); }
public MyWidget(QWidget parent) : base(parent) { SetFixedSize(200, 120); QPushButton quit = new QPushButton(Tr("Quit"), this); quit.SetGeometry(62, 40, 75, 30); quit.Font = new QFont("Times", 18, (int)QFont.Weight.Bold); Connect(quit, SIGNAL("clicked()"), qApp, SLOT("quit()")); }
public static void Main(string[] args) { using (QApplication app = new QApplication()) { using (QPushButton hello = new QPushButton("Hello world!")) { hello.Resize(200, 30); QObject.Connect(hello, "2clicked()", app, "1aboutQt()", ConnectionType.AutoConnection); hello.SetVisible(true); QApplication.Exec(); } } }
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); }
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); }
public static int Main(String[] args) { QApplication app = new QApplication(args); QPushButton quit = new QPushButton("Quit"); quit.Resize(75, 30); quit.Font = new QFont("Times", 18, (int)QFont.Weight.Bold); QObject.Connect(quit, SIGNAL("clicked()"), app, SLOT("quit()")); quit.Show(); return(QApplication.Exec()); }
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); }
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); }
public override void InitUI() { this.Layout = new QHBoxLayout(); QPushButton button = new QPushButton("Dialog", this); button.Clicked += Show_Clicked; button.FocusPolicy = QtCore.Qt.FocusPolicy.NoFocus; this.Layout.AddWidget(button); //show.Move( 20, 20 ); edit = new QLineEdit(this); //edit.Move( 130, 22 ); this.Layout.AddWidget(edit); }
public AddFriendWindow(Account account) { SetupUi(); closeButton.icon = Gui.LoadIcon("window-close", 16); QPushButton addButton = new QPushButton(Gui.LoadIcon("list-add", 16), "Add Friend"); addButton.SetParent(buttonBox); buttonBox.AddButton(addButton, QDialogButtonBox.ButtonRole.AcceptRole); m_Account = account; groupsWidget.Account = account; }
public AddAccountDialog() { SetupUi(); var forwardButton = new QPushButton(Gui.LoadIcon("forward"), "&Forward"); QObject.Connect(forwardButton, Qt.SIGNAL("clicked()"), HandleForwardButtonClicked); buttonBox.AddButton(forwardButton, QDialogButtonBox.ButtonRole.AcceptRole); buttonBox_2.StandardButtons = (uint)QDialogButtonBox.StandardButton.Ok | (uint)QDialogButtonBox.StandardButton.Cancel; var addAccountButton = buttonBox_2.Button(QDialogButtonBox.StandardButton.Ok); QObject.Connect(addAccountButton, Qt.SIGNAL("clicked()"), HandleAddAccountButtonClicked); addAccountButton.Text = "&Add Account"; Gui.CenterWidgetOnScreen(this); }
public void SetupUi(QDialog SelectWriteModeDialog) { if (SelectWriteModeDialog.ObjectName == "") { SelectWriteModeDialog.ObjectName = "SelectWriteModeDialog"; } QSize Size = new QSize(443, 125); Size = Size.ExpandedTo(SelectWriteModeDialog.MinimumSizeHint()); SelectWriteModeDialog.Size = Size; SelectWriteModeDialog.WindowIcon = new QIcon(":/main/resources/monosim_128.png"); gridLayout = new QGridLayout(SelectWriteModeDialog); gridLayout.ObjectName = "gridLayout"; LblTitle = new QLabel(SelectWriteModeDialog); LblTitle.ObjectName = "LblTitle"; LblTitle.Alignment = Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading") | Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft") | Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignTop"); gridLayout.AddWidget(LblTitle, 0, 0, 1, 4); BtnCancel = new QPushButton(SelectWriteModeDialog); BtnCancel.ObjectName = "BtnCancel"; gridLayout.AddWidget(BtnCancel, 1, 0, 1, 1); spacerItem = new QSpacerItem(152, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum); gridLayout.AddItem(spacerItem, 1, 1, 1, 1); BtnOverride = new QPushButton(SelectWriteModeDialog); BtnOverride.ObjectName = "BtnOverride"; BtnOverride.icon = new QIcon(":/toolbar/resources/qt/draw-eraser.png"); gridLayout.AddWidget(BtnOverride, 1, 2, 1, 1); BtnAppend = new QPushButton(SelectWriteModeDialog); BtnAppend.ObjectName = "BtnAppend"; BtnAppend.icon = new QIcon(":/toolbar/resources/qt/list-add.png"); gridLayout.AddWidget(BtnAppend, 1, 3, 1, 1); RetranslateUi(SelectWriteModeDialog); QMetaObject.ConnectSlotsByName(SelectWriteModeDialog); } // SetupUi
private void InitUI() { QGridLayout grid = new QGridLayout (this); QLabel nameLabel = new QLabel ("Name", this); QLineEdit nameEdit = new QLineEdit (this); QTextEdit textEdit = new QTextEdit (this); QPushButton okButton = new QPushButton ("Ok", this); QPushButton closeButton = new QPushButton ("Close", this); grid.AddWidget (nameLabel, 0, 0); grid.AddWidget (nameEdit, 0, 1, 1, 3); grid.AddWidget (textEdit, 1, 0, 2, 4); grid.SetColumnStretch (1, 1); grid.AddWidget (okButton, 4, 2); grid.AddWidget (closeButton, 4, 3); }
private void InitUI() { QGridLayout grid = new QGridLayout(this); QLabel nameLabel = new QLabel("Name", this); QLineEdit nameEdit = new QLineEdit(this); QTextEdit textEdit = new QTextEdit(this); QPushButton okButton = new QPushButton("Ok", this); QPushButton closeButton = new QPushButton("Close", this); grid.AddWidget(nameLabel, 0, 0); grid.AddWidget(nameEdit, 0, 1, 1, 3); grid.AddWidget(textEdit, 1, 0, 2, 4); grid.SetColumnStretch(1, 1); grid.AddWidget(okButton, 4, 2); grid.AddWidget(closeButton, 4, 3); }
public static int Main(String[] args) { QApplication app = new QApplication(args); QWidget window = new QWidget(); window.Resize(200, 120); QPushButton quit = new QPushButton("Quit", window); quit.Font = new QFont("Times", 18, (int)QFont.Weight.Bold); quit.SetGeometry(10, 40, 180, 40); QObject.Connect(quit, SIGNAL("clicked()"), app, SLOT("quit()")); window.Show(); return(QApplication.Exec()); }
/// <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); }
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); }
public void InitUI(QGridLayout grid) { grid.Spacing = 2; var errorButton = new QPushButton("Error"); var warnimgButton = new QPushButton("Warning"); var questionButton = new QPushButton("Question"); var informationButton = new QPushButton("Information"); var aboutButton = new QPushButton("About"); grid.AddWidget(errorButton, 0, 0); grid.AddWidget(warnimgButton, 0, 1); grid.AddWidget(questionButton, 1, 0); grid.AddWidget(informationButton, 1, 1); grid.AddWidget(aboutButton, 2, 0); errorButton.Clicked += ErrorButton_Clicked; warnimgButton.Clicked += WarnimgButton_Clicked; questionButton.Clicked += QuestionButton_Clicked; informationButton.Clicked += InformationButton_Clicked; aboutButton.Clicked += AboutButton_Clicked; }
protected void SetupUi() { base.ObjectName = "EditGroupsWidget"; this.Geometry = new QRect(0, 0, 212, 239); this.WindowTitle = "EditGroupsWidget"; QVBoxLayout verticalLayout; verticalLayout = new QVBoxLayout(this); verticalLayout.Spacing = 3; verticalLayout.Margin = 0; this.listWidget = new QListWidget(this); this.listWidget.ObjectName = "listWidget"; QSizePolicy listWidget_sizePolicy; listWidget_sizePolicy = new QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding); listWidget_sizePolicy.SetVerticalStretch(0); listWidget_sizePolicy.SetHorizontalStretch(0); listWidget_sizePolicy.SetHeightForWidth(this.listWidget.SizePolicy.HasHeightForWidth()); this.listWidget.SizePolicy = listWidget_sizePolicy; this.listWidget.MinimumSize = new QSize(0, 50); this.listWidget.FrameShape = QFrame.Shape.NoFrame; verticalLayout.AddWidget(this.listWidget); QGridLayout gridLayout; gridLayout = new QGridLayout(); verticalLayout.AddLayout(gridLayout); this.label_2 = new QLabel(this); this.label_2.ObjectName = "label_2"; this.label_2.Text = "Add Group:"; gridLayout.AddWidget(this.label_2, 0, 0, 1, 1); this.lineEdit = new QLineEdit(this); this.lineEdit.ObjectName = "lineEdit"; gridLayout.AddWidget(this.lineEdit, 0, 1, 1, 1); this.addButton = new QPushButton(this); this.addButton.ObjectName = "addButton"; this.addButton.Text = ""; gridLayout.AddWidget(this.addButton, 0, 2, 1, 1); QMetaObject.ConnectSlotsByName(this); }
public override void InitUI() { _color = new QColor(); _redButton = new QPushButton("Red", this); _redButton.Checkable = true; _greenButton = new QPushButton("Green", this); _greenButton.Checkable = true; _blueButton = new QPushButton("Blue", this); _blueButton.Checkable = true; _redButton.Toggled += OnToggled; _greenButton.Toggled += OnToggled; _blueButton.Toggled += OnToggled; _square = new QWidget(this); _square.StyleSheet = "QWidget { background-color: black }"; _redButton.Move(30, 30); _greenButton.Move(30, 80); _blueButton.Move(30, 130); _square.SetGeometry(150, 25, 150, 150); }
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; }
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); }
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; }
public void SetupUi(QMainWindow MainWindow) { if (MainWindow.ObjectName == "") MainWindow.ObjectName = "MainWindow"; QSize Size = new QSize(631, 570); Size = Size.ExpandedTo(MainWindow.MinimumSizeHint()); MainWindow.Size = Size; MainWindow.MinimumSize = new QSize(600, 550); MainWindow.WindowIcon = new QIcon(":/main/resources/Images/comex_256.png"); action_Open = new QAction(MainWindow); action_Open.ObjectName = "action_Open"; action_Open.icon = new QIcon(":/main/resources/Images/document-open.png"); action_Close = new QAction(MainWindow); action_Close.ObjectName = "action_Close"; action_Close.Enabled = false; action_Close.icon = new QIcon(":/main/resources/Images/document-close.png"); action_Exit = new QAction(MainWindow); action_Exit.ObjectName = "action_Exit"; action_Exit.icon = new QIcon(":/main/resources/Images/application-exit.png"); action_Info = new QAction(MainWindow); action_Info.ObjectName = "action_Info"; action_Info.icon = new QIcon(":/main/resources/Images/dialog-information.png"); action_ATR = new QAction(MainWindow); action_ATR.ObjectName = "action_ATR"; action_ATR.icon = new QIcon(":/main/resources/Images/quickopen.png"); action_Exec_Command = new QAction(MainWindow); action_Exec_Command.ObjectName = "action_Exec_Command"; action_SerialSettings = new QAction(MainWindow); action_SerialSettings.ObjectName = "action_SerialSettings"; action_SerialSettings.icon = new QIcon(":/main/resources/Images/configure.png"); centralwidget = new QWidget(MainWindow); centralwidget.ObjectName = "centralwidget"; gridLayout = new QGridLayout(centralwidget); gridLayout.ObjectName = "gridLayout"; FrameATR = new QGroupBox(centralwidget); FrameATR.ObjectName = "FrameATR"; QSizePolicy sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed); sizePolicy.SetHorizontalStretch(0); sizePolicy.SetVerticalStretch(0); sizePolicy.SetHeightForWidth(FrameATR.SizePolicy.HasHeightForWidth()); FrameATR.SizePolicy = sizePolicy; gridLayout1 = new QGridLayout(FrameATR); gridLayout1.ObjectName = "gridLayout1"; TxtATR = new QLineEdit(FrameATR); TxtATR.ObjectName = "TxtATR"; TxtATR.StyleSheet = "color: rgb(30, 109, 30);"; TxtATR.ReadOnly = true; gridLayout1.AddWidget(TxtATR, 0, 0, 1, 1); gridLayout.AddWidget(FrameATR, 0, 0, 1, 1); FrameFile = new QGroupBox(centralwidget); FrameFile.ObjectName = "FrameFile"; gridLayout2 = new QGridLayout(FrameFile); gridLayout2.ObjectName = "gridLayout2"; LstCommands = new QListWidget(FrameFile); LstCommands.ObjectName = "LstCommands"; LstCommands.EditTriggers = Qyoto.Qyoto.GetCPPEnumValue("QAbstractItemView", "NoEditTriggers"); gridLayout2.AddWidget(LstCommands, 0, 0, 1, 1); gridLayout.AddWidget(FrameFile, 1, 0, 1, 1); FrameExchange = new QGroupBox(centralwidget); FrameExchange.ObjectName = "FrameExchange"; sizePolicy.SetHeightForWidth(FrameExchange.SizePolicy.HasHeightForWidth()); FrameExchange.SizePolicy = sizePolicy; gridLayout3 = new QGridLayout(FrameExchange); gridLayout3.ObjectName = "gridLayout3"; LblCommand = new QLabel(FrameExchange); LblCommand.ObjectName = "LblCommand"; gridLayout3.AddWidget(LblCommand, 0, 0, 1, 1); TxtCmd = new QLineEdit(FrameExchange); TxtCmd.ObjectName = "TxtCmd"; TxtCmd.StyleSheet = "color: rgb(30, 109, 30);"; gridLayout3.AddWidget(TxtCmd, 0, 1, 1, 1); BtnSend = new QPushButton(FrameExchange); BtnSend.ObjectName = "BtnSend"; BtnSend.icon = new QIcon(":/main/resources/Images/arrow-right.png"); gridLayout3.AddWidget(BtnSend, 0, 2, 1, 1); LblResponse = new QLabel(FrameExchange); LblResponse.ObjectName = "LblResponse"; gridLayout3.AddWidget(LblResponse, 1, 0, 1, 1); TxtResp = new QLineEdit(FrameExchange); TxtResp.ObjectName = "TxtResp"; TxtResp.StyleSheet = "color: rgb(0, 0, 255);"; TxtResp.ReadOnly = true; gridLayout3.AddWidget(TxtResp, 1, 1, 1, 1); gridLayout.AddWidget(FrameExchange, 2, 0, 1, 1); MainWindow.SetCentralWidget(centralwidget); menubar = new QMenuBar(MainWindow); menubar.ObjectName = "menubar"; menubar.Geometry = new QRect(0, 0, 631, 24); menu_File = new QMenu(menubar); menu_File.ObjectName = "menu_File"; menu_Reader = new QMenu(menubar); menu_Reader.ObjectName = "menu_Reader"; menu_About = new QMenu(menubar); menu_About.ObjectName = "menu_About"; MainWindow.SetMenuBar(menubar); statusbar = new QStatusBar(MainWindow); statusbar.ObjectName = "statusbar"; MainWindow.SetStatusBar(statusbar); toolBar = new QToolBar(MainWindow); toolBar.ObjectName = "toolBar"; toolBar.Movable = false; toolBar.ToolButtonStyle = Qt.ToolButtonStyle.ToolButtonTextBesideIcon; toolBar.Floatable = false; MainWindow.AddToolBar(Qt.ToolBarArea.TopToolBarArea, toolBar); menubar.AddAction(menu_File.MenuAction()); menubar.AddAction(menu_Reader.MenuAction()); menubar.AddAction(menu_About.MenuAction()); menu_File.AddAction(action_Open); menu_File.AddAction(action_Close); menu_File.AddSeparator(); menu_File.AddAction(action_SerialSettings); menu_File.AddSeparator(); menu_File.AddAction(action_Exit); menu_About.AddAction(action_Info); toolBar.AddAction(action_Open); toolBar.AddAction(action_Close); toolBar.AddAction(action_SerialSettings); toolBar.AddAction(action_ATR); toolBar.AddAction(action_Info); toolBar.AddSeparator(); toolBar.AddAction(action_Exit); RetranslateUi(MainWindow); QMetaObject.ConnectSlotsByName(MainWindow); }
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); }
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); }
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; }
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. }