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


C++ wxArrayInt::Count方法代码示例

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


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

示例1: GetSelections

// Return number of selections and an array of selected integers
int wxListBox::GetSelections(wxArrayInt& aSelections) const
{
    aSelections.Empty();

    if ( HasMultipleSelection() )
    {
        int countSel = ListBox_GetSelCount(GetHwnd());
        if ( countSel == LB_ERR )
        {
            wxLogDebug(wxT("ListBox_GetSelCount failed"));
        }
        else if ( countSel != 0 )
        {
            int *selections = new int[countSel];

            if ( ListBox_GetSelItems(GetHwnd(),
                                     countSel, selections) == LB_ERR )
            {
                wxLogDebug(wxT("ListBox_GetSelItems failed"));
                countSel = -1;
            }
            else
            {
                aSelections.Alloc(countSel);
                for ( int n = 0; n < countSel; n++ )
                    aSelections.Add(selections[n]);
            }

            delete [] selections;
        }

        return countSel;
    }
    else  // single-selection listbox
    {
        if (ListBox_GetCurSel(GetHwnd()) > -1)
            aSelections.Add(ListBox_GetCurSel(GetHwnd()));

        return aSelections.Count();
    }
}
开发者ID:mael15,项目名称:wxWidgets,代码行数:42,代码来源:listbox.cpp

示例2: ReadEQPresets

// -------------------------------------------------------------------------------- //
bool ReadEQPresets( const wxString &value, wxArrayInt &preset )
{
    long CurVal;
    int index;
    int count;
    wxArrayString Values = wxStringTokenize( value, wxT( "," ), wxTOKEN_RET_EMPTY_ALL );
    if( ( count = Values.Count() ) == guEQUALIZER_BAND_COUNT )
    {
        for( index = 0; index < count; index++ )
        {
            if( Values[ index ].ToLong( &CurVal ) )
            {
                preset.Add( CurVal );
            }
            else
              break;
        }
        return ( preset.Count() == guEQUALIZER_BAND_COUNT );
    }
    return false;
}
开发者ID:Hreinnjons,项目名称:guayadeque,代码行数:22,代码来源:Equalizer.cpp

示例3: AppendColumnHeader

void ctlSQLGrid::AppendColumnHeader(wxString &str, wxArrayInt columns)
{
	if(settings->GetColumnNames())
	{
		bool CopyQuoting = (settings->GetCopyQuoting() == 1 || settings->GetCopyQuoting() == 2);
		size_t i;

		for(i = 0; i < columns.Count() ; i++)
		{
			long columnPos = columns.Item(i);
			if(i > 0)
				str.Append(settings->GetCopyColSeparator());

			if(CopyQuoting)
				str.Append(settings->GetCopyQuoteChar());
			str.Append(GetColumnName(columnPos));
			if(CopyQuoting)
				str.Append(settings->GetCopyQuoteChar());

		}
		str.Append(END_OF_LINE);
	}
}
开发者ID:SokilV,项目名称:pgadmin3,代码行数:23,代码来源:ctlSQLGrid.cpp

示例4: GetRadioGenresList

// -------------------------------------------------------------------------------- //
void guDbRadios::GetRadioGenresList( const int source, const wxArrayInt &ids, guListItems * listitems, wxArrayInt * radioflags )
{
  wxString query;
  wxSQLite3ResultSet dbRes;

  if( ids.Count() )
  {
    query = wxT( "SELECT radiogenre_id, radiogenre_name, radiogenre_flags FROM radiogenres WHERE " );
    query += wxString::Format( wxT( "radiogenre_source = %i AND " ), source );
    query += ArrayToFilter( ids, wxT( "radiogenre_id" ) );
    query += wxT( " ORDER BY radiogenre_name COLLATE NOCASE;" );

    //guLogMessage( query );
    dbRes = ExecuteQuery( query );

    while( dbRes.NextRow() )
    {
      listitems->Add( new guListItem( dbRes.GetInt( 0 ), dbRes.GetString( 1 ) ) );
      if( radioflags )
        radioflags->Add( dbRes.GetInt( 2 ) );
    }
    dbRes.Finalize();
  }
}
开发者ID:Hreinnjons,项目名称:guayadeque,代码行数:25,代码来源:DbRadios.cpp

