本文整理汇总了C++中FindString函数的典型用法代码示例。如果您正苦于以下问题:C++ FindString函数的具体用法?C++ FindString怎么用?C++ FindString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FindString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Determine_QM_Level
void Determine_QM_Level(char szQMLevel[])
{
char ErrorMsg[256];
if(FindString(szQMLevel, "HF") >= 0) {
QM_Level = QM_LEVEL_HF;
}
else if(FindString(szQMLevel, "MP2") >= 0) {
QM_Level = QM_LEVEL_MP2;
}
else {
sprintf(ErrorMsg, "Fail to determine the QM level.\n%s\nQuit\n", szQMLevel);
Quit_With_Error_Msg(ErrorMsg);
}
return;
}
开发者ID:mj-harvey,项目名称:gaamp-local,代码行数:16,代码来源:qm-1d-scan-para.cpp
示例2: OPT_GET
void OptionPage::OptionChoice(wxFlexGridSizer *flex, const wxString &name, const wxArrayString &choices, const char *opt_name) {
parent->AddChangeableOption(opt_name);
const auto opt = OPT_GET(opt_name);
auto cb = new wxComboBox(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, choices, wxCB_READONLY | wxCB_DROPDOWN);
Add(flex, name, cb);
switch (opt->GetType()) {
case agi::OptionType::Int: {
int val = opt->GetInt();
cb->Select(val < (int)choices.size() ? val : 0);
cb->Bind(wxEVT_COMBOBOX, IntCBUpdater(opt_name, parent));
break;
}
case agi::OptionType::String: {
wxString val(to_wx(opt->GetString()));
if (cb->FindString(val) != wxNOT_FOUND)
cb->SetStringSelection(val);
else if (!choices.empty())
cb->SetSelection(0);
cb->Bind(wxEVT_COMBOBOX, StringUpdater(opt_name, parent));
break;
}
default:
throw agi::InternalError("Unsupported type");
}
}
开发者ID:Aegisub,项目名称:Aegisub,代码行数:28,代码来源:preferences_base.cpp
示例3: FindString
/*
** Vers. 1.1
** NEW: CopyList()
*/
void CACListWnd::CopyList()
{
m_DisplayList.Copy(m_SearchList);
m_lCount = (long)m_DisplayList.GetSize();
if(m_lCount)
FindString(0,_T(""),true);
}
开发者ID:spritetong,项目名称:tortoisegit-utf8,代码行数:11,代码来源:ACListWnd.cpp
示例4: To_Find_Tag
int To_Find_Tag(FILE *fIn, char szFileName[], char szTag[], char szLine[])
{
char *ReadLine, ErrorMsg[256];
while(1) {
if(feof(fIn)) {
sprintf(ErrorMsg, "Fail to find the tag: %s in file %s\nQuit\n", szTag, szFileName);
fclose(fIn);
Quit_With_Error_Msg(ErrorMsg);
}
ReadLine = fgets(szLine, 256, fIn);
if(ReadLine == NULL) {
sprintf(ErrorMsg, "Fail to find the tag: %s in file %s\nQuit\n", szTag, szFileName);
fclose(fIn);
Quit_With_Error_Msg(ErrorMsg);
}
else {
if(FindString(szLine, szTag) >= 0) {
return 1;
}
}
}
return 0;
}
开发者ID:mj-harvey,项目名称:gaamp-local,代码行数:26,代码来源:qm-1d-scan-para.cpp
示例5: FindString
bool wxBitmapComboBox::Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
int n,
const wxString choices[],
long style,
const wxValidator& validator,
const wxString& name)
{
if ( !wxComboBox::Create(parent, id, value, pos, size,
n, choices, style, validator, name) )
return false;
// Select 'value' in entry-less mode
if ( !GetEntry() )
{
int i = FindString(value);
if (i != wxNOT_FOUND)
SetSelection(i);
}
return true;
}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:25,代码来源:bmpcbox.cpp
示例6: SetStringValue
virtual void SetStringValue(const wxString& s)
{
if (s.Length() > 0)
{
// Search item index
int index = FindString(s);
// Removes item if already in combos box
if ( index != wxNOT_FOUND )
{
Delete(index);
}
// Removes last item if max nb item is reached
if ( GetCount() >= m_MaxHistoryLen)
{
// Removes last one
Delete(GetCount()-1);
}
// Adds it to combos
Insert(s, 0);
Select(0);
}
}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:25,代码来源:IncrementalSearch.cpp
示例7: FindString
void FStringTable::SetString (const char *name, const char *newString)
{
StringEntry **pentry, *oentry;
FindString (name, pentry, oentry);
size_t newlen = strlen (newString);
size_t namelen = strlen (name);
// Create a new string entry
StringEntry *entry = (StringEntry *)M_Malloc (sizeof(*entry) + newlen + namelen + 2);
strcpy (entry->String, newString);
strcpy (entry->Name = entry->String + newlen + 1, name);
entry->PassNum = 0;
// If this is a new string, insert it. Otherwise, replace the old one.
if (oentry == NULL)
{
entry->Next = *pentry;
*pentry = entry;
}
else
{
*pentry = entry;
entry->Next = oentry->Next;
M_Free (oentry);
}
}
开发者ID:Accusedbold,项目名称:zdoom,代码行数:27,代码来源:stringtable.cpp
示例8: GetCurSel
LONG CSizeComboBox::GetHeight(int sel)
{
if (sel == -1)
sel = GetCurSel();
if (sel == -1)
{
TCHAR szText[20];
GetWindowText(szText, 20);
sel = FindString( -1, szText);
if (sel == CB_ERR)
{
CY cyTmp;
cyTmp.Lo = 0;
cyTmp.Hi = 0;
_AfxCyFromString(cyTmp, szText);
int PointSize = (int)((cyTmp.Lo + 5000) / 10000);
if (PointSize != 0)
return MulDiv(-afxData.cyPixelsPerInch, PointSize, 72);
else
sel = 0;
}
}
return (LONG) GetItemData(sel);
}
开发者ID:Rupan,项目名称:winscp,代码行数:26,代码来源:ppgfont.cpp
示例9: AddFont
int CFontComboBox::AddFont(LOGFONT *pLF, DWORD FontType)
{
int nEntry;
FONTITEM_PPG* pFontItem = NULL;
// Font already in the combobox
if (FindString(-1, (LPCTSTR) pLF->lfFaceName) != CB_ERR)
return CB_ERR;
// allocate some memory for the FONTITEM_PPG structure
TRY
{
pFontItem = new FONTITEM_PPG;
}
CATCH( CMemoryException, e )
{
return CB_ERR;
}
END_CATCH
ASSERT( pFontItem );
pFontItem->lf = *pLF;
pFontItem->dwFontType = FontType;
nEntry = AddString( (LPCTSTR) pFontItem->lf.lfFaceName );
if (nEntry == CB_ERR)
delete pFontItem;
else
SetItemData( nEntry, (DWORD) pFontItem );
return nEntry;
}
开发者ID:anyue100,项目名称:winscp,代码行数:33,代码来源:ppgfont.cpp
示例10:
const char*
PSettings::GetString(const char *name)
{
const char *old;
status_t s=FindString(name,&old);
return old;
}
开发者ID:threedeyes,项目名称:DjVuViewer,代码行数:7,代码来源:Settings.cpp
示例11: FindString
void wxListBoxBase::SetFirstItem(const wxString& s)
{
int n = FindString(s);
wxCHECK_RET( n != wxNOT_FOUND, wxT("invalid string in wxListBox::SetFirstItem") );
DoSetFirstItem(n);
}
开发者ID:Asmodean-,项目名称:Ishiiruka,代码行数:8,代码来源:lboxcmn.cpp
示例12: Lock
bool
Preferences::ReadString(BString &string, const char* name)
{
Lock();
bool loaded = FindString(name, &string) == B_OK;
Unlock();
return loaded;
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:8,代码来源:Preferences.cpp
示例13: FindStringExact
void CLocalComboBox::SetTheText(LPCTSTR lpszText,BOOL bMatchExact)
{
int idx = (bMatchExact) ? FindStringExact(-1,lpszText) :
FindString(-1, lpszText);
SetCurSel( (idx==CB_ERR) ? -1 : idx);
if (idx == CB_ERR)
SetWindowText(lpszText);
}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:8,代码来源:FormatBar.cpp
示例14: FindString
int ctlComboBox::GetGuessedSelection() const
{
int sel=GetCurrentSelection();
if (sel < 0)
sel = FindString(GetValue());
return sel;
}
开发者ID:xiul,项目名称:Database-Designer-for-pgAdmin,代码行数:8,代码来源:ctlComboBox.cpp
示例15: GetHeader
DWORD CItemList::FindString(LPCTSTR pCol, LPCTSTR pStr)
{
// Get column index
DWORD i = GetHeader().FindCol( pCol );
if ( i == MAXDWORD ) return i;
return FindString( i, pStr );
}
开发者ID:sanyaade-webdev,项目名称:wpub,代码行数:8,代码来源:ItemList.cpp
示例16: FindString
C4String *C4StringTable::RegString(StdStrBuf String)
{
C4String * s = FindString(String.getData());
if (s)
return s;
else
return new C4String(String);
}
开发者ID:772,项目名称:openclonk,代码行数:8,代码来源:C4StringTable.cpp
示例17:
/*!
\brief Returns the name of the set
\return The name of the set
*/
const char *
CursorSet::GetName(void)
{
const char *name;
if (FindString("name", &name) == B_OK)
return name;
return NULL;
}
开发者ID:mariuz,项目名称:haiku,代码行数:13,代码来源:CursorSet.cpp
示例18: SetCurSel
int color_combo_box::SetCurSelNEW(int model_index)
{
if((model_index < 0) || (model_index >= Num_ship_types)){
return SetCurSel(model_index);
}
// lookup the ship name
return FindString(0, Ship_info[model_index].name);
}
开发者ID:lubomyr,项目名称:freespace2,代码行数:9,代码来源:mainfrm.cpp
示例19: AddString
void
PSettings::SetString(const char *name,const char *text)
{
const char *old;
status_t s=FindString(name,&old);
if(s==B_OK)ReplaceString(name,text);
else AddString(name,text);
}
开发者ID:threedeyes,项目名称:DjVuViewer,代码行数:9,代码来源:Settings.cpp
示例20: FindString
/*
========================
idLangDict::GetString
========================
*/
const char* idLangDict::GetString( const char* str ) const
{
const char* localized = FindString( str );
if( localized == NULL )
{
return str;
}
return localized;
}
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:14,代码来源:LangDict.cpp
注:本文中的FindString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论