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


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

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


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

示例1: OnDropFiles

bool DnDialogFile::OnDropFiles(wxCoord, wxCoord, const wxArrayString& filenames)
{
    //只有一个文件时弹出添加命令窗口
    if (filenames.Count() == 1)
    {
        wxString cmd = filenames[0];
        cmd.Replace('\\','/');
        DlgAddNewCmd* dlg=new DlgAddNewCmd(NULL);
        dlg->cmdLine->SetValue(cmd);
        dlg->cmdName->SetValue(wxFileNameFromPath(cmd));
        cmd.Clear();
        if (dlg->ShowModal() == wxID_OK)
            m_pOwner->ReLoadCmds();
        dlg->Destroy();
        return true;
    }
    //多个文件时自动批量添加;
    for(int i = filenames.Count() - 1 ; i>=0; --i)
    {
        wxString cmd = filenames[i];
        cmd.Replace("\\","/");
        g_config->AddCmd(cmd,wxFileNameFromPath(cmd));
    }
    m_pOwner->ReLoadCmds();
    return true;
    //多个文件时自动批量添加;
}
开发者ID:sunclx,项目名称:ALMRun,代码行数:27,代码来源:cmdListCtrl.cpp

示例2: ShowFontsDialog

void szFontProvider::ShowFontsDialog(wxWindow *parent, wxArrayString fonts)
{
	wxDialog dlg(parent, wxID_ANY, wxString(_("Font configuration")));
	m_dlg = &dlg;
	wxStaticText* warnText = new wxStaticText(&dlg, -1,
			_("You have to restart program to apply\nnew fonts settings."));
	szSetDefFont(warnText);
	wxButton* clBut = new wxButton(&dlg, wxID_CANCEL, _("Close"));
	szSetDefFont(clBut);

	wxBoxSizer* sizer0 = new wxBoxSizer(wxVERTICAL);

	int width = 0;
	int height = 0;
	wxClientDC dc(&dlg);
	for (size_t i = 0; i < fonts.Count() / 2; i++) {
		int w, h;
		dc.SetFont(GetFont(fonts[i*2]));
		dc.GetTextExtent(fonts[i*2+1], &w, &h);
		width = wxMax(width, w);
		height = wxMax(height, h);
	}
	int w, h, w2, h2;
	dc.SetFont(GetFont(wxEmptyString));
	dc.GetTextExtent(_("Configure"), &w, &h);
	dc.GetTextExtent(_("Reset to default"), &w2, &h2);
	for (size_t i = 0; i < fonts.Count() / 2; i++) {
		wxString name = fonts[i*2];
		wxString descr = fonts[i*2+1];
		wxBoxSizer* sizer1 = new wxBoxSizer(wxHORIZONTAL);
		wxStaticText* txt = new wxStaticText(&dlg, -1, descr, wxDefaultPosition,
				wxSize(width, height), 
				wxSUNKEN_BORDER | wxALIGN_CENTRE |
				wxST_NO_AUTORESIZE);
		txt->SetFont(GetFont(fonts[i*2]));
		//szSetFont(txt, name);
		sizer1->Add(txt, 0, wxALL, 10);
		wxButton* but = new szFontDialogBtn(this, name, &dlg, -1, _("Configure"),
				wxDefaultPosition, wxSize(w + 8, h + 8));
		but->Connect(but->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) 
				(wxEventFunction) (wxCommandEventFunction)&szFontDialogBtn::OnConfigureFont);
		szSetDefFont(but);
		sizer1->Add(but, 1, wxALL, 10);
		wxButton* but2 = new szFontDialogBtn(this, name, &dlg, -1, _("Reset to default"),
				wxDefaultPosition, wxSize(w2 + 8, h + 8));
		but2->Connect(but2->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) 
				(wxEventFunction) (wxCommandEventFunction)&szFontDialogBtn::OnResetFont);
		szSetDefFont(but2);
		sizer1->Add(but2, 0, wxALL, 10);
		sizer0->Add(sizer1, 0);
	}

	sizer0->Add(warnText, 0, wxALL | wxEXPAND, 10);
	sizer0->Add(clBut, 0, wxALL | wxCENTER, 10);
	dlg.SetSizer(sizer0);
	sizer0->SetSizeHints(&dlg);
	dlg.ShowModal();
}
开发者ID:cyclefusion,项目名称:szarp,代码行数:58,代码来源:fonts.cpp

示例3: MakePackagePython

