• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ getSelectedIndex函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中getSelectedIndex函数的典型用法代码示例。如果您正苦于以下问题:C++ getSelectedIndex函数的具体用法?C++ getSelectedIndex怎么用?C++ getSelectedIndex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getSelectedIndex函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: getItem

/**
 * Returns the selected item
 */
wstring CListBox::getSelectedItem()
{
	if(getItemCount() == 0)
	{
		return L"";
	}
	return getItem(getSelectedIndex());
}
开发者ID:fritzone,项目名称:netscan,代码行数:11,代码来源:ListBox.cpp


示例17: getSelectedIndex

FileInfo *FileInfoListView::getSelectedFileInfo()
{
  int si = getSelectedIndex();
  if (si == -1) {
    return NULL;
  }
  return reinterpret_cast<FileInfo *>(getSelectedItem().tag);
}
开发者ID:Aliceljm1,项目名称:TightVNC-1,代码行数:8,代码来源:FileInfoListView.cpp


示例18: getSelectedIndex

FileInfo *FileInfoListView::getSelectedFileInfo()
{
  int si = getSelectedIndex();
  if (si == -1) {
    return NULL;
  }
  return (FileInfo *)getSelectedItem().tag;
}
开发者ID:newmind,项目名称:tvnc_rds,代码行数:8,代码来源:FileInfoListView.cpp


示例19: getSelectedIndex

void CList::selectPrev()
{
    int index = getSelectedIndex();
    if (index <= 0)
        selectIndex(0);
    else
        selectIndex(index-1);
}
开发者ID:yzliang,项目名称:vcmi,代码行数:8,代码来源:AdventureMapClasses.cpp


示例20: getSubnet

// sets subnet with index as selected. returns false if no valid selection possible.
bool SM_ModelBackend::selectIndex(int index)
{
    int currentSelection=getSelectedIndex();

    if ((currentSelection!=index)&(currentSelection<SubnetList.count())) {
        getSubnet(getSelectedIndex())->setSelected(false);
        emit dataChanged();
    };

    if (index<SubnetList.count()) {
        getSubnet(index)->setSelected(true);
        emit dataChanged();
    } else {
        return false;
    };

    return true;
}
开发者ID:lordwolfchild,项目名称:subnetmapper,代码行数:19,代码来源:sm_modelbackend.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ getSelectedPlayer函数代码示例发布时间:2022-05-28
下一篇:
C++ getSelectedCreature函数代码示例发布时间:2022-05-28
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap