/** * Construct a push button with an abstract command id. * * @param parent parent widget * @param cmdId abstract command id this button is representing */ CommandButton::CommandButton(QWidget* parent, int cmdId) : QPushButton(parent) { id = cmdId; connect(this, SIGNAL(clicked()), SLOT(buttonActivated())); }
void InteractiveMessageBox::okayPressed() { std::string ok = Misc::StringUtils::lowerCase(MyGUI::LanguageManager::getInstance().replaceTags("#{sOK}")); std::vector<MyGUI::Button*>::const_iterator button; for(button = mButtons.begin(); button != mButtons.end(); ++button) { if(Misc::StringUtils::lowerCase((*button)->getCaption()) == ok) { buttonActivated(*button); MWBase::Environment::get().getSoundManager()->playSound("Menu Click", 1.f, 1.f); break; } } }
void InteractiveMessageBox::mousePressed (MyGUI::Widget* pressed) { buttonActivated (pressed); }
void InteractiveMessageBox::onKeyPressed(MyGUI::Widget *_sender, MyGUI::KeyCode _key, MyGUI::Char _char) { if (_key == MyGUI::KeyCode::Return || _key == MyGUI::KeyCode::NumpadEnter || _key == MyGUI::KeyCode::Space) buttonActivated(_sender); }
void ManufactureTestButtonPress(void) { startTimeout(&biosUnused, BIOS_UNUSED_MS); while(1) { uint8_t red = LED_OFF; uint8_t green = LED_OFF; uint8_t blue = LED_OFF; WatchdogPet(); if (buttonActivated(B_START) & buttonActivated(B_SELECT)) { delay_ms(500); reset_do_soft_reset(); } if(checkTimeout(&biosUnused)) { cancelTimeout(&biosUnused); setLEDValue(0, 0, 0); powerOff(global_header.powerOffSoftware); } if( buttonActivated(B_UP) || buttonActivated(B_DOWN) || buttonActivated(B_LEFT) || buttonActivated(B_RIGHT) || buttonActivated(B_A) || buttonActivated(B_B) || buttonActivated(B_X) || buttonActivated(B_Y) || buttonActivated(B_START) || buttonActivated(B_SELECT) || buttonActivated(B_LB) || buttonActivated(B_RB) || buttonActivated(B_LT) || buttonActivated(B_RT) || buttonActivated(B_JL) || buttonActivated(B_JR) ) { green = LED_DIM; } for(uint8_t idx = 0 ; idx<NUM_JOYSTICKS; idx++) { uint16_xy raw; raw.x = sampleAnalogChannel(joysticks[idx].adc_channel_x); raw.y = sampleAnalogChannel(joysticks[idx].adc_channel_y); int16_xy out; SimpleJoystickAdj( center[idx], &deadzone, &raw, &out ); //Write raw and adjusted X,Y values to USB serial port PrintXY(raw.x,raw.y); sendUSBString("->", false); PrintXY(out.x,out.y); sendUSBLine(""); if( out.y<0 ) { //up is yellow red = LED_DIM; green = LED_DIM; } else if( out.y>0 ) { //down is blue blue = LED_DIM; } else if( out.x>0 ) { //right is Red red = LED_DIM; } else if( out.x<0 ) { //left is green green = LED_DIM; } } setLEDValue(red, green, blue); } // end while(1) }