Exemplo n.º 1
0
MScetcher::MScetcher(QWidget *parent) :
    QWidget(parent)
{
    mFrame= new QFrame(this);


    QHBoxLayout* hb=new QHBoxLayout(this);
    hb->addWidget(mFrame);
    hb = new QHBoxLayout(mFrame);
    stackedW = new QStackedLayout();
    hb->addLayout(stackedW);

    nPage* pg = new nFirstPage(this);
    pList.append(pg);
    stackedW->addWidget(pg);
    connect(pg,SIGNAL(nextPage()),SLOT(nextPage()));
    connect(pg,SIGNAL(prePage()),SLOT(prePage()));

    pg = new nSecondPage(this);
    pList.append(pg);
    stackedW->addWidget(pg);
    connect(pg,SIGNAL(nextPage()),SLOT(nextPage()));
    connect(pg,SIGNAL(prePage()),SLOT(prePage()));

}
void ChooseAlgorithmType::involvementForRadioButtons()
{
    connect( ui->AllFLradioButton, SIGNAL(released()), this, SLOT(nextPage()) );
    connect( ui->allGAradioButton, SIGNAL(released()), this, SLOT(nextPage()) );
    connect( ui->OneFLradioButton, SIGNAL(released()), this, SLOT(nextPage()) );
    connect( ui->OneGAradioButton, SIGNAL(released()), this, SLOT(nextPage()) );
    connect( ui->standardRadioButton, SIGNAL(released()), this, SLOT(nextPage()) );
}
bool FunctionHintProposalWidget::eventFilter(QObject *obj, QEvent *e)
{
    switch (e->type()) {
    case QEvent::ShortcutOverride:
        if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Escape)
            d->m_escapePressed = true;
        break;
    case QEvent::KeyPress:
        if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Escape)
            d->m_escapePressed = true;
        if (d->m_model->size() > 1) {
            QKeyEvent *ke = static_cast<QKeyEvent*>(e);
            if (ke->key() == Qt::Key_Up) {
                previousPage();
                return true;
            } else if (ke->key() == Qt::Key_Down) {
                nextPage();
                return true;
            }
            return false;
        }
        break;
    case QEvent::KeyRelease:
        if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Escape && d->m_escapePressed) {
            abort();
            return false;
        }
        d->m_assistant->notifyChange();
        break;
    case QEvent::WindowDeactivate:
    case QEvent::FocusOut:
        if (obj != d->m_underlyingWidget)
            break;
        abort();
        break;
    case QEvent::MouseButtonPress:
    case QEvent::MouseButtonRelease:
    case QEvent::MouseButtonDblClick:
    case QEvent::Wheel: {
            QWidget *widget = qobject_cast<QWidget *>(obj);
            if (!d->m_popupFrame->isAncestorOf(widget)) {
                abort();
            } else if (e->type() == QEvent::Wheel) {
                if (static_cast<QWheelEvent*>(e)->delta() > 0)
                    previousPage();
                else
                    nextPage();
                return true;
            }
        }
        break;
    default:
        break;
    }
    return false;
}
Exemplo n.º 4
0
UBWebPluginPDFWidget::UBWebPluginPDFWidget(const QUrl &url, QWidget *parent)
    : UBWebPluginWidget(url, parent)
    , mPreviousPageButton(this)
    , mNextPageButton(this)
    , mPreviousPageAction(0)
    , mNextPageAction(0)
    , mRenderer(0)
    , mScale(1.5)
    , mPageNumber(1)
{
    QIcon previousPageIcon;
    QIcon nextPageIcon;
    previousPageIcon.addFile(":/images/toolbar/previousPage.png", QSize(32, 32), QIcon::Normal);
    nextPageIcon.addFile(":/images/toolbar/nextPage.png", QSize(32, 32), QIcon::Normal);
    mPreviousPageAction = new QAction(previousPageIcon, QString(), this);
    mNextPageAction = new QAction(nextPageIcon, QString(), this);

    connect(mPreviousPageAction, SIGNAL(triggered()), this, SLOT(previousPage()));
    connect(mNextPageAction, SIGNAL(triggered()), this, SLOT(nextPage()));

    mPreviousPageButton.setFixedSize(32, 32);
    mNextPageButton.setFixedSize(32, 32);

    mPreviousPageButton.setDefaultAction(mPreviousPageAction);
    mNextPageButton.setDefaultAction(mNextPageAction);
    mNextPageButton.move(mPreviousPageButton.x() + mPreviousPageButton.width() + 10, mNextPageButton.y());
}
Exemplo n.º 5
0
void kdvi::makeToolBar2(QWidget *parent)
{
    QPixmap pm;

    toolBar2 = new QFrame( parent );

    QBoxLayout * gl = new QBoxLayout( toolBar2, QBoxLayout::Down );

    sbox = new ScrollBox( toolBar2 );
    connect( sbox, SIGNAL(valueChanged(QPoint)),
             dviwin, SLOT(scroll(QPoint)) );
    connect( sbox, SIGNAL(button3Pressed()), dviwin, SLOT(nextPage()) );
    connect( sbox, SIGNAL(button2Pressed()), dviwin, SLOT(prevPage()) );
    connect( dviwin, SIGNAL(pageSizeChanged( QSize )),
             sbox, SLOT(setPageSize( QSize )) );
    connect( dviwin, SIGNAL(viewSizeChanged( QSize )),
             sbox, SLOT(setViewSize( QSize )) );
    connect( dviwin, SIGNAL(currentPosChanged( QPoint )),
             sbox, SLOT(setViewPos( QPoint )) );
    QToolTip::add( sbox, 0, tipgroup, i18n("Scroll window and switch the page") );
    sbox->setFixedSize(70,80);
    gl->addWidget( sbox );

    // Create a MarkList

    marklist = new MarkList( toolBar2 );
    connect( marklist, SIGNAL(selected(const char *)),
             SLOT(pageActivated(const char *)) );
    QToolTip::add( marklist, 0, tipgroup, i18n("Select page and mark pages for printing") );

    gl->addWidget( marklist );
    gl->activate();

    sbox->setPageSize( dviwin->pageSize() );
}
Exemplo n.º 6
0
            //--------------------------------------------------------------
            void Gui::keyPressed(int key) {
                if(!pages.size()) return;

                if(doDefaultKeys) {
                    if(key == ' ') {
                        toggleDraw();
                    } else if(key>='1' && key<='9') {
                        setPage((int)(key - '1')+1);
                        setDraw(true);
                    } else if(doDraw) {
                        switch(key) {
                            case '[': prevPage(); break;
                            case ']': nextPage(); break;
                        }
                    }
                }
                
                if(!doDraw) return;
                ofKeyEventArgs e;
                e.key = key;

                if(!getActiveControls().empty()) {
                    getActiveControls()[0]->_keyPressed(e);
                } else {
                    getCurrentPage().keyPressed(key);
                    Container::keyPressed(key);
                }
            }
