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


C++ wxArrayString::Item方法代码示例

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


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

示例1: DoAddFilesToFolder

void PHPWorkspaceView::DoAddFilesToFolder(const wxArrayString& paths, PHPProject::Ptr_t pProject, bool notify)
{
    if(paths.IsEmpty()) return;

    CHECK_PTR_RET(pProject);

    wxString folder_path = PHPFolder::GetFolderPathFromFileFullPath(paths.Item(0), pProject->GetFilename().GetPath());
    wxTreeItemId folderItem =
        EnsureFolderExists(DoGetProjectItem(pProject->GetName()), folder_path, pProject->GetName());
    PHPFolder::Ptr_t pFolder = pProject->AddFolder(folder_path);
    CHECK_PTR_RET(pFolder);

    wxArrayString newPaths;
    for(size_t i = 0; i < paths.GetCount(); i++) {
        if(pFolder->AddFile(paths.Item(i))) {
            newPaths.Add(paths.Item(i));
        }
    }
    if(newPaths.IsEmpty()) return;

    if(notify) {
        DoAddFilesToTreeView(folderItem, pProject, pFolder, newPaths);
        // Notify the plugins
        clCommandEvent evtFilesAdded(wxEVT_PROJ_FILE_ADDED);
        evtFilesAdded.SetStrings(newPaths);
        EventNotifier::Get()->AddPendingEvent(evtFilesAdded);
    }
}
开发者ID:raresp,项目名称:codelite,代码行数:28,代码来源:php_workspace_view.cpp

示例2: wxObject

wtfRenamer::wtfRenamer(const wxArrayString& files, const wxArrayString& names)
	: wxObject(),
	m_files(),
	m_names(),
	m_opts(NULL),
	m_process(),
	m_error(0),
	m_undo()
{
	wxString str;
	size_t i, cnt;

	cnt = files.GetCount();
	for (i = 0; i < cnt; i++)
	{
		str = files.Item(i);
		m_files.Add(str);
	}

	cnt = names.GetCount();
	for (i = 0; i < cnt; i++)
	{
		str = names.Item(i);
		m_names.Add(str);
	}

	m_opts = new wsdgRenamerOptions();
}
开发者ID:codegooglecom,项目名称:wtfu,代码行数:28,代码来源:util.cpp

示例3: DoAddNode

void SubversionView::DoAddNode(const wxString& title, int imgId, SvnTreeData::SvnNodeType nodeType, const wxArrayString& files)
{
	wxTreeItemId root = m_treeCtrl->GetRootItem();
	wxString basePath = m_textCtrlRootDir->GetValue();

	// Add the basic four root items
	if (files.IsEmpty() == false) {

		wxTreeItemId parent = m_treeCtrl->AppendItem(root, title, imgId, imgId, new SvnTreeData(nodeType, wxT("")));

		// Set the parent node with bold font
		wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
		font.SetWeight(wxBOLD);
		m_treeCtrl->SetItemFont(parent, font);

		// Add all children items
		for (size_t i=0; i<files.GetCount(); i++) {
			wxString filename(files.Item(i));
			m_treeCtrl->AppendItem(parent, files.Item(i), DoGetIconIndex(filename), DoGetIconIndex(filename), new SvnTreeData(SvnTreeData::SvnNodeTypeFile, files.Item(i)));
		}

		if ( nodeType != SvnTreeData::SvnNodeTypeUnversionedRoot) {
			m_treeCtrl->Expand(parent);
		}
	}
}
开发者ID:RVictor,项目名称:EmbeddedLite,代码行数:26,代码来源:subversion_view.cpp

示例4: _Add_IN_ClauseForColumn

void _Add_IN_ClauseForColumn(wxString & query,const PlaylistColumn & Column,const wxArrayString & aList)
{
    bool bQuote = (Column.Type == PlaylistColumn::Textual);

    query << wxString::Format(Column.ColQueryMask,Column.DBName.c_str())
        << wxT(" in (");
    for ( int i = 0; i < (int)aList.GetCount(); i++ )
    {
        if ( i > 0 )
            query << wxT(',');
        if(bQuote)
        {
            query << wxT('\'');
            wxString s (aList.Item( i ));
            s.Replace( wxT("'"), wxT("''") );
            query << s;
        }
        else
            query << aList.Item( i );
        if(bQuote)
            query << wxT('\'');

    }
    query << wxT(')');
}
开发者ID:BackupTheBerlios,项目名称:musik-svn,代码行数:25,代码来源:MusikLibrary.cpp

示例5: HasOption

