Transition::Ptr Type::StateTransition(State::Ptr inBeginStatePtr, State::Ptr inEndStatePtr)
            {
                Transition::Ptr TransPtr = WIZ_NEW Transition::Type;
                if (::Wiz::IsValidPtr(TransPtr))
                {
                    if (LinkNode(TransPtr, inBeginStatePtr, inEndStatePtr))
                    {
                        insertLink(TransPtr);
                        return TransPtr;
                    }

                    WIZ_DEL TransPtr;
                    TransPtr = WIZ_NULL;
                }

                return WIZ_NULL;
            }
            Transition::Epsilon::Ptr Type::EpsilonTransition(State::Ptr inBeginStatePtr, State::Ptr inEndStatePtr)
            {
                Transition::Epsilon::Ptr EpsilonPtr = WIZ_NEW Transition::Epsilon::Type;
                if (::Wiz::IsValidPtr(EpsilonPtr))
                {
                    if (LinkNode(EpsilonPtr, inBeginStatePtr, inEndStatePtr))
                    {
                        insertLink(EpsilonPtr);
                        return EpsilonPtr;
                    }

                    WIZ_DEL EpsilonPtr;
                    EpsilonPtr = WIZ_NULL;
                }

                return WIZ_NULL;
            }
Exemplo n.º 3
0
void WordEditFrame::on_contextButton_clicked()
{
    QMenu *contextMenu=new QMenu(this);

    QMenu *autoTextMenu=contextMenu->addMenu("Вставить авто-текст");

    autoTextMenu->addAction("Страница", this, SLOT(insertPage()));
    autoTextMenu->addAction("Количество страниц", this, SLOT(insertPageCount()));

    contextMenu->addAction("Вставить переменную", this, SLOT(insertLink()));

    setGeometryInDesktop(contextMenu,
                         cursor().pos().x(),
                         cursor().pos().y(),
                         contextMenu->sizeHint().width(),
                         contextMenu->sizeHint().height());

    contextMenu->show();
}
Exemplo n.º 4
0
void ReferencesTool::createActions()
{
    QWidgetAction *wAction = 0;

    QAction *action = new QAction(i18n("Insert"), this);
    addAction("insert_tableofcontents", action);
    action->setToolTip(i18n("Insert a Table of Contents into the document."));

    action = new QAction(i18n("Insert Custom..."), this);
    addAction("insert_configure_tableofcontents", action);
    action->setToolTip(i18n("Insert a custom Table of Contents into the document."));

    action = new QAction(koIcon("configure"), i18n("Configure..."), this);
    addAction("format_tableofcontents", action);
    action->setToolTip(i18n("Configure the Table of Contents"));
    connect(action, SIGNAL(triggered()), this, SLOT(formatTableOfContents()));

    action = new QAction(i18n("Insert footnote with auto number"),this);
    addAction("insert_autofootnote",action);
    connect(action, SIGNAL(triggered()), this, SLOT(insertAutoFootNote()));

    wAction = new QWidgetAction(this);
    wAction->setText(i18n("Insert Labeled Footnote"));
    QWidget *w = new LabeledWidget(wAction, i18n("Insert with label:"), LabeledWidget::INLINE, false);
    wAction->setDefaultWidget(w);
    addAction("insert_labeledfootnote", wAction);
    connect(w, SIGNAL(triggered(QString)), this, SLOT(insertLabeledFootNote(QString)));

    action = new QAction(i18n("Insert endnote with auto number"),this);
    addAction("insert_autoendnote",action);
    connect(action, SIGNAL(triggered()), this, SLOT(insertAutoEndNote()));

    wAction = new QWidgetAction(this);
    wAction->setText(i18n("Insert Labeled Endnote"));
    w = new LabeledWidget(wAction, i18n("Insert with label:"), LabeledWidget::INLINE, false);
    wAction->setDefaultWidget(w);
    addAction("insert_labeledendnote", wAction); connect(w, SIGNAL(triggered(QString)), this, SLOT(insertLabeledEndNote(QString)));

    action = new QAction(koIcon("configure"), i18n("Settings..."), this);
    addAction("format_footnotes",action);
    connect(action, SIGNAL(triggered()), this, SLOT(showFootnotesConfigureDialog()));

    action = new QAction(koIcon("configure"), i18n("Settings..."), this);
    addAction("format_endnotes",action);
    connect(action, SIGNAL(triggered()), this, SLOT(showEndnotesConfigureDialog()));

    action = new QAction(i18n("Insert Citation"), this);
    addAction("insert_citation",action);
    action->setToolTip(i18n("Insert a citation into the document."));
    connect(action, SIGNAL(triggered()), this, SLOT(insertCitation()));

    action = new QAction(i18n("Insert Bibliography"), this);
    addAction("insert_bibliography",action);
    action->setToolTip(i18n("Insert a bibliography into the document."));

    action = new QAction(i18n("Insert Custom Bibliography"), this);
    addAction("insert_custom_bibliography", action);
    action->setToolTip(i18n("Insert a custom Bibliography into the document."));

    action = new QAction(i18n("Configure"),this);
    addAction("configure_bibliography",action);
    action->setToolTip(i18n("Configure the bibliography"));
    connect(action, SIGNAL(triggered()), this, SLOT(configureBibliography()));

    action = new QAction(i18n("Insert Link"), this);
    addAction("insert_link", action);
    action->setToolTip(i18n("Insert a weblink or link to a bookmark."));
    connect(action, SIGNAL(triggered()), this, SLOT(insertLink()));

    wAction = new QWidgetAction(this);
    wAction->setText(i18n("Add Bookmark"));
    m_bmark = new LabeledWidget(wAction, i18n("Add Bookmark :"), LabeledWidget::ABOVE, true);
    connect(m_bmark, SIGNAL(lineEditChanged(QString)), this, SLOT(validateBookmark(QString)));
    wAction->setDefaultWidget(m_bmark);
    addAction("insert_bookmark", wAction);
    connect(m_bmark, SIGNAL(triggered(QString)), this, SLOT(insertBookmark(QString)));
    wAction->setToolTip(i18n("Insert a Bookmark. This is useful to create links that point to areas within the document"));

    action = new QAction(i18n("Bookmarks"), this);
    addAction("invoke_bookmark_handler", action);
    action->setToolTip(i18n("Display a pop up that hosts the options to add new Bookmark or handle existing Bookmarks"));

    action = new QAction(i18n("Manage Bookmarks"), this);
    addAction("manage_bookmarks", action);
    action->setToolTip(i18n("Manage your Bookmarks. Check where are they pointing to, Delete or Rename."));
}