本文整理汇总了C++中getSelectedIndex函数的典型用法代码示例。如果您正苦于以下问题:C++ getSelectedIndex函数的具体用法?C++ getSelectedIndex怎么用?C++ getSelectedIndex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSelectedIndex函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onButton
void ofApproxPiSetupGUI::onButton(ofxDatGuiButtonEvent e)
{
if(e.target->getName() == "Abort")
{
settings->exit = true;
}
else
{
settings->exit = false;
if(settings->dur_in_mins == -1)
{
gui->getTextInput("Duration (in mins)")->setText("*ENTER DURATION*");
return;
}
int selected_channels = nChannels_options_int[getSelectedIndex("NChannels")];
int available_channels = output_devices[getSelectedIndex("Audio Device")].outputChannels;
if(selected_channels > available_channels)
{
gui->addLabel("***INSUFFICIENT CHANNELS ON OUTPUT DEVICE***");
return;
}
}
gui->setVisible(false);
exit();
}
示例2: switch
BOOL LLRadioGroup::handleKeyHere(KEY key, MASK mask)
{
BOOL handled = FALSE;
// do any of the tab buttons have keyboard focus?
if (mask == MASK_NONE)
{
switch(key)
{
case KEY_DOWN:
if (!setSelectedIndex((getSelectedIndex() + 1)))
{
make_ui_sound("UISndInvalidOp");
}
else
{
onCommit();
}
handled = TRUE;
break;
case KEY_UP:
if (!setSelectedIndex((getSelectedIndex() - 1)))
{
make_ui_sound("UISndInvalidOp");
}
else
{
onCommit();
}
handled = TRUE;
break;
case KEY_LEFT:
if (!setSelectedIndex((getSelectedIndex() - 1)))
{
make_ui_sound("UISndInvalidOp");
}
else
{
onCommit();
}
handled = TRUE;
break;
case KEY_RIGHT:
if (!setSelectedIndex((getSelectedIndex() + 1)))
{
make_ui_sound("UISndInvalidOp");
}
else
{
onCommit();
}
handled = TRUE;
break;
default:
break;
}
}
return handled;
}
示例3: getSelectedIndex
Component* TabPanel::getRightmostDecendent(void) const
{
if(getMFTabContents()->size() > 0 &&
getSelectedIndex() != -1)
{
return getTabContents(getSelectedIndex())->getRightmostDecendent();
}
return NULL;
}
示例4: exit
//--------------------------------------------------------------
void ofApproxPiSetupGUI::exit(void)
{
settings->nChannels = nChannels_options_int[getSelectedIndex("NChannels")];
settings->windowWidth = widths_options_int[getSelectedIndex("Resolution")];
settings->windowHeight = heights_options_int[getSelectedIndex("Resolution")];
settings->audioDeviceID = audio_device_options_int[getSelectedIndex("Audio Device")];
settings->doneSetup = true;
}
示例5: PreviousSelection
void DefaultSingleSelectionModel::setSelectedIndex(Int32 index)
{
if(getInternalSelectedIndex() != index)
{
Int32 PreviousSelection(getSelectedIndex());
setInternalSelectedIndex(index);
produceSelectionChanged(getSelectedIndex(), PreviousSelection);
}
}
示例6: getTabs
void TabPanel::mousePressed(MouseEventDetails* const e)
{
bool isContained;
for(Int32 i(getMFTabs()->size()-1) ; i>=0 ; --i)
{ // going backwards through through elements, so only top button is pressed
isContained = getTabs(i)->isContained(e->getLocation(), true);
checkMouseEnterExit(e,e->getLocation(),getTabs(i),isContained,e->getViewport());
if(isContained)
{
//Give myself temporary focus
takeFocus(true);
if(!getTabs(i)->getType().isDerivedFrom(ComponentContainer::getClassType()))
{
getTabs(i)->takeFocus();
}
getTabs(i)->mousePressed(e);
break;
}
}
if(isContained)
{
//Remove my temporary focus
giveFocus(NULL, false);
}
else
{
//Give myself permanant focus
takeFocus();
}
// now do it for the content tab
isContained = getTabContents(getSelectedIndex())->isContained(e->getLocation(), true);
checkMouseEnterExit(e,e->getLocation(),getTabContents(getSelectedIndex()),isContained,e->getViewport());
if(isContained)
{
//Give myself temporary focus
takeFocus(true);
if(!getTabContents(getSelectedIndex())->getType().isDerivedFrom(ComponentContainer::getClassType()))
{
getTabContents(getSelectedIndex())->takeFocus();
}
getTabContents(getSelectedIndex())->mousePressed(e);
giveFocus(NULL, false);
}
else
{
//Give myself permanent focus
takeFocus();
}
Component::mousePressed(e);
}
示例7: getSelectedIndex
void COptionsOrganizerDlg::OnButtonRename() {
const int selected = getSelectedIndex();
if(selected >= 0) {
m_nameListCtrl.SetFocus();
m_nameListCtrl.EditLabel(selected);
}
}
示例8: getSelectedIndex
void UiUtil::removeTableViewSelectedRow(QTableView *view) {
QModelIndex index = getSelectedIndex(view);
if (index.isValid()) {
view->model()->removeRow(index.row());
}
}
示例9: getSelectedIndex
void TabbedPane::removeTab( int index )
{
if(index < 0 || index >= (int)tabs.size())
{
return;
}
int newSelectedIndex = getSelectedIndex();
if(newSelectedIndex > 0 && tabs.size() >= 2)
{
newSelectedIndex--;
}
else if(newSelectedIndex == 0 && tabs.size() == 1)
{
newSelectedIndex = -1;
}
tabs[index].first->setTabPane(NULL);
tabContainer->remove(tabs[index].first);
tabs.erase(tabs.begin() + index);
for(std::vector<TabbedPaneListener*>::iterator it = tabListeners.begin();
it != tabListeners.end(); ++it)
{
(*it)->tabRemoved(this,tabs[index].first);
}
setSelectedTab(newSelectedIndex);
}
示例10: getSelectedIndex
void MdsEditView::slotAttributeDoubleClicked(QListViewItem *)
{
int i = getSelectedIndex(m_listView);
if ( i < 0 )
{
fprintf(stderr, "No items were selected!\n");
return;
}
//CDir *pDir = m_pRec->m_pRecType->m_pDir;
//CMDS *pMds = pDir->m_pMds;
//CSSM_DB_RECORDTYPE dwRecType = m_pRec->m_pRecType->m_dwRecType;
if (m_pRec->m_outputAttributeData[i].Info.AttributeFormat ==
CSSM_DB_ATTRIBUTE_FORMAT_BLOB)
{
if ( m_pRec->m_outputAttributeData[i].Value->Data )
{
//TODO:OnEditExportBlob();
}
else
{
//TODO:OnEditImportBlob();
}
}
else
{
slotModifyAttributeAction();
}
}
示例11: add
void Menu::addItem(const std::shared_ptr<MenuItem> & item) {
if(item) {
items.push_back(item);
add(item.get());
setSelectedIndex(getSelectedIndex());
}
}
示例12: connectToSwitch
void NotificationCenterTest::connectToSwitch(Ref *sender)
{
auto item = (MenuItemToggle*)sender;
bool bConnected = item->getSelectedIndex() == 0 ? false : true;
Light* pLight = (Light*)this->getChildByTag(item->getTag()-kTagConnect+kTagLight);
pLight->setIsConnectToSwitch(bConnected);
}
示例13: onUpdate
void BaseMenuScreen::onUpdate(ApplicationData appData)
{
if(getSelectedIndex() != MenuScreen::NO_SELECTION)
{
if(hoverPulseEnabled)
{
double scaleIncrement = PULSE_SPEED * appData.getFrameSpeedMultiplier();
if(hoverPulseGrowing)
{
hoverPulseScale += scaleIncrement;
if(hoverPulseScale >= PULSE_UPPERBOUND)
{
hoverPulseScale = PULSE_UPPERBOUND;
hoverPulseGrowing = false;
}
}
else
{
hoverPulseScale -= scaleIncrement;
if(hoverPulseScale <= PULSE_LOWERBOUND)
{
hoverPulseScale = PULSE_LOWERBOUND;
hoverPulseGrowing = true;
}
}
}
}
MenuScreen::onUpdate(appData);
}
示例14: getDrawnTabBackground
Layer* TabPanel::getDrawnTabBackground(const UInt32& Index) const
{
if(getEnabled())
{
if(Index == getSelectedIndex())
{
return getTabActiveBackground();
}
else if(Index == _MouseInTabLastMouse)
{
return getTabRolloverBackground();
}
else if(getTabs(Index)->getFocused())
{
return getTabFocusedBackground();
}
else
{
return getTabBackground();
}
}
else
{
return getTabDisabledBackground();
}
}
示例15: setSelectedTab
void TabbedPane::keyDown( KeyEvent &keyEvent )
{
if(keyEvent.getExtendedKey() == EXT_KEY_LEFT)
{
if(getSelectedIndex() > 0)
{
setSelectedTab(getSelectedIndex() - 1);
keyEvent.consume();
}
}
else if(keyEvent.getExtendedKey() == EXT_KEY_RIGHT)
{
setSelectedTab(getSelectedIndex() + 1);
keyEvent.consume();
}
}