本文整理汇总了C++中wxString::Cmp方法的典型用法代码示例。如果您正苦于以下问题:C++ wxString::Cmp方法的具体用法?C++ wxString::Cmp怎么用?C++ wxString::Cmp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxString
的用法示例。
在下文中一共展示了wxString::Cmp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseAlignment
SectionFieldAlignment SectionFieldDescriptor::ParseAlignment(wxString& value)
{
if ( value.Cmp(_("L")) == 0 ) {
return FA_LEFT;
} else if ( value.Cmp(_("R")) == 0 ) {
return FA_RIGHT;
} else {
throw wxString::Format(DESCRIPTOR_WRONG_ALIGNMENT + wxString(" %s"), value);
}
}
示例2: UpdateTrailer
void EdiComposer::UpdateTrailer(const wxString& recordType)
{
if ( recordType.Cmp(ADDED) == 0 ) {
GetTrailer().TotalAdds++;
} else if( recordType.Cmp(CHANGED) == 0 ) {
GetTrailer().TotalChanges++;
} else if( recordType.Cmp(MOVED) == 0 ) {
GetTrailer().TotalMoveHistory++;
} else if( recordType.Cmp(REPLACED) == 0 ) {
GetTrailer().TotalReplacements++;
}
};
示例3: Append
int wxVListBoxComboPopup::Append(const wxString& item)
{
int pos = (int)m_strings.GetCount();
if ( m_combo->GetWindowStyle() & wxCB_SORT )
{
// Find position
// TODO: Could be optimized with binary search
wxArrayString strings = m_strings;
unsigned int i;
for ( i=0; i<strings.GetCount(); i++ )
{
if ( item.Cmp(strings.Item(i)) < 0 )
{
pos = (int)i;
break;
}
}
}
Insert(item,pos);
return pos;
}
示例4: SelectAllTreeItems
void SelectAllTreeItems(const wxString &searchStr, wxTreeCtrl *tvCtrl,
int SelImageIdx, const wxTreeItemId& idParent, wxTreeItemIdValue cookie)
{
wxTreeItemId id;
if (!cookie)
id = tvCtrl->GetFirstChild(idParent, cookie);
else
id = tvCtrl->GetNextChild(idParent, cookie);
if (!id.IsOk())
return;
if (searchStr.Cmp(wxEmptyString) == 0)
tvCtrl->SetItemImage(id, SelImageIdx);
else
{
if (tvCtrl->GetItemText(id).Upper().Contains(searchStr.Upper()))
{
tvCtrl->SetItemImage(id, SelImageIdx);
}
}
if (tvCtrl->ItemHasChildren(id))
SelectAllTreeItems(searchStr, tvCtrl, SelImageIdx, id);
SelectAllTreeItems(searchStr, tvCtrl, SelImageIdx, idParent, cookie);
}
示例5: getApnRule
bool
SbAccessFilterPolicy::setPath(wxString path)
{
struct apn_rule *rule;
rule = getApnRule();
if ((rule == NULL) || path.IsEmpty()){
return (false);
}
startChange();
if (rule->rule.sbaccess.path != NULL) {
free(rule->rule.sbaccess.path);
rule->rule.sbaccess.path = NULL;
setModified();
}
if (path.Cmp(wxT("any")) != 0) {
rule->rule.sbaccess.path = strdup(path.fn_str());
setModified();
}
finishChange();
return (true);
}
示例6: equals
bool Identifier::equals(const wxString& rhs) const
{
if (needsQuoting(textM))
return (0 == rhs.Cmp(textM));
else
return (0 == rhs.CmpNoCase(textM));
}
示例7: CompareFiles
int CComparisonManager::CompareFiles(const int dirSortMode, const wxString& local, const wxString& remote, bool localDir, bool remoteDir)
{
switch (dirSortMode)
{
default:
if (localDir)
{
if (!remoteDir)
return -1;
}
else if (remoteDir)
return 1;
break;
case 2:
// Inline
break;
}
#ifdef __WXMSW__
return local.CmpNoCase(remote);
#else
return local.Cmp(remote);
#endif
return 0;
}
示例8: sortfunc
static bool sortfunc(const wxString& a, const wxString& b)
{
#ifdef __WXMSW__
return b.CmpNoCase(a) > 0;
#else
return b.Cmp(a) > 0;
#endif
}
示例9: sortfunc
static bool sortfunc(const wxString& a, const wxString& b)
{
int cmp = a.CmpNoCase(b);
if (!cmp)
cmp = a.Cmp(b);
return cmp < 0;
}
示例10: set
bool ALMRunConfig::set(const wxString& name,const wxString &value)
{
if (name.Cmp("Explorer") == 0)
Explorer = value;
else if (name.Cmp("Root") == 0)
{
Root = value;
if (Root.empty())
return false;
wxSetWorkingDirectory(Root);
}
else if(name.Cmp("HotKey") == 0)
HotKey = value;
else if(name.Cmp("HotKeyReLoad") == 0)
HotKeyReLoad = value;
else
return false;
return ::wxSetEnv(wxT("ALMRUN_")+name.Upper(),value);
}
示例11: ColumnPullDownSearcher
// 10個のプルダウン全て調べる
void WxSQLiteTest::ColumnPullDownSearcher(wxString& dataType, wxString& value)
{
// それぞれのカラムを調べる
if (!dataType.IsEmpty() && !value.IsEmpty()) {
if (!dataType.Cmp(wxT("カラムを作らない")) == 0 && ColumnValidator(value)) {
columnArray->Add(dataType);
columnArray->Add(value.MakeUpper());
wxMessageBox(dataType);
wxMessageBox(value);
}
}
}
示例12: FindGroupByName
int IniParser::FindGroupByName(const wxString& name, bool caseSensitive) const
{
for (int i = 0; i < GetGroupsCount(); ++i)
{
bool found = caseSensitive
? name.Cmp(m_Array[i].name) == 0
: name.CmpNoCase(m_Array[i].name) == 0;
if (found)
return i;
}
return -1;
}
示例13: GetProjectCountByPath
int ProjectListBox::GetProjectCountByPath(wxString path)
{
int count = 0;
for(int i=0; i<this->GetItemCount(); i++)
{
if(path.Cmp(GetText(i,1))==0)
{
count++;
}
}
return count;
}
示例14: getInternalGroupIndex
//-----------------------------------------------------------------------
int DialogResourceGroups::getInternalGroupIndex( const wxString& groupName ) const
{
int rowsize = m_groupsGrid->GetRows();
for ( int i = 0; i < rowsize; i++ )
{
const wxString rowname = m_groupsGrid->GetCellValue( i, 0 );
if ( rowname.Cmp( groupName ) == 0 )
return i;
}
return -1;
}
示例15: Encode
wxString SectionFieldDescriptor::Encode(wxString& value, wxString& type)
{
wxDateTime date;
if ( type.Cmp("date") == 0
&& value.Length() != 0 ) {
if ( date.ParseFormat(value, "%Y/%m/%d") ) {
return date.Format("%Y%m%d");
} else {
return value;
}
} else {
return value;
}
}