bool ProjectOptionsManipulator::HasOption(const wxArrayString& opt_array, const wxString& opt, wxString& full_opt)
{
  switch ( m_Dlg->GetSearchOption() )
  {
    case (ProjectOptionsManipulatorDlg::eContains):
    {
      for (size_t i=0; i<opt_array.Count(); ++i)
      {
        if ( opt_array.Item(i).Contains(opt) )
        {
          full_opt = opt_array.Item(i);
          return true;
        }
      }
    }
    break;

    case (ProjectOptionsManipulatorDlg::eEquals): // fall through
    default:
    {
      int idx = opt_array.Index(opt);
      if (idx!=wxNOT_FOUND)
      {
        full_opt = opt_array.Item(idx);
        return true;
      }
    }
    break;
  }

  return false;
}
开发者ID:DowerChest,项目名称:codeblocks,代码行数:32,代码来源:ProjectOptionsManipulator.cpp

示例6: SetRecentFiles

void DbExplorerSettings::SetRecentFiles(const wxArrayString& recentFiles)
{
    m_recentFiles.Clear();
    for(size_t i=0; i<recentFiles.Count(); i++) {
        if(m_recentFiles.Index(recentFiles.Item(i)) == wxNOT_FOUND) {
            m_recentFiles.Add(recentFiles.Item(i));
        }
    }
}
开发者ID:292388900,项目名称:codelite,代码行数:9,代码来源:db_explorer_settings.cpp

示例7: DoAddFilesToTreeView

void PHPWorkspaceView::DoAddFilesToTreeView(const wxTreeItemId& folderId, PHPProject::Ptr_t pProject, PHPFolder::Ptr_t pFolder, const wxArrayString& files)
{
    for(size_t i=0; i<files.GetCount(); ++i) {
        ItemData *itemData = new ItemData(ItemData::Kind_File);
        itemData->SetFile( files.Item(i) );
        itemData->SetProjectName( pProject->GetName() );
        itemData->SetFolderPath( pFolder->GetPathRelativeToProject() );
        
        int imgId = DoGetItemImgIdx(files.Item(i));
        m_treeCtrlView->AppendItem(folderId, wxFileName(files.Item(i)).GetFullName(), imgId, imgId, itemData);
    }
    m_treeCtrlView->SortChildren( folderId );
}
开发者ID:gahr,项目名称:codelite,代码行数:13,代码来源:php_workspace_view.cpp

示例8: SetSearchPaths

void ParseThread::SetSearchPaths(const wxArrayString& paths, const wxArrayString &exlucdePaths)
{
	wxCriticalSectionLocker locker( m_cs );
	m_searchPaths.Clear();
	m_excludePaths.Clear();
	for (size_t i=0; i<paths.GetCount(); i++) {
		m_searchPaths.Add( paths.Item(i).c_str() );
	}

	for (size_t i=0; i<exlucdePaths.GetCount(); i++) {
		m_excludePaths.Add( exlucdePaths.Item(i).c_str() );
	}
}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:13,代码来源:parse_thread.cpp

示例9: SetMRUList

/// Set the list of most recently used computers.
///
/// \param[in] mru_list An array containing the names of all computers
///                     that were used recently.
void CDlgSelectComputer::SetMRUList(const wxArrayString& mru_list)
{
    m_ComputerNameCtrl->Clear();
    for (size_t i = 0; i < mru_list.Count(); ++i) {
        m_ComputerNameCtrl->Append(mru_list.Item(i));
    }
}
开发者ID:phenix3443,项目名称:synecdoche,代码行数:11,代码来源:DlgSelectComputer.cpp

示例10: SetDependencies

void Project::SetDependencies(wxArrayString& deps, const wxString& configuration)
{
    // first try to locate the old node
    wxXmlNode *node = m_doc.GetRoot()->GetChildren();
    while (node) {
        if ( node->GetName() == wxT("Dependencies") && node->GetPropVal(wxT("Name"), wxEmptyString) == configuration) {
            // we have our match
            node->GetParent()->RemoveChild(node);
            delete node;
            break;
        }
        node = node->GetNext();
    }

    // create new dependencies node
    node = new wxXmlNode(NULL, wxXML_ELEMENT_NODE, wxT("Dependencies"));
    node->AddProperty(wxT("Name"), configuration);
    m_doc.GetRoot()->AddChild(node);

    //create a node for each dependency in the array
    for (size_t i=0; i<deps.GetCount(); i++) {
        wxXmlNode *child = new wxXmlNode(NULL, wxXML_ELEMENT_NODE, wxT("Project"));
        child->AddProperty(wxT("Name"), deps.Item(i));
        node->AddChild(child);
    }

    //save changes
    SaveXmlFile();
    SetModified(true);
}
开发者ID:Hmaal,项目名称:codelite,代码行数:30,代码来源:project.cpp

示例11: ShowHint

