void SWizard::loadPages() { for (int x = 0; x < this->wizardPages.size(); x++) { ui->pageLayout->addWidget(this->wizardPages[x]); } switchPage(); }
void SimpleWizard::backButtonClicked() { ui.nextButton->setEnabled(true); QWidget *oldPage = mHistory.takeLast(); switchPage(oldPage, mHistory.last()); delete oldPage; }
void TabBar::onNotify(LPNMHDR info, LPARAM) { switch(info->code) { case TCN_SELCHANGE: switchPage(); break; }; }
bool Help::handleMouse(const Common::Event &event) { Common::Point mousePos; mousePos.x = event.mouse.x; mousePos.y = event.mouse.y / 2; int index = -1; if (event.type == Common::EVENT_LBUTTONUP) { // Clicked *somewhere*... _holdLeft = false; if ((mousePos.x < 470) || (mousePos.x > 550) || (((mousePos.y - 13) % 27) > 20)) index = -1; else // Clicked on a button. index = ((mousePos.y - 13) / 27) - 1; } else { // LBUTTONDOWN or MOUSEMOVE int highlightIs = 0; // Decide which button we are hovering the cursor over: if ((mousePos.x > 470) && (mousePos.x <= 550) && (((mousePos.y - 13) % 27) <= 20)) { // No click, so highlight. highlightIs = (mousePos.y - 13) / 27 - 1; if ((highlightIs < 0) || (5 < highlightIs)) highlightIs = 177; // In case of silly values. } else highlightIs = 177; Color highlightColor = kColorLightblue; // If we clicked on a button or we are holding down the button, we have to highlight it with cyan: if (((highlightIs != 177) && (event.type == Common::EVENT_LBUTTONDOWN)) || _holdLeft) { _holdLeft = true; highlightColor = kColorLightcyan; } // Erase the previous highlight only if it's needed: if (_highlightWas != highlightIs) _vm->_graphics->helpDrawHighlight(_highlightWas, kColorBlue); // Highlight the current one with the proper color: if ((highlightIs != 177) && (_buttons[highlightIs]._trigger != Common::KEYCODE_INVALID)) { _highlightWas = highlightIs; _vm->_graphics->helpDrawHighlight(highlightIs, highlightColor); } } if ((index >= 0) && (_buttons[index]._trigger != Common::KEYCODE_INVALID)) { if (_buttons[index]._trigger == Common::KEYCODE_ESCAPE) return true; else { _vm->fadeOut(); switchPage(_buttons[index]._whither); _vm->fadeIn(); return false; } } return false; }
void Reset(void) { unsigned char data; switchPage(0x00); data = 0x01; Write8BitRegisters(F01CommandBase, &data, 1); msleep(10); }
inline void page_modifySchedule(){ static int value = 0; static schedule s = node_get(node_index); if(pre_page != MODIFY_SCHEDULE) { PTLS("Page Modify Schedule"); lcd.cursor(); pre_page = MODIFY_SCHEDULE; //Need to reintialize everytime we enter the page but not every refresh s = node_get(node_index); value = 0; } String t = getTimeString(s); lcd.print(t); lcd.setCursor(0,1); lcd.print("Temp: " + (String) s.temperature); if (button_input == PLUS_UP || button_input == PLUS_HOLD) { if (value == 0) { s.day++; if (s.day >= 8) s.day = 1; } else if (value == 1) { s.hour++; if (s.hour >= 24) s.hour = 0; } else if (value == 2) { s.minute++; if (s.minute >= 60) s.minute = 0; } else if (value == 3) { s.temperature++; if (s.temperature >= 99) s.temperature = 99; } } else if (button_input == MINUS_UP || button_input == MINUS_HOLD) { if (value == 0) { s.day--; if (s.day <= 0) s.day = 7; } else if (value == 1) { s.hour--; if (s.hour >= 24) s.hour = 23; } else if (value == 2) { s.minute--; if (s.minute >= 60) s.minute = 59; } else if (value == 3) { s.temperature--; if (s.temperature <= 32 || s.temperature >= 99) s.temperature = 32; } } else if (button_input == MODE_UP) { value += 1; value = value % 4; } else if (button_input == SET_UP) { node_edit(node_index,s); switchPage(PICK_SCHEDULE); } }
void SWizard::stepNext() { if (this->currentPage == (this->wizardPages.size() - 1)) { emit wizardFinished(); } else { this->currentPage++; switchPage(); } }
inline void page_listMode() { static char selected = 0; if(pre_page != LIST_MODE) { PTLS("Page List Modes"); lcd.cursor(); pre_page = LIST_MODE; selected = 0; } lcd.print(menu[selected % 4]); lcd.setCursor(0,1); lcd.print(menu[((selected+1) % 4)]); if(button_input == PLUS_UP || button_input == PLUS_HOLD) { selected += 1; selected = selected % 4; } else if (button_input == MINUS_UP || button_input == MINUS_HOLD) { selected -= 1; if(selected == -1) { selected = 3; } } else if (button_input == MODE_UP) { switchPage(HOME); } else if (button_input == SET_UP) { if(selected % 4 == 0){ //Modify mod = true; switchPage(PICK_SCHEDULE); } else if (selected % 4 == 1) { //Add switchPage(ADD_SCHEDULE); } else if (selected % 4 == 2) { //Delete mod = false; switchPage(PICK_SCHEDULE); } else { switchPage(MODIFY_TIME); } } }
/* * if srcSn < 0, insert IDLE */ int ChipCP1121A::connectVC4(int srcSn, uint32 destSn) { uint32 regAddr = vc4RegAddr(destSn); uint32 regData = srcSn | 0x40; if( srcSn < 0 ) { regData = 0x20; // insert IDLE } regAccess->writeReg(regAddr, regData); if( switchPage() ) { regAddr = vc4RegAddr(destSn); regAccess->writeReg(regAddr, regData); return 1; } return -1; }
bool Help::handleKeyboard(const Common::Event &event) { if (event.kbd.keycode == Common::KEYCODE_ESCAPE) return true; for (int i = 0; i < _buttonNum; i++) { if (_buttons[i]._trigger == event.kbd.keycode) { _vm->fadeOut(); switchPage(_buttons[i]._whither); _vm->fadeIn(); return false; } } return false; }
/* * if srcVC4Sn < 0 || srcVC12Sn < 0, insert IDLE */ int ChipCP1121A::connectVC12(int srcVC4Sn, int srcVC12Sn, uint32 destVC4Sn, uint32 destVC12Sn) { connectVC4(-1, destVC4Sn); //���VC4���� uint32 regAddr = vc12RegAddr(destVC4Sn, destVC12Sn); uint16 regData = srcVC4Sn | ((srcVC12Sn+1) << 5); if( srcVC4Sn < 0 || srcVC12Sn < 0 ) { regData = regAccess->readReg(regAddr); regData |= (1 << 11); //insert IDLE } regAccess->writeReg(regAddr, regData); if( switchPage() ) { regAddr = vc12RegAddr(destVC4Sn, destVC12Sn); regAccess->writeReg(regAddr, regData); } return 1; }
/* * Constructs a IdPage as a child of 'parent', with the * name 'name' and widget flags set to 'f'. */ IdPage::IdPage( QWidget* parent, const char* name, Master * session, WFlags fl ) : Page( parent, name, session, fl ) { if ( !name ) setName( "IdPage" ); IdPageLayout = new QGridLayout( this, 1, 1, 6, 6, "IdPageLayout"); details_button = new QPushButton( this, "details_button" ); IdPageLayout->addWidget( details_button, 1, 0 ); update_button = new QPushButton( this, "update_button" ); IdPageLayout->addWidget( update_button, 1, 2 ); widgetStack = new QWidgetStack( this, "widgetStack" ); idform = new IdForm(widgetStack, "idform"); widgetStack->addWidget(idform, 0); browser = new MtpBrowser(widgetStack, "browser"); widgetStack->addWidget(browser, 1); IdPageLayout->addMultiCellWidget( widgetStack, 0, 0, 0, 2 ); QSpacerItem* spacer = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); IdPageLayout->addItem( spacer, 1, 1 ); languageChange(); resize( QSize(445, 308).expandedTo(minimumSizeHint()) ); id = 1; switchPage(); connect(details_button, SIGNAL(clicked()), SLOT(switchPage())); connect(update_button, SIGNAL(clicked()), SLOT(updatePage())); connect(browser,SIGNAL(linkClicked(const QString &)), session, SLOT(slotLinkClicked(const QString &))); }
int TabBar::addTab(const Tab &tab) { const int index = count(); m_pages.push_back(tab.page); TCITEM item{}; item.mask |= TCIF_TEXT; item.pszText = const_cast<auto_char *>(tab.text.c_str()); TabCtrl_InsertItem(handle(), index, &item); if(index == 0) switchPage(); return index; }
inline void page_modifyTime() { static int timeScaleIndex = 0; if (pre_page != MODIFY_TIME) { PTLS("Page Mod Time"); pre_page = MODIFY_TIME; lcd.cursor(); } lcd.setCursor(0,1); String str_time = getTimeString(); lcd.print(str_time); if (timeScaleIndex == 0) lcd.setCursor(0,1); else if (timeScaleIndex == 1) lcd.setCursor(0,4); else if (timeScaleIndex == 2) lcd.setCursor(0,7); if (button_input == PLUS_UP || button_input == PLUS_HOLD) { long adjust = timeScale[timeScaleIndex]; adjustTime(adjust); setSyncInterval(SCALE_HOUR); } else if (button_input == MINUS_UP || button_input == MINUS_HOLD) { long adjust = -timeScale[timeScaleIndex]; adjustTime(adjust); setSyncInterval(SCALE_HOUR); } else if (button_input == SET_UP) { setSyncInterval( 3600 ); switchPage(HOME); } else if (button_input == MODE_UP) { timeScaleIndex++; timeScaleIndex = timeScaleIndex % 3; PTS("Changed focus: "); PTL(timeScaleIndex); } }
void SimpleWizard::nextButtonClicked() { ui.nextButton->setEnabled(true); if (mHistory.size() == mNumPages) { // We're on last page and Finish was just clicked accept(); } else { QWidget *oldPage = mHistory.isEmpty() ? NULL : mHistory.last(); QWidget* newPage = createPage( mHistory.size() ); if ( newPage ) { mHistory += newPage; switchPage(oldPage, mHistory.last()); } else nextButtonClicked(); } }
void MasterGui::handleLoginBtnSlot() { switchPage(CENTER_GUI); }
void DatabaseDialog::back() { --m_currentPage; switchPage(m_currentPage); }
void MasterGui::handleUsersBtnSlot() { switchPage(USERS_GUI); }
void MainWindow::back() { page--; switchPage(); }
void MasterGui::handleVideoBtnSlot() { switchPage(VIDEO_GUI); }
void MasterGui::handleResultsBtnSlot() { switchPage(RESULTS_GUI); }
void TabBar::setCurrentIndex(const int index) { TabCtrl_SetCurSel(handle(), index); switchPage(); }
void MasterGui::handleBackBtnSlot() { currentPage = SIGNUP_GUI; switchPage(OPENING_GUI); }
Chip_INIT_RESULT ChipCP1121A::ChipInit(void) { uint16 id = regAccess->readReg(ID); if( id != CP1121A_ID ) { id = regAccess->readReg(ID); if( id != CP1121A_ID ) { id = regAccess->readReg(ID); if( id != CP1121A_ID ) { return failed; } } } /* top level */ if( ObjectReference::getOPTMode() ) { regAccess->writeReg(MCR, 0x58); // 77.76MHz mode, STM-1 mode, H12H4A, H12H4B } else { regAccess->writeReg(MCR, 0x59); // 77.76MHz mode, STM-4 mode, H12H4A, H12H4B } regAccess->writeReg(0x0006, 0x0781); regAccess->writeReg(0x0007, 0x1890); //0x1888 id = regAccess->readReg(BHLXMCTL); id &= 0xfffe; regAccess->writeReg(BHLXMCTL, id); //the idle code type is all 0 /* ��ʼ�������Ĵ��� */ uint16 firstPage = 0; uint16 secondPage = 0; if( currentPage() == 0 ) { firstPage = HLXCM_PG1; secondPage = HLXCM_PG0; } else { firstPage = HLXCM_PG0; secondPage = HLXCM_PG1; } static int defultOH[] = {4,5,6,7,0,1,2,3,0,1,2,3,4,5,6,7,0,4}; for( int i = 0; i < 18; i++ ) { regAccess->writeReg(firstPage+(i<<7), defultOH[i]); for( int j = 0; j < 63; j++ ) { uint16 regAddr = firstPage+(i<<7)+j+1; uint16 regValue = ((j+1)<<5) | i | (1<<11); regAccess->writeReg(regAddr, regValue); } } switchPage(); for( int i = 0; i < 18; i++ ) { regAccess->writeReg(secondPage+(i<<7), defultOH[i]); for( int j = 0; j < 63; j++ ) { uint16 regAddr = secondPage+(i<<7)+j+1; uint16 regValue = ((j+1)<<5) | i | (1<<11); regAccess->writeReg(regAddr, regValue); } } /* ��ʼ������Ĵ��� */ for(int i = 0; i < 18; i++ ) { for( int j = 0; j < 63; j++ ) { connectVC12(-1, -1, i, j); } } /* ��ʼ��MAP�Ĵ��� */ for(int i = 0; i < 21; i++ ) { ITUT_T& t = TimeSlot2ITUT::itutFrom(i+1); uint16 regData = (t.tug3<<5) | (t.tug2 << 2) | t.tug1; regData |= (regData << 8); regAccess->writeReg(TUTSCFG+(i+1)*128, regData); regAccess->writeReg(CCR+(i+1)*128, 0x00f9); regAccess->writeReg(PPSCR+(i+1)*128, 0x0004); regAccess->writeReg(TV5K4LINA+(i+1)*128, 0x0004); regAccess->writeReg(TV5K4LINB+(i+1)*128, 0x0004); regAccess->writeReg(TJ2+(i+1)*128, 0x0089); } /* ��ʼ��oh�Ĵ��� */ regAccess->writeReg(0x1480, 0xf010); regAccess->writeReg(0x1580, 0xf010); regAccess->writeReg(0x1680, 0xf010); regAccess->writeReg(0x1780, 0xf010); regAccess->writeReg(0x1c80, 0xf010); regAccess->writeReg(0x1d80, 0xf010); regAccess->writeReg(0x1e80, 0xf010); regAccess->writeReg(0x1f80, 0xf010); regAccess->writeReg(0x14d0, 0x0089); regAccess->writeReg(0x15d0, 0x0089); regAccess->writeReg(0x16d0, 0x0089); regAccess->writeReg(0x17d0, 0x0089); regAccess->writeReg(0x1cd0, 0x0089); regAccess->writeReg(0x1dd0, 0x0089); regAccess->writeReg(0x1ed0, 0x0089); regAccess->writeReg(0x1fd0, 0x0089); regAccess->writeReg(0x1482, 0x0002); regAccess->writeReg(0x1582, 0x0002); regAccess->writeReg(0x1682, 0x0002); regAccess->writeReg(0x1782, 0x0002); regAccess->writeReg(0x1c82, 0x0002); regAccess->writeReg(0x1d82, 0x0002); regAccess->writeReg(0x1e82, 0x0002); regAccess->writeReg(0x1f82, 0x0002); regAccess->writeReg(0x3101, 0x0020); regAccess->writeReg(0x3201, 0x0020); regAccess->writeReg(0x3301, 0x0020); regAccess->writeReg(0x3401, 0x0020); regAccess->writeReg(0x3501, 0x0020); regAccess->writeReg(0x3601, 0x0020); regAccess->writeReg(0x3701, 0x0020); regAccess->writeReg(0x3801, 0x0020); /*��ʼ��DCC�Ĵ���*/ regAccess->writeReg(0x1020, 0x0000); regAccess->writeReg(0x1345, 0x3fee); regAccess->writeReg(0x1B45, 0x3fee); return succeed; }
void MasterGui::handleSignInBtnSlot() { switchPage(LOGIN_GUI); }
void MasterGui::handleSignUpBtnSlot() { switchPage(SIGNUP_GUI); }
void SWizard::stepBack() { this->currentPage--; switchPage(); }
void MasterGui::handleDevicesBtnSlot() { switchPage(DEVICES_GUI); }
void MasterGui::handleHistoryBtnSlot() { switchPage(HISTORY_GUI); }
void MasterGui::handleRegisterBtnSlot() { cout << "currentPage is: " << currentPage << endl; switchPage(CENTER_GUI); }