コード例 #1
0
ファイル: laylib.cpp プロジェクト: AbdelghaniDr/mirror
void EscDraw::DrawSmartText(EscEscape& e)
{
	if(e.GetCount() < 3 || e.GetCount() > 7)
		e.ThrowError("wrong number of arguments in call to 'DrawSmartText'");
	int x = e.Int(0);
	int y = e.Int(1);
	int ii = 2;
	String text;
	if(ii < e.GetCount() && e[ii].IsArray())
		text = ToUtf8((WString)e[ii++]);
	int accesskey = ExtractAccessKey(text, text);
	Font font = StdFont().Height(11);
	if(ii < e.GetCount())
		font = FontEsc(e[ii++]);
	if(font.GetHeight() == 0)
#ifdef GUI_X11
		font.Height(12);
#else
		font.Height(11);
#endif
	Color color = SColorText;
	if(ii < e.GetCount())
		color = ColorEsc(e[ii++]);
	int cx = INT_MAX;
	if(ii < e.GetCount())
		cx = e.Int(ii++);
	::DrawSmartText(w, x, y, cx, text, font, color, accesskey);
}
コード例 #2
0
ファイル: Static.cpp プロジェクト: AbdelghaniDr/mirror
Label& Label::SetLabel(const char *_text)
{
	String text;
	int accesskey = ExtractAccessKey(_text, text);
	LabelBase::SetText(text);
	lbl.accesskey = accesskey;
	return *this;
}
コード例 #3
0
ファイル: ToolButton.cpp プロジェクト: koz4k/soccer
Bar::Item& ToolButton::Text(const char *txt)
{
	String newtext;
	ExtractAccessKey(txt, newtext);
	if(newtext != text) {
		text = newtext;
		UpdateTip();
		Refresh();
	}
	return *this;
}
コード例 #4
0
ファイル: laylib.cpp プロジェクト: AbdelghaniDr/mirror
void SIC_GetSmartTextSize(EscEscape& e)
{
	if(e.GetCount() < 1 || e.GetCount() > 2)
		e.ThrowError("wrong number of arguments in call to 'GetTextSize'");
	e.CheckArray(0);
	String text = ToUtf8((WString)(e[0]));
	ExtractAccessKey(text, text);
	Font font = StdFont();
	if(e.GetCount() > 1)
		font = FontEsc(e[1]);
	e = EscSize(GetSmartTextSize(text, font));
}
コード例 #5
0
ファイル: MenuItem.cpp プロジェクト: guowei8412/upp-mirror
Bar::Item& MenuItemBase::Text(const char *s)
{
	accesskey = ExtractAccessKey(s, text);
	Refresh();
	return *this;
}