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


C++ wxString::IsEmpty方法代码示例

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


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

示例1: AddHighlightLanguage

HighlightLanguage EditorColourSet::AddHighlightLanguage(int lexer, const wxString& name)
{
    if (   lexer <= wxSCI_LEX_NULL
        || lexer >  wxSCI_LEX_LAST // this is a C::B extension to wxscintilla.h
        || name.IsEmpty())
    {
        return HL_NONE;
    }

    // fix name to be XML compliant
    wxString newID;
    size_t pos = 0;
    while (pos < name.Length())
    {
        wxChar ch = name[pos];
        if (wxIsalnum(ch) || ch == _T('_'))
        {
            // valid character
            newID.Append(ch);
        }
        else if (wxIsspace(ch))
        {
            // convert spaces to underscores
            newID.Append(_T('_'));
        }
        ++pos;
    }
    // make sure it's not starting with a number or underscore.
    // if it is, prepend an 'A'
    if (wxIsdigit(newID.GetChar(0)) || newID.GetChar(0) == _T('_'))
        newID.Prepend(_T('A'));

    if (GetHighlightLanguage(newID) != HL_NONE)
    {
        return HL_NONE;
    }

    m_Sets[newID].m_Langs = name;
    m_Sets[newID].m_Lexers = lexer;
    return newID;
}
开发者ID:stahta01,项目名称:EmBlocks_old,代码行数:41,代码来源:editorcolourset.cpp

示例2: SetLocus

void CBaseMenuEdit::SetLocus(
  const wxString &s, 
  bool bEnabled
  )
{
  m_pMenuReview->SetLocusName(s);
  m_pMenuAccept->SetLocusName(s);
  if(s.IsEmpty())
  {
    SetLabel(IDmenuEditCell,EDIT_SAMPLE_LABEL);
  }
  else
  {
    wxString sLabel;
    sLabel = "Edit ";
    sLabel.Append(s);
    sLabel.Append("...");
    SetLabel(IDmenuEditCell,sLabel);
  }
  Enable(IDmenuEditCell,bEnabled);
}
开发者ID:HelloWilliam,项目名称:osiris,代码行数:21,代码来源:CMenuEdit.cpp

示例3: AppendExt

CPath CPath::AppendExt(const wxString& ext) const
{
	wxASSERT(ext.IsAscii());

	// Though technically, and empty extension would simply 
	// be another . at the end of the filename, we ignore them.
	if (ext.IsEmpty()) {
		return *this;
	}

	CPath result(*this);
	if (ext[0] == wxT('.')) {
		result.m_printable << ext;
		result.m_filesystem << ext;
	} else {
		result.m_printable << wxT(".") << ext;
		result.m_filesystem << wxT(".") << ext;
	}

	return result;
}
开发者ID:dreamerc,项目名称:amule,代码行数:21,代码来源:Path.cpp

示例4: AddTestFailure

void WxGuiTestHelper::AddTestFailure (const wxString &file, const int line,
        const wxString &shortDescription, const wxString &message)
{
    if (s_accTestFailures.IsEmpty ()) {

        s_fileOfFirstTestFailure = file;
        s_lineNmbOfFirstTestFailure = line;
        s_shortDescriptionOfFirstTestFailure = shortDescription;

    } else {

        s_accTestFailures += _T("\nAND SUBSEQUENTLY:");
        if (!shortDescription.IsEmpty ()) {

            s_accTestFailures += _T("\n");
            s_accTestFailures += shortDescription;
        }
    }
    s_accTestFailures += _T("\n");
    s_accTestFailures += message;
}
开发者ID:jralls,项目名称:wxGuiTesting,代码行数:21,代码来源:WxGuiTestHelper.cpp

示例5: set_column_name

bool pgsRecord::set_column_name(const USHORT &column, wxString name)
{
	// Column number must be valid
	if (column >= count_columns())
	{
		return false;
	}

	// Column name must not exist
	// Column name must not be empty
	name = name.Strip(wxString::both).Lower();
	if (m_columns.Index(name) != wxNOT_FOUND || name.IsEmpty())
	{
		return false;
	}

	// Set the column name
	m_columns[column] = name;

	return true;
}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:21,代码来源:pgsRecord.cpp

示例6: Add_String

