本文整理汇总了C++中gcn::ActionEvent类的典型用法代码示例。如果您正苦于以下问题:C++ ActionEvent类的具体用法?C++ ActionEvent怎么用?C++ ActionEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ActionEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: action
void OutfitWindow::action(const gcn::ActionEvent &event)
{
if (event.getId() == "next")
{
if (mCurrentOutfit < (OUTFITS_COUNT - 1))
mCurrentOutfit++;
else
mCurrentOutfit = 0;
mCurrentLabel->setCaption(strprintf(_("Outfit: %d"), mCurrentOutfit + 1));
mUnequipCheck->setSelected(mItemsUnequip[mCurrentOutfit]);
}
else if (event.getId() == "previous")
{
if (mCurrentOutfit > 0)
{
mCurrentOutfit--;
}
else
{
mCurrentOutfit = OUTFITS_COUNT - 1;
}
mCurrentLabel->setCaption(strprintf(_("Outfit: %d"), mCurrentOutfit + 1));
mUnequipCheck->setSelected(mItemsUnequip[mCurrentOutfit]);
}
else if (event.getId() == "unequip")
{
mItemsUnequip[mCurrentOutfit] = mUnequipCheck->isSelected();
}
}
示例2: action
void GlassTabbedContainer::action(const gcn::ActionEvent &ae) {
GlassTabState s = ((GlassTab*)ae.getSource())->getState();
if(s == GTS_OPENED || s == GTS_OPENING)
((GlassTab*)ae.getSource())->close();
else
((GlassTab*)ae.getSource())->open();
}
示例3: action
void StorageWindow::action(const gcn::ActionEvent &event)
{
if (event.getId() == "close")
{
mItems->selectNone();
close();
}
else if (event.getId() == "retrieve" || event.getId() == "default")
{
Item *item = mItems->getSelectedItem();
if (!item)
return;
if (item->getQuantity() == 1)
{
removeStore(item, 1);
selectNone();
}
// Choose amount of items to retrieve
else
new ItemAmountWindow(AMOUNT_STORE_REMOVE, this, item);
}
else if (event.getId() == "showpopupmenu")
mItems->showPopupMenu(STORAGE, false);
}
示例4: action
void InventoryWindow::action(const gcn::ActionEvent &event)
{
Item *item = mItems->getSelectedItem();
if (!item)
return;
if (event.getId() == "use")
{
if (item->isEquipment())
{
if (item->isEquipped())
Net::getInventoryHandler()->unequipItem(item);
else
Net::getInventoryHandler()->equipItem(item);
}
else
Net::getInventoryHandler()->useItem(item);
}
else if (event.getId() == "drop")
{
ItemAmountWindow::showWindow(ItemAmountWindow::ItemDrop, this, item);
}
else if (event.getId() == "split")
{
ItemAmountWindow::showWindow(ItemAmountWindow::ItemSplit, this, item,
(item->getQuantity() - 1));
}
}
示例5: action
void ChangeDisplay::action(const gcn::ActionEvent &event)
{
if (Net::getPlayerHandler()->canCorrectAttributes() &&
event.getSource() == mDec)
{
int newcorpoints = PlayerInfo::getAttribute(CORR_POINTS) - 1;
PlayerInfo::setAttribute(CORR_POINTS, newcorpoints);
int newpoints = PlayerInfo::getAttribute(CHAR_POINTS) + 1;
PlayerInfo::setAttribute(CHAR_POINTS, newpoints);
int newbase = PlayerInfo::getStatBase(mId) - 1;
PlayerInfo::setStatBase(mId, newbase);
Net::getPlayerHandler()->decreaseAttribute(mId);
}
else if (event.getSource() == mInc)
{
int newpoints = PlayerInfo::getAttribute(CHAR_POINTS) - 1;
PlayerInfo::setAttribute(CHAR_POINTS, newpoints);
int newbase = PlayerInfo::getStatBase(mId) + 1;
PlayerInfo::setStatBase(mId, newbase);
Net::getPlayerHandler()->increaseAttribute(mId);
}
}
示例6: if
void
Wellcome::action(const gcn::ActionEvent &event)
{
//ResourceManager *resman = ResourceManager::getInstance();
if (event.getId() == "close")
{
if (mAgain->isSelected())
{
config.setValue("Wellcome", 1);
logger->log("Wellcome : 1");
}
else
{
config.setValue("Wellcome", 0);
logger->log("Wellcome : 0");
}
scheduleDelete();
}
else if (event.getId() == "next")
{
if (mCurrentSlide< mList.size()-1)
{
mCurrentSlide++;
load();
}
} else if (event.getId() == "prev")
{
if (mCurrentSlide> 0)
{
mCurrentSlide--;
load();
}
}
}
示例7: action
void ProfileChooser::action(const gcn::ActionEvent &actionEvent)
{
std::string tmp_string;
int buttons = 0;
/*
* Check which button was pressed
*/
if ( actionEvent.getId() == "mOk" ) {
hide ();
mCancelPressed = false;
}
else if ( actionEvent.getId() == "mCancel" ) {
hide();
mCancelPressed = true;
}
else if ( actionEvent.getId() == "mCreateNew" ) {
mNewProfile.setVisible ( mCreateNew.isSelected() );
mNewProfileLabel.setVisible ( mCreateNew.isSelected() );
return;
}
distributeActionEvent();
} /* end action */
示例8: action
void action(const gcn::ActionEvent& actionEvent)
{
if(actionEvent.getSource() == cmdPath)
{
char tmp[MAX_PATH];
strncpy(tmp, txtPath->getText().c_str(), MAX_PATH);
wndEditFilesysVirtual->releaseModalFocus();
if(SelectFolder("Select folder", tmp))
txtPath->setText(tmp);
wndEditFilesysVirtual->requestModalFocus();
cmdPath->requestFocus();
}
else
{
if (actionEvent.getSource() == cmdOK)
{
if(txtDevice->getText().length() <= 0)
{
wndEditFilesysVirtual->setCaption("Please enter a device name.");
return;
}
if(txtVolume->getText().length() <= 0)
{
wndEditFilesysVirtual->setCaption("Please enter a volume name.");
return;
}
dialogResult = true;
}
dialogFinished = true;
}
}
示例9: action
void LoginDialog::action(const gcn::ActionEvent &event)
{
if (event.getId() == "login" && canSubmit())
{
mLoginData->username = mUserField->getText();
mLoginData->password = mPassField->getText();
mLoginData->remember = mKeepCheck->isSelected();
mLoginData->registerLogin = false;
mRegisterButton->setEnabled(false);
mServerButton->setEnabled(false);
mLoginButton->setEnabled(false);
Client::setState(STATE_LOGIN_ATTEMPT);
}
else if (event.getId() == "server")
{
Client::setState(STATE_SWITCH_SERVER);
}
else if (event.getId() == "register")
{
if (Net::getLoginHandler()->isRegistrationEnabled())
{
mLoginData->username = mUserField->getText();
mLoginData->password = mPassField->getText();
Client::setState(STATE_REGISTER_PREP);
}
else
{
new OkDialog(_("Registration disabled"), _("You need to use the "
"website to register an account for this server."));
}
}
}
示例10: action
void TabbedArea::action(const gcn::ActionEvent& actionEvent)
{
Widget* source = actionEvent.getSource();
Tab* tab = dynamic_cast<Tab*>(source);
if (tab)
{
setSelectedTab(tab);
}
else
{
if (actionEvent.getId() == "shift_left")
{
if (mTabScrollIndex)
--mTabScrollIndex;
}
else if (actionEvent.getId() == "shift_right")
{
if (mTabScrollIndex < mTabs.size() - 1)
++mTabScrollIndex;
}
adjustTabPositions();
updateArrowEnableState();
}
}
示例11: action
void action(const gcn::ActionEvent &event)
{
exitConfirm = NULL;
if (event.getId() == "yes" || event.getId() == "ok")
stateManager->setState(QUIT_STATE);
}
示例12: action
void action(const gcn::ActionEvent& actionEvent)
{
if (actionEvent.getSource() == sldChipmem) {
changed_prefs.chipmem_size = ChipMem_values[(int)(sldChipmem->getValue())];
if ((changed_prefs.chipmem_size > 0x200000) && (changed_prefs.fastmem_size > 0))
changed_prefs.fastmem_size = 0;
}
if (actionEvent.getSource() == sldSlowmem) {
changed_prefs.bogomem_size = SlowMem_values[(int)(sldSlowmem->getValue())];
}
if (actionEvent.getSource() == sldFastmem) {
changed_prefs.fastmem_size = FastMem_values[(int)(sldFastmem->getValue())];
if (changed_prefs.fastmem_size > 0 && changed_prefs.chipmem_size > 0x200000)
changed_prefs.chipmem_size = 0x200000;
}
if (actionEvent.getSource() == sldZ3mem) {
changed_prefs.z3fastmem_size = FastMem_values[(int)(sldZ3mem->getValue())];
if (changed_prefs.z3fastmem_size > max_z3fastmem)
changed_prefs.z3fastmem_size = max_z3fastmem;
}
if (actionEvent.getSource() == sldGfxmem) {
changed_prefs.gfxmem_size = FastMem_values[(int)(sldGfxmem->getValue())];
}
RefreshPanelRAM();
}
示例13: action
void Setup::action(const gcn::ActionEvent &event)
{
if (event.getId() == "Apply")
{
setVisible(false);
for_each(mTabs.begin(), mTabs.end(), std::mem_fun(&SetupTabContainer::apply));
}
else if (event.getId() == "Cancel")
{
setVisible(false);
for_each(mTabs.begin(), mTabs.end(), std::mem_fun(&SetupTabContainer::cancel));
}
else if (event.getId() == "Reset Windows")
{
Widgets widgets = windowContainer->getWidgetList();
WidgetIterator iter;
for (iter = widgets.begin(); iter != widgets.end(); ++iter)
{
Window* window = dynamic_cast<Window*>(*iter);
if (window)
window->resetToDefaultSize();
}
}
}
示例14: action
void Setup::action(const gcn::ActionEvent &event)
{
if (event.getId() == "Apply")
{
setVisible(false);
for_each(mTabs.begin(), mTabs.end(), std::mem_fun(&SetupTab::apply));
}
else if (event.getId() == "Cancel")
{
setVisible(false);
for_each(mTabs.begin(), mTabs.end(), std::mem_fun(&SetupTab::cancel));
}
else if (event.getId() == "Reset Windows")
{
// Bail out if this action happens to be activated before the windows
// are created (though it should be disabled then)
if (!statusWindow)
return;
for (std::list<Window*>::iterator it = mWindowsToReset.begin();
it != mWindowsToReset.end(); it++)
{
(*it)->resetToDefaultSize();
}
}
}
示例15: action
void action(const gcn::ActionEvent& actionEvent) {
if (actionEvent.getSource() == radioButton_quickSwitch_off)
mainMenu_quickSwitch=0;
else if (actionEvent.getSource() == radioButton_quickSwitch_1)
mainMenu_quickSwitch=1;
else if (actionEvent.getSource() == radioButton_quickSwitch_2)
mainMenu_quickSwitch=2;
show_settings_TabOnScreen();
}