示例5: AddAlbums

// -------------------------------------------------------------------------------- //
void guJamendoDownloadThread::AddAlbums( const wxArrayInt &albumids, const bool iscover )
{
    int Index;
    int Count = albumids.Count();

    if( iscover )
    {
        m_CoversMutex.Lock();
        for( Index = 0; Index < Count; Index++ )
        {
            m_Covers.Add( albumids[ Index ] );
        }
        m_CoversMutex.Unlock();
    }
    else
    {
        m_AlbumsMutex.Lock();
        for( Index = 0; Index < Count; Index++ )
        {
            m_Albums.Add( albumids[ Index ] );
        }
        m_AlbumsMutex.Unlock();
    }
}
开发者ID:anonbeat,项目名称:guayadeque,代码行数:25,代码来源:Jamendo.cpp

示例6: generateList

wxString ddDatabaseDesign::generateList(wxArrayString tables, wxArrayInt options, pgConn *connection, wxString schemaName)
{
	int i;

	// Validate
	if(tables.Count() != options.Count())
	{
		// shouldn't it be a WXASSERT?
		wxMessageBox(_("Invalid number of arguments in call of function generate tables of list"), _("Error at generation process"),  wxICON_ERROR);
		return wxEmptyString;
	}

	int tablesCount = tables.Count();
	for(i = 0; i < tablesCount; i++)
	{
		ddTableFigure *table = getTable(tables[i]);
		if(table == NULL)
		{
			// shouldn't it be a WXASSERT?
			wxMessageBox(_("Metadata of table to be generated not found at database designer model"), _("Error at generation process"),  wxICON_ERROR);
			return wxEmptyString;
		}
	}

	// Start building of CREATE + ALTER PK(s) + ALTER UK(s) + ALTER FK(s)
	wxString out;
	out += wxT(" \n");
	out += wxT("--\n-- ");
	out += _("Generating Create sentence(s) for table(s) ");
	out += wxT(" \n--\n");
	out += wxT(" \n");
	for(i = 0; i < tablesCount; i++)
	{
		if(options[i] == DDGENCREATE || options[i] == DDGENDROPCRE)
		{
			ddTableFigure *table = getTable(tables[i]);
			if(options[i] == DDGENDROPCRE)
			{
				out += wxT(" \n");
				out += wxT("DROP TABLE \"") + table->getTableName() + wxT("\";");
				out += wxT(" \n");
			}
			out += wxT(" \n");
			out += table->generateSQLCreate(schemaName);
			out += wxT(" \n");
		}
	}
	out += wxT(" \n");
	out += wxT(" \n");
	out += wxT(" \n");
	out += wxT("--\n-- ");
	out += _("Generating Pk sentence for table(s) ");
	out += wxT(" \n--\n");
	out += wxT(" \n");
	out += wxT(" \n");
	for(i = 0; i < tablesCount; i++)
	{
		if(options[i] == DDGENCREATE || options[i] == DDGENDROPCRE)
		{
			ddTableFigure *table = getTable(tables[i]);
			out += table->generateSQLAlterPks(schemaName);
		}
	}
	out += wxT(" \n");
	out += wxT(" \n");
	out += wxT(" \n");
	out += wxT("--\n-- ");
	out += _("Generating Uk sentence(s) for table(s) ");
	out += wxT(" \n--\n");
	out += wxT(" \n");
	out += wxT(" \n");
	for(i = 0; i < tablesCount; i++)
	{
		if(options[i] == DDGENCREATE || options[i] == DDGENDROPCRE)
		{
			ddTableFigure *table = getTable(tables[i]);
			out += table->generateSQLAlterUks(schemaName);
		}
	}
	out += wxT(" \n");
	out += wxT(" \n");
	out += wxT(" \n");
	out += wxT("--\n-- ");
	out += _("Generating Fk sentence(s) for table(s) ");
	out += wxT(" \n--\n");
	out += wxT(" \n");
	out += wxT(" \n");
	for(i = 0; i < tablesCount; i++)
	{
		if(options[i] == DDGENCREATE || options[i] == DDGENDROPCRE)
		{
			ddTableFigure *table = getTable(tables[i]);
			out += table->generateSQLAlterFks(schemaName);
		}
	}

	//Start generation of alter table instead of create
	//Check there is some
	int countAlter = 0;
	for(i = 0; i < tablesCount; i++)
//.........这里部分代码省略.........
开发者ID:dragansah,项目名称:pgadmin3,代码行数:101,代码来源:ddDatabaseDesign.cpp

示例7: OnTimerTest

// called on each Timer tick while Test dialog is open
void xLightsFrame::OnTimerTest(long curtime)
{
    static int LastNotebookSelection = -1;
    static int LastBgIntensity,LastFgIntensity,LastBgColor[3],LastFgColor[3],*ShimColor,ShimIntensity;
    static int LastSequenceSpeed;
    static int LastAutomatedTest;
    static long NextSequenceStart = -1;
    static TestFunctions LastFunc = OFF;
    static unsigned int interval, rgbCycle, TestSeqIdx;
    static wxArrayInt chArray,TwinkleState;
    static float frequency;
    int v,BgIntensity,FgIntensity,BgColor[3],FgColor[3];
    unsigned int i;
    bool ColorChange;

    if (!xout) return;
    xout->TimerStart(curtime);
    int NotebookSelection = NotebookTest->GetSelection();
    if (NotebookSelection != LastNotebookSelection)
    {
        LastNotebookSelection = NotebookSelection;
        CheckChannelList = true;
        TestSeqIdx=0;
        TestButtonsOff();
    }
    if (TestFunc != LastFunc)
    {
        LastFunc = TestFunc;
        rgbCycle=0;
        CheckChannelList = true;
        NextSequenceStart = -1;
    }

    if (CheckChannelList)
    {
        // get list of checked channels
        xout->alloff();
        GetCheckedItems(chArray);
        LastSequenceSpeed=-1;
        LastBgIntensity=-1;
        LastFgIntensity=-1;
        LastAutomatedTest=-1;
        for (i=0; i < 3; i++)
        {
            LastBgColor[i] = -1;
            LastFgColor[i] = -1;
        }
        if (!CheckBoxLightOutput->IsChecked())
        {
            StatusBar1->SetStatusText(_("Testing disabled - Output to Lights is not checked"));
        }
        else if (TestFunc == OFF)
        {
            StatusBar1->SetStatusText(_("Testing off"));
        }
        else
        {
            StatusBar1->SetStatusText(wxString::Format(_("Testing %ld channels"),static_cast<long>(chArray.Count())));
        }
        CheckChannelList = false;
    }

    if (TestFunc != OFF && chArray.Count() > 0) switch (NotebookSelection)
        {
        case 0:
            // standard tests
            v=SliderChaseSpeed->GetValue();  // 0-100
            BgIntensity = SliderBgIntensity->GetValue();
            FgIntensity = SliderFgIntensity->GetValue();
            ColorChange = BgIntensity != LastBgIntensity || FgIntensity != LastFgIntensity;
            LastBgIntensity = BgIntensity;
            LastFgIntensity = FgIntensity;
            interval = 1600 - v*15;

            switch (TestFunc)
            {
            case DIM:
                if (ColorChange)
                {
                    for (i=0; i < chArray.Count(); i++)
                    {
                        xout->SetIntensity(chArray[i], BgIntensity);
                    }
                }
                break;

            case TWINKLE:
                if (LastSequenceSpeed < 0)
                {
                    LastSequenceSpeed=0;
                    TwinkleState.Clear();
                    for (i=0; i < chArray.Count(); i++)
                    {
                        TestSeqIdx = static_cast<int>(rand01()*TwinkleRatio);
                        TwinkleState.Add(TestSeqIdx == 0 ? -1 : 1);
                    }
                }
                for (i=0; i < TwinkleState.Count(); i++)
                {
//.........这里部分代码省略.........
开发者ID:josephcsible,项目名称:xLights,代码行数:101,代码来源:TabTest.cpp


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