Inheritance: QObject, IQPaintDevice, IDisposable
Beispiel #1
0
        public void HandleAccountAdded(Account account)
        {
            QApplication.Invoke(delegate {
                QTextEdit textEdit = new QTextEdit(this);
                textEdit.FrameShape = QFrame.Shape.NoFrame;
                textEdit.ReadOnly = true;

                QWidget widget = new QWidget();

                QVBoxLayout layout = new QVBoxLayout(widget);
                layout.Margin = 0;
                layout.AddWidget(textEdit);

                m_XmlToolBox.AddItem(widget, account.Jid);

                m_AccountXmlWidgets.Add(account, widget);

                account.Client.OnWriteText += delegate(object sender, string txt) {
                    QApplication.Invoke(delegate {
                        if (enableConsoleCheckBox.Checked)
                            textEdit.Append("<b>" + Qt.Escape(txt) + "</b><br/>");
                    });
                };

                account.Client.OnReadText += delegate(object sender, string txt) {
                    QApplication.Invoke(delegate {
                        if (enableConsoleCheckBox.Checked)
                            textEdit.Append(Qt.Escape(txt) + "<br/>");
                    });
                };
            });
        }
Beispiel #2
0
        public EditGroupsWidget(QWidget parent)
            : base(parent)
        {
            SetupUi();

            addButton.icon = Gui.LoadIcon("add", 16);
        }
Beispiel #3
0
Datei: t8.cs Projekt: KDE/qyoto
 public CannonField(QWidget parent)
     : base(parent)
 {
     currentAngle = 45;
     Palette = new QPalette(new QColor(250, 250, 200));
     AutoFillBackground = true;
 }
Beispiel #4
0
        public NoAccountsWidget(QWidget parent)
            : base(parent)
        {
            SetupUi();

            m_Scene = new QGraphicsScene(m_Scene);
            m_GraphicsView.SetScene(m_Scene);
            m_Scene.SetSceneRect(0, 0, 200, 200);

            var octy = new QGraphicsPixmapItem(new QPixmap("resource:/octy.png"));
            octy.SetPos(0, 10);
            m_Scene.AddItem(octy);

            // TODO: Add bubbles!

            m_TimeLine = new QTimeLine(2000, m_Scene);
            m_TimeLine.curveShape = QTimeLine.CurveShape.EaseOutCurve;
            QObject.Connect(m_TimeLine, Qt.SIGNAL("finished()"), HandleTimerFinished);

            QGraphicsItemAnimation animation = new QGraphicsItemAnimation(m_Scene);
            animation.SetItem(octy);
            animation.SetTimeLine(m_TimeLine);
            animation.SetPosAt(1, new QPointF(0, 0));

            m_TimeLine.Start();
        }
Beispiel #5
0
        public AboutDialog(QWidget parentWindow)
            : base(parentWindow)
        {
            SetupUi();

            m_Scene = new QGraphicsScene(m_Scene);
            graphicsView.SetScene(m_Scene);
            m_Scene.SetSceneRect(0, 0, 200, 200);

            textLabel.Pixmap = new QPixmap("resource:/text.png");

            var octy = new QGraphicsPixmapItem(new QPixmap("resource:/octy.png"));
            octy.SetPos(0, 10);
            m_Scene.AddItem(octy);

            m_TimeLine = new QTimeLine(2000, m_Scene);
            m_TimeLine.curveShape = QTimeLine.CurveShape.EaseOutCurve;
            QObject.Connect(m_TimeLine, Qt.SIGNAL("finished()"), TimerFinished);

            QGraphicsItemAnimation animation = new QGraphicsItemAnimation(m_Scene);
            animation.SetItem(octy);
            animation.SetTimeLine(m_TimeLine);
            animation.SetPosAt(1, new QPointF(0, 0));

            m_TimeLine.Start();

            Gui.CenterWidgetOnScreen(this);
        }
        public MucAffiliationDialog(Room room, RoomParticipant participant, QWidget parentWindow)
            : base(parentWindow)
        {
            SetupUi();

            m_Room = room;
            m_Participant = participant;

            roomLabel.Text = room.JID.Bare;
            userLabel.Text = participant.RealJID.Bare;

            switch (participant.Affiliation) {
            case RoomAffiliation.owner:
                ownerRadioButton.Checked = true;
                break;
            case RoomAffiliation.admin:
                adminRadioButton.Checked = true;
                break;
            case RoomAffiliation.member:
                memberRadioButton.Checked = true;
                break;
            case RoomAffiliation.outcast:
                outcastRadioButton.Checked = true;
                break;
            default:
                noneRadioButton.Checked = true;
                break;
            }

            buttonBox.StandardButtons = (uint)QDialogButtonBox.StandardButton.Ok | (uint)QDialogButtonBox.StandardButton.Cancel;

            Gui.CenterWidgetOnScreen(this);
        }
