本文整理汇总了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);
}
}
}
}
}
示例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();
}
}