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


C++ ComboBox::ItemText方法代码示例

本文整理汇总了C++中ComboBox::ItemText方法的典型用法代码示例。如果您正苦于以下问题:C++ ComboBox::ItemText方法的具体用法?C++ ComboBox::ItemText怎么用?C++ ComboBox::ItemText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ComboBox的用法示例。


在下文中一共展示了ComboBox::ItemText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ComboItemSelected

void CCDFrameInterface::ComboItemSelected(ComboBox& sender, int itemIndex) {
	if (sender == GUI->CCDDevice_Combo){
		m_Device = sender.ItemText(itemIndex);
		if (ThePixInsightINDIInterface != 0) {

			PixInsightINDIInstance* pInstance = &ThePixInsightINDIInterface->instance;

			if (pInstance==NULL)
				return;

			INDIPropertyListItem CCDProp;
			// check for cooler connection (e.g. Atik cameras)
			GUI->Temperature_Timer.Start();
			if (pInstance->getINDIPropertyItem(m_Device,
					"COOLER_CONNECTION", "CONNECT_COOLER", CCDProp)) {
				if(CCDProp.PropertyValue==String("OFF")){
					INDINewPropertyListItem newPropertyListItem;
					newPropertyListItem.Device=m_Device;
					newPropertyListItem.Property = String("COOLER_CONNECTION");
					newPropertyListItem.Element = String("CONNECT_COOLER");
					newPropertyListItem.PropertyType = String("INDI_SWITCH");

					newPropertyListItem.NewPropertyValue = String("ON");
					pInstance->sendNewPropertyValue(newPropertyListItem,true);

				}
			}

		}
	}
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:31,代码来源:CCDFrameInterface.cpp

示例2: ComboItemSelected

void INDIMountInterface::ComboItemSelected( ComboBox& sender, int itemIndex )
{
   if ( sender == GUI->MountDevice_Combo )
   {
      m_Device = sender.ItemText( itemIndex );
      if ( TheINDIDeviceControllerInterface != nullptr )
      {
         INDIDeviceControllerInstance* pInstance = &TheINDIDeviceControllerInterface->instance;
         if ( pInstance == nullptr )
            return;

         // Start update timer
         GUI->UpdateMount_Timer.Start();
      }

      pcl::Sleep( 2 );
      // Download stars from simbad database
      NetworkTransfer transfer;
      IsoString url( "http://simbad.u-strasbg.fr/simbad/sim-tap/sync?request=doQuery&lang=adql&format=text&query=" );
      //IsoString url( "http://simbad.cfa.harvard.edu/simbad/sim-tap/sync?request=doQuery&lang=adql&format=text&query=" );

      SkyMap::geoCoord geoCoord;
      geoCoord.geo_lat = m_geoLat;
      SkyMap::filter filter;
      filter.dec_lowerLimit = (m_geoLat < 0) ? 90.0 - m_geoLat : m_geoLat - 90.0;
      filter.dec_upperLimit = (m_geoLat < 0) ? -90.0 : 90.0;
      filter.v_upperLimit = m_limitStarMag;

      m_skymap = new SkyMap( filter, geoCoord );
      IsoString select_stmt = m_skymap->getASDLQueryString();
      Console().WriteLn( "QueryStr = " + m_skymap->getASDLQueryString() );
      url.Append( select_stmt );
      transfer.SetURL( url );
      transfer.OnDownloadDataAvailable(
         (NetworkTransfer::download_event_handler) &INDIMountInterface::DownloadObjectCoordinates, *this );
      if ( !transfer.Download() )
      {
         Console().WriteLn( "Download failed with error '" + transfer.ErrorInformation() + "'" );
         if ( transfer.WasAborted() )
            Console().WriteLn( "Download was aborted" );
      }
      else
      {
         Console().WriteLn( String().Format( "%u bytes downloaded @ %.3g KiB/s",
                                             transfer.BytesTransferred(), transfer.TotalSpeed() ) );
         StringList lines;
         m_downloadedFile.Break( lines, '\n', true/*trim*/ );
         Console().WriteLn( m_downloadedFile.c_str() );
         for ( size_t i = 0; i < lines.Length(); i++ )
         {
            if ( i <= 1 )
               continue;

            StringList tokens;
            lines[i].Break( tokens, '|', true/*trim*/ );
            if ( tokens.Length() != 5 )
               continue;
            if ( !tokens[1].IsNumeral() || !tokens[2].IsNumeral() || !tokens[3].IsNumeral() )
               continue;
            SkyMap::object star;
            star.mainId = tokens[0];
            star.ra = tokens[1].ToDouble();
            star.dec = tokens[2].ToDouble();
            star.v = tokens[3].ToDouble();
            star.spType = tokens[4];
#if DEBUG
            Console().WriteLn( IsoString().Format(
               "star=%s, ra=%f, dec=%f, vmag=%f, sp=%s", star.mainId.c_str(), star.ra, star.dec, star.v, star.spType.c_str() ) );
#endif
            m_skymap->addObject( star );
         }
      }
      m_downloadedFile.Clear();
   }
}
开发者ID:eprimucci,项目名称:PCL,代码行数:75,代码来源:INDIMountInterface.cpp


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