Beispiel #7
0
        public InviteToMucDialog(IChatHandler handler, QWidget parentWindow)
            : base(parentWindow)
        {
            SetupUi();

            buttonBox.StandardButtons = (uint)QDialogButtonBox.StandardButton.Ok | (uint)QDialogButtonBox.StandardButton.Cancel | (uint)QDialogButtonBox.StandardButton.Close;
            buttonBox.Button(QDialogButtonBox.StandardButton.Close).Hide();
            buttonBox.Button(QDialogButtonBox.StandardButton.Ok).Text = "&Invite";

            m_Handler = handler;

            if (handler is ChatHandler) {
                foreach (var room in m_Handler.Account.ConferenceManager.Rooms) {
                    mucsListWidget.AddItem(room.JID.ToString());
                }
                stackedWidget.CurrentIndex = 0;
            } else {
                foreach (var jid in m_Handler.Account.Roster) {
                    if (m_Handler.Account.PresenceManager.IsAvailable(jid)) {
                        friendsListWidget.AddItem(jid.ToString());
                    }
                }
                stackedWidget.CurrentIndex = 1;
                urlLineEdit.Text = String.Format("http://chat.synapse.im/room/{0}/", Uri.EscapeUriString(((MucHandler)m_Handler).Room.JID.ToString()));
            }

            Gui.CenterWidgetOnScreen(this);

            on_mucsListWidget_itemSelectionChanged();
        }
Beispiel #8
0
    public override void Paint(QPainter painter, QStyleOptionGraphicsItem option, QWidget widget)
    {
        // Body
        painter.SetBrush(color);
        painter.DrawEllipse(-10, -20, 20, 40);

        // Eyes
        painter.SetBrush(Qt.GlobalColor.white);
        painter.DrawEllipse(-10, -17, 8, 8);
        painter.DrawEllipse(2, -17, 8, 8);

        // Nose
        painter.SetBrush(Qt.GlobalColor.black);
        painter.DrawEllipse(new QRectF(-2, -22, 4, 4));

        // Pupils
        painter.DrawEllipse(new QRectF(-8.0 + mouseEyeDirection, -17, 4, 4));
        painter.DrawEllipse(new QRectF(4.0 + mouseEyeDirection, -17, 4, 4));

        // Ears
        painter.SetBrush(Scene().CollidingItems(this).Count == 0 ? Qt.GlobalColor.darkYellow : Qt.GlobalColor.red);
        painter.DrawEllipse(-17, -12, 16, 16);
        painter.DrawEllipse(1, -12, 16, 16);

        // Tail
        QPainterPath path = new QPainterPath(new QPointF(0, 20));
        path.CubicTo(-5, 22, -5, 22, 0, 25);
        path.CubicTo(5, 27, 5, 32, 0, 30);
        path.CubicTo(-5, 32, -5, 42, 0, 35);
        painter.SetBrush(Qt.BrushStyle.NoBrush);
        painter.DrawPath(path);
    }
        public ViewOnTwitterAction(QWidget parent)
            : base(parent)
        {
            base.Text = "View on Twitter";
            base.icon = new QIcon(new QPixmap("resource:/twitter/twitm-16.png"));

            QObject.Connect<bool>(this, Qt.SIGNAL("triggered(bool)"), HandleTriggered);
        }
