Beispiel #1
0
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;
    //多个文件时自动批量添加;
}
Beispiel #2
0
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();
}
Beispiel #3
0
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"));
}
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();
}
Beispiel #5
0
//------------------------------------------------------------------------------
wxString UserInputValidator::ToWxString(const wxArrayString &names)
{
   wxString str = "";
   wxString delimiter = ", ";
   if (names.Count() > 0)
   {
      str = names[0];
      
      for (unsigned int i=1; i<names.Count(); i++)
         str = str + delimiter + names[i];
   }
   
   return str;
}
Beispiel #6
0
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
}
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;
}
Beispiel #8
0
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;
}
Beispiel #9
0
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;
}
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;
	}
}
Beispiel #11
0
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;
    }
}
/// 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));
    }
}
Beispiel #13
0
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;
}
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;
}
Beispiel #15
0
	virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames)
	{
		if (filenames.Count() > 0)
		{
			win->LoadFile(filenames[0]);
		}
		return true;
	}
Beispiel #16
0
  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;
  }
Beispiel #17
0
bool myStyleSheet::GetCSS(wxArrayString& cssSheet) {
    cssSheet.Clear();

    for (size_t i = 0 ; i < m_styleArray.Count() ; i++) {
        m_styleArray[i].GetCSS(cssSheet);
    }

    return (cssSheet.Count() > 0)?true:false;
}
Beispiel #18
0
// -------------------------------------------------------------------------------- //
int GetFirstCoverPath( const wxArrayString &words, const wxArrayString &paths )
{
    int WordsIndex;
    int WordsCount = words.Count();
    for( WordsIndex = 0; WordsIndex < WordsCount; WordsIndex++ )
    {
        int PathsIndex;
        int PathsCount = paths.Count();
        for( PathsIndex = 0; PathsIndex < PathsCount; PathsIndex++ )
        {
            if( paths[ PathsIndex ].Lower().Find( words[ WordsIndex ].Lower() ) != wxNOT_FOUND )
            {
                return PathsIndex;
            }
        }
    }
    return wxNOT_FOUND;
}
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));
        }
    }
}
Beispiel #20
0
/*
 // Big p
 C16C BAD3 4D47 5EC5 3966 95D6 94BC 8BC4 7E59 8E23 B5A9 D7C5 CEC8 2D65 B682 7D44 E953 7848 4730 C0BF F1F4 CB56 F47C 6E51 054B E892 00F3 0D43 DC4F EF96 24D4 665B.*
 // Big q
 B7B8 10B5 8C09 34F6 4287 8F36 0B96 D7CC 26B5 3E4D.
 // Big g
 4C53 C726 BDBF BBA6 549D 7E73 1939 C6C9 3A86 9A27 C5DB 17BA 3CAC 589D 7B3E 003F A735 F290 CFD0 7A3E F10F 3515 5F1A 2EF7 0335 AF7B 6A52 11A1 1035 18FB A44E 9718.
 // Big y
 063A C955 F639 B2F9 202E 070C 4A10 E82F 877A BC7F D928 D5F4 55C2 A3BF E928 92C5 9EB5 5DB0 ED6A 9555 ED8F 1C6E F218 DB62 FFFD F74E 5755 A989 44C7 6B50 9C41 B022.

 */
