本文整理汇总了C++中getSelected函数的典型用法代码示例。如果您正苦于以下问题:C++ getSelected函数的具体用法?C++ getSelected怎么用?C++ getSelected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSelected函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: getListModel
void ListBox::incrementSelected()
{
const int lastSelection = getListModel()->getNumberOfElements() - 1;
if (getSelected() < lastSelection)
setSelected(mSelected + 1);
else if (getSelected() == lastSelection && mWrappingEnabled)
setSelected(0);
}
开发者ID:Aethyra,项目名称:Client,代码行数:9,代码来源:listbox.cpp
示例2: GfLogInfo
void GfglFeatures::dumpSelection() const
{
GfLogInfo("Selected OpenGL features :\n");
GfLogInfo(" Double buffer : %s\n", isSelected(DoubleBuffer) ? "On" : "Off");
if (getSelected(ColorDepth) != InvalidInt)
GfLogInfo(" Color depth : %d bits\n", getSelected(ColorDepth));
else
GfLogInfo(" Color depth : no selection\n");
GfLogInfo(" Alpha channel : %s",
getSelected(AlphaDepth) > 0 ? "On" : "Off");
if (getSelected(AlphaDepth) > 0)
GfLogInfo(" (%d bits)", getSelected(AlphaDepth));
GfLogInfo("\n");
if (getSelected(TextureMaxSize) != InvalidInt)
GfLogInfo(" Max texture size : %d\n", getSelected(TextureMaxSize));
else
GfLogInfo(" Max texture size : no selection\n");
GfLogInfo(" Texture compression : %s\n", isSelected(TextureCompression) ? "On" : "Off");
GfLogInfo(" Multi-texturing : %s", isSelected(MultiTexturing) ? "On" : "Off");
if (isSelected(MultiTexturing))
GfLogInfo(" (%d units)", getSelected(MultiTexturingUnits));
GfLogInfo("\n");
GfLogInfo(" Rectangle textures : %s\n", isSelected(TextureRectangle) ? "On" : "Off");
GfLogInfo(" Non power-of-2 textures : %s\n", isSelected(TextureNonPowerOf2) ? "On" : "Off");
GfLogInfo(" Multi-sampling : %s", isSelected(MultiSampling) ? "On" : "Off");
if (isSelected(MultiSampling))
GfLogInfo(" (%d samples)", getSelected(MultiSamplingSamples));
GfLogInfo("\n");
GfLogInfo(" Stereo vision : %s\n", isSelected(StereoVision) ? "On" : "Off");
GfLogInfo(" Bump Mapping : %s\n", isSelected(BumpMapping) ? "On" : "Off");
GfLogInfo(" Anisotropic Filtering : %d\n",
getSupported(AnisotropicFiltering));
}
开发者ID:702nADOS,项目名称:speed-dreams,代码行数:33,代码来源:glfeatures.cpp
示例3: touchHits
void CheckBox::onTouchMoved(cocos2d::Touch *touch, cocos2d::Event *event)
{
auto hits = touchHits(touch);
if (hits && _enabled && isVisible())
{
setSelected(!getSelected());
} else
{
setSelected(!getSelected());
}
}
开发者ID:LeeWei92,项目名称:CocosGui,代码行数:11,代码来源:CheckBox.cpp
示例4: setSelected
void ListBox::mouseWheelMovedUp(MouseEvent& mouseEvent)
{
if (isFocused())
{
if (getSelected() > 0 )
{
setSelected(getSelected() - 1);
}
mouseEvent.consume();
}
}
开发者ID:ArkBriar,项目名称:rlvm,代码行数:12,代码来源:listbox.cpp
示例5: distributeActionEvent
void ListBox::keyPressed(KeyEvent& keyEvent)
{
Key key = keyEvent.getKey();
if (key.getValue() == Key::ENTER || key.getValue() == Key::SPACE)
{
distributeActionEvent();
keyEvent.consume();
}
else if (key.getValue() == Key::UP)
{
setSelected(mSelected - 1);
if (mSelected == -1)
{
if (mWrappingEnabled)
{
setSelected(getListModel()->getNumberOfElements() - 1);
}
else
{
setSelected(0);
}
}
keyEvent.consume();
}
else if (key.getValue() == Key::DOWN)
{
if (mWrappingEnabled
&& getSelected() == getListModel()->getNumberOfElements() - 1)
{
setSelected(0);
}
else
{
setSelected(getSelected() + 1);
}
keyEvent.consume();
}
else if (key.getValue() == Key::HOME)
{
setSelected(0);
keyEvent.consume();
}
else if (key.getValue() == Key::END)
{
setSelected(getListModel()->getNumberOfElements() - 1);
keyEvent.consume();
}
}
开发者ID:ArkBriar,项目名称:rlvm,代码行数:52,代码来源:listbox.cpp
示例6: distributeActionEvent
void ListBox::keyPressed(KeyEvent& keyEvent)
{
Key key = keyEvent.getKey();
if (key.getValue() == Key::Enter || key.getValue() == Key::Space)
{
distributeActionEvent();
keyEvent.consume();
}
else if (key.getValue() == Key::Up)
{
setSelected(mSelected - 1);
if (mSelected == -1)
{
if (mWrappingEnabled)
{
setSelected(getListModel()->getNumberOfElements() - 1);
}
else
{
setSelected(0);
}
}
keyEvent.consume();
}
else if (key.getValue() == Key::Down)
{
if (mWrappingEnabled
&& getSelected() == getListModel()->getNumberOfElements() - 1)
{
setSelected(0);
}
else
{
setSelected(getSelected() + 1);
}
keyEvent.consume();
}
else if (key.getValue() == Key::Home)
{
setSelected(0);
keyEvent.consume();
}
else if (key.getValue() == Key::End)
{
setSelected(getListModel()->getNumberOfElements() - 1);
keyEvent.consume();
}
}
开发者ID:Beliaar,项目名称:fifechan,代码行数:52,代码来源:listbox.cpp
示例7: getch
bool InterfaceCLI::tick(bool updateAll)
{
int input = getch();
if (input == 'q') {
return false;
} else if (input == KEY_DOWN) {
if (_selected < _sumParams-1) {
_selected++;
drawParamsWin();
}
} else if (input == KEY_UP) {
if (_selected > 0) {
_selected--;
drawParamsWin();
}
} else if (input == '+') {
_paramsDelta *= 2.0;
drawStatusWin();
} else if (input == '-') {
_paramsDelta /= 2.0;
drawStatusWin();
} else if (input == KEY_LEFT) {
getSelected() -= _paramsDelta;
drawParamsWin();
} else if (input == KEY_RIGHT) {
getSelected() += _paramsDelta;
drawParamsWin();
} else if (input == '0') {
getSelected() = 0.0;
drawParamsWin();
}
for (size_t i=0;i<_userBindings.size();i++) {
if (input == _userBindings[i].key) {
_userBindings[i].handler();
drawStatusWin();
}
}
if (updateAll) {
drawStatusWin();
drawMonitorsWin();
}
if (_isTerminalUpdated) {
drawTerminalWin();
}
return true;
}
开发者ID:RhobanProject,项目名称:Model,代码行数:48,代码来源:InterfaceCLI.cpp
示例8: LOG
bool SystemView::input(InputConfig* config, Input input)
{
if(input.value != 0)
{
if(config->getDeviceId() == DEVICE_KEYBOARD && input.value && input.id == SDLK_r && SDL_GetModState() & KMOD_LCTRL && Settings::getInstance()->getBool("Debug"))
{
LOG(LogInfo) << " Reloading SystemList view";
// reload themes
for(auto it = mEntries.begin(); it != mEntries.end(); it++)
it->object->loadTheme();
populate();
updateHelpPrompts();
return true;
}
if(config->isMappedTo("left", input))
{
listInput(-1);
return true;
}
if(config->isMappedTo("right", input))
{
listInput(1);
return true;
}
if(config->isMappedTo("a", input))
{
stopScrolling();
SystemData *systemData = getSelected();
// decide whether to show game list or launch the command directly
if ( !systemData->getDirectLaunch() )
{
ViewController::get()->goToGameList(getSelected());
}else{
systemData->launchGame( mWindow, nullptr );
}
return true;
}
}else{
if(config->isMappedTo("left", input) || config->isMappedTo("right", input))
listInput(0);
}
return GuiComponent::input(config, input);
}
开发者ID:HotMykeul,项目名称:EmulationStation,代码行数:48,代码来源:SystemView.cpp
示例9: kdebugf
void ModulesDialog::refreshList()
{
kdebugf();
int vScrollValue = lv_modules->verticalScrollBar()->value();
QString s_selected;
QTreeWidgetItem *selectedItem = getSelected();
if (selectedItem)
s_selected = selectedItem->text(0);
lv_modules->clear();
QStringList moduleList = ModulesManager::instance()->staticModules();
ModuleInfo info;
bool hideBase = hideBaseModules->isChecked();
foreach (const QString &module, moduleList)
{
QStringList strings;
if (ModulesManager::instance()->moduleInfo(module, info))
{
if (info.base && hideBase)
continue;
strings << module << info.version << tr("Static") << tr("Loaded");
}
else
strings << module << QString::null << tr("Static") << tr("Loaded");
new QTreeWidgetItem(lv_modules, strings);
}
开发者ID:ziemniak,项目名称:kadu,代码行数:33,代码来源:modules.cpp
示例10: getSelected
void LocalSharedFilesDialog::openfolder()
{
std::cerr << "SharedFilesDialog::openfolder" << std::endl;
QModelIndexList qmil = getSelected();
model->openSelected(qmil);
}
开发者ID:sehraf,项目名称:RetroShare,代码行数:7,代码来源:SharedFilesDialog.cpp
示例11: getSelected
void GuiGameListMenuCtrl::changeRow(S32 delta)
{
S32 oldRowIndex = getSelected();
S32 newRowIndex = oldRowIndex;
do
{
newRowIndex += delta;
if (newRowIndex >= mRows.size())
{
newRowIndex = 0;
}
else if (newRowIndex < 0)
{
newRowIndex = mRows.size() - 1;
}
}
while ((! mRows[newRowIndex]->mEnabled) && (newRowIndex != oldRowIndex));
setSelected(newRowIndex);
// do the callback if it is defined
StringTableEntry onChange = StringTable->insert("onChange", false);
if (isMethod(onChange))
{
Con::executef(this, onChange);
}
}
开发者ID:adhistac,项目名称:ee-client-2-0,代码行数:27,代码来源:guiGameListMenuCtrl.cpp
示例12: glColor3f
void PlanetLocator::render(int window_w, int window_h)
{
if (m_hidden) return;
glColor3f(1.0f, 1.0f, 1.0f);
float rectw = (5.0f / (float)window_w);
float recth = (5.0f / (float)window_h);
TeleportTarget *target = game->getSpaceship()->getNavigator()->getTarget();
std::string selected = getSelected();
for (auto label : m_labels)
{
// Highlight targeted label
if (target && target->getTeleportName() == label.first)
glColor3f(0.0f, 1.0f, 0.0f);
else if (selected == label.first)
glColor3f(1.0f, 0.0f, 0.0f);
else
glColor3f(1.0f, 1.0f, 1.0f);
// Highlight the label closest to the cursor
glRectf(label.second.x - rectw, label.second.y + recth,
label.second.x + rectw, label.second.y - recth);
glRasterPos2f(label.second.x + 3 * rectw, label.second.y - recth);
glutBitmapString(GLUT_BITMAP_HELVETICA_12, (unsigned char *)label.first.c_str());
}
}
开发者ID:Jeija,项目名称:planether,代码行数:30,代码来源:hud.cpp
示例13: getText
GameState *TextBox::EventUpdate(App& app, const sf::Event& event, GameUtility* gameUtility, float x, float y)
{
Label::EventUpdate(app, event, gameUtility, x, y);
if(getSelected())
{
if (event.type == sf::Event::TextEntered)
{
if (event.text.unicode < 128)
{
//std::cout << event.text.unicode << std::endl;
switch(event.text.unicode)
{
case 8: //Backspace
{
sf::String temp = getText()->getString();
if(temp.getSize() > 0)
{
temp.erase(temp.getSize() - 1);
getText()->setString(temp);
}
}
break;
default:
{
if(getText()->getGlobalBounds().width < m_width)
getText()->setString(getText()->getString() + event.text.unicode);
}
break;
}
}
}
}
return nullptr;
}
开发者ID:CheeseSoftware,项目名称:Cheese_Multiplayer,代码行数:34,代码来源:TextBox.cpp
示例14: getFilePaths
void LocalSharedFilesDialog::playselectedfiles()
{
/* call back to the model (which does all the interfacing? */
std::cerr << "SharedFilesDialog::playselectedfiles()";
std::cerr << std::endl;
std::list<std::string> paths;
model -> getFilePaths(getSelected(), paths);
std::list<std::string>::iterator it;
QStringList fullpaths;
for(it = paths.begin(); it != paths.end(); ++it)
{
std::string fullpath;
rsFiles->ConvertSharedFilePath(*it, fullpath);
fullpaths.push_back(QString::fromStdString(fullpath));
std::cerr << "Playing: " << fullpath;
std::cerr << std::endl;
}
playFiles(fullpaths);
std::cerr << "SharedFilesDialog::playselectedfiles() Completed";
std::cerr << std::endl;
}
开发者ID:sehraf,项目名称:RetroShare,代码行数:27,代码来源:SharedFilesDialog.cpp
示例15: collView
void SharedFilesDialog::collView()
{
std::list<DirDetails> files_info ;
model->getFileInfoFromIndexList(getSelected(),files_info);
if(files_info.size() != 1) return ;
/* make path for downloaded files */
std::list<DirDetails>::iterator it = files_info.begin();
DirDetails details = (*it);
FileInfo info;
if (!rsFiles->FileDetails(details.hash, RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_LOCAL
| RS_FILE_HINTS_BROWSABLE | RS_FILE_HINTS_NETWORK_WIDE
| RS_FILE_HINTS_SPEC_ONLY, info)) return;
std::string path;
path = info.path;
/* open file with a suitable application */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollectionFile::ExtensionString)) {
RsCollectionFile collection;
collection.openColl(qinfo.absoluteFilePath(), true);
}//if (qinfo.absoluteFilePath().endsWith(RsCollectionFile::ExtensionString))
}//if (qinfo.exists())
}
开发者ID:sehraf,项目名称:RetroShare,代码行数:29,代码来源:SharedFilesDialog.cpp
示例16: writeChar
void InputWidget::writeChar()
{
if (getSelected())
{
IControllerToMenu* controller = PolyBomberApp::getIControllerToMenu();
char c = 0;
while((c = controller->getCharPressed()) == 0)
sf::sleep(sf::milliseconds(10));
if (c > 2)
{
std::string s = text.getString() + c;
if (s.size() < this->maxLength + 1)
text.setString(s);
}
else if (c == 2) // retour arrière
{
std::string s = text.getString();
if (s.size() > 0)
s.erase(s.size() - 1);
text.setString(s);
}
}
}
开发者ID:Damsolla,项目名称:projetBomberman,代码行数:29,代码来源:InputWidget.cpp
示例17: getRow
void GuiGameListMenuCtrl::onMouseUp(const GuiEvent &event)
{
S32 hitRow = getRow(event.mousePoint);
if ((hitRow != NO_ROW) && isRowEnabled(hitRow) && (hitRow == getSelected()))
{
activateRow();
}
}
开发者ID:adhistac,项目名称:ee-client-2-0,代码行数:8,代码来源:guiGameListMenuCtrl.cpp
示例18: getSelectedString
std::string DropDown::getSelectedString() const
{
gcn::ListModel *listModel = mListBox->getListModel();
if (!listModel)
return "";
return listModel->getElementAt(getSelected());
}
开发者ID:Evonline,项目名称:ManaPlus,代码行数:8,代码来源:dropdown.cpp
示例19: getSelected
ccHObject::Container vombat::getSelectedThatAre(CC_CLASS_ENUM ThisType) const
{
ccHObject::Container sel = getSelected(); // all selected
ccHObject::Container out = vombat::filterObjectsByType(sel, ThisType);
return out;
}
开发者ID:luca-penasa,项目名称:vombat,代码行数:8,代码来源:vombat.cpp
示例20: getSelected
SkillInfo *getSelectedInfo()
{
const int selected = getSelected();
if (selected < 0 || selected > mListModel->getNumberOfElements())
return 0;
return static_cast<SkillModel*>(mListModel)->getSkillAt(selected);
}
开发者ID:TonyRice,项目名称:mana,代码行数:8,代码来源:skilldialog.cpp
注:本文中的getSelected函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论