Beispiel #10
0
        public InsertLinkDialog(QWidget parentWindow)
            : base(parentWindow)
        {
            SetupUi();
            buttonBox.StandardButtons = (uint)QDialogButtonBox.StandardButton.Ok | (uint)QDialogButtonBox.StandardButton.Cancel;
            Validate();

            Gui.CenterWidgetOnScreen(this);
        }
Beispiel #11
0
 /// <remarks>
 ///  Static convenience function to let the user select an item from a
 ///  list. caption is the text that is displayed in the title bar.
 ///  label is the text that appears as the label for the list. list
 ///  is the string list which is inserted into the list, and current
 ///  is the number of the item which should be the selected item. If
 ///  editable is true, the user can enter his own text.
 /// <param> name="caption" Caption of the dialog
 /// </param><param> name="label" Text of the label for the list
 /// </param><param> name="list" List of item for user to choose from
 /// </param><param> name="current" Index of the selected item
 /// </param><param> name="editable" If true, user can enter own text
 /// </param><param> name="ok" This bool would be set to true if user pressed Ok
 /// </param><param> name="parent" Parent of the dialog widget
 /// </param></remarks>        <return> Text of the selected item. If <code>editable</code> is true this can be
 ///          a text entered by the user.
 ///      </return>
 ///         <short>    Static convenience function to let the user select an item from a  list.</short>
 public static string GetItem(string caption, string label, List<string> list, int current, bool editable, ref bool ok, QWidget parent)
 {
     StackItem[] stack = new StackItem[8];
     #if DEBUG
     stack[1].s_class = (IntPtr) DebugGCHandle.Alloc(caption);
     #else
     stack[1].s_class = (IntPtr) GCHandle.Alloc(caption);
     #endif
     #if DEBUG
     stack[2].s_class = (IntPtr) DebugGCHandle.Alloc(label);
     #else
     stack[2].s_class = (IntPtr) GCHandle.Alloc(label);
     #endif
     #if DEBUG
     stack[3].s_class = (IntPtr) DebugGCHandle.Alloc(list);
     #else
     stack[3].s_class = (IntPtr) GCHandle.Alloc(list);
     #endif
     stack[4].s_int = current;
     stack[5].s_bool = editable;
     stack[6].s_bool = ok;
     #if DEBUG
     stack[7].s_class = (IntPtr) DebugGCHandle.Alloc(parent);
     #else
     stack[7].s_class = (IntPtr) GCHandle.Alloc(parent);
     #endif
     staticInterceptor.Invoke("getItem$$?$$$#", "getItem(const QString&, const QString&, const QStringList&, int, bool, bool*, QWidget*)", stack);
     #if DEBUG
     DebugGCHandle.Free((GCHandle) stack[1].s_class);
     #else
     ((GCHandle) stack[1].s_class).Free();
     #endif
     #if DEBUG
     DebugGCHandle.Free((GCHandle) stack[2].s_class);
     #else
     ((GCHandle) stack[2].s_class).Free();
     #endif
     #if DEBUG
     DebugGCHandle.Free((GCHandle) stack[3].s_class);
     #else
     ((GCHandle) stack[3].s_class).Free();
     #endif
     ok = stack[6].s_bool;
     #if DEBUG
     DebugGCHandle.Free((GCHandle) stack[7].s_class);
     #else
     ((GCHandle) stack[7].s_class).Free();
     #endif
     object returnValue = ((GCHandle) stack[0].s_class).Target;
     #if DEBUG
     DebugGCHandle.Free((GCHandle) stack[0].s_class);
     #else
     ((GCHandle) stack[0].s_class).Free();
     #endif
     return (string) returnValue;
 }
Beispiel #12
0
        public InsertSnippetAction(QWidget parent)
            : base(parent)
        {
            m_ChatWindow = (ChatWindow)parent;

            QObject.Connect<bool>(this, Qt.SIGNAL("triggered(bool)"), HandleOnTriggered);

            base.Text = "Code Snippet...";
            base.icon = Gui.LoadIcon("stock_script", 16);
        }
