本文整理汇总了C++中IconButton::setAction方法的典型用法代码示例。如果您正苦于以下问题:C++ IconButton::setAction方法的具体用法?C++ IconButton::setAction怎么用?C++ IconButton::setAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IconButton
的用法示例。
在下文中一共展示了IconButton::setAction方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MenuSetting
MenuSettingRGBA::MenuSettingRGBA(GMenu2X *gmenu2x, const string &name, const string &description, RGBAColor *value)
: MenuSetting(gmenu2x,name,description) {
IconButton *btn;
selPart = 0;
_value = value;
originalValue = *value;
this->setR(this->value().r);
this->setG(this->value().g);
this->setB(this->value().b);
this->setA(this->value().a);
btn = new IconButton(gmenu2x, "skin:imgs/buttons/x.png", gmenu2x->tr["Decrease"]);
btn->setAction(MakeDelegate(this, &MenuSettingRGBA::dec));
buttonBox.add(btn);
btn = new IconButton(gmenu2x, "skin:imgs/buttons/y.png", gmenu2x->tr["Increase"]);
btn->setAction(MakeDelegate(this, &MenuSettingRGBA::inc));
buttonBox.add(btn);
btn = new IconButton(gmenu2x, "skin:imgs/buttons/left.png");
btn->setAction(MakeDelegate(this, &MenuSettingRGBA::leftComponent));
buttonBox.add(btn);
btn = new IconButton(gmenu2x, "skin:imgs/buttons/right.png", gmenu2x->tr["Change color component"]);
btn->setAction(MakeDelegate(this, &MenuSettingRGBA::rightComponent));
buttonBox.add(btn);
}
示例2: MenuSetting
MenuSettingInt::MenuSettingInt(
GMenu2X *gmenu2x, Touchscreen &ts,
const string &name, const string &description,
int *value, int min, int max, int increment)
: MenuSetting(gmenu2x,name,description)
{
IconButton *btn;
_value = value;
originalValue = *value;
this->min = min;
this->max = max;
this->increment = increment;
setValue(this->value());
//Delegates
ButtonAction actionInc = MakeDelegate(this, &MenuSettingInt::inc);
ButtonAction actionDec = MakeDelegate(this, &MenuSettingInt::dec);
btn = new IconButton(gmenu2x, ts, "skin:imgs/buttons/l.png");
btn->setAction(actionDec);
buttonBox.add(btn);
btn = new IconButton(gmenu2x, ts, "skin:imgs/buttons/left.png", gmenu2x->tr["Decrease"]);
btn->setAction(actionDec);
buttonBox.add(btn);
btn = new IconButton(gmenu2x, ts, "skin:imgs/buttons/r.png");
btn->setAction(actionInc);
buttonBox.add(btn);
btn = new IconButton(gmenu2x, ts, "skin:imgs/buttons/right.png", gmenu2x->tr["Increase"]);
btn->setAction(actionInc);
buttonBox.add(btn);
}
示例3: MenuSettingStringBase
MenuSettingFile::MenuSettingFile(GMenu2X *gmenu2x, const string &name, const string &description, string *value, const string &filter_, const string &startPath_)
: MenuSettingStringBase(gmenu2x, name, description, value)
, filter(filter_), startPath(startPath_)
{
IconButton *btn;
btn = new IconButton(gmenu2x, "uda://gmenu2x/skins/Default/imgs/buttons/x.png", gmenu2x->tr["Clear"]);
btn->setAction(MakeDelegate(this, &MenuSettingFile::clear));
buttonBox.add(btn);
btn = new IconButton(gmenu2x, "uda://gmenu2x/skins/Default/imgs/buttons/b.png", gmenu2x->tr["Select a file"]);
btn->setAction(MakeDelegate(this, &MenuSettingFile::edit));
buttonBox.add(btn);
}
示例4: MenuSettingStringBase
MenuSettingDir::MenuSettingDir(GMenu2X *gmenu2x, const string &name, const string &description, string *value, const std::string &startPath_)
: MenuSettingStringBase(gmenu2x, name, description, value)
, startPath(startPath_)
{
IconButton *btn;
btn = new IconButton(gmenu2x, "skin:imgs/buttons/x.png", gmenu2x->tr["Clear"]);
btn->setAction(MakeDelegate(this, &MenuSettingDir::clear));
buttonBox.add(btn);
btn = new IconButton(gmenu2x, "skin:imgs/buttons/b.png", gmenu2x->tr["Select a directory"]);
btn->setAction(MakeDelegate(this, &MenuSettingDir::edit));
buttonBox.add(btn);
}
示例5: initButton
void MenuSettingBool::initButton()
{
IconButton *btn = new IconButton(gmenu2x, "skin:imgs/buttons/b.png",
gmenu2x->tr["Switch"]);
btn->setAction(MakeDelegate(this, &MenuSettingBool::toggle));
buttonBox.add(btn);
}
示例6: MenuSettingStringBase
MenuSettingDir::MenuSettingDir(
GMenu2X *gmenu2x, Touchscreen &ts_,
const string &name, const string &description, string *value)
: MenuSettingStringBase(gmenu2x, name, description, value)
, ts(ts_)
{
IconButton *btn;
btn = new IconButton(gmenu2x, ts, "skin:imgs/buttons/cancel.png",
gmenu2x->tr["Clear"]);
btn->setAction(BIND(&MenuSettingDir::clear));
buttonBox.add(btn);
btn = new IconButton(gmenu2x, ts, "skin:imgs/buttons/accept.png",
gmenu2x->tr["Select a directory"]);
btn->setAction(BIND(&MenuSettingDir::edit));
buttonBox.add(btn);
}
示例7: MenuSettingStringBase
MenuSettingString::MenuSettingString(
GMenu2X *gmenu2x, const string &name,
const string &description, string *value,
const string &diagTitle_, const string &diagIcon_)
: MenuSettingStringBase(gmenu2x, name, description, value)
, diagTitle(diagTitle_)
, diagIcon(diagIcon_)
{
IconButton *btn;
btn = new IconButton(gmenu2x, "skin:imgs/buttons/cancel.png", gmenu2x->tr["Clear"]);
btn->setAction(MakeDelegate(this, &MenuSettingString::clear));
buttonBox.add(btn);
btn = new IconButton(gmenu2x, "skin:imgs/buttons/accept.png", gmenu2x->tr["Edit"]);
btn->setAction(MakeDelegate(this, &MenuSettingString::edit));
buttonBox.add(btn);
}
示例8: MenuSettingStringBase
MenuSettingMultiString::MenuSettingMultiString(
GMenu2X *gmenu2x, Touchscreen &ts,
const string &name, const string &description,
string *value, const vector<string> *choices_)
: MenuSettingStringBase(gmenu2x, name, description, value)
, choices(choices_)
{
setSel(find(choices->begin(), choices->end(), *value) - choices->begin());
IconButton *btn;
btn = new IconButton(gmenu2x, ts, "skin:imgs/buttons/left.png");
btn->setAction(MakeDelegate(this, &MenuSettingMultiString::decSel));
buttonBox.add(btn);
btn = new IconButton(gmenu2x, ts, "skin:imgs/buttons/right.png", gmenu2x->tr["Change value"]);
btn->setAction(MakeDelegate(this, &MenuSettingMultiString::incSel));
buttonBox.add(btn);
}