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


C++ wxSplit函数代码示例

本文整理汇总了C++中wxSplit函数的典型用法代码示例。如果您正苦于以下问题:C++ wxSplit函数的具体用法?C++ wxSplit怎么用?C++ wxSplit使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: ResizeCustomGrid

// Initialize custom grid with saved values
// Must be called AFTER Choice_DisplayAs & SpinCtrl_parm1 & SpinCtrl_parm2 have been set
void ModelDialog::SetCustomGridData(const wxString& customChannelData)
{
    wxString value;
    wxArrayString cols;

    if (!IsCustom()) return;

    HasCustomData = true;
    if (customChannelData.IsEmpty())
    {
        ResizeCustomGrid();
        return;
    }

    wxArrayString rows=wxSplit(customChannelData,';');
    for(size_t row=0; row < rows.size(); row++)
    {
        if (row >= GridCustom->GetNumberRows()) GridCustom->AppendRows();
        cols=wxSplit(rows[row],',');
        for(size_t col=0; col < cols.size(); col++)
        {
            if (col >= GridCustom->GetNumberCols()) GridCustom->AppendCols();
            value=cols[col];
            if (!value.IsEmpty() && value != "0")
            {
                GridCustom->SetCellValue(row,col,value);
            }
        }
    }
    SpinCtrl_parm1->SetValue(GridCustom->GetNumberCols());
    SpinCtrl_parm2->SetValue(GridCustom->GetNumberRows());
}
开发者ID:waejones,项目名称:xLights,代码行数:34,代码来源:ModelDialog.cpp

示例2: wxSplit

// return true if version string is older than compare string
bool RenderableEffect::IsVersionOlder(const std::string& compare, const std::string& version)
{
    wxArrayString compare_parts = wxSplit(compare, '.');
    wxArrayString version_parts = wxSplit(version, '.');
    if( wxAtoi(version_parts[0]) < wxAtoi(compare_parts[0]) ) return true;
    if( wxAtoi(version_parts[0]) > wxAtoi(compare_parts[0]) ) return false;
    if( wxAtoi(version_parts[1]) < wxAtoi(compare_parts[1]) ) return true;
    if( wxAtoi(version_parts[1]) > wxAtoi(compare_parts[1]) ) return false;
    if( wxAtoi(version_parts[2]) < wxAtoi(compare_parts[2]) ) return true;
    return false;
}
开发者ID:rickcowan,项目名称:xLights,代码行数:12,代码来源:RenderableEffect.cpp

示例3: wxT

