本文整理汇总了C++中wxArrayString::RemoveAt方法的典型用法代码示例。如果您正苦于以下问题:C++ wxArrayString::RemoveAt方法的具体用法?C++ wxArrayString::RemoveAt怎么用?C++ wxArrayString::RemoveAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxArrayString
的用法示例。
在下文中一共展示了wxArrayString::RemoveAt方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxSTEPrependArrayString
void wxSTEPrependArrayString(const wxString &str, wxArrayString &strArray, int count)
{
const int idx = strArray.Index(str);
if (idx == 0)
return;
if (idx != wxNOT_FOUND)
strArray.RemoveAt(idx);
strArray.Insert(str, 0);
if ((count > 0) && ((int)strArray.GetCount() > count))
strArray.RemoveAt(count, strArray.GetCount()-count);
}
示例2: AddTypeToAssociated
void AddTypeToAssociated( wxListBox *WxListBoxAssociated,
wxListBox *WxListBoxPredefined,
const wxArrayString &as )
{
int idx = 0;
const int count = int( as.Count() );
wxString type;
while( idx < count )
{
type = as[idx];
int n = WxListBoxPredefined->FindString( type );
if( n != wxNOT_FOUND ) { WxListBoxPredefined->Delete( n ); }
n = WxListBoxAssociated->FindString( type );
if( n == wxNOT_FOUND ) { WxListBoxAssociated->Append( type ); }
n = as_remove.Index( type );
if( n != wxNOT_FOUND ) { as_remove.RemoveAt( n ); }
++idx;
}
}
示例3: wxArrayStringUpdatePos
bool wxArrayStringUpdatePos(wxArrayString& arr, size_t pos, int num, bool no_error)
{
if (num == 0)
return false;
else if (num > 0)
{
// if no_error check if <= GetCount, else let array error out
if (!no_error || (pos <= arr.GetCount()))
arr.Insert( wxEmptyString, pos, num );
}
else // if (num < 0)
{
const int count = arr.GetCount();
if (no_error && (int(pos) - num > count))
{
num = -(count - int(pos));
if ((num >= 0) || (count == 0)) return false;
}
else
{
wxCHECK_MSG( int(pos) - num <= count, false,
wxString::Format(wxT("Called wxArrayStringUpdatePos(pos=%d, N=%d)\nPos value is invalid for present array with %d elements"),
int(pos), num, count) );
}
if ((pos == 0u) && (num == count))
arr.Clear();
else
arr.RemoveAt( pos, -num );
}
return true;
}
示例4: DoRefreshItemRecursively
void DebuggerTreeListCtrlBase::DoRefreshItemRecursively(IDebugger *dbgr, const wxTreeItemId &item, wxArrayString &itemsToRefresh)
{
if(itemsToRefresh.IsEmpty())
return;
wxTreeItemIdValue cookieOne;
wxTreeItemId exprItem = m_listTable->GetFirstChild(item, cookieOne);
while( exprItem.IsOk() ) {
DbgTreeItemData* data = static_cast<DbgTreeItemData*>(m_listTable->GetItemData(exprItem));
if(data) {
int where = itemsToRefresh.Index(data->_gdbId);
if(where != wxNOT_FOUND) {
dbgr->EvaluateVariableObject(data->_gdbId, m_DBG_USERR);
m_gdbIdToTreeId[data->_gdbId] = exprItem;
itemsToRefresh.RemoveAt((size_t)where);
}
}
if(m_listTable->HasChildren(exprItem)) {
DoRefreshItemRecursively(dbgr, exprItem, itemsToRefresh);
}
exprItem = m_listTable->GetNextChild(item, cookieOne);
}
}
示例5: OnRemovePlugin
/**
* Function OnRemovePlugin
* Remove a plugin from the list
*/
void DIALOG_BOM::OnRemovePlugin( wxCommandEvent& event )
{
int ii = m_lbPlugins->GetSelection();
if( ii < 0 )
return;
m_lbPlugins->Delete( ii );
m_plugins.RemoveAt( 2*ii, 2 ); // Remove title and command line
// Select the next item, if exists
if( (int)m_lbPlugins->GetCount() >= ii )
ii = m_lbPlugins->GetCount() - 1;
if( ii >= 0 )
m_lbPlugins->SetSelection( ii );
pluginInit();
}
示例6: BuildRemoteList
//=============================================================================
// Function: BuildRemoteList
// Purpose: Append Network Neighborhood items to the list.
// Notes: - Mounted gets transalated into Connected. FilteredAdd is told
// to ignore the Mounted flag since we need to handle it in a weird
// way manually.
// - The resulting list is sorted alphabetically.
//=============================================================================
static bool BuildRemoteList(wxArrayString& list, NETRESOURCE* pResSrc,
unsigned flagsSet, unsigned flagsUnset)
{
// NN query depends on dynamically loaded library.
if (!s_pWNetOpenEnum || !s_pWNetEnumResource || !s_pWNetCloseEnum)
{
wxLogError(_("Failed to load mpr.dll."));
return false;
}
// Don't waste time doing the work if the flags conflict.
if (flagsSet & wxFS_VOL_MOUNTED && flagsUnset & wxFS_VOL_MOUNTED)
return false;
//----------------------------------------------
// Generate the list according to the flags set.
//----------------------------------------------
BuildListFromNN(list, pResSrc, flagsSet, flagsUnset);
list.Sort(CompareFcn);
//-------------------------------------------------------------------------
// If mounted only is requested, then we only need one simple pass.
// Otherwise, we need to build a list of all NN volumes and then apply the
// list of mounted drives to it.
//-------------------------------------------------------------------------
if (!(flagsSet & wxFS_VOL_MOUNTED))
{
// generate.
wxArrayString mounted;
BuildListFromNN(mounted, pResSrc, flagsSet | wxFS_VOL_MOUNTED, flagsUnset & ~wxFS_VOL_MOUNTED);
mounted.Sort(CompareFcn);
// apply list from bottom to top to preserve indexes if removing items.
ssize_t iList = list.GetCount()-1;
for (ssize_t iMounted = mounted.GetCount()-1; iMounted >= 0 && iList >= 0; iMounted--)
{
int compare;
wxString all(list[iList]);
wxString mount(mounted[iMounted]);
while (compare =
wxStricmp(list[iList].c_str(), mounted[iMounted].c_str()),
compare > 0 && iList >= 0)
{
iList--;
all = list[iList];
}
if (compare == 0)
{
// Found the element. Remove it or mark it mounted.
if (flagsUnset & wxFS_VOL_MOUNTED)
list.RemoveAt(iList);
else
s_fileInfo[list[iList]].m_flags |= wxFS_VOL_MOUNTED;
}
iList--;
}
}
return true;
} // BuildRemoteList
示例7: TruncateArray
void FindReplaceData::TruncateArray(wxArrayString& arr, size_t maxSize)
{
while(arr.GetCount() > maxSize && arr.GetCount() > 0) {
arr.RemoveAt(arr.GetCount() - 1);
}
}