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


C++ GetText函数代码示例

本文整理汇总了C++中GetText函数的典型用法代码示例。如果您正苦于以下问题:C++ GetText函数的具体用法?C++ GetText怎么用?C++ GetText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: BeginScan

void
CBCSharpStyler::Scan
	(
	istream&			input,
	const TokenExtra&	initData
	)
{
	BeginScan(input);

	const JString& text = GetText();

	Token token;
	JFontStyle style;
	do
		{
		token = NextToken();
		if (token.type == kEOF)
			{
			break;
			}

		// save token starts

		if (token.type == kID                 ||
			token.type == kReservedCKeyword   ||
			token.type == kBuiltInDataType    ||
			token.type == kString             ||
			token.type == kComment            ||
			token.type == kDocComment)
			{
			SaveTokenStart(TokenExtra());
			}

		// set the style

		const JIndex typeIndex = token.type - kWhitespace;
		if (token.type == kWhitespace)
			{
			style = GetDefaultFontStyle();
			}
		else if (token.type == kComment    ||
				 token.type == kDocComment ||
				 token.type == kString)
			{
			style = GetTypeStyle(typeIndex);
			}
		else if (token.type == kPPDirective && SlurpPPComment(&(token.range)))
			{
			token.type = kComment;
			style      = GetTypeStyle(kComment - kWhitespace);
			}
		else if (token.type == kPPDirective)
			{
			style = GetStyle(typeIndex, text.GetSubstring(GetPPNameRange()));
			}
		else if (token.type < kWhitespace)
			{
			style = GetTypeStyle(kError - kWhitespace);
			}
		else if (token.type > kError)	// misc
			{
			if (!GetWordStyle(text.GetSubstring(token.range), &style))
				{
				style = GetDefaultFontStyle();
				}
			}
		else
			{
			style = GetStyle(typeIndex, text.GetSubstring(token.range));
			}
		}
		while (SetStyle(token.range, style));
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:73,代码来源:CBCSharpStyler.cpp

示例2: IsOn

bool CPrefsDialog::OKClicked()
{
	font_family defFamily;
	font_style defStyle;

	be_plain_font->GetFamilyAndStyle(&defFamily, &defStyle);
	gPrefs->SetPrefString("defdoc font family", fNewFontFamily);
	gPrefs->SetPrefString("defdoc font style", defStyle);
	gPrefs->SetPrefDouble("defdoc font size", fNewFontSize);

	be_bold_font->GetFamilyAndStyle(&defFamily, &defStyle);
	gPrefs->SetPrefString("border font family", fNewBFontFamily);
	gPrefs->SetPrefString("border font style", defStyle);
	gPrefs->SetPrefDouble("border font size", fNewBFontSize);

	gPrefs->SetPrefInt("decimal point", *GetText("decsep"));
	gPrefs->SetPrefInt("thousands separator", *GetText("thoussep"));
	gPrefs->SetPrefInt("list separator", *GetText("listsep"));
	gPrefs->SetPrefInt("date separator", *GetText("datesep"));
	gPrefs->SetPrefInt("time separator", *GetText("timesep"));
	gPrefs->SetPrefString("date order", fDMY->FindMarked()->Label());	
	gPrefs->SetPrefInt("24 hours", IsOn("24 hours"));
	gPrefs->SetPrefInt("Excel keys", IsOn("excel"));
	gPrefs->SetPrefInt("Select Gray", IsOn("grayselect"));
	gPrefs->SetPrefInt("start with new", IsOn("donew"));
	gWithEqualSign = IsOn("formula starts with equal");
	gPrefs->SetPrefInt("formula starts with equal", gWithEqualSign);
	gPrefs->SetPrefInt("dark gridlines", 	IsOn("dark gridlines"));
	if (gPrefs->GetPrefInt("dark gridlines", 0))
		gGridColor = 10;
	else
		gGridColor = 6;

	gPrefs->SetPrefString("c_symbol", GetText("c_symbol"));
	gPrefs->SetPrefInt("c_before", IsOn("c_before"));
	gPrefs->SetPrefInt("c_neg_par", IsOn("c_neg_par"));
	gPrefs->SetPrefInt("c_digits", atoi(GetText("c_digits")));

	if (fPageSetup)
	{
		char *ps = Bin2Hex(fPageSetup, fPageSetupSize);
		gPrefs->SetPrefString("default page setup", ps);
		FREE(ps);
	}

	BMessage msg(msg_WindowOptions);

	msg.AddString("docfamily", fDocFontFamily);
	msg.AddString("docstyle", "Roman");
	msg.AddFloat("docsize", fDocFontSize);
	msg.AddString("borderfamily", fDocBFontFamily);
	msg.AddString("borderstyle", "Bold");
	msg.AddFloat("bordersize", fDocBFontSize);
	msg.AddBool("autorecalc", IsOn("autorecalc"));
	msg.AddBool("displayzero", IsOn("displayzero"));
	msg.AddBool("dispgrid", IsOn("dispgrid"));
	msg.AddBool("disphead", IsOn("disphead"));
	msg.AddBool("prgrid", IsOn("prgrid"));
	msg.AddBool("prhead", IsOn("prhead"));
	
	fOwner->PostMessage(&msg, fOwner->GetCellView());

	BButton *b;
	b = (BButton *)FindView("ok");
	b->SetEnabled(false);
	b = (BButton *)FindView("cancel");
	b->SetEnabled(false);

	InitFormatter();

	return false;
} /* CPrefsDialog::OKClicked */
开发者ID:ModeenF,项目名称:OpenSumIt,代码行数:72,代码来源:PrefsDialog.cpp

示例3: GetText

void CListBoxEx::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) 
{
	m_pwndSBV->MoveWindow(m_rcSBV);

	if ((int)lpDrawItemStruct->itemID < 0)
		return; 

	CString text;
	GetText(lpDrawItemStruct->itemID, text);
	CRect rect = lpDrawItemStruct->rcItem;

	int cntItem = GetCount();
	int numShow = m_rcSBV.Height() / m_nItemHeight;
	// 스크롤바가 생성되면 List Box의 드로우 영역을 줄인다.
	if (cntItem > numShow)
		rect.right -= 20;

	CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
	Graphics mainG (lpDrawItemStruct->hDC);

	Color clrText = m_clrTextNom;
	// 선택된 Item 영역 그리는 부분.
	if ((lpDrawItemStruct->itemState & ODS_SELECTED) && (lpDrawItemStruct->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)))
	{
		DrawItem(&mainG,rect,m_clrItemHot);
		clrText = m_clrTextHot;
		DrawText(&mainG,rect,text,clrText);
	}

	// 기본 Item 영역 그리는 부분.
	if (!(lpDrawItemStruct->itemState & ODS_SELECTED) && (lpDrawItemStruct->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)))
	{
		if (m_bModeOneColor == true)
		{
			DrawItem(&mainG,rect,m_clrItemNom1);
		}
		else
		{
			Color clr;
			lpDrawItemStruct->itemID%2 ? clr = m_clrItemNom1 : clr = m_clrItemNom2;
			DrawItem(&mainG,rect,clr);
		}
		DrawText(&mainG,rect,text,clrText);
	}

	// 선택 -> 미선택 Item 영역 그리는 부분.
	if (!(lpDrawItemStruct->itemState & ODS_SELECTED) && (lpDrawItemStruct->itemAction & ODA_SELECT))
	{
		if (m_bModeOneColor == true)
		{
			DrawItem(&mainG,rect,m_clrItemNom1);
		}
		else
		{
			Color clr;
			lpDrawItemStruct->itemID%2 ? clr = m_clrItemNom1 : clr = m_clrItemNom2;
			DrawItem(&mainG,rect,clr);
		}
		DrawText(&mainG,rect,text,clrText);
	}

}
开发者ID:luckygg,项目名称:ListBoxEx,代码行数:62,代码来源:ListBoxEx.cpp