void ArraysTestCase::wxStringArraySplitTest()
{
    // test wxSplit:

    {
        wxString str = wxT(",,,,first,second,third,,");
        const wxChar *expected[] =
            { wxT(""), wxT(""), wxT(""), wxT(""), wxT("first"),
              wxT("second"), wxT("third"), wxT(""), wxT("") };

        wxArrayString exparr(WXSIZEOF(expected), expected);
        wxArrayString realarr(wxSplit(str, wxT(',')));
        CPPUNIT_ASSERT( exparr == realarr );
    }

    {
        wxString str = wxT(",\\,first,second,third,");
        const wxChar *expected[] =
            { wxT(""), wxT(",first"), wxT("second"), wxT("third"), wxT("") };
        const wxChar *expected2[] =
            { wxT(""), wxT("\\"), wxT("first"), wxT("second"), wxT("third"), wxT("") };

        // escaping on:
        wxArrayString exparr(WXSIZEOF(expected), expected);
        wxArrayString realarr(wxSplit(str, wxT(','), wxT('\\')));
        CPPUNIT_ASSERT( exparr == realarr );

        // escaping turned off:
        wxArrayString exparr2(WXSIZEOF(expected2), expected2);
        wxArrayString realarr2(wxSplit(str, wxT(','), wxT('\0')));
        CPPUNIT_ASSERT( exparr2 == realarr2 );
    }

    {
        // test is escape characters placed before non-separator character are
        // just ignored as they should:
        wxString str = wxT(",\\,,fir\\st,se\\cond\\,,\\third");
        const wxChar *expected[] =
            { wxT(""), wxT(","), wxT("fir\\st"), wxT("se\\cond,"), wxT("\\third") };
        const wxChar *expected2[] =
            { wxT(""), wxT("\\"), wxT(""), wxT("fir\\st"), wxT("se\\cond\\"),
              wxT(""), wxT("\\third") };

        // escaping on:
        wxArrayString exparr(WXSIZEOF(expected), expected);
        wxArrayString realarr(wxSplit(str, wxT(','), wxT('\\')));
        CPPUNIT_ASSERT( exparr == realarr );

        // escaping turned off:
        wxArrayString exparr2(WXSIZEOF(expected2), expected2);
        wxArrayString realarr2(wxSplit(str, wxT(','), wxT('\0')));
        CPPUNIT_ASSERT( exparr2 == realarr2 );
    }
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:54,代码来源:arrays.cpp

示例4: GetViewName

void SequenceElements::DeleteTimingFromView(const std::string &name, int view)
{
    std::string viewName = GetViewName(view);
    Element* elem = GetElement(name);
    if( elem != nullptr && elem->GetType() == "timing" )
    {
        std::string views = elem->GetViews();
        wxArrayString all_views = wxSplit(views,',');
        int found = -1;
        for( int j = 0; j < all_views.size(); j++ )
        {
            if( all_views[j] == viewName )
            {
                found = j;
                break;
            }
        }
        if( found != -1 )
        {
            all_views.erase(all_views.begin() + found);
            views = wxJoin(all_views, ',');
            elem->SetViews(views);
        }
    }
}
开发者ID:ebrady1,项目名称:xLights,代码行数:25,代码来源:SequenceElements.cpp

示例5: get_cfg

//read config options if heartbeat config file is present:
static void get_cfg()
{
    cfg.logpath.clear();
    cfg.maxents=0;
    cfg.interval=50;
    wxFileName cfgFile = wxFileName::FileName(wxStandardPaths::Get().GetExecutablePath());
    cfgFile.SetFullName("heartbeat.cfg");
    if (!wxFile::Exists(cfgFile.GetFullPath())) {
        return;
    }
    wxFile f(cfgFile.GetFullPath());
    if (!f.IsOpened()) {
        return;
    }
    wxString AllLines;
    f.ReadAll(&AllLines);
    f.Close();
    wxArrayString arrLines=wxSplit(AllLines,'\n');
    for (int i=0; i<arrLines.Count(); i++)
    {
        if (arrLines[i].StartsWith("Path=")) cfg.logpath = arrLines[i].Mid(5).Trim();
        if (arrLines[i].StartsWith("Maxents=")) arrLines[i].Mid(8).ToLong(&cfg.maxents);
        if (arrLines[i].StartsWith("Interval=")) arrLines[i].Mid(9).ToLong(&cfg.interval);
    }

    state.numents = 0;
    state.fifo.empty();
    state.latest=wxDateTime::Today();
}
开发者ID:derekbackus,项目名称:xLights,代码行数:30,代码来源:heartbeat.cpp

示例6: wxSplit

void ProjectSettings::GetSettings(cxProjectInfo& project) const {
	project.ClearFilters();

	if (!m_inheritCheck->GetValue()) {
		const wxArrayString ind = wxSplit(m_includeDirs->GetValue(), wxT('\n'), wxT('\0'));
		const wxArrayString exd = wxSplit(m_excludeDirs->GetValue(), wxT('\n'), wxT('\0'));
		const wxArrayString inf = wxSplit(m_includeFiles->GetValue(), wxT('\n'), wxT('\0'));
		const wxArrayString exf = wxSplit(m_excludeFiles->GetValue(), wxT('\n'), wxT('\0'));
		project.SetFilters(ind, exd, inf, exf);
	}

	if (m_projectInfo.IsRoot()) {
		project.env.clear();
		m_envPage->GetVars(project.env);
	}
}
开发者ID:BBkBlade,项目名称:e,代码行数:16,代码来源:ProjectSettings.cpp

示例7: wxSplit

void SequenceElements::SetTimingVisibility(const std::string& name)
{
    for(int i=0;i<mAllViews[MASTER_VIEW].size();i++)
    {
        Element* elem = mAllViews[MASTER_VIEW][i];
        if( elem->GetType() == "model" )
        {
            break;
        }
        if( name == "Master View" )
        {
            elem->SetVisible(true);
        }
        else
        {
            elem->SetVisible(false);
            wxArrayString views = wxSplit(elem->GetViews(),',');
            for(int v=0;v<views.size();v++)
            {
                std::string viewName = views[v].ToStdString();
                if( name == viewName )
                {
                    elem->SetVisible(true);
                    break;
                }
            }
        }
    }
}
开发者ID:ebrady1,项目名称:xLights,代码行数:29,代码来源:SequenceElements.cpp

示例8: wxSplit

/* MapTextureBrowser::determineTexturePath
 * Builds and returns the tree item path for [info]
 *******************************************************************/
string MapTextureBrowser::determineTexturePath(Archive* archive, uint8_t category, string type, string path)
{
	wxArrayString tree_spec = wxSplit(map_tex_treespec, ',');
	string ret;
	for (unsigned b = 0; b < tree_spec.size(); b++)
	{
		if (tree_spec[b] == "archive")
			ret += archive->getFilename(false);
		else if (tree_spec[b] == "type")
			ret += type;
		else if (tree_spec[b] == "category")
		{
			switch (category)
			{
			case MapTextureManager::TC_TEXTUREX:
				ret += "TEXTUREx"; break;
			case MapTextureManager::TC_TEXTURES:
				ret += "TEXTURES"; break;
			case MapTextureManager::TC_HIRES:
				ret += "HIRESTEX"; break;
			case MapTextureManager::TC_TX:
				ret += "Single (TX)"; break;
			default:
				continue;
			}
		}

		ret += "/";
	}

	return ret + path;
}
开发者ID:Blzut3,项目名称:SLADE,代码行数:35,代码来源:MapTextureBrowser.cpp

示例9: deserialize_size

static Optional<Size> deserialize_size(const utf8_string& str){
  wxString wxStr(to_wx(str));
  wxArrayString strs = wxSplit(to_wx(str), ',', '\0');
  if (strs.GetCount() != 2){
    return {};
  }

  long width;
  if (!strs[0].ToLong(&width)){
    return {};
  }
  if (width <= 0){
    return {};
  }

  long height;
  if (!strs[1].ToLong(&height)){
    return {};
  }
  if (height <= 0){
    return {};
  }

  return {Size(static_cast<coord>(width), static_cast<coord>(height))};
}
开发者ID:lukas-ke,项目名称:faint-graphics-editor,代码行数:25,代码来源:clipboard-util.cpp

示例10: wxSplit

/* AudioPrefsPanel::onBtnBrowseSoundfont
 * Called when the browse for soundfont button is clicked
 *******************************************************************/
void AudioPrefsPanel::onBtnBrowseSoundfont(wxCommandEvent& e)
{
#ifdef WIN32
	char separator = ';';
#else
	char separator = ':';
#endif

	string dir = dir_last_soundfont;
	if (dir_last_soundfont.value.empty() && fs_soundfont_path.value.size())
	{
		wxArrayString paths = wxSplit(fs_soundfont_path, separator);
		dir = wxFileName(paths[0]).GetPath();
	}

	// Open file dialog
	wxFileDialog fd(this, "Browse for MIDI Soundfont", dir, "", "Soundfont files (*.sf2)|*.sf2", wxFD_MULTIPLE);
	if (fd.ShowModal() == wxID_OK)
	{
		wxArrayString paths;
		string fullpath = "";
		fd.GetPaths(paths);
		for (size_t a = 0; a < paths.size(); ++a)
			fullpath += paths[a] + separator;
		if (paths.size())
			fullpath.RemoveLast(1);
		text_soundfont_path->SetValue(fullpath);
		dir_last_soundfont = fd.GetDirectory();
	}
}
开发者ID:DemolisherOfSouls,项目名称:SLADE,代码行数:33,代码来源:AudioPrefsPanel.cpp

示例11: wxSplit

wxXmlNode* xLightsFrame::CreateModelNodeFromGroup(const std::string &name) {
    wxXmlNode* element;
    std::vector<Model*> models;
    std::string modelString;
    for(wxXmlNode* e=ModelGroupsNode->GetChildren(); e!=NULL; e=e->GetNext() ) {
        if (e->GetName() == "modelGroup") {
            if (name == e->GetAttribute("name")) {
                element = e;
                modelString = e->GetAttribute("models");
                wxArrayString modelNames = wxSplit(modelString, ',');
                for (int x = 0; x < modelNames.size(); x++) {
                    Model *c = GetModel(modelNames[x].ToStdString());
                    if (c != nullptr) {
                        models.push_back(c);
                    }
                }
            }
        }
    }
    if (models.size() == 0) {
        return NULL;
    }
    wxXmlNode * ret = BuildWholeHouseModel(name, element, models);
    ret->AddAttribute("models", modelString);
    return ret;
}
开发者ID:rickcowan,项目名称:xLights,代码行数:26,代码来源:TabSequence.cpp

示例12: UpdateSelectedModel

void PreviewModels::UpdateSelectedModel()
{
    wxString groupModels;
    wxXmlNode* e;
    e=(wxXmlNode*)(ListBoxModelGroups->GetClientData(ListBoxModelGroups->GetSelection()));
    groupModels = e->GetAttribute("models");
    ListBoxModelsInGroup->Clear();
    wxArrayString ModelsInGroup=wxSplit(groupModels,',');
    for(int i=0;i<ModelsInGroup.size();i++)
    {
        ListBoxModelsInGroup->Append(ModelsInGroup[i]);
    }
    TextModelGroupName->SetValue(ListBoxModelGroups->GetString(ListBoxModelGroups->GetSelection()));
    PopulateUnusedModels(ModelsInGroup);

    wxString v = e->GetAttribute("layout", "grid");
    if (v == "grid") {
        ChoiceModelLayoutType->SetSelection(0);
    }else if (v == "minimalGrid") {
        ChoiceModelLayoutType->SetSelection(1);
    } else if (v == "horizontal") {
        ChoiceModelLayoutType->SetSelection(2);
    } else if (v == "vertical") {
        ChoiceModelLayoutType->SetSelection(3);
    }

    wxCommandEvent evt;
    OnChoiceModelLayoutTypeSelect(evt);

    SizeSpinCtrl->SetValue(wxAtoi(e->GetAttribute("GridSize", "400")));
}
开发者ID:rickcowan,项目名称:xLights,代码行数:31,代码来源:PreviewModels.cpp

示例13: wxSplit

/* TextEditor::onJumpToCalculateComplete
 * Called when the 'Jump To' calculation thread completes
 *******************************************************************/
void TextEditor::onJumpToCalculateComplete(wxThreadEvent& e)
{
	if (!choice_jump_to)
	{
		jump_to_calculator = nullptr;
		return;
	}

	choice_jump_to->Clear();
	jump_to_lines.clear();

	string jump_points = e.GetString();
	wxArrayString split = wxSplit(jump_points, ',');

	wxArrayString items;
	for (unsigned a = 0; a < split.size(); a += 2)
	{
		if (a == split.size() - 1)
			break;

		long line;
		if (!split[a].ToLong(&line))
			line = 0;
		string name = split[a + 1];

		items.push_back(name);
		jump_to_lines.push_back(line);
	}

	choice_jump_to->Append(items);
	choice_jump_to->Enable(true);

	jump_to_calculator = nullptr;
}
开发者ID:Gaerzi,项目名称:SLADE,代码行数:37,代码来源:TextEditor.cpp

示例14: wxSplit

bool 
Project::AddFolderByName(wxString folder_name, FolderType type) {
	wxArrayString folders = wxSplit(folder_name, wxFILE_SEP_PATH);
	std::vector<Folder>* folder_vec = this->folders.GetFolders();
	wxString folder_path = wxT("");
	Folder folder(QGF_FOLDER_TYPE_SCRIPT, wxT(""), wxT(""));
	if (folders.Count() == 1) {
		folder_vec->push_back(Folder(type, folders.Last(), folders.Last()));
		return true;
	}
	for (wxArrayString::iterator it = folders.begin() ; it != folders.end(); ++it) {
		wxString new_full_path = (folder_path == wxT("")) ? *it : folder_path + wxFILE_SEP_PATH + *it;
		folder = Folder(QGF_FOLDER_TYPE_OTHER, *it, new_full_path);
		std::vector<Folder>::iterator pos = std::find(folder_vec->begin(), folder_vec->end(), folder);
		if (pos == folder_vec->end()) return false;
		wxString full_path = pos->GetFullPath() + wxFILE_SEP_PATH + folders.Last();
		if (full_path == folder_name) {
			pos->GetSubFolders()->push_back(Folder(type, folders.Last(), full_path));
			return true;
		}

		folder_vec = pos->GetSubFolders();
		folder_path = new_full_path;
	}
	return false;
}
开发者ID:holywyvern,项目名称:qgf,代码行数:26,代码来源:project.cpp

示例15: wxSplit

void OptionsConfig::SetBookmarkLabel(const wxString& label, size_t index)
{
    wxArrayString arr = wxSplit(m_bookmarkLabels, ';');
    if(index < arr.GetCount()) {
        arr.Item(index) = label;
        m_bookmarkLabels = wxJoin(arr, ';');
    }
}
开发者ID:05storm26,项目名称:codelite,代码行数:8,代码来源:optionsconfig.cpp


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