本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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();
}