Exemplo n.º 7
0
    void LoginPage::init()
    {
        QMap<QString, QString> countryCodes = Utils::GetCountryCodes();
        combobox_->setEditBoxClass("CountrySearchEdit");
        combobox_->setComboboxViewClass("CountrySearchView");
        combobox_->setClass("CountySearchWidgetInternal");
        combobox_->setPlaceholder(QT_TRANSLATE_NOOP("login_page","Type country or code"));
        country_search_widget_->layout()->addWidget(combobox_);
        combobox_->setSources(countryCodes);

        connect(combobox_, SIGNAL(selected(QString)), this, SLOT(countrySelected(QString)), Qt::QueuedConnection);
        connect(this, SIGNAL(country(QString)), this, SLOT(redrawCountryCode()), Qt::QueuedConnection);
        connect(next_page_link_, SIGNAL(clicked()), this, SLOT(nextPage()), Qt::QueuedConnection);
        connect(prev_page_link_, SIGNAL(clicked()), this, SLOT(prevPage()), Qt::QueuedConnection);
        connect(edit_phone_button_, SIGNAL(clicked()), this, SLOT(prevPage()), Qt::QueuedConnection);
        connect(edit_phone_button_, SIGNAL(clicked()), this, SLOT(stats_edit_phone()), Qt::QueuedConnection);
        connect(switch_login_link_, SIGNAL(clicked()), this, SLOT(switchLoginType()), Qt::QueuedConnection);
        connect(resend_button_, SIGNAL(clicked()), this, SLOT(sendCode()), Qt::QueuedConnection);
        connect(resend_button_, SIGNAL(clicked()), this, SLOT(stats_resend_sms()), Qt::QueuedConnection);
        connect(timer_, SIGNAL(timeout()), this, SLOT(updateTimer()), Qt::QueuedConnection);

        connect(proxy_settings_link_, SIGNAL(clicked()), this, SLOT(openProxySettings()), Qt::QueuedConnection);

        country_code_->setProperty("CountryCodeEdit", true);
        phone_->setProperty("PhoneNumberEdit", true);
        phone_->setAttribute(Qt::WA_MacShowFocusRect, false);
        phone_->setPlaceholderText(QT_TRANSLATE_NOOP("login_page","your phone number"));
        phone_widget_->layout()->addWidget(country_code_);
        phone_widget_->layout()->addWidget(phone_);
        Testing::setAccessibleName(phone_, "StartWindowPhoneNumberField");

        connect(country_code_, SIGNAL(focusIn()), this, SLOT(setPhoneFocusIn()), Qt::QueuedConnection);
        connect(country_code_, SIGNAL(focusOut()), this, SLOT(setPhoneFocusOut()), Qt::QueuedConnection);
        connect(phone_, SIGNAL(focusIn()), this, SLOT(setPhoneFocusIn()), Qt::QueuedConnection);
        connect(phone_, SIGNAL(focusOut()), this, SLOT(setPhoneFocusOut()), Qt::QueuedConnection);

        connect(uin_login_edit_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection);
        connect(uin_password_edit_, SIGNAL(textEdited(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection);
        connect(code_edit_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection);
        connect(code_edit_, SIGNAL(textChanged(QString)), this, SLOT(codeEditChanged(QString)), Qt::QueuedConnection);
        connect(country_code_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection);
        connect(country_code_, SIGNAL(textEdited(QString)), this, SLOT(countryCodeChanged(QString)), Qt::QueuedConnection);
        connect(phone_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection);
        connect(phone_, SIGNAL(emptyTextBackspace()), this, SLOT(emptyPhoneRemove()), Qt::QueuedConnection);

        QObject::connect(Ui::GetDispatcher(), SIGNAL(getSmsResult(int64_t, int, int)), this, SLOT(getSmsResult(int64_t, int, int)), Qt::DirectConnection);
        QObject::connect(Ui::GetDispatcher(), SIGNAL(loginResult(int64_t, int)), this, SLOT(loginResult(int64_t, int)), Qt::DirectConnection);
        QObject::connect(Ui::GetDispatcher(), SIGNAL(loginResultAttachUin(int64_t, int)), this, SLOT(loginResultAttachUin(int64_t, int)), Qt::DirectConnection);
        QObject::connect(Ui::GetDispatcher(), SIGNAL(loginResultAttachPhone(int64_t, int)), this, SLOT(loginResultAttachPhone(int64_t, int)), Qt::DirectConnection);

        country_code_->setValidator(new QRegExpValidator(QRegExp("[\\+\\d]\\d*")));
        phone_->setValidator(new QRegExpValidator(QRegExp("\\d*")));
        code_edit_->setValidator(new QRegExpValidator(QRegExp("\\d*")));

        combobox_->selectItem(Utils::GetTranslator()->getCurrentPhoneCode());
        error_label_->hide();
        phone_->setFocus();
        country_code_->setFocusPolicy(Qt::ClickFocus);
        initLoginSubPage(SUBPAGE_PHONE_LOGIN_INDEX);
    }
Exemplo n.º 8
0
void pageNumberEdit::wantNext() { 
  int cur = getCurrentPageNum();
  if ( cur < numberOfPages ) {
    setPageNumber( cur+1 );
    emit nextPage();
  }
}
Exemplo n.º 9
0
 void BookWindow::onMouseWheel(MyGUI::Widget *_sender, int _rel)
 {
     if (_rel < 0)
         nextPage();
     else
         prevPage();
 }
Exemplo n.º 10
0
void CommentWindow::BuildComment()
{
	QVBoxLayout *commentLayout = new QVBoxLayout();
	int count = m_mvModel.m_vComments.size() - MAXPERPAGE*(m_iCurrPage) < MAXPERPAGE
		? m_mvModel.m_vComments.size() - MAXPERPAGE*(m_iCurrPage) : MAXPERPAGE;
	for (int i = 0; i < count; i++)
	{
		BuildSingle(i + MAXPERPAGE*(m_iCurrPage));
		commentLayout->addWidget(m_qwSingleComment);
	}
	commentLayout->addStretch();
	m_qpbPrev = new QPushButton("Prev", m_qwComment);
	m_qpbPrev->setObjectName("detail");
	m_qpbPrev->setFixedSize(DETAIL_W*xscale, DETAIL_H*yscale);
	m_qpbNext = new QPushButton("Next", m_qwComment);
	m_qpbNext->setObjectName("detail");
	m_qpbNext->setFixedSize(DETAIL_W*xscale, DETAIL_H*yscale);
	connect(m_qpbPrev, SIGNAL(clicked()), this, SLOT(prevPage()));
	connect(m_qpbNext, SIGNAL(clicked()), this, SLOT(nextPage()));
	QHBoxLayout *buttonLayout = new QHBoxLayout();
	buttonLayout->addStretch();
	buttonLayout->addWidget(m_qpbPrev);
	buttonLayout->addWidget(m_qpbNext);
	buttonLayout->addSpacing(SPACE);
	commentLayout->addLayout(buttonLayout);
	m_qwComment->setLayout(commentLayout);
	m_qsaArea->setWidget(m_qwComment);
}
Exemplo n.º 11
0
void searchTab::mouseReleaseEvent(QMouseEvent *e)
{
	if (e->button() == Qt::XButton1)
	{ previousPage(); }
	else if (e->button() == Qt::XButton2)
	{ nextPage(); }
}
Exemplo n.º 12
0
const BooksPos BooksTextView::rewind()
{
    SUPER::gotoPosition(0, 0, 0);
    preparePaintInfo();
    if (!textArea().isVisible()) nextPage();
    return position();
}
Exemplo n.º 13
0
void GUIManager::sideBarGUIEvent(ofxUIEventArgs &e) //---------------- Top bar
{
	string name = e.widget->getName();
    
	if (name == SIDE_AUTO_SAVE)
	{
		ofxUIToggle *toggle = (ofxUIToggle *)e.widget;
		isAutoSave = toggle->getValue();
	}
	else if (name == SIDE_SAVE)
	{
		saveSettings();
	}
	else if (name == SIDE_NEXT)
	{
		ofxUIButton *button = (ofxUIButton *)e.widget;
		if (button->getValue()) nextPage();
	}
	else if (name == SIDE_PREVIOUS)
	{
		ofxUIButton *button = (ofxUIButton *)e.widget;
		if (button->getValue()) previousPage();
	}
    else
    {
        for (int i = 0; i < (int)guiPages.size(); i++)
            if (name == guiPages[i]->getName()) currentUIID = i;
        
        showGUI(name);
    }
}
// ------------------
// HintProposalWidget
// ------------------
FunctionHintProposalWidget::FunctionHintProposalWidget()
    : d(new FunctionHintProposalWidgetPrivate)
{
    QToolButton *downArrow = new QToolButton;
    downArrow->setArrowType(Qt::DownArrow);
    downArrow->setFixedSize(16, 16);
    downArrow->setAutoRaise(true);

    QToolButton *upArrow = new QToolButton;
    upArrow->setArrowType(Qt::UpArrow);
    upArrow->setFixedSize(16, 16);
    upArrow->setAutoRaise(true);

    QHBoxLayout *pagerLayout = new QHBoxLayout(d->m_pager);
    pagerLayout->setMargin(0);
    pagerLayout->setSpacing(0);
    pagerLayout->addWidget(upArrow);
    pagerLayout->addWidget(d->m_numberLabel);
    pagerLayout->addWidget(downArrow);

    QHBoxLayout *popupLayout = new QHBoxLayout(d->m_popupFrame);
    popupLayout->setMargin(0);
    popupLayout->setSpacing(0);
    popupLayout->addWidget(d->m_pager);
    popupLayout->addWidget(d->m_hintLabel);

    connect(upArrow, SIGNAL(clicked()), SLOT(previousPage()));
    connect(downArrow, SIGNAL(clicked()), SLOT(nextPage()));

    qApp->installEventFilter(this);

    setFocusPolicy(Qt::NoFocus);
}
Exemplo n.º 15
0
void EPlaybackWing::applyExtraButtons(const QByteArray& data)
{
    /* Check that there's enough data for flags */
    if (data.size() < EWING_PLAYBACK_BYTE_EXTRA_BUTTONS + 1)
        return;

    if (!(data[EWING_PLAYBACK_BYTE_EXTRA_BUTTONS] & EWING_PLAYBACK_BIT_PAGEUP))
    {
        nextPage();
        sendPageData();
    }
    else if (!(data[EWING_PLAYBACK_BYTE_EXTRA_BUTTONS] & EWING_PLAYBACK_BIT_PAGEDOWN))
    {
        previousPage();
        sendPageData();
    }
    else if (!(data[EWING_PLAYBACK_BYTE_EXTRA_BUTTONS] & EWING_PLAYBACK_BIT_BACK))
    {
        /** @todo */
    }
    else if (!(data[EWING_PLAYBACK_BYTE_EXTRA_BUTTONS] & EWING_PLAYBACK_BIT_GO))
    {
        /** @todo */
    }
}
Exemplo n.º 16
0
KexiReportView::KexiReportView(QWidget *parent)
        : KexiView(parent)
{
    m_preRenderer = 0;
    setObjectName("KexiReportDesigner_DataView");
    m_scrollArea = new QScrollArea(this);
    m_scrollArea->setBackgroundRole(QPalette::Dark);
    m_scrollArea->viewport()->setAutoFillBackground(true);

    m_pageSelector = new KexiRecordNavigator(this, 0);
    layout()->addWidget(m_scrollArea);
    layout()->addWidget(m_pageSelector);

    m_pageSelector->setRecordCount(0);
    m_pageSelector->setInsertingButtonVisible(false);
    m_pageSelector->setLabelText(i18n("Page"));


    // -- setup local actions
    QList<QAction*> viewActions;
    QAction* a;
    viewActions << (a = new KAction(KIcon("printer"), i18n("Print"), this));
    a->setObjectName("pgzkexirpt_print_report");
    a->setToolTip(i18n("Print Report"));
    a->setWhatsThis(i18n("Prints the current report."));
    connect(a, SIGNAL(triggered()), this, SLOT(slotPrintReport()));

    viewActions << (a = new KAction(KIcon("kword"), i18n("Open in KWord"), this));
    a->setObjectName("pgzkexirpt_open_kword");
    a->setToolTip(i18n("Open the report in KWord"));
    a->setWhatsThis(i18n("Opens the current report in KWord."));
    a->setEnabled(false);
//! @todo connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKWord()));

#ifdef HAVE_KSPREAD
    viewActions << (a = new KAction(KIcon("kspread"), i18n("Open in KSpread"), this));
    a->setObjectName("pgzkexirpt_open_kspread");
    a->setToolTip(i18n("Open the report in KSpread"));
    a->setWhatsThis(i18n("Opens the current report in KSpread."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKSpread()));
#endif

    viewActions << (a = new KAction(KIcon("text-html"), i18n("Export to HTML"), this));
    a->setObjectName("pgzkexirpt_export_html");
    a->setToolTip(i18n("Export the report to HTML"));
    a->setWhatsThis(i18n("Exports the report to a HTML file."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportHTML()));

    setViewActions(viewActions);


    connect(m_pageSelector, SIGNAL(nextButtonClicked()), this, SLOT(nextPage()));
    connect(m_pageSelector, SIGNAL(prevButtonClicked()), this, SLOT(prevPage()));
    connect(m_pageSelector, SIGNAL(firstButtonClicked()), this, SLOT(firstPage()));
    connect(m_pageSelector, SIGNAL(lastButtonClicked()), this, SLOT(lastPage()));

}
Exemplo n.º 17
0
void LibraryPageHandler::nextPageReleased()
{
    if(nextPageTimer.isActive() && !m_firstPageLaunched)
    {
        nextPageTimer.stop();
        nextPage();
    }
    m_lastPageLaunched = false;
}
Exemplo n.º 18
0
KexiReportView::KexiReportView(QWidget *parent)
        : KexiView(parent), m_preRenderer(0), m_reportDocument(0), m_kexi(0), m_functions(0)
{   
    setObjectName("KexiReportDesigner_DataView");
    m_scrollArea = new QScrollArea(this);
    m_scrollArea->setBackgroundRole(QPalette::Dark);
    m_scrollArea->viewport()->setAutoFillBackground(true);

    layout()->addWidget(m_scrollArea);
    
#ifndef KEXI_MOBILE
    m_pageSelector = new KexiRecordNavigator(this, 0);
    layout()->addWidget(m_pageSelector);
    m_pageSelector->setRecordCount(0);
    m_pageSelector->setInsertingButtonVisible(false);
    m_pageSelector->setLabelText(i18n("Page"));
#endif
    
    // -- setup local actions
    QList<QAction*> viewActions;
    QAction* a;
    viewActions << (a = new KAction(KIcon("printer"), i18n("Print"), this));
    a->setObjectName("print_report");
    a->setToolTip(i18n("Print Report"));
    a->setWhatsThis(i18n("Prints the current report."));
    connect(a, SIGNAL(triggered()), this, SLOT(slotPrintReport()));

    viewActions << (a = new KAction(KIcon("kword"), i18n("Save to KWord"), this));
    a->setObjectName("save_to_kword");
    a->setToolTip(i18n("Save the report to a KWord document"));
    a->setWhatsThis(i18n("Save the report to a KWord document"));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderODT()));

    viewActions << (a = new KAction(KIcon("kspread"), i18n("Save to KSpread"), this));
    a->setObjectName("save_to_kspread");
    a->setToolTip(i18n("Save the report to a KSpread document"));
    a->setWhatsThis(i18n("Saves the current report to a KSpread document."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKSpread()));

    viewActions << (a = new KAction(KIcon("text-html"), i18n("Export as Web Page"), this));
    a->setObjectName("export_as_web_page");
    a->setToolTip(i18n("Export the report as web page"));
    a->setWhatsThis(i18n("Exports the report to a web page file."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportHTML()));

    setViewActions(viewActions);

#ifndef KEXI_MOBILE
    connect(m_pageSelector, SIGNAL(nextButtonClicked()), this, SLOT(nextPage()));
    connect(m_pageSelector, SIGNAL(prevButtonClicked()), this, SLOT(prevPage()));
    connect(m_pageSelector, SIGNAL(firstButtonClicked()), this, SLOT(firstPage()));
    connect(m_pageSelector, SIGNAL(lastButtonClicked()), this, SLOT(lastPage()));
#endif
}
Exemplo n.º 19
0
void ofxSimpleGuiToo::keyPressed(ofKeyEventArgs &e) {
	//ofLog(OF_LOG_VERBOSE, ofToString(e.key));
	
	if(doDefaultKeys && keyboardShortcutsEnabled) {
		if(e.key == ' ') {
			toggleDraw();
			/* disabled for keyboard editing
			 } else if(e.key>='0' && e.key<='9') {
			 setPage((int)(e.key - '0'));
			 setDraw(true);
			 */
		} else if(doDraw) {
			switch(e.key) {
				case '[': prevPage(); break;
				case ']': nextPage(); break;
					//case 'p': focusPrev(); break;
					//case 'l': focusNext(); break;
				case 'g': 
					setPage(1); 
					setDraw(true);
					break;
				case 'G': gui.setAlignRight(!gui.getAlignRight()); break;
				case OF_KEY_UP:
					gui.currentPage().onKeyUp();
					break;
				case OF_KEY_DOWN:
					//focusNext();
					gui.currentPage().onKeyDown();
					break;
				case OF_KEY_LEFT:
					gui.currentPage().onKeyLeft();
					break;
				case OF_KEY_RIGHT:
					gui.currentPage().onKeyRight();
					break;
				case OF_KEY_RETURN:
					gui.currentPage().onKeyEnter();
					break;
			}
		}
	}
	
	// check and trigger keyboard shortcuts
	if(keyboardShortcutsEnabled){
		map<int,ofxSimpleGuiEventTrigger*>::iterator it = keyboardShortcuts.find(e.key);
		if(it != keyboardShortcuts.end()){ //< if already exists
			it->second->trigger();
		}
	}
	
	if(doDraw) {
		headerPage->keyPressed(e);
		pages[currentPageIndex]->keyPressed(e);
	}
	
}
Exemplo n.º 20
0
bool PageCurl::qt_emit( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: prevPage(); break;
    case 1: nextPage(); break;
    default:
	return QWidget::qt_emit(_id,_o);
    }
    return TRUE;
}
Exemplo n.º 21
0
QScrollBar *ZLQtViewWidget::addScrollBar(QGridLayout *layout, Qt::Orientation orientation, int x, int y) {
	QScrollBar *scrollBar = new QScrollBar(orientation, myFrame);
	layout->addWidget(scrollBar, x, y);
	scrollBar->hide();
	if (orientation == Qt::Vertical) {
		connect(scrollBar, SIGNAL(sliderMoved(int)), this, SLOT(onVerticalSliderMoved(int)));
		connect(scrollBar, SIGNAL(nextLine()), this, SLOT(onVerticalSliderStepNext()));
		connect(scrollBar, SIGNAL(nextPage()), this, SLOT(onVerticalSliderPageNext()));
		connect(scrollBar, SIGNAL(prevLine()), this, SLOT(onVerticalSliderStepPrevious()));
		connect(scrollBar, SIGNAL(prevPage()), this, SLOT(onVerticalSliderPagePrevious()));
	} else {
SettingsGeneralTermsInfo::SettingsGeneralTermsInfo(QWidget* parent) : FullScreenWidget(parent){

        qDebug() << "--->" << Q_FUNC_INFO;
        setupUi(this);

        connect(backBtn,SIGNAL(clicked()),this, SIGNAL(hideMe()));
        connect(verticalPage, SIGNAL(previousPageReq()),  this , SLOT(previousPage()));
        connect(verticalPage, SIGNAL(nextPageReq()), this, SLOT(nextPage()));
        generalTermsResult->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
        vbar = generalTermsResult->verticalScrollBar();
}
Exemplo n.º 23
0
QDesignerQ3WidgetStack::QDesignerQ3WidgetStack(QWidget *parent) : 
    Q3WidgetStack(parent), 
    m_prev(createToolButton(this, Qt::LeftArrow,  QLatin1String("__qt__passive_prev"))),
    m_next(createToolButton(this, Qt::RightArrow, QLatin1String("__qt__passive_next")))
{
    connect(m_prev, SIGNAL(clicked()), this, SLOT(prevPage()));
    connect(m_next, SIGNAL(clicked()), this, SLOT(nextPage()));
    updateButtons();

    connect(this, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentChanged(int)));
}
Exemplo n.º 24
0
void EigenGraspDlg::setSlaveLayout( int nGrasps )
{
	mainLayout = new QVBoxLayout(mSlave, 5);

	QLabel *valueLabel = new QLabel(QString("Value:"), mSlave);
	QLabel *amplLabel = new QLabel(QString("Amplitude:"), mSlave);
	QLabel *fixedLabel = new QLabel(QString("Fixed"), mSlave);

	QHBoxLayout *fakeRow = new QHBoxLayout(mainLayout,-1);
	fakeRow->addSpacing(400);

	QHBoxLayout *labelRow = new QHBoxLayout(mainLayout,-1);
	labelRow->addSpacing(5);
	labelRow->addWidget(valueLabel,0);
	labelRow->addWidget(amplLabel,1,Qt::AlignHCenter);
	labelRow->addWidget(fixedLabel,0);
	labelRow->addSpacing(5);
	mainLayout->addLayout(labelRow);

	for (int i=0; i<nGrasps; i++) {
		QHBoxLayout *graspRow = new QHBoxLayout(mainLayout,10);
	
		QLabel *eigenValue = new QLabel(QString("0.0"), mSlave);
		QScrollBar *bar = new QScrollBar(Qt::Horizontal, mSlave);
		bar->setRange( -SLIDER_STEPS, SLIDER_STEPS );
		bar->setPageStep(5000);
		bar->setLineStep(1000);
		bar->setValue(0);
		QCheckBox *box = new QCheckBox(mSlave);

		graspRow->addSpacing(15);
		graspRow->addWidget(eigenValue,0);
		graspRow->addWidget(bar,1);
		graspRow->addWidget(box,0);
		graspRow->addSpacing(15);

		mValueList.push_back(eigenValue);
		mBarList.push_back(bar);
		mCheckList.push_back(box);

		connect(bar,SIGNAL(sliderMoved(int)), this, SLOT(eigenGraspChanged()) );
		//comment this one out
		//connect(bar,SIGNAL(valueChanged(int)), this, SLOT(eigenGraspChanged()) );
		connect(bar,SIGNAL(nextLine()), this, SLOT(eigenGraspChanged()) );
		connect(bar,SIGNAL(prevLine()), this, SLOT(eigenGraspChanged()) );
		connect(bar,SIGNAL(nextPage()), this, SLOT(eigenGraspChanged()) );
		connect(bar,SIGNAL(prevPage()), this, SLOT(eigenGraspChanged()) );
		connect(bar,SIGNAL(sliderReleased()), this, SLOT(eigenGraspChanged()) );
		connect(box,SIGNAL(clicked()), this, SLOT(fixBoxChanged()) );
	}	
	mainLayout->addSpacing(20);
}
Exemplo n.º 25
0
void ShootEmUp::instructions() {
	_vm->_graphics->blackOutScreen();
	_vm->_graphics->seuDrawPicture(25, 25, kFacingRight);
	_vm->_graphics->drawNormalText("< Avvy, our hero, needs your help - you must move him around.", _vm->_font, 8, 60, 35, kColorWhite);
	_vm->_graphics->drawNormalText("(He''s too terrified to move himself!)", _vm->_font, 8, 80, 45, kColorWhite);
	_vm->_graphics->drawNormalText("Your task is to prevent the people in the stocks from escaping", _vm->_font, 8, 0, 75, kColorWhite);
	_vm->_graphics->drawNormalText("by pelting them with rotten fruit, eggs and bread. The keys are:", _vm->_font, 8, 0, 85, kColorWhite);
	_vm->_graphics->drawNormalText("LEFT SHIFT", _vm->_font, 8, 80, 115, kColorWhite);
	_vm->_graphics->drawNormalText("Move left.", _vm->_font, 8, 200, 115, kColorWhite);
	_vm->_graphics->drawNormalText("RIGHT SHIFT", _vm->_font, 8, 72, 135, kColorWhite);
	_vm->_graphics->drawNormalText("Move right.", _vm->_font, 8, 200, 135, kColorWhite);
	_vm->_graphics->drawNormalText("ALT", _vm->_font, 8, 136, 155, kColorWhite);
	_vm->_graphics->drawNormalText("Throw something.", _vm->_font, 8, 200, 155, kColorWhite);

	nextPage();

	_vm->_graphics->seuDrawPicture(25, 35, kStocks);
	_vm->_graphics->drawNormalText("This man is in the stocks. Your job is to stop him getting out.", _vm->_font, 8, 80, 35, kColorWhite);
	_vm->_graphics->drawNormalText("UNFORTUNATELY... the locks on the stocks are loose, and every", _vm->_font, 8, 88, 45, kColorWhite);
	_vm->_graphics->drawNormalText("so often, someone will discover this and try to get out.", _vm->_font, 8, 88, 55, kColorWhite);
	_vm->_graphics->seuDrawPicture(25, 85, kStocks + 2);
	_vm->_graphics->drawNormalText("< Someone who has found a way out!", _vm->_font, 8, 80, 85, kColorWhite);
	_vm->_graphics->drawNormalText("You MUST IMMEDIATELY hit people smiling like this, or they", _vm->_font, 8, 88, 95, kColorWhite);
	_vm->_graphics->drawNormalText("will disappear and lose you points.", _vm->_font, 8, 88, 105, kColorWhite);
	_vm->_graphics->seuDrawPicture(25, 125, kStocks + 5);
	_vm->_graphics->seuDrawPicture(25, 155, kStocks + 4);
	_vm->_graphics->drawNormalText("< Oh dear!", _vm->_font, 8, 80, 125, kColorWhite);

	nextPage();

	_vm->_graphics->drawNormalText("Your task is made harder by:", _vm->_font, 8, 0, 35, kColorWhite);
	_vm->_graphics->seuDrawPicture(25, 55, 48);
	_vm->_graphics->drawNormalText("< Yokels. These people will run in front of you. If you hit", _vm->_font, 8, 60, 55, kColorWhite);
	_vm->_graphics->drawNormalText("them, you will lose MORE points than you get hitting people", _vm->_font, 8, 68, 65, kColorWhite);
	_vm->_graphics->drawNormalText("in the stocks. So BEWARE!", _vm->_font, 8, 68, 75, kColorWhite);
	_vm->_graphics->drawNormalText("Good luck with the game!", _vm->_font, 8, 80, 125, kColorWhite);

	nextPage();
}
Exemplo n.º 26
0
MiniBar::MiniBar( QWidget * parent, KPDFDocument * document )
    : QFrame( parent, "miniBar" ), m_document( document ),
    m_currentPage( -1 )
{
    // left spacer
    QHBoxLayout * horLayout = new QHBoxLayout( this );
    QSpacerItem * spacerL = new QSpacerItem( 20, 10, QSizePolicy::Expanding );
    horLayout->addItem( spacerL );

    // central 2r by 3c grid layout that contains all components
    QGridLayout * gridLayout = new QGridLayout( 0, 3,5, 2,1 );
     // top spacer 6x6 px
//     QSpacerItem * spacerTop = new QSpacerItem( 6, 6, QSizePolicy::Fixed, QSizePolicy::Fixed );
//     gridLayout->addMultiCell( spacerTop, 0, 0, 0, 4 );
     // center progress widget
     m_progressWidget = new ProgressWidget( this );
     gridLayout->addMultiCellWidget( m_progressWidget, 0, 0, 0, 4 );
     // bottom: left prev_page button
     m_prevButton = new HoverButton( this );
     m_prevButton->setIconSet( SmallIconSet( QApplication::reverseLayout() ? "1rightarrow" : "1leftarrow" ) );
     gridLayout->addWidget( m_prevButton, 1, 0 );
     // bottom: left lineEdit (current page box)
     m_pagesEdit = new PagesEdit( this );
     gridLayout->addWidget( m_pagesEdit, 1, 1 );
     // bottom: central '/' label
     gridLayout->addWidget( new QLabel( "/", this ), 1, 2 );
     // bottom: right button
     m_pagesButton = new HoverButton( this );
     gridLayout->addWidget( m_pagesButton, 1, 3 );
     // bottom: right next_page button
     m_nextButton = new HoverButton( this );
     m_nextButton->setIconSet( SmallIconSet( QApplication::reverseLayout() ? "1leftarrow" : "1rightarrow" ) );
     gridLayout->addWidget( m_nextButton, 1, 4 );
    horLayout->addLayout( gridLayout );

    // right spacer
    QSpacerItem * spacerR = new QSpacerItem( 20, 10, QSizePolicy::Expanding );
    horLayout->addItem( spacerR );

    // customize own look
    setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );

    // connect signals from child widgets to internal handlers / signals bouncers
    connect( m_pagesEdit, SIGNAL( returnPressed() ), this, SLOT( slotChangePage() ) );
    connect( m_pagesButton, SIGNAL( clicked() ), this, SIGNAL( gotoPage() ) );
    connect( m_prevButton, SIGNAL( clicked() ), this, SIGNAL( prevPage() ) );
    connect( m_nextButton, SIGNAL( clicked() ), this, SIGNAL( nextPage() ) );

    // widget starts hidden (will be shown after opening a document)
    parent->hide();
}
Exemplo n.º 27
0
Arquivo: db.c Projeto: jpverdejo/kv-db
// Funcion que escribe una palabra en un archivo (Consumidor)
void * save(void * input) {
	sem_wait(Wavailable);

	// Obtenemos el indice entregado, con eso buscaremos la informacion necesaria 
	int indice = (int) input;

	// Creamos una copia de la instruccion correpondiente
	// Guardamos aparte la palabra para evitar problemas con un posible futuro realloc del arreglo de instrucciones
	pthread_mutex_lock(&instructionsMutex);
	Instruction i = instructions[indice];
	char * word = i.word;
	pthread_mutex_unlock(&instructionsMutex);
	
	Page page = nextPage(word);
	int index = getIndex(page.letter);

	pthread_mutex_lock(pages_mutexs[index]);
	
	page = nextPage(word);
	index = getIndex(page.letter);

	FILE *fp = fopen(page.filename, "a");
	if(fp != NULL) {
		fprintf (fp, "%s\n", word);
	}
	fclose(fp);

	size_t string_size = snprintf(NULL, 0, "[SAVE] %c.%d.%d:%s", page.letter, page.number, page.index, word);
	char * string = (char *)malloc(string_size + 1);
	snprintf(string, string_size +1, "[SAVE] %c.%d.%d:%s", page.letter, page.number, page.index, word);
	printMessage(i, string);

	pthread_mutex_unlock(pages_mutexs[index]);

	sem_post(Wavailable);

	return NULL;
}
Exemplo n.º 28
0
BrowserPageSlider::BrowserPageSlider(QWidget *parent)
    : QFrame(parent)

