當前位置: 首頁>>代碼示例>>C++>>正文


C++ FindString函數代碼示例

本文整理匯總了C++中FindString函數的典型用法代碼示例。如果您正苦於以下問題:C++ FindString函數的具體用法?C++ FindString怎麽用?C++ FindString使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了FindString函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的FindString函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。