本文整理汇总了C++中getSelected函数的典型用法代码示例。如果您正苦于以下问题:C++ getSelected函数的具体用法?C++ getSelected怎么用?C++ getSelected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSelected函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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));
}
示例3: touchHits
void CheckBox::onTouchMoved(cocos2d::Touch *touch, cocos2d::Event *event)
{
auto hits = touchHits(touch);
if (hits && _enabled && isVisible())
{
setSelected(!getSelected());
} else
{
setSelected(!getSelected());
}
}
示例4: setSelected
void ListBox::mouseWheelMovedUp(MouseEvent& mouseEvent)
{
if (isFocused())
{
if (getSelected() > 0 )
{
setSelected(getSelected() - 1);
}
mouseEvent.consume();
}
}
示例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();
}
}
示例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();
}
}
示例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;
}
示例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);
}
示例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);
}
示例10: getSelected
void LocalSharedFilesDialog::openfolder()
{
std::cerr << "SharedFilesDialog::openfolder" << std::endl;
QModelIndexList qmil = getSelected();
model->openSelected(qmil);
}
示例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);
}
}
示例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());
}
}
示例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;
}
示例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;
}
示例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())
}