{
    setupUi(this);

    connect(label, SIGNAL(clicked()), this, SIGNAL(buttonClicked()));
    connect(QBookApp::instance(),SIGNAL(swipe(int)),this,SLOT(handleSwipe(int)));
    connect(downPageBtn, SIGNAL(clicked()), this, SLOT(nextPage()));
    connect(upPageBtn,   SIGNAL(clicked()), this, SLOT(previousPage()));
    noteMode->setStyleSheet("background:none;");

    m_isShowPageOnly = false;
}
Exemplo n.º 29
0
bool LevelMenuScene::TouchBegan(Touch *touch, Event *event) {

	int x = touch->getLocation().x;
	int y = touch->getLocation().y;

	rectangle_ = new PRectangle(x, y, 20, 20);

	nextPage(buttonArrowLeft_, 0);
	nextPage(buttonArrowRight_, LAST_PAGE);
	
	buttonArrowLeft_->show(page_, 0);
	buttonArrowRight_->show(page_, LAST_PAGE);

	for (int i = 0; i < levels_.size(); i++){
		if (!levels_.at(i)->getLock() && levels_.at(i)->getRect()->intersects(rectangle_)){
			getEventDispatcher()->removeEventListener(touchListener_);
			CocosDenshion::SimpleAudioEngine::getInstance()->stopBackgroundMusic();
			Director::getInstance()->pushScene(WorldScene::create(levels_.at(i)->getName(), i, soundController_)->getScene());
		}
	}

	return true;
}
Exemplo n.º 30
0
//void ofxSimpleGuiToo::setup(ofEventArgs &e) {
void ofxSimpleGuiToo::update(ofEventArgs &e) {
	if(changePage) {
		nextPage();
		changePage = false;
	}

	headerPage->update(e);
	pages[currentPageIndex]->height = ofGetHeight();
	pages[currentPageIndex]->update(e);


//	if(doSaveBackup) doSave = true;

	if(doSave) saveToXML();
}