void XmlResApp::MakePackagePython(const wxArrayString& flist)
{
    wxFFile file(parOutput, wxT("wt"));
    size_t i;

    if (flagVerbose)
        wxPrintf(_T("creating Python source file ") + parOutput +  _T("...\n"));

    file.Write(
       _T("#\n")
       _T("# This file was automatically generated by wxrc, do not edit by hand.\n")
       _T("#\n\n")
       _T("import wx\n")
       _T("import wx.xrc\n\n")
    );


    file.Write(_T("def ") + parFuncname + _T("():\n"));

    for (i = 0; i < flist.Count(); i++)
        file.Write(
          FileToPythonArray(parOutputPath + wxFILE_SEP_PATH + flist[i], i));

    file.Write(
        _T("    # check if the memory filesystem handler has been loaded yet, and load it if not\n")
        _T("    wx.MemoryFSHandler.AddFile('XRC_resource/dummy_file', 'dummy value')\n")
        _T("    fsys = wx.FileSystem()\n")
        _T("    f = fsys.OpenFile('memory:XRC_resource/dummy_file')\n")
        _T("    wx.MemoryFSHandler.RemoveFile('XRC_resource/dummy_file')\n")
        _T("    if f is not None:\n")
        _T("        f.Destroy()\n")
        _T("    else:\n")
        _T("        wx.FileSystem.AddHandler(wx.MemoryFSHandler())\n")
        _T("\n")
        _T("    # load all the strings as memory files and load into XmlRes\n")
        );


    for (i = 0; i < flist.Count(); i++)
    {
        wxString s;
        s.Printf(_T("    wx.MemoryFSHandler.AddFile('XRC_resource/") + flist[i] +
                 _T("', xml_res_file_%i)\n"), i);
        file.Write(s);
    }
    for (i = 0; i < parFiles.Count(); i++)
    {
        file.Write(_T("    wx.xrc.XmlResource.Get().Load('memory:XRC_resource/") +
                   GetInternalFileName(parFiles[i], flist) + _T("')\n"));
    }

    file.Write(_T("\n"));
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:53,代码来源:wxrc.cpp

示例4: WriteArrayString

bool wxArchive::WriteArrayString(const wxArrayString& value)
{
    if(CanStore())
    {
		// write header + string
		SaveChar(wxARCHIVE_HDR_ARRSTRING);
		SaveUint32(value.Count());
		for(size_t i = 0; i < value.Count(); i++)
			SaveString(value[i]);
    }

    return IsOk();
}
开发者ID:BackupTheBerlios,项目名称:bijutsukan-svn,代码行数:13,代码来源:wxArchive.cpp

示例5: accel

FileViewer::FileViewer(wxWindow *parent,
                       const wxString& basePath,
                       const wxArrayString& references,
                       int startAt)
        : wxFrame(parent, -1, _("Source file")),
          m_references(references)
{
    m_basePath = basePath;

    SetName("fileviewer");

    wxPanel *panel = new wxPanel(this, -1);
    wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
    panel->SetSizer(sizer);

    wxSizer *barsizer = new wxBoxSizer(wxHORIZONTAL);
    sizer->Add(barsizer, wxSizerFlags().Expand().Border());

    barsizer->Add(new wxStaticText(panel, wxID_ANY,
                                   _("Source file occurrence:")),
                  wxSizerFlags().Center().Border(wxRIGHT));

    wxChoice *choice = new wxChoice(panel, wxID_ANY);
    barsizer->Add(choice, wxSizerFlags(1).Center());

    for (size_t i = 0; i < references.Count(); i++)
        choice->Append(references[i]);
    choice->SetSelection(startAt);

    wxButton *edit = new wxButton(panel, wxID_ANY, _("Open In Editor"));
    barsizer->Add(edit, wxSizerFlags().Center().Border(wxLEFT, 10));

    m_text = new wxStyledTextCtrl(panel, wxID_ANY,
                                  wxDefaultPosition, wxDefaultSize,
                                  wxBORDER_THEME);
    SetupTextCtrl();
    sizer->Add(m_text, 1, wxEXPAND);

    RestoreWindowState(this, wxSize(600, 400));

    wxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
    topsizer->Add(panel, wxSizerFlags(1).Expand());
    SetSizer(topsizer);
    Layout();

    choice->Bind(wxEVT_CHOICE, &FileViewer::OnChoice, this);
    edit->Bind(wxEVT_BUTTON, &FileViewer::OnEditFile, this);

    ShowReference(m_references[startAt]);

#ifdef __WXOSX__
    wxAcceleratorEntry entries[] = {
        { wxACCEL_CMD,  'W', wxID_CLOSE }
    };
    wxAcceleratorTable accel(WXSIZEOF(entries), entries);
    SetAcceleratorTable(accel);

    Bind(wxEVT_MENU, [=](wxCommandEvent&){ Destroy(); }, wxID_CLOSE);
#endif
}
开发者ID:mfloryan,项目名称:poedit,代码行数:60,代码来源:fileviewer.cpp

示例6: OnDropFiles

bool BFBackupTree::OnDropFiles (wxCoord x, wxCoord y, const wxArrayString& filenames)
{
    if (filenames.Count() == 0)
        return false;

    wxMenu*					pMenu = NULL;
    wxString                str;

    if ( wxFile::Exists(filenames[0]) )
        // ** copy file **
        BFBackupTree::GenerateBackupMenu(pMenu, false);
    else
        // ** directory (existing and unexisting/created while backup) **
        BFBackupTree::GenerateBackupMenu(pMenu, true);

    // remember the filename for use in other methodes
    SetDropedFilename(filenames[0]);

    // remember the destination directory (by draging over it) if ther is one
    BFBackupTreeItemData*   pItemData   = NULL;
    wxTreeItemId            itemId      = HitTest(wxPoint(x, y));

    if ( itemId.IsOk() )
        pItemData = (BFBackupTreeItemData*)GetItemData(itemId);

    if ( pItemData )
      // && pItemData->GetOID() == BFInvalidOID)
        strCurrentDestination_ = pItemData->GetPath();

    // show the menu
    PopupMenu(pMenu, wxPoint(x, y));

    return true;
}
开发者ID:BackupTheBerlios,项目名称:blackfisk-svn,代码行数:34,代码来源:BFBackupTree.cpp

示例7: arrayStringToVector

std::vector<std::string> arrayStringToVector(const wxArrayString& arr) {
    std::vector<std::string> vec;
    vec.reserve(arr.Count());
    for(auto s : arr)
        vec.push_back(STD_STRING(s));
    return vec;
}
开发者ID:Mailaender,项目名称:springlobby,代码行数:7,代码来源:conversion.cpp

示例8: TagsReplace

wxString CLogger::TagsReplace(const wxString& string, const wxArrayString& tags, const wxArrayString& replacements)
{
	wxString ret;
	for(size_t i = 0; i < string.length(); )
	{
		bool bFound = false;

		if(string[i] == '{')
		{
			for(size_t j = 0; j < tags.Count(); j++)
			{
				const wxString& tag = tags[j];
				if(string.substr(i, tag.length()) == tag)
				{
					ret += replacements[j];
					i += tag.length();

					bFound = true;
					break;
				}
			}
		}

		if(!bFound)
		{
			ret += string[i++];
		}
	}

	return ret;
}
开发者ID:Moggers,项目名称:open-steamworks,代码行数:31,代码来源:Logger.cpp

示例9: AddTypeToPredefined

void AddTypeToPredefined( 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 = WxListBoxAssociated->FindString( type );

		if( n != wxNOT_FOUND ) { WxListBoxAssociated->Delete( n ); }

		n = WxListBoxPredefined->FindString( type );

		if( n == wxNOT_FOUND ) { WxListBoxPredefined->Append( type ); }

		n = as_remove.Index( type );

		if( n == wxNOT_FOUND ) { as_remove.Add( type ); }

		++idx;
	}
}
开发者ID:nikoss,项目名称:madedit-mod,代码行数:26,代码来源:MadFileAssociationDialog.cpp