Beispiel #13
0
    public AnalogClock(QWidget parent)
        : base(parent)
    {
        QTimer timer = new QTimer(this);
        Connect(timer, SIGNAL("timeout()"), this, SLOT("update()"));
        timer.Start(1000);

        WindowTitle = Tr("Analog Clock");
        Resize(200, 200);
    }
Beispiel #14
0
        public InsertSnippetAction(QWidget parent)
            : base(parent)
        {
            m_ChatWindow = (ChatWindow)parent;

            QObject.Connect<bool>(this, Qt.SIGNAL("triggered(bool)"), HandleOnTriggered);

            base.Text = "Code Snippet...";
            base.icon = new QIcon(new QPixmap("resource:/codesnippets/insert-code.png"));
        }
Beispiel #15
0
 public Controller(QWidget parent)
     : base(parent)
 {
     ui = new Ui.Controller();
     ui.SetupUi(this);
     car = new QDBusInterface("com.trolltech.CarExample", "/Car",
                              "com.trolltech.Examples.CarInterface",
                              QDBusConnection.SessionBus(), this);
     StartTimer(1000);
 }
Beispiel #16
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);
 }
Beispiel #17
0
        public MainWindow()
        {
            m_layout = new QHBoxLayout();
            m_label = new QLabel("Hello Qyoto!");
            m_widget = new QWidget(this);

            m_layout.AddWidget(m_label);
            m_widget.SetLayout(m_layout);

            SetCentralWidget(m_widget);
        }
        public LightboxContainerWidget(QWidget parent)
            : base(parent)
        {
            m_LightboxWidget = new QWidget(this);
            m_LightboxWidget.ObjectName = "lightboxWidget";
            new QVBoxLayout(m_LightboxWidget);
            base.AddWidget(m_LightboxWidget);

            ((QStackedLayout)base.Layout()).stackingMode = QStackedLayout.StackingMode.StackAll;
            m_LightboxWidget.Hide();
        }
Beispiel #19
0
Datei: t4.cs Projekt: KDE/qyoto
    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()") );
    }
Beispiel #20
0
Datei: p5.cs Projekt: KDE/kimono
    public MainWindow(string name)
        : base((QWidget) null)
    {
        ObjectName = name;
        SetCaption("KDE Tutorial - p5");

        QMenu filemenu = new QMenu(KDE.I18n("&File"), this);
        filemenu.AddAction(KDE.I18n("&Quit"), KApplication.kApplication(), SLOT("quit()"));

        string about = KDE.I18n("p5 1.0\n\n" +
                 "(C) 1999-2002 Antonio Larrosa Jimenez\n" +
                 "[email protected]\t\[email protected]\n" +
                 "Malaga (Spain)\n\n" +
                 "Simple KDE Tutorial\n" +
                 "This tutorial comes with ABSOLUTELY NO WARRANTY\n" +
                 "This is free software, and you are welcome to redistribute it\n" +
                 "under certain conditions\n");
        QMenu helpmenu = HelpMenu(about);

        KMenuBar menu = MenuBar();
        menu.AddMenu(filemenu);
        menu.AddSeparator();
        menu.AddMenu(helpmenu);

        location = new QLineEdit();
        location.Text = "http://localhost";

        Connect( location , SIGNAL("returnPressed()"),
                    this, SLOT("changeLocation()") );

        QSplitter split = new QSplitter();
        split.OpaqueResize = true;

        QWidget widget = new QWidget(this);

        QVBoxLayout vbox = new QVBoxLayout(widget);
        vbox.AddWidget(location);
        vbox.AddWidget(split);

        QPushButton bookmark = new QPushButton(KDE.I18n("Add to Bookmarks"), split);

        Connect(bookmark, SIGNAL("clicked()"), this, SLOT("BookLocation()"));

        browser = new KHTMLPart(split);
        browser.OpenUrl(new KUrl(location.Text));

        Connect( browser.BrowserExtension(),
                 SIGNAL("openUrlRequest(KUrl, KParts::OpenUrlArguments)"),
                 this, SLOT("OpenUrlRequest(KUrl, KParts::OpenUrlArguments)") );

        SetCentralWidget(widget);
    }
