void ofxUIPageManager::guiEvent(ofxUIEventArgs &e){ string name = e.widget->getName(); // Event listener for all gui pages if (e.widget->getKind() == OFX_UI_WIDGET_BUTTON) { ofxUIButton* w = (ofxUIButton*)e.widget; if (w->getValue()) { if(name == UI_SAVE_LABEL){ // get the widget parent which will be a page (ofxUICanvas) ofxUICanvas* page = (ofxUICanvas*)e.widget->getParent(); string pageName = page->getName(); string path = getPath(pageName); ofLogNotice() << "ofxUIPageManager::saving " << path; page->saveSettings(path); } else if(name == "<" && w->getValue()){ w->mouseReleased(0, 0, true); showPreviousPage(); } else if(name == ">" && w->getValue()){ w->mouseReleased(0, 0, true); showNextPage(); } } } // Page manager specific else if(name == "bg r"){ ofxUISlider *slider = (ofxUISlider *) e.widget; bgColour.r = slider->getScaledValue(); updateAllPages(); } else if(name == "bg g"){ ofxUISlider *slider = (ofxUISlider *) e.widget; bgColour.g = slider->getScaledValue(); updateAllPages(); } else if(name == "bg b"){ ofxUISlider *slider = (ofxUISlider *) e.widget; bgColour.b = slider->getScaledValue(); updateAllPages(); } else if(name == "bg a"){ ofxUISlider *slider = (ofxUISlider *) e.widget; bgColour.a = slider->getScaledValue(); updateAllPages(); } else if (name == "show page list") { pageList->setVisible(isPageListVisible); updateAllPages(); } }
/** * Returns whether a new page has been displayed or not */ bool Grid::selectNext(int off){ selection->setVisible(true); int total = page->items.size(); if(selectindex + off >= total && !hasNextPage()) return false; selectindex += off; if(selectindex >= total){ selectindex %= total; showNextPage(); return true; } else { resized(); } return false; }
LibraryCollectionLayer::LibraryCollectionLayer( QWidget* parent ) : GestureWidget(parent) , m_page(0) { setupUi(this); items.append(collectionItem0); items.append(collectionItem1); items.append(collectionItem2); items.append(collectionItem3); connect(collectionItem0, SIGNAL(tap(int)), this, SLOT(changeCollection(int))); connect(collectionItem1, SIGNAL(tap(int)), this, SLOT(changeCollection(int))); connect(collectionItem2, SIGNAL(tap(int)), this, SLOT(changeCollection(int))); connect(collectionItem3, SIGNAL(tap(int)), this, SLOT(changeCollection(int))); connect(VerticalPagerPopup, SIGNAL(nextPageReq()), this, SLOT(showNextPage())); connect(VerticalPagerPopup, SIGNAL(previousPageReq()), this, SLOT(showPreviousPage())); connect(addNewCollection, SIGNAL(clicked()), this, SIGNAL(createCollection())); }
void ofxUIPageManager::keyPressed(ofKeyEventArgs &e) { int key = e.key; switch (key) { case '[': case '-': showPreviousPage(); break; case ']': case '+': showNextPage(); break; case ' ': if (isVisible) hide(); else show(); break; default: break; } }
bool Presentation::start(AV_View * view) { EV_EditMethodContainer * pEMC = m_pApp->getEditMethodContainer(); g_return_val_if_fail (pEMC != 0, FALSE); m_pView = static_cast<FV_View *>(view); m_sPrevBindings = m_pApp->getInputMode(); _loadPresentationBindings(view); UT_sint32 i = m_pApp->setInputMode("Presentation"); if(i < 0 ) return false; // get a handle to the actual EditMethod EV_EditMethod * pFullScreen = pEMC->findEditMethodByName ("viewFullScreen"); g_return_val_if_fail (pFullScreen != 0, false); const char * sz =""; EV_EditMethodCallData calldata(sz,0); calldata.m_xPos = 0; calldata.m_yPos = 0; m_iPage = 0; XAP_Frame * pFrame = static_cast<XAP_Frame*>(m_pView->getParentData()); m_OldZoomType = pFrame->getZoomType(); m_iOldZoom = pFrame->getZoomPercentage(); pFrame->hideMenuScroll(true); bool b = false; b = (pFullScreen->Fn(view,&calldata) ? TRUE : FALSE); GR_Graphics * pG = m_pView->getGraphics(); // // Let all the configure events propagate to their full extent // for(i= 0; i<20;i++) pFrame->nullUpdate(); pFrame->setZoomType(XAP_Frame::z_PAGEWIDTH); i = m_pView-> calculateZoomPercentForPageWidth(); pFrame->quickZoom(i); for(i= 0; i<20;i++) pFrame->nullUpdate(); b= showNextPage(); if(pG) pG->allCarets()->disable(); return b; }
bool Presentation::showNext(void) { return showNextPage(); }
CMainWindow::CMainWindow(int argc, char *argv[], QWidget *parent) : QMainWindow(parent) { //====================================================================================================================================== QStringList arguments; for (int i = 0; i < argc; i++) { arguments.append(argv[i]); arguments[i].remove("-"); } //====================================================================================================================================== qSetMessagePattern("[%{time h:mm:ss:zzz} %{if-category}%{category}%{endif} %{type}] %{function}: - %{message}"); //====================================================================================================================================== ui.setupUi(this); QSettings settings; m_EventFilter = CEventFilter::Signleton(); m_Data = new CData; //====================================================================================================================================== if (arguments.contains("ip")) { m_WebSocketClient = new CWebSocketClient(QUrl(QString("ws://%1").arg((arguments.at(arguments.indexOf("ip") + 1)))), m_Data); settings.setValue("IPAdress", arguments.at(arguments.indexOf("ip") + 1).split(":").first()); settings.setValue("Port", arguments.at(arguments.indexOf("ip") + 1).split(":").last()); } else m_WebSocketClient = new CWebSocketClient(QUrl(QString("ws://%1:%2").arg(settings.value("IPAdress").toString()).arg(settings.value("Port").toString())), m_Data); //====================================================================================================================================== ////Actions //QAction *action_Close = new QAction(QIcon(QString::fromUtf8(":/Resources/cancel.png")), "Close", this); //QAction *action_FullScreen = new QAction(QIcon(QString::fromUtf8(":/Resources/slideshow_full_screen.png")), "Fullsreen", this); //QAction *action_HomePage = new QAction(QIcon(QString::fromUtf8(":/Resources/home_page.png")), "Home Page", this); //QAction *action_Plotter = new QAction(QIcon(QString::fromUtf8(":/Resources/chart_curve.png")), "Plotter", this); ////====================================================================================================================================== ////Toolbar //ui.toolBar->addAction(action_Close); //ui.toolBar->addAction(action_FullScreen); //ui.toolBar->addSeparator(); //ui.toolBar->setIconSize(QSize(20, 20)); //ui.toolBar->addAction(action_HomePage); //ui.toolBar->addAction(action_Plotter); //====================================================================================================================================== //StartPage m_StartPage = new CStartPage(this); ui.stackedWidget->addWidget(m_StartPage->getView()); //====================================================================================================================================== //Plotter m_Plotter = new CPlotter(this); ui.stackedWidget->addWidget(m_Plotter->getView()); //====================================================================================================================================== //Settings m_Settings = new CSettings(this); ui.stackedWidget->addWidget(m_Settings); //====================================================================================================================================== //====================================================================================================================================== connect(m_EventFilter, SIGNAL(reciveClick()), this, SLOT(showNextPage())); connect(m_EventFilter, SIGNAL(reciveDoubleClick()), this, SLOT(showSettings())); connect(m_Data, SIGNAL(NewDataRecieved()), this, SLOT(onNewData())); connect(m_Settings, SIGNAL(reciveNewURL(QString)), this, SLOT(onNewURL(QString))); connect(m_Settings, SIGNAL(ready()), this, SLOT(showStartpage())); connect(m_WebSocketClient, SIGNAL(serverConnected(QString)), m_Settings, SLOT(onServerConnected(QString))); connect(m_WebSocketClient, SIGNAL(serverDisconnected()), m_Settings, SLOT(onServerDisconnected())); connect(m_WebSocketClient, SIGNAL(recievedInitialScript(QJsonObject)), m_Data, SLOT(recievedInitialScript(QJsonObject))); connect(m_WebSocketClient, SIGNAL(recievedDataScript(QJsonObject)), m_Data, SLOT(recievedDataScript(QJsonObject))); //====================================================================================================================================== //====================================================================================================================================== resize(480, 320); ui.stackedWidget->setCurrentIndex(0); }