int frmHint::ShowHint(wxWindow *fr, const wxArrayString &hints, const wxString &info, bool force)
{
	wxArrayInt hintnos;
	size_t i;

	if(!hints.GetCount())
		return wxID_OK;
	for (i = 0 ; i < hints.GetCount() ; i++)
	{
		int hintNo = GetHintNo(hints.Item(i));
		if (hintNo >= 0 && (force || WantHint(hintNo)))
			hintnos.Add(hintNo);
	}

	if (!hintnos.GetCount())
		return wxID_OK;

	frmHint *frm = new frmHint(fr, force);
	frm->SetHint(hintnos, info);

	frm->CenterOnParent();
	int rc = frm->ShowModal();
	delete frm;

	if ((rc == wxID_CANCEL || rc == -1))
		rc = wxID_OK;

	return rc;
}
开发者ID:KrisShannon,项目名称:pgadmin3,代码行数:29,代码来源:frmHint.cpp

示例12: Populate

//void wxVListBoxComboPopup::Populate( int n, const wxString choices[] )
void wxVListBoxComboPopup::Populate( const wxArrayString& choices )
{
    int i;

    int n = choices.GetCount();

    for ( i=0; i<n; i++ )
    {
        const wxString& item = choices.Item(i);
        m_strings.Add(item);
    }

    m_widths.SetCount(n,-1);
    m_widthsDirty = true;

    if ( IsCreated() )
        wxVListBox::SetItemCount(n);

    // Sort the initial choices
    if ( m_combo->GetWindowStyle() & wxCB_SORT )
        m_strings.Sort();

    // Find initial selection
    wxString strValue = m_combo->GetValue();
    if ( !strValue.empty() )
        m_value = m_strings.Index(strValue);
}
开发者ID:beanhome,项目名称:dev,代码行数:28,代码来源:odcombo.cpp

示例13: IsMatchFilter

bool GitCommitListDlg::IsMatchFilter(const wxArrayString& filters, const wxArrayString& columns)
{
    if(filters.IsEmpty()) return true;

    bool match = true;
    for(size_t i = 0; i < filters.GetCount() && match; ++i) {
        wxString filter = filters.Item(i).Lower();
        wxString col1, col2, col3, col4;
        col1 = columns.Item(0).Lower();
        col2 = columns.Item(1).Lower();
        col3 = columns.Item(2).Lower();
        col4 = columns.Item(3).Lower();
        match = (col1.Contains(filter) || col2.Contains(filter) || col3.Contains(filter) || col4.Contains(filter));
    }
    return match;
}
开发者ID:05storm26,项目名称:codelite,代码行数:16,代码来源:gitCommitListDlg.cpp

示例14: Find

/**
 * Find()
 *
 * Finds the next file descibed by a pattern in the archive, starting
 * the file given by second parameter
 *
 * @param pattern   The file-pattern to search for. May contain '*' and/or '?'
 * @param startfrom The filename which the search should start after
 * @returns         The full pathname of the found file
 */
const wxString wxChmTools::Find(const wxString& pattern,
                                const wxString& startfrom)
{
    int count;
    wxString tmp;
    wxString pattern_tmp(pattern);
    wxString startfrom_tmp(startfrom);
    pattern_tmp.MakeLower();
    startfrom_tmp.MakeLower();

    if ( m_fileNames && (count = m_fileNames->GetCount()) > 0 )
    {
        for (int i = 0; i < count; i++)
        {
            tmp = m_fileNames->Item(i).MakeLower();
            // if we find the string where the search should began
            if ( tmp.Matches(startfrom_tmp) ||
                 tmp.Mid(1).Matches(startfrom_tmp) )
                continue;
            if ( tmp.Matches(pattern_tmp) ||
                 tmp.Mid(1).Matches(pattern_tmp) )
            {
                return tmp;
            }
        }
    }

    return wxEmptyString;
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:39,代码来源:chm.cpp

示例15: SetRecentItems

void EditorConfig::SetRecentItems(const wxArrayString& files, const wxString& nodeName)
{
    if(nodeName.IsEmpty()) { return; }

    // find the root node
    wxXmlNode* node = XmlUtils::FindFirstByTagName(m_doc->GetRoot(), nodeName);
    if(node) {
        wxXmlNode* root = m_doc->GetRoot();
        root->RemoveChild(node);
        delete node;
    }
    // create new entry in the configuration file
    node = new wxXmlNode(NULL, wxXML_ELEMENT_NODE, nodeName);
    m_doc->GetRoot()->AddChild(node);
    for(size_t i = 0; i < files.GetCount(); i++) {
        wxXmlNode* child = new wxXmlNode(NULL, wxXML_ELEMENT_NODE, wxT("File"));
        child->AddProperty(wxT("Name"), files.Item(i));
        node->AddChild(child);
    }

    // Update the cache
    if(m_cacheRecentItems.count(nodeName)) { m_cacheRecentItems.erase(nodeName); }
    m_cacheRecentItems.insert(std::make_pair(nodeName, files));

    // save the data to disk
    DoSave();
    wxCommandEvent evt(wxEVT_EDITOR_CONFIG_CHANGED);
    evt.SetString(nodeName);
    EventNotifier::Get()->AddPendingEvent(evt);
}
开发者ID:eranif,项目名称:codelite,代码行数:30,代码来源:editor_config.cpp


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