示例10: MakePackageZIP

void XmlResApp::MakePackageZIP(const wxArrayString& flist)
{
    wxString files;

    for (size_t i = 0; i < flist.Count(); i++)
        files += flist[i] + _T(" ");
    files.RemoveLast();

    if (flagVerbose)
        wxPrintf(_T("compressing ") + parOutput +  _T("...\n"));

    wxString cwd = wxGetCwd();
    wxSetWorkingDirectory(parOutputPath);
    int execres = wxExecute(_T("zip -9 -j ") +
                            wxString(flagVerbose ? _T("\"") : _T("-q \"")) +
                            parOutput + _T("\" ") + files, true);
    wxSetWorkingDirectory(cwd);
    if (execres == -1)
    {
        wxLogError(_T("Unable to execute zip program. Make sure it is in the path."));
        wxLogError(_T("You can download it at http://www.cdrom.com/pub/infozip/"));
        retCode = 1;
        return;
    }
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:25,代码来源:wxrc.cpp

示例11: 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

示例12: ProcessLibs

bool ProcessingDlg::ProcessLibs( const wxArrayString& Shortcuts )
{
    int TotalCount = 0;
    for ( int i=0; i<m_Manager.GetLibraryCount(); ++i )
    {
        if ( const LibraryDetectionConfigSet* Set = m_Manager.GetLibrary( Shortcuts[i] ) )
        {
            TotalCount += (int)Set->Configurations.size();
        }
    }
    Gauge1->SetRange( TotalCount );

    int progress = 1;
    for ( size_t i=0; i<Shortcuts.Count(); ++i )
    {
        if ( StopFlag ) return false;
        Gauge1->SetValue( progress++ );
        if ( const LibraryDetectionConfigSet* Set = m_Manager.GetLibrary( Shortcuts[i] ) )
        {
            for ( size_t j=0; j<Set->Configurations.size(); ++j )
            {
                if ( StopFlag ) return false;
                Gauge1->SetValue( progress++ );

                ProcessLibrary( &Set->Configurations[j], Set );
            }
        }
    }

    return !StopFlag;
}
开发者ID:stahta01,项目名称:EmBlocks,代码行数:31,代码来源:processingdlg.cpp

示例13: 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

示例14: OnDropFiles

	virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames)
	{
		if (filenames.Count() > 0)
		{
			win->LoadFile(filenames[0]);
		}
		return true;
	}
开发者ID:colindr,项目名称:calchart,代码行数:8,代码来源:basic_ui.cpp

示例15: OnDropFiles

  virtual bool OnDropFiles(wxCoord /* x */, wxCoord /* y */, const wxArrayString &dropped_files) {
    size_t i;

    for (i = 0; i < dropped_files.Count(); i++)
      owner->add_attachment(dropped_files[i]);

    return true;
  }
开发者ID:Trottel,项目名称:mkvtoolnix,代码行数:8,代码来源:attachments.cpp


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