//---------------------------------------------------------
void CINFO_Messages::Add_String(wxString sMessage, bool bNewLine, bool bTime, TSG_UI_MSG_STYLE Style)
{
	if( !sMessage.IsEmpty() )
	{
		if( bNewLine )
		{
			_Add_Text(wxT("\n"));
		}

		if( bTime )
		{
			Add_Time(false);

			_Add_Text(wxT(" "));
		}

		_Set_Style(Style);

		_Add_Text(sMessage);
	}
}
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:22,代码来源:info_messages.cpp

示例7: Init

void pgPassConfigLine::Init(const wxString &line)
{
	text = line;

	if (line.IsEmpty())
		return;

	isComment = line.StartsWith(wxT("#"));

	wxStringTokenizer tok(isComment ? line.Mid(1) : line, wxT(":"));
	if (tok.HasMoreTokens())
		hostname = tok.GetNextToken();
	if (tok.HasMoreTokens())
		port = tok.GetNextToken();
	if (tok.HasMoreTokens())
		database = tok.GetNextToken();
	if (tok.HasMoreTokens())
		username = tok.GetNextToken();
	if (tok.HasMoreTokens())
		password = tok.GetNextToken();
}
开发者ID:Timosha,项目名称:pgadmin3,代码行数:21,代码来源:pgconfig.cpp

示例8: GetArrayFromString

bool MSVC7Loader::ParseInputString(const wxString& Input, wxArrayString& Output)
{
    /* This function will parse an input string recursively
     * with separators (',' and ';') */
    wxArrayString Array1, Array2;
    if (Input.IsEmpty())
        return false;
    Array1 = GetArrayFromString(Input, _T(","));
    for (size_t i = 0; i < Array1.GetCount(); ++i)
    {
        if (Array1[i].Find(_T(";")) != -1)
        {
            Array2 = GetArrayFromString(Array1[i], _T(";"));
            for (size_t j = 0; j < Array2.GetCount(); ++j)
                Output.Add(Array2[j]);
        }
        else
            Output.Add(Array1[i]);
    }
    return true;
}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:21,代码来源:msvc7loader.cpp

示例9: needsQuoting

bool Identifier::needsQuoting(const wxString& s)
{
    if (s.IsEmpty())
        return false;
    const wxChar* p = s.c_str();
    // first character: only 'A'..'Z' allowed, else quotes needed
    if (*p < 'A' || *p > 'Z')
        return true;
    p++;
    // after first character: 'A'..'Z', '0'..'9', '_', '$' allowed
    while (*p != 0)
    {
        bool validChar = (*p >= 'A' && *p <= 'Z') || (*p >= '0' && *p <= '9')
            || *p == '_' || *p == '$';
        if (!validChar)
            return true;
        p++;
    }
    // may still need quotes if reserved word
    return SqlTokenizer::isReservedWord(s);
}
开发者ID:DragonZX,项目名称:flamerobin,代码行数:21,代码来源:Identifier.cpp

示例10: Split

void BatchCommands::Split(const wxString & str, wxString & command, wxString & param)
{
   int splitAt;

   command.Empty();
   param.Empty();

   if (str.IsEmpty()) {
      return;
   }

   splitAt = str.Find(wxT(':'));
   if (splitAt < 0) {
      return;
   }

   command = str.Mid(0, splitAt);
   param = str.Mid(splitAt + 1);

   return;
}
开发者ID:JordanGraves,项目名称:TabMagic,代码行数:21,代码来源:BatchCommands.cpp

示例11: SetAttributes

/// Convenience function for setting the major attributes for a list level specification
void wxRichTextListStyleDefinition::SetAttributes(int i, int leftIndent, int leftSubIndent, int bulletStyle, const wxString& bulletSymbol)
{
    wxASSERT( (i >= 0 && i < 10) );
    if (i >= 0 && i < 10)
    {
        wxRichTextAttr attr;

        attr.SetBulletStyle(bulletStyle);
        attr.SetLeftIndent(leftIndent, leftSubIndent);

        if (!bulletSymbol.IsEmpty())
        {
            if (bulletStyle & wxTEXT_ATTR_BULLET_STYLE_SYMBOL)
                attr.SetBulletText(bulletSymbol);
            else
                attr.SetBulletName(bulletSymbol);
        }

        m_levelStyles[i] = attr;
    }
}
开发者ID:hgwells,项目名称:tive,代码行数:22,代码来源:richtextstyles.cpp

示例12: setConfig