Beispiel #21
0
 public CannonField(QWidget parent)
     : base(parent)
 {
     currentAngle = 45;
     currentForce = 0;
     timerCount = 0;
     autoShootTimer = new QTimer(this);
     Connect(autoShootTimer, SIGNAL("timeout()"), this, SLOT("moveShot()"));
     shootAngle = 0;
     shootForce = 0;
     Palette = new QPalette(new QColor(250, 250, 200));
     AutoFillBackground = true;
 }
Beispiel #22
0
 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);
 }
Beispiel #23
0
Datei: main.cs Projekt: KDE/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();
    }
Beispiel #24
0
        public MainTabWidget(QWidget parent)
            : base(parent)
        {
            var layout = new QVBoxLayout(this);
            layout.Spacing = 0;
            layout.Margin = 0;

            m_Pages = new QStackedWidget(this);
            m_Pages.Layout().Margin = 0;
            layout.AddWidget(m_Pages, 1);

            m_TabBar = new TabBar(this);
            layout.AddWidget(m_TabBar, 0);
        }
Beispiel #25
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);
 }
Beispiel #26
0
        public EditAccountDialog(AccountInfo accountInfo, QWidget parentWindow)
            : base(parentWindow)
        {
            SetupUi();

            m_AccountInfo = accountInfo;

            jidLineEdit.Text = String.Format("{0}@{1}", accountInfo.User, accountInfo.Domain);
            passwordLineEdit.Text = accountInfo.Password;
            resourceCombo.SetEditText(accountInfo.Resource);

            serverLineEdit.Text = accountInfo.ConnectServer;
            portSpinBox.Value = accountInfo.ConnectPort;

            autoConnectCheckBox.Checked = accountInfo.AutoConnect;

            switch (m_AccountInfo.ProxyType) {
            case ProxyType.System:
                comboBox.CurrentIndex = 0;
                ShowProxyWidgets(false);
                break;
            case ProxyType.None:
                comboBox.CurrentIndex = 1;
                ShowProxyWidgets(false);
                break;
            case ProxyType.HTTP:
                comboBox.CurrentIndex = 2;
                ShowProxyWidgets(true);
                break;
            case ProxyType.SOCKS4:
                comboBox.CurrentIndex = 3;
                ShowProxyWidgets(true);
                break;
            case ProxyType.SOCKS5:
                comboBox.CurrentIndex = 4;
                ShowProxyWidgets(true);
                break;
            }
            proxyHostLineEdit.Text = m_AccountInfo.ProxyHost;
            proxyPortSpinBox.Value = m_AccountInfo.ProxyPort;
            proxyUserLineEdit.Text = m_AccountInfo.ProxyUsername;
            proxyPassLineEdit.Text = m_AccountInfo.ProxyPassword;

            this.buttonBox.StandardButtons = (uint)QDialogButtonBox.StandardButton.Ok |
                                             (uint)QDialogButtonBox.StandardButton.Cancel;

            Gui.CenterWidgetOnScreen(this);
        }
Beispiel #27
0
Datei: t3.cs Projekt: KDE/qyoto
    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();
    }