示例4: GetText

CString FORMULA_Formula::GetText(byte mode)
{
	int layer = 0;
	return GetText(mode, layer);
}
开发者ID:slawer,项目名称:krs_kal,代码行数:5,代码来源:FORMULA.cpp

示例5: GetText

			WString GuiBindableListView::ItemSource::GetTextValue(vint itemIndex)
			{
				return GetText(itemIndex);
			}
开发者ID:vczh-libraries,项目名称:GacUI,代码行数:4,代码来源:GuiBindableListControls.cpp

示例6: GetText

 const char32_t* LineEditData::GetViewText() const {
     return GetText().c_str() + scroll;
 }
开发者ID:Foe-of-Eternity,项目名称:Unvanquished,代码行数:3,代码来源:LineEditData.cpp

示例7: GetText

std::string CGUITextBox::GetDescription() const
{
  return GetText();
}
开发者ID:has12,项目名称:xbmc,代码行数:4,代码来源:GUITextBox.cpp

示例8: BeginScan

void
CBTCLStyler::Scan
	(
	std::istream&			input,
	const TokenExtra&	initData
	)
{
	BeginScan(input);

	const JString& text = GetText();

	JBoolean keepGoing;
	Token token;
	JFontStyle style;
	do
		{
		token = NextToken();
		if (token.type == kEOF)
			{
			break;
			}

		// save token starts

		if (token.type == kPredefinedWord ||
			token.type == kOtherWord ||
			token.type == kVariable ||
			token.type == kString ||
			token.type == kComment)
			{
			SaveTokenStart(TokenExtra());
			}

		// handle special cases

		if (token.type == kString ||
			token.type == kUnterminatedString)
			{
			ExtendCheckRangeForString(token.range);
			}

		// set the style

		const JIndex typeIndex = token.type - kWhitespace;
		if (token.type == kWhitespace)
			{
			style = GetDefaultFont().GetStyle();
			}
		else if (token.type == kComment       ||
				 token.type == kString        ||
				 token.type == kBrace         ||
				 token.type == kSquareBracket ||
				 token.type == kParenthesis)
			{
			style = GetTypeStyle(typeIndex);
			}
		else if (token.type < kWhitespace)
			{
			style = GetTypeStyle(kError - kWhitespace);
			}
		else
			{
			style = GetStyle(typeIndex, text.GetSubstring(token.range));
			}

		keepGoing = SetStyle(token.range, style);

		if (token.type == kString)
			{
			StyleEmbeddedVariables(token);
			}
		}
		while (keepGoing);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:74,代码来源:CBTCLStyler.cpp

示例9: SaveOptStringValue

void CUIEditBox::SaveValue(){
	CUIOptionsItem::SaveValue();
	SaveOptStringValue(GetText());
}
开发者ID:2asoft,项目名称:xray,代码行数:4,代码来源:UIEditBox.cpp

示例10: SelectAll

/**
 * Convenience for {@link Selection#selectAll}.
 */
ECode EditText::SelectAll()
{
    Selection::SelectAll(ISpannable::Probe(GetText().Get()));
    return NOERROR;
}
开发者ID:TheTypoMaster,项目名称:ElastosRDK5_0,代码行数:8,代码来源:EditText.cpp

示例11: ExtendSelection

/**
 * Convenience for {@link Selection#extendSelection}.
 */
ECode EditText::ExtendSelection(
    /* [in] */ Int32 index)
{
    Selection::ExtendSelection(ISpannable::Probe(GetText().Get()), index);
    return NOERROR;
}
开发者ID:TheTypoMaster,项目名称:ElastosRDK5_0,代码行数:9,代码来源:EditText.cpp

示例12: GetText

    void Field::AutoComplete() {
        //We want to complete in the middle of a command text with potentially multiple commands

        //Add slash prefix and get command text up to cursor
        if (GetText().empty() || (GetText()[0] != '/' && GetText()[0] != '\\')) {
            GetText().insert(GetText().begin(), '/');
            SetCursor(GetCursorPos() + 1);
        }
        std::string commandText = Str::UTF32To8(GetText().substr(1, GetCursorPos() - 1));

        //Split the command text and find the command to complete
        const char* commandStart = commandText.data();
        const char* commandEnd = commandText.data() + commandText.size();
        while (true) {
            const char* next = Cmd::SplitCommand(commandStart, commandEnd);
            if (next != commandEnd)
                commandStart = next;
            else
                break;
        }

        //Parse the arguments and get the list of candidates
        Cmd::Args args(std::string(commandStart, commandEnd));
        int argNum = args.Argc() - 1;
        std::string prefix;
        if (!args.Argc() || Str::cisspace(GetText()[GetCursorPos() - 1])) {
            argNum++;
        } else {
            prefix = args.Argv(argNum);
        }

        Cmd::CompletionResult candidates = Cmd::CompleteArgument(args, argNum);
        if (candidates.empty()) {
            return;
        }
        std::sort(candidates.begin(), candidates.end());
        candidates.erase(std::unique(candidates.begin(), candidates.end()), candidates.end());

        //Compute the longest common prefix of all the results
        int prefixSize = candidates[0].first.size();
        size_t maxCandidateLength = 0;
        for (auto& candidate : candidates) {
            prefixSize = std::min(prefixSize, Str::LongestIPrefixSize(candidate.first, candidates[0].first));
            maxCandidateLength = std::max(maxCandidateLength, candidate.first.length());
        }

        std::string completedArg(candidates[0].first, 0, prefixSize);

        //Help the user bash the TAB key, but not when completing paths
        if (candidates.size() == 1 && !Str::cisspace(GetText()[GetCursorPos()]) && !Str::IsSuffix("/", completedArg)) {
            completedArg += " ";
        }

        //Insert the completed arg
        std::u32string toInsert = Str::UTF8To32(completedArg);
        DeletePrev(prefix.size());
        GetText().insert(GetCursorPos(), toInsert);
        SetCursor(GetCursorPos() + toInsert.size());

        //Print the matches if it is ambiguous
        if (candidates.size() >= 2) {
            Com_Printf(S_COLOR_YELLOW "-> " S_COLOR_WHITE "%s\n", Str::UTF32To8(GetText()).c_str());
            for (const auto& candidate : candidates) {
                std::string filler(maxCandidateLength - candidate.first.length(), ' ');
                Com_Printf("   %s%s %s\n", candidate.first.c_str(), filler.c_str(), candidate.second.c_str());
            }
        }
    }
开发者ID:JacksonTech,项目名称:Unvanquished,代码行数:68,代码来源:ConsoleField.cpp

示例13: HistoryNext

 void Field::HistoryNext() {
     std::string current = Str::UTF32To8(GetText());
     NextLine(hist, current);
     SetText(Str::UTF8To32(current));
 }
开发者ID:JacksonTech,项目名称:Unvanquished,代码行数:5,代码来源:ConsoleField.cpp

示例14: ASSERT

void CListBox::GetText(int nIndex, CString& rString) const
{
	ASSERT(::IsWindow(m_hWnd));
	GetText(nIndex, rString.GetBufferSetLength(GetTextLen(nIndex)));
	rString.ReleaseBuffer();
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:6,代码来源:winctrl1.cpp

示例15: GetText

/*
 * Return true if the two tokens are equivalent in a 
 * Speech recognition way.
 */
bool Token::IsEquivalentTo(Token* token)
{
    string tok1;
    string tok2;
    
    if (segment->PerformCaseSensitiveAlignment()) //case sensitive
    {
        tok1 = GetText();
        tok2 = token->GetText();
    }
    else
    {
        tok1 = GetTextInLowerCase();
        tok2 = token->GetTextInLowerCase();
    }
	
	if (segment->AreFragmentsCorrect()) 
    {
		int otherFrag = token->GetFragmentStatus();
		
		if(fragment == NOT_FRAGMENT) 
        {
			if(otherFrag == NOT_FRAGMENT) 
            {
				return tok1 == tok2;
			}
            else if (otherFrag == BEGIN_FRAGMENT) 
            {
                return (tok1.find(tok2, 0) == 0);
			} 
            else 
            {
				return (tok1.find(tok2, tok1.size()-tok2.size()) != string::npos);					
			}
		}
        else if (fragment == BEGIN_FRAGMENT)
        {			
			if(otherFrag == NOT_FRAGMENT) 
            {
				return (tok2.find(tok1, 0) == 0);
			} 
            else if (otherFrag == BEGIN_FRAGMENT) 
            {
				 return ((tok1.find(tok2, 0) != string::npos) || (tok2.find(tok1, 0) != string::npos));
			}
            else 
            {
				return false;
			}
			
		} 
        else 
        { // fragment == END_FRAGMENT
			if(otherFrag == NOT_FRAGMENT)
            {
				return (tok2.find(tok1, tok2.size()-tok1.size()) != string::npos);
			} 
            else if (otherFrag == BEGIN_FRAGMENT) 
            {
				return false;
			} 
            else 
            {
				uint s1 = tok1.size();
				uint s2 = tok2.size();
				return (tok1.find(tok2, s1 - s2) != string::npos) || (tok2.find(tok1, s2 - s1) != string::npos);
			}
		}
	} 
    else 
    {
        return tok1 == tok2;
    }
}
开发者ID:AIDman,项目名称:Kaldi,代码行数:78,代码来源:token.cpp


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