本文整理汇总了C++中wxArrayString::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ wxArrayString::begin方法的具体用法?C++ wxArrayString::begin怎么用?C++ wxArrayString::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxArrayString
的用法示例。
在下文中一共展示了wxArrayString::begin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetSearchHistory
void DirectoryParamsPanel::SetSearchHistory(const wxArrayString& searchDirs, const wxArrayString& searchMasks)
{
for (wxArrayString::const_iterator it = searchDirs.begin(); it != searchDirs.end(); ++it)
{
if (!it->empty())
m_pSearchDirPath->Append(*it);
}
for (wxArrayString::const_iterator it = searchMasks.begin(); it != searchMasks.end(); ++it)
{
if (!it->empty())
m_pMask->Append(*it);
}
}
示例2: setValue
bool Config::setValue(const wxString& key, const wxArrayString& value)
{
wxString s;
for (wxArrayString::const_iterator it = value.begin(); it != value.end();
it++)
{
if (it != value.begin())
s += ",";
// this is just a parachute, if this should ever be triggered we
// will need to quote and unquote this wxString or all in value
wxASSERT((*it).find(',') == wxString::npos);
s += *it;
}
return setValue(key, s);
}
示例3: SetExcludeConfigForFile
void Project::SetExcludeConfigForFile(const wxString& filename, const wxString& virtualDirPath, const wxArrayString& configs)
{
wxXmlNode *vdNode = GetVirtualDir(virtualDirPath);
if ( !vdNode ) {
return ;
}
// locate our file
wxFileName tmp(filename);
tmp.MakeRelativeTo(m_fileName.GetPath());
wxString filepath = tmp.GetFullPath(wxPATH_UNIX);
wxXmlNode *fileNode = XmlUtils::FindNodeByName(vdNode, "File", filepath);
if ( !fileNode ) {
return ;
}
// Make sure the list is unique
wxStringSet_t unique_set;
unique_set.insert(configs.begin(), configs.end());
wxArrayString uniqueArr;
wxStringSet_t::iterator iter = unique_set.begin();
for( ; iter != unique_set.end(); ++iter ) {
uniqueArr.Add( *iter );
}
wxString excludeConfigs = ::wxJoin(uniqueArr, ';');
XmlUtils::UpdateProperty(fileNode, EXCLUDE_FROM_BUILD_FOR_CONFIG, excludeConfigs );
SaveXmlFile();
}
示例4: DoAutoCompleteStrings
bool wxTextEntry::DoAutoCompleteStrings(const wxArrayString& choices)
{
GtkEntry* const entry = (GtkEntry*)GetEditable();
wxCHECK_MSG(GTK_IS_ENTRY(entry), false, "auto completion doesn't work with this control");
GtkListStore * const store = gtk_list_store_new(1, G_TYPE_STRING);
GtkTreeIter iter;
for ( wxArrayString::const_iterator i = choices.begin();
i != choices.end();
++i )
{
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
0, (const gchar *)i->utf8_str(),
-1);
}
GtkEntryCompletion * const completion = gtk_entry_completion_new();
gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(store));
gtk_entry_completion_set_text_column(completion, 0);
gtk_entry_set_completion(entry, completion);
g_object_unref(completion);
return true;
}
示例5: modFileName
bool ModEditWindow::JarModsDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &filenames)
{
int flags = wxLIST_HITTEST_ONITEM;
long index = 0;
if (m_owner->GetItemCount() > 0)
{
index = m_owner->HitTest(wxPoint(x, y), flags);
}
m_owner->SetInsertMark(-1);
for (wxArrayString::const_iterator iter = filenames.begin(); iter != filenames.end(); iter++)
{
// just skip the dirs here...
if(wxFileName::DirExists(*iter))
continue;
wxFileName modFileName(*iter);
m_inst->GetModList()->InsertMod(index, modFileName.GetFullPath());
m_owner->UpdateItems();
}
return true;
}
示例6: get_valid
wxArrayString ArrayVariableProperty::get_valid(const wxArrayString& val) {
std::set<wxString> set = get_set(dataset_vars_);
wxArrayString ret;
for (wxArrayString::const_iterator it = val.begin(); it != val.end(); it++)
if (set.find(*it) != set.end()) ret.Add(*it);
return ret;
}
示例7: switch
GameDatabaseListView& GameDatabaseListView::SortBy( GameDataColumnId column )
{
const bool isDescending = false;
wxArrayString::iterator begin = m_GamesInView.begin();
wxArrayString::iterator end = m_GamesInView.end();
// Note: std::sort does not pass predicate instances by reference, which means we can't use
// object polymorphism to simplify the code below. --air
switch( column )
{
case GdbCol_Serial:
std::sort(begin, end, GLSort_bySerial(isDescending));
break;
case GdbCol_Title:
std::sort(begin, end, GLSort_byTitle(isDescending));
break;
case GdbCol_Region:
std::sort(begin, end, GLSort_byRegion(isDescending));
break;
case GdbCol_Compat:
std::sort(begin, end, GLSort_byCompat(isDescending));
break;
case GdbCol_Patches:
std::sort(begin, end, GLSort_byPatches(isDescending));
break;
default:
break; // for GdbCol_Count
}
//m_GamesInView.( );
return *this;
}
示例8: GetFiles
void SearchThread::GetFiles(const SearchData* data, wxArrayString& files)
{
std::set<wxString> scannedFiles;
const wxArrayString& rootDirs = data->GetRootDirs();
files = data->GetFiles();
// Remove files that do not match our search criteria
FilterFiles(files, data);
// Populate "scannedFiles" with list of files to scan
scannedFiles.insert(files.begin(), files.end());
for(size_t i = 0; i < rootDirs.size(); ++i) {
// make sure it's really a dir (not a fifo, etc.)
DirTraverser traverser(data->GetExtensions());
wxDir dir(rootDirs.Item(i));
dir.Traverse(traverser);
wxArrayString& someFiles = traverser.GetFiles();
for(size_t j = 0; j < someFiles.Count(); ++j) {
if(scannedFiles.count(someFiles.Item(j)) == 0) {
files.Add(someFiles.Item(j));
scannedFiles.insert(someFiles.Item(j));
}
}
}
files.clear();
std::for_each(scannedFiles.begin(), scannedFiles.end(), [&](const wxString& file) { files.Add(file); });
}
示例9: display_invalid_params
void ParamsDialog::display_invalid_params(const wxArrayString& params) {
if (params.empty()) return;
wxString msg = "The following parameters are invalid.\n";
wxArrayString::const_iterator it;
for (it = params.begin(); it != params.end(); it++) msg += '\n' + *it;
wxMessageBox(msg, "Error", wxICON_ERROR);
}
示例10:
const std::set<wxString> ArrayVariableProperty::get_set(
const wxArrayString& val) const {
std::set<wxString> ret;
for (wxArrayString::const_iterator it = val.begin(); it != val.end(); it++)
ret.emplace(*it);
return ret;
}
示例11: DoAutoCompleteStrings
bool wxTextEntry::DoAutoCompleteStrings(const wxArrayString& choices)
{
GtkEntry* const entry = (GtkEntry*)GetEditable();
wxCHECK_MSG(GTK_IS_ENTRY(entry), false, "auto completion doesn't work with this control");
GtkListStore * const store = gtk_list_store_new(1, G_TYPE_STRING);
GtkTreeIter iter;
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
# pragma ivdep
# pragma swp
# pragma unroll
# pragma prefetch
# if 0
# pragma simd noassert
# endif
#endif /* VDM auto patch */
for ( wxArrayString::const_iterator i = choices.begin();
i != choices.end();
++i )
{
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
0, (const gchar *)i->utf8_str(),
-1);
}
GtkEntryCompletion * const completion = gtk_entry_completion_new();
gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(store));
gtk_entry_completion_set_text_column(completion, 0);
gtk_entry_set_completion(entry, completion);
g_object_unref(completion);
return true;
}
示例12: GetItem
wxCoord
ClueListBox::OnMeasureItem(size_t n) const
{
XPuzzle::Clue clue = GetItem(n);
// Cache the wrapped clue's text if it isn't already
if (m_cachedClues.at(n).empty())
{
int maxWidth;
GetClientSize(&maxWidth, NULL);
m_cachedClues.at(n) = Wrap(this, clue.Text(),
maxWidth - m_numWidth - GetMargins().x);
}
int height = 0;
const wxArrayString lines = wxStringTokenize(m_cachedClues.at(n), _T("\n"));
for (wxArrayString::const_iterator it = lines.begin();
it != lines.end();
++it)
{
int lineHeight;
GetTextExtent(*it, NULL, &lineHeight);
height += lineHeight;
}
return height;
}
示例13: GetFiles
void SearchThread::GetFiles(const SearchData* data, wxArrayString& files)
{
wxStringSet_t scannedFiles;
const wxArrayString& rootDirs = data->GetRootDirs();
files = data->GetFiles();
// Populate "scannedFiles" with list of files to scan
scannedFiles.insert(files.begin(), files.end());
for(size_t i = 0; i < rootDirs.size(); ++i) {
// make sure it's really a dir (not a fifo, etc.)
clFilesScanner scanner;
std::vector<wxString> filesV;
if(scanner.Scan(rootDirs.Item(i), filesV, data->GetExtensions())) {
std::for_each(filesV.begin(), filesV.end(), [&](const wxString& file) { scannedFiles.insert(file); });
}
}
files.clear();
files.Alloc(scannedFiles.size());
std::for_each(scannedFiles.begin(), scannedFiles.end(), [&](const wxString& file) { files.Add(file); });
// Filter all non matching files
FilterFiles(files, data);
}
示例14: SetSearchPaths
void FindReplaceData::SetSearchPaths(const wxArrayString& searchPaths)
{
// filter duplicate items
wxStringSet_t paths;
paths.insert(searchPaths.begin(), searchPaths.end());
m_searchPaths.clear();
std::for_each(paths.begin(), paths.end(), [&](const wxString& path) { m_searchPaths.Add(path); });
}
示例15: CreateHtml
/**
* @brief Joins array of strings into single string.
*
* @param array Input array.
*
* @return Result string.
*/
static wxString CreateHtml(const wxArrayString& array)
{
wxString result;
for (wxArrayString::const_iterator it = array.begin(), ite = array.end(); it != ite; ++it) {
if (it != array.begin()) {
result += "<br />";
}
wxString esc = *it;
// Escape
esc.Replace("<", "<");
esc.Replace(">", ">");
result += esc;
}
return result;
}