Beispiel #28
0
Datei: t6.cs Projekt: KDE/qyoto
    public LCDRange(QWidget parent)
        : base(parent)
    {
        QLCDNumber lcd  = new QLCDNumber( 2, this );
        lcd.segmentStyle = QLCDNumber.SegmentStyle.Filled;

        QSlider slider = new QSlider( Orientation.Horizontal, this );
        slider.SetRange( 0, 99 );
        slider.Value = 0;
        Connect( slider, SIGNAL("valueChanged(int)"), lcd, SLOT("display(int)") );

        QVBoxLayout layout = new QVBoxLayout();
        layout.AddWidget(lcd);
        layout.AddWidget(slider);
        SetLayout(layout);
    }
        public void ShowLightbox(QWidget widget)
        {
            if (m_LightboxChild != null)
                throw new InvalidOperationException("Lightbox is already visible");

            var layout = (QBoxLayout)m_LightboxWidget.Layout();
            m_LightboxChild = widget;
            widget.SetParent(m_LightboxWidget);
            layout.AddWidget(widget);
            widget.Show();

            base.Widget(1).Enabled = false;

            m_LightboxWidget.Show();
            base.CurrentIndex = 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);
 }
 public override void Paint(Qyoto.QPainter painter, Qyoto.QStyleOptionGraphicsItem option, Qyoto.QWidget widget)
 {
     if (m_Pixmap != null)
     {
         painter.DrawPixmap(m_Rect, m_Pixmap);
     }
 }
Beispiel #32
0
            public override void Paint(Qyoto.QPainter painter, Qyoto.QStyleOptionGraphicsItem option, Qyoto.QWidget widget)
            {
                painter.SetRenderHint(QPainter.RenderHint.Antialiasing, true);
                int iconSize = m_Grid.IconSize;

                // Parent opacity overrides item opacity.
                var parentGroup = (RosterItemGroup)base.Group();

                if (parentGroup == null)                 // This happens while the item is being removed.
                {
                    return;
                }
                if (parentGroup.Opacity != 1)
                {
                    painter.SetOpacity(parentGroup.Opacity);
                }
                else
                {
                    painter.SetOpacity(m_Opacity);
                }

                QPixmap pixmap = (QPixmap)m_Grid.Model.GetImage(m_Item);

                Gui.DrawAvatar(painter, iconSize, iconSize, pixmap);

                if (IsHover)
                {
                    // FIXME: Do something?
                }

                if (m_Grid.ListMode)
                {
                    var rect = BoundingRect();
                    var pen  = new QPen();
                    pen.SetBrush(m_Grid.Palette.Text());
                    painter.SetPen(pen);

                    int x = iconSize + m_Grid.IconPadding;
                    painter.DrawText(x, 0, (int)rect.Width() - x, (int)rect.Height(), (int)Qt.TextFlag.TextSingleLine, m_Grid.Model.GetName(m_Item));
                }
            }
            public override void Paint(Qyoto.QPainter painter, Qyoto.QStyleOptionGraphicsItem option, Qyoto.QWidget widget)
            {
                painter.SetOpacity(m_Opacity);

                var color = m_Grid.Palette.Color(QPalette.ColorRole.Text);

                // Group Name
                painter.SetFont(m_Font);
                painter.SetPen(new QPen(color));

                string text = null;

                if (m_Grid.ShowGroupCounts)
                {
                    text = String.Format("{0} ({1}/{2})",
                                         m_GroupName,
                                         m_Grid.Model.NumOnlineItemsInGroup(m_GroupName),
                                         m_Grid.Model.NumItemsInGroup(m_GroupName));
                }
                else
                {
                    text = m_GroupName;
                }

                painter.DrawText(BoundingRect(), text);

                int arrowX = m_Grid.IconPadding + m_Metrics.Width(text) + 4;
                int arrowY = 5;

                // Group expander arrow
                painter.Save();
                painter.Translate(arrowX, arrowY);
                QPainterPath path = new QPainterPath();

                if (IsExpanded)
                {
                    path.MoveTo(0, 0);
                    path.LineTo(4, 0);
                    path.LineTo(2, 2);
                    path.LineTo(0, 0);
                }
                else
                {
                    path.MoveTo(2, 0);
                    path.LineTo(2, 4);
                    path.LineTo(0, 2);
                    path.LineTo(2, 0);
                }
                painter.SetPen(new QPen(color));
                painter.SetBrush(new QBrush(color));
                painter.DrawPath(path);
                painter.Restore();

                m_ArrowRect = new QRectF(arrowX, 0, 4, m_Grid.HeaderHeight);

                if (ItemOver)
                {
                    painter.SetPen(new QPen(new QColor("red")));
                    painter.DrawRect(BoundingRect());
                }
            }