// 配置文件读写	
bool CUpdate::setConfig(const wxString& key, const wxString& values, wxString fileName)
{
	if(fileName.IsEmpty())
	{
		fileName = m_configFile;
	}
	wxString	realFileName = m_skinDir +fileName;
	wxFileInputStream fis(realFileName);
	if (!fis.Ok())
	{
		assert("Config file not found.");
		return false;
	}
	wxFileConfig *conf = new wxFileConfig(fis);
	bool result = conf->Write(key, values);
	wxFileOutputStream os(realFileName);
	conf->Save(os);
	os.Close();	
	delete conf;
	return result;
}
开发者ID:dnjsflagh1,项目名称:code,代码行数:22,代码来源:update.cpp

示例13: LoadTabgroupData

void TabgroupManager::LoadTabgroupData(const wxString& tabgroup)
{
    // 'tabgroup' is the filepath of the tabgroup to load
    if(tabgroup.IsEmpty()) {
        return;
    }

    // Load the data: we're only interested in the tab names here, not each CurrentLine etc
    TabGroupEntry session;
    wxString filepath = tabgroup.BeforeLast(wxT('.')); // FindSession() doesn't want the .ext here
    if(SessionManager::Get().GetSession(filepath, session, "tabgroup", tabgroupTag)) {
        wxArrayString tabnames;
        const std::vector<TabInfo>& vTabInfoArr = session.GetTabInfoArr();
        for(size_t i = 0; i < vTabInfoArr.size(); ++i) {
            const TabInfo& ti = vTabInfoArr[i];
            tabnames.Add(ti.GetFileName());
        }
        std::pair<wxString, wxArrayString> TabgroupItem(tabgroup, tabnames);
        m_tabgroups.push_back(TabgroupItem);
    }
}
开发者ID:anatooly,项目名称:codelite,代码行数:21,代码来源:tabgroupmanager.cpp

示例14: DoAddItemToTabgroup

bool TabgroupManager::DoAddItemToTabgroup(
    wxXmlDocument& doc, wxXmlNode* node, const wxString& filepath, const wxString& nextitemfilepath)
{
    wxXmlNode* TabInfoArrayNode = XmlUtils::FindFirstByTagName(doc.GetRoot(), wxT("TabInfoArray"));
    if(!TabInfoArrayNode) {
        return false;
    }

    // If previousnode is valid, insert the new tab after it
    wxXmlNode* previousnode = NULL;
    if(!nextitemfilepath.IsEmpty()) {
        previousnode = FindTabgroupItem(doc, filepath, nextitemfilepath);
    }
    if(previousnode) {
        return TabInfoArrayNode->InsertChildAfter(node, previousnode); // >=2.8.8 has a convenient function to do this
    } else {
        TabInfoArrayNode->AddChild(node);
    }

    return true;
}
开发者ID:anatooly,项目名称:codelite,代码行数:21,代码来源:tabgroupmanager.cpp

示例15: SetLastProject

void WinEDA_BasicFrame::SetLastProject(const wxString & FullFileName)
/*******************************************************************/
/* Met a jour la liste des anciens projets
*/
{
unsigned ii;

	if ( FullFileName.IsEmpty() ) return;

	//suppression d'une ancienne trace eventuelle du meme fichier
	for ( ii = 0; ii < m_Parent->m_LastProject.GetCount(); )
	{
		if(m_Parent->m_LastProject[ii].IsEmpty() ) break;
#ifdef __WINDOWS__
		if ( m_Parent->m_LastProject[ii].CmpNoCase(FullFileName) == 0 )
#else
		if ( m_Parent->m_LastProject[ii] == FullFileName )
#endif
		{
#if ( (wxMAJOR_VERSION < 2) || ((wxMAJOR_VERSION == 2)&& (wxMINOR_VERSION <= 4)) )
			m_Parent->m_LastProject.Remove(ii);
#else
			m_Parent->m_LastProject.RemoveAt(ii);
#endif
		}
		else ii++;
	}

    while (m_Parent->m_LastProject.GetCount() >= m_Parent->m_LastProjectMaxCount)
    {
#if ( (wxMAJOR_VERSION < 2) || ((wxMAJOR_VERSION == 2)&& (wxMINOR_VERSION <= 4)) )
        files.Remove(files.GetCount() - 1);
#else
        m_Parent->m_LastProject.RemoveAt(m_Parent->m_LastProject.GetCount() - 1);
#endif
    }
	m_Parent->m_LastProject.Insert(FullFileName, 0);

	ReCreateMenuBar();
}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:40,代码来源:basicframe.cpp


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