void pub_key::ReadKey(const wxArrayString &key_array)
{
    for(unsigned int i=0 ; i < key_array.Count() ; i++){
        wxString line = key_array[i];
        if( line.Upper().Find(_T("BIG P")) != wxNOT_FOUND ){
            if( (i+1) < key_array.Count() ){
                wxString key_line = key_array[i+1];
                key_line.Replace(_T(" "), _T("") );
                wxCharBuffer lbuf = key_line.ToUTF8();
                mp_read_radix(&m_p, lbuf.data(), 16);
            }
        }
        
        else if( line.Upper().Find(_T("BIG Q")) != wxNOT_FOUND ){
            if( (i+1) < key_array.Count() ){
                wxString key_line = key_array[i+1];
                key_line.Replace(_T(" "), _T("") );
                wxCharBuffer lbuf = key_line.ToUTF8();
                mp_read_radix(&m_q, lbuf.data(), 16);
            }
        }
        
        else if( line.Upper().Find(_T("BIG G")) != wxNOT_FOUND ){
            if( (i+1) < key_array.Count() ){
                wxString key_line = key_array[i+1];
                key_line.Replace(_T(" "), _T("") );
                wxCharBuffer lbuf = key_line.ToUTF8();
                mp_read_radix(&m_g, lbuf.data(), 16);
            }
        }
        
        else if( line.Upper().Find(_T("BIG Y")) != wxNOT_FOUND ){
            if( (i+1) < key_array.Count() ){
                wxString key_line = key_array[i+1];
                key_line.Replace(_T(" "), _T("") );
                wxCharBuffer lbuf = key_line.ToUTF8();
                mp_read_radix(&m_y, lbuf.data(), 16);
            }
        }
    }
    
    if( !mp_iszero(&m_p) && !mp_iszero(&m_q) && !mp_iszero(&m_g) && !mp_iszero(&m_y) )
        m_OK = true;
}
Beispiel #21
0
void LauncherUIDialog::CreateButtons( const wxArrayString& labels, const wxArrayString& commands )
{
    for ( size_t i = 0; i < labels.Count(); i++ )
    {
        AddButton( labels[i], commands[i] );
    }
    this->m_scrolledWindow->Layout();
    this->button_sizer->Fit( m_scrolledWindow );
    this->Layout();
}
Beispiel #22
0
void szAppImpl::InitializeLocale(wxArrayString &catalogs, wxLocale &locale) {

	wxString lang = wxConfig::Get()->Read(_T("LANGUAGE"), AUTO_LANGUAGE);
	if (lang == AUTO_LANGUAGE)
		lang = DEFAULT_LANGUAGE;

	const wxLanguageInfo *info = wxLocale::FindLanguageInfo(lang);

	int l;

	if (info)
	{
		l = info->Language;
	} else
		l = wxLANGUAGE_ENGLISH;

	locale.Init(l);

	if (!locale.IsOk()) {
		if(locale.IsAvailable(locale.GetSystemLanguage())) {
			l = locale.GetSystemLanguage();
			locale.Init(l);
			if(!locale.IsOk()) {
				wxMessageBox(_("Default locale cannot be loaded. Exiting"), _("Information."), wxICON_ERROR);
				exit(1);
			}
			wxString Ls = L"Locale " + lang + L" not available.\nDefault system locale loaded.";
			wxMessageBox(_(s), _("Information."), wxICON_INFORMATION);
		}
		else {
			wxLogWarning(_("No locale for this system`s language."));
		}
	}

	locale.AddCatalogLookupPathPrefix(GetSzarpDir() + _T("resources/locales"));

	for(size_t i = 0; i < catalogs.Count(); i++)
		locale.AddCatalog(catalogs[i]);

#ifdef __WXGTK__
	if (!locale.IsOk()) {
		wxLogInfo(_("Setting locale to \"C\""));
		setenv("LC_ALL", "C", 1);
	} else if( locale.GetSystemEncodingName() == _("") ) { // this probably doesn't happen on unix machines 
		wxLogInfo(_("wx: Setting locale to \"") + locale.GetCanonicalName() + _("\""));
		setenv("LC_ALL", SC::S2A(locale.GetCanonicalName()).c_str(), 1);
	} else {
		wxString localename = locale.GetCanonicalName() + _(".") + locale.GetSystemEncodingName();
		wxLogInfo(_("wx: Setting locale to \"") + localename + _("\""));
		setenv("LC_ALL", SC::S2A(localename).c_str(), 1);
	}
#endif

}
Beispiel #23
0
bool wxCurlFTP::SetPostQuoteList(const wxArrayString& arrQuote)
{
	ResetPostQuoteList();

	for(unsigned int i = 0; i < arrQuote.Count(); i++)
	{
		m_pPostQuote = curl_slist_append(m_pPostQuote, (const char*)(arrQuote[i].c_str()));
	}

	return (m_pPostQuote != NULL);
}
Beispiel #24
0
// -------------------------------------------------------------------------------- //
bool CheckFileLibPath( const wxArrayString &LibPaths, const wxString &filename )
{
    int index;
    int count = LibPaths.Count();
    for( index = 0; index < count; index++ )
    {
        if( filename.StartsWith( LibPaths[ index ] ) )
            return true;
    }
    return false;
}
Beispiel #25
0
// -------------------------------------------------------------------------------- //
bool SearchCoverWords( const wxString &FileName, const wxArrayString &Strings )
{
    int index;
    int count = Strings.Count();
    for( index = 0; index < count; index++ )
    {
        if( FileName.Find( Strings[ index ] ) != wxNOT_FOUND )
            return true;
    }
    return false;
}
Beispiel #26
0
int GetMaxStringWidth( const wxWindow& win, const wxArrayString& strings )
{
    int max = -1;
    for (size_t i = 0; i < strings.Count(); ++i ) {
        wxSize size;
        win.GetTextExtent( strings[i], &size.x, &size.y );
        max = std::max( max, size.x );
    }

    return max;
}
Beispiel #27
0
void BattleRoomTab::ReloadMaplist()
{
	if (!m_battle)
		return;
	m_map_combo->Clear();

	const wxArrayString maplist = lslTowxArrayString(LSL::usync().GetMapList());
	size_t nummaps = maplist.Count();
	for (size_t i = 0; i < nummaps; i++)
		m_map_combo->Insert(maplist[i], i);
	m_map_combo->SetValue(TowxString(m_battle->GetHostMapName()));
}
Beispiel #28
0
// -------------------------------------------------------------------------------- //
bool SearchFilterTexts( wxArrayString &texts, const wxString &name )
{
    int Index;
    int Count = texts.Count();
    for( Index = 0; Index < Count; Index++ )
    {
        //guLogMessage( wxT( "%s = > '%s'" ), name.c_str(), texts[ Index ].Lower().c_str() );
        if( name.Find( texts[ Index ].Lower() ) == wxNOT_FOUND )
            return false;
    }
    return true;
}
Beispiel #29
0
void BattleRoomTab::ReloadMaplist()
{
	if ( !m_battle ) return;
	m_map_combo->Clear();

    const wxArrayString maplist = LSL::Util::vectorToArrayString(LSL::usync().GetMapList());
// maplist.Sort(CompareStringIgnoreCase);

	size_t nummaps = maplist.Count();
	for ( size_t i = 0; i < nummaps; i++ ) m_map_combo->Insert( maplist[i], i );
	m_map_combo->SetValue( m_battle->GetHostMapName() );
}
Beispiel #30
0
	void OnMapSettingsChange(const AtObj& settings)
	{
		// Reload displayed player names
		Clear();
		size_t numPlayers = settings["PlayerData"]["item"].count();
		for (size_t i = 0; i <= numPlayers && i < m_Players.Count(); ++i)
		{
			Append(m_Players[i]);
		}

		SetSelection(m_ObjectSettings.GetPlayerID());
	}