当前位置: 首页>>代码示例>>C++>>正文


C++ ActionEvent::getSource方法代码示例

本文整理汇总了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();
    }
开发者ID:GrethTom,项目名称:uae4arm-rpi,代码行数:30,代码来源:PanelRAM.cpp

示例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();
}
开发者ID:newerthcom,项目名称:savagerebirth,代码行数:7,代码来源:GlassTabbedContainer.cpp

示例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);
    }
}
开发者ID:Ablu,项目名称:mana,代码行数:27,代码来源:statuswindow.cpp

示例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;
   }
 }
开发者ID:GrethTom,项目名称:uae4arm-rpi,代码行数:31,代码来源:EditFilesysVirtual.cpp

示例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();
 }
开发者ID:debind,项目名称:uae4all_AmigaPi,代码行数:9,代码来源:menuTabOnScreen.cpp

示例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;
      }
开发者ID:Elotoha,项目名称:uae4all-rpi,代码行数:9,代码来源:menuTabHD.cpp

示例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;
    }
开发者ID:GrethTom,项目名称:uae4arm-rpi,代码行数:11,代码来源:PanelCPU.cpp

示例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);
     }
 }
开发者ID:engur,项目名称:e-uae,代码行数:14,代码来源:menuRom.cpp

示例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;
 }
开发者ID:BrianSidebotham,项目名称:uae4arm-rpi,代码行数:32,代码来源:SelectFile.cpp

示例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;
 }
开发者ID:engur,项目名称:e-uae,代码行数:7,代码来源:menuCpuFpu.cpp

示例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();
        }
    }
}
开发者ID:B-Rich,项目名称:mana,代码行数:28,代码来源:setup_joystick.cpp

示例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();
    }
}
开发者ID:B-Rich,项目名称:mana,代码行数:26,代码来源:tabbedarea.cpp

示例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();
    }

}
开发者ID:IamusNavarathna,项目名称:lv3proj,代码行数:29,代码来源:LayerPanel.cpp

示例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);
}
开发者ID:Aethyra,项目名称:Client,代码行数:8,代码来源:tabbedarea.cpp

示例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;
 }
开发者ID:lubomyr,项目名称:vice-2.4,代码行数:9,代码来源:menuLoad_guichan.cpp


注:本文中的gcn::ActionEvent::getSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。