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


C++ getSelectedIndex函数代码示例

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

示例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;
}
开发者ID:Krazy-Bish-Margie,项目名称:Thunderstorm,代码行数:58,代码来源:llradiogroup.cpp

示例3: getSelectedIndex

Component* TabPanel::getRightmostDecendent(void) const
{
    if(getMFTabContents()->size() > 0 &&
       getSelectedIndex() != -1)
    {
        return getTabContents(getSelectedIndex())->getRightmostDecendent();
    }
    return NULL;
}
开发者ID:ahuballah,项目名称:OpenSGToolbox,代码行数:9,代码来源:OSGTabPanel.cpp

示例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;
}
开发者ID:akshay1992,项目名称:ApproximatingPi,代码行数:10,代码来源:ofApproxPiSetupGUI.cpp

示例5: PreviousSelection

void DefaultSingleSelectionModel::setSelectedIndex(Int32 index)
{
    if(getInternalSelectedIndex() != index)
    {
        Int32 PreviousSelection(getSelectedIndex());
        setInternalSelectedIndex(index);

        produceSelectionChanged(getSelectedIndex(), PreviousSelection);
    }
}
开发者ID:Himbeertoni,项目名称:OpenSGToolbox,代码行数:10,代码来源:OSGDefaultSingleSelectionModel.cpp

示例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);
}
开发者ID:ahuballah,项目名称:OpenSGToolbox,代码行数:53,代码来源:OSGTabPanel.cpp

示例7: getSelectedIndex

void COptionsOrganizerDlg::OnButtonRename() {
  const int selected = getSelectedIndex();
  if(selected >= 0) {
    m_nameListCtrl.SetFocus();
    m_nameListCtrl.EditLabel(selected);
  }
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:7,代码来源:OptionsOrganizerDlg.cpp

示例8: getSelectedIndex

void UiUtil::removeTableViewSelectedRow(QTableView *view) {
    QModelIndex index = getSelectedIndex(view);

    if (index.isValid()) {
        view->model()->removeRow(index.row());
    }
}
开发者ID:xtuer,项目名称:Qt,代码行数:7,代码来源:UiUtil.cpp

示例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);
    
  }
开发者ID:jmasterx,项目名称:Agui,代码行数:32,代码来源:TabbedPane.cpp

示例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();
  }  
}
开发者ID:mr-c,项目名称:bioapi-linux,代码行数:30,代码来源:MdsEditView.cpp

示例11: add

 void Menu::addItem(const std::shared_ptr<MenuItem> & item) {
     if(item) {
         items.push_back(item);
         add(item.get());
         setSelectedIndex(getSelectedIndex());
     }
 }
开发者ID:jatemack,项目名称:hikari,代码行数:7,代码来源:Menu.cpp

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

示例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);
		}
开发者ID:lufinkey,项目名称:MobileBrawler,代码行数:29,代码来源:BaseMenuScreen.cpp

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

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


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