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


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

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


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

示例1: DoGetWordStarts

bool SpellCheckerPlugin::DoGetWordStarts(const wxString& word, wxArrayInt& wordStarts, int numWords)
{
    if (numWords <= 0) // finish split
    {
        wordStarts.Add(0); // first word
        wxString currWord;
        for (int i = wordStarts.GetCount() - 1; i > 0; --i) // reverse iteration (so numbers are checked lowest to highest)
        {
            currWord = word(wordStarts[i], wordStarts[i - 1] - wordStarts[i]);
            if (currWord.Length() > 3) // capitalize medium/long words so proper nouns work
                currWord = currWord(0, 1).Upper() + currWord.Mid(1);
            if (!m_pSpellChecker->IsWordInDictionary(currWord))
            {
                wordStarts.RemoveAt(wordStarts.GetCount() - 1);
                return false; // no, fall back a level
            }
        }
        currWord = word.Mid(wordStarts[0]);
        if (currWord.Length() > 3) // capitalize
            currWord = currWord(0, 1).Upper() + currWord.Mid(1);
        if (!m_pSpellChecker->IsWordInDictionary(currWord)) // last word (wordStarts[] is reverse sorted)
        {
            wordStarts.RemoveAt(wordStarts.GetCount() - 1);
            return false; // no, fall back a level
        }
        return true; // all parts are correctly spelled
    }

    // iterate through possibilities of the current word start
    for (int i = (wordStarts.IsEmpty() ? word.Length() : wordStarts[wordStarts.GetCount() - 1]) - 2;
         i >= numWords * 2; --i)
    {
        wordStarts.Add(i);
        if (DoGetWordStarts(word, wordStarts, numWords - 1))
        {
            return true; // yes, fall through and return
        }
        wordStarts.RemoveAt(wordStarts.GetCount() - 1);
    }
    return false; // no, fall back an iteration
}
开发者ID:Three-DS,项目名称:codeblocks-13.12,代码行数:41,代码来源:SpellCheckerPlugin.cpp

示例2: MoveColumnInOrderArray

/* static */
void wxHeaderCtrlBase::MoveColumnInOrderArray(wxArrayInt& order,
                                              unsigned int idx,
                                              unsigned int pos)
{
    int posOld = order.Index(idx);
    wxASSERT_MSG( posOld != wxNOT_FOUND, "invalid index" );

    if ( pos != (unsigned int)posOld )
    {
        order.RemoveAt(posOld);
        order.Insert(idx, pos);
    }
}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:14,代码来源:headerctrlcmn.cpp


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