本文整理汇总了C++中gcn::ActionEvent::getSource方法的典型用法代码示例。如果您正苦于以下问题:C++ ActionEvent::getSource方法的具体用法?C++ ActionEvent::getSource怎么用?C++ ActionEvent::getSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gcn::ActionEvent
的用法示例。
在下文中一共展示了ActionEvent::getSource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例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 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);
}
}
示例4: 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;
}
}
示例5: 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();
}
示例6: action
void action(const gcn::ActionEvent& actionEvent)
{
if (actionEvent.getSource() == radioButton_boothd_off)
mainMenu_bootHD=0;
else if (actionEvent.getSource() == radioButton_boothd_hddir)
mainMenu_bootHD=1;
else if (actionEvent.getSource() == radioButton_boothd_hdfile)
mainMenu_bootHD=2;
}
示例7: action
void action(const gcn::ActionEvent& actionEvent)
{
if (actionEvent.getSource() == opt7Mhz)
changed_prefs.m68k_speed = M68K_SPEED_7MHZ_CYCLES;
else if (actionEvent.getSource() == opt14Mhz)
changed_prefs.m68k_speed = M68K_SPEED_14MHZ_CYCLES;
else if (actionEvent.getSource() == opt28Mhz)
changed_prefs.m68k_speed = M68K_SPEED_25MHZ_CYCLES;
else if (actionEvent.getSource() == optFastest)
changed_prefs.m68k_speed = -1;
}
示例8: action
void action(const gcn::ActionEvent& actionEvent) {
char tempPath[300];
strcpy(tempPath, prefs_get_attr ("rom_path"));
strcpy(currentDir,tempPath);
if (actionEvent.getSource() == button_main_rom) {
run_menuLoad_guichan(currentDir, MENU_SELECT_MAIN_ROM);
}
if (actionEvent.getSource() == button_ext_rom) {
run_menuLoad_guichan(currentDir, MENU_SELECT_EXT_ROM);
}
if (actionEvent.getSource() == button_key_rom) {
run_menuLoad_guichan(currentDir, MENU_SELECT_KEY_ROM);
}
}
示例9: action
void action(const gcn::ActionEvent& actionEvent)
{
if (actionEvent.getSource() == cmdOK)
{
int selected_item;
selected_item = lstFiles->getSelected();
if(createNew)
{
char tmp[MAX_PATH];
if(txtFilename->getText().length() <= 0)
return;
strcpy(tmp, workingDir);
strcat(tmp, "/");
strcat(tmp, txtFilename->getText().c_str());
if(strstr(tmp, filefilter[0]) == NULL)
strcat(tmp, filefilter[0]);
if(my_existsfile(tmp) == 1)
return; // File already exists
strcpy(workingDir, tmp);
dialogResult = true;
}
else
{
if(fileList->isDir(selected_item))
return; // Directory selected -> Ok not possible
strcat(workingDir, "/");
strcat(workingDir, fileList->getElementAt(selected_item).c_str());
dialogResult = true;
}
}
dialogFinished = true;
}
示例10: action
void action(const gcn::ActionEvent& actionEvent) {
if (actionEvent.getSource() == checkBox_cpu_compatible)
if (checkBox_cpu_compatible->isSelected())
changed_prefs.cpu_compatible = 1;
else
changed_prefs.cpu_compatible = 0;
}
示例11: action
void Setup_Joystick::action(const gcn::ActionEvent &event)
{
if (!joystick)
{
return;
}
if (event.getSource() == mJoystickEnabled)
{
joystick->setEnabled(mJoystickEnabled->isSelected());
}
else
{
if (joystick->isCalibrating())
{
mCalibrateButton->setCaption(_("Calibrate"));
mCalibrateLabel->setCaption
(_("Press the button to start calibration"));
joystick->finishCalibration();
}
else
{
mCalibrateButton->setCaption(_("Stop"));
mCalibrateLabel->setCaption(_("Rotate the stick"));
joystick->startCalibration();
}
}
}
示例12: 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();
}
}
示例13: action
void LayerPanel::action(const gcn::ActionEvent& ae)
{
gcn::Widget *src = ae.getSource();
if(src == cbVisible)
{
_engine->GetLayerMgr()->GetLayer(_engine->GetDrawPanel()->GetActiveLayerId())->visible = cbVisible->isSelected();
UpdateSelection();
}
else if(src == tfName)
{
_engine->GetLayerMgr()->GetLayer(_engine->GetDrawPanel()->GetActiveLayerId())->name = tfName->getText();
focusNext(); // move focus away, else almost impossible to escape from textfield widget
UpdateSelection();
}
else if(src == btnAllVisible)
{
for(uint32 i = 0; i < LAYER_MAX; i++)
_engine->GetLayerMgr()->GetLayer(i)->visible = true;
UpdateSelection();
}
else if(src == btnNoneVisible)
{
for(uint32 i = 0; i < LAYER_MAX; i++)
_engine->GetLayerMgr()->GetLayer(i)->visible = false;
UpdateSelection();
}
}
示例14: action
void TabbedArea::action(const gcn::ActionEvent& actionEvent)
{
gcn::Widget* source = actionEvent.getSource();
Tab* tab = dynamic_cast<Tab*>(source);
if (tab != NULL)
setSelectedTab(tab);
}
示例15: action
void action(const gcn::ActionEvent& actionEvent) {
if (actionEvent.getSource() == checkBox_extfilter) {
if (checkBox_extfilter->isSelected())
menuLoad_extfilter=1;
else
menuLoad_extfilter=0;
}
dirList=currentDir;
}