Component* Button::updateFocus(int direction, int buttonsPressed) { Component* newFocus = NULL; if(!getFocus() && active) { setFocus(true); newFocus = this; } else if (!getFocus() && !active) { //try to move direction, and if new component found send to focus manager and remove focus for current component if (getNextFocus(direction)) newFocus = (getNextFocus(direction))->updateFocus(direction, buttonsPressed); else newFocus = getNextFocus(direction); } else { if (getNextFocus(direction)) newFocus = (getNextFocus(direction))->updateFocus(direction, buttonsPressed); if (newFocus) setFocus(false); else newFocus = this; } if (newFocus == this) { //finally update button behavior based on buttons pressed if(buttonsPressed & Focus::ACTION_BACK) doReturn(); else if (buttonsPressed & Focus::ACTION_SELECT) doClicked(); } return newFocus; }
FontPickerButton::FontPickerButton(const QIcon &i, const QString &t, QWidget *p, const QFont &iF) : QPushButton(i, t, p), selectedFont(QFont()) { setSelectedFont(iF); QObject::connect(this, SIGNAL(clicked()), this, SLOT(doClicked())); }
ColorButton::ColorButton(QWidget *parent) : QPushButton(parent) { logMessage("ColorButton::ColorButton()"); setAutoFillBackground(false); setCursor(Qt::PointingHandCursor); connect(this, SIGNAL(clicked()), this, SLOT(doClicked())); }
ORadioButtonItem :: ORadioButtonItem (ORadioButtonGroup *pORadioButtonGroup ) : ItemData (pORadioButtonGroup->childCount()) ,QRadioButton( pORadioButtonGroup->WidgetQ() ) ,buttonGroup(pORadioButtonGroup) { connect(this ,SIGNAL(clicked()), this ,SLOT(doClicked())); }
FontPickerButton::FontPickerButton(QWidget *p, const QFont &iF) : QPushButton(tr("Select a Font"), p), selectedFont(QFont()) { setSelectedFont(iF); QObject::connect(this, SIGNAL(clicked()), this, SLOT(doClicked())); }