Пример #1
0
/* Set the textbox label (C string). */
void
AG_TextboxSetLabelS(AG_Textbox *tb, const char *s)
{
	AG_ObjectLock(tb);
	if (tb->lbl != NULL) {
		AG_LabelTextS(tb->lbl, s);
	} else {
		tb->lbl = AG_LabelNewS(tb, 0, s);
		AG_LabelSetPadding(tb->lbl, -1, 10, -1, -1);
	}
	AG_ObjectUnlock(tb);
}
Пример #2
0
void AGOL_Settings::OdamexPathSelectorOk(AG_Event *event)
{
	char *odapath = AG_STRING(2);

	// If a path came back set the odamex path label
	if(odapath && strlen(odapath) > 0)
		AG_LabelTextS(OdamexPathLabel, odapath);

	DeleteEventHandler(DirSelOkHandler);

	delete DirSel;
	DirSel = NULL;
}
Пример #3
0
/* Set the label text (C string). */
void
AG_ButtonTextS(AG_Button *bu, const char *label)
{
	AG_ObjectLock(bu);
	if (bu->surface != -1) {
		AG_ButtonSurface(bu, NULL);
	}
	if (bu->lbl == NULL) {
		bu->lbl = AG_LabelNewS(bu, 0, label);
		AG_LabelJustify(bu->lbl, bu->justify);
		AG_LabelValign(bu->lbl, bu->valign);
	} else {
		AG_LabelTextS(bu->lbl, label);
	}
	AG_ObjectUnlock(bu);
	AG_Redraw(bu);
}
Пример #4
0
AG_Label *AGOL_Settings::CreateOdamexPathLabel(void *parent)
{
	AG_Label *oplabel;
	string    oppath;

	oplabel = AG_LabelNewS(parent, AG_LABEL_FRAME | AG_LABEL_EXPAND, "");
	AG_LabelValign(oplabel, AG_TEXT_MIDDLE);

	GuiConfig::Read("OdamexPath", oppath);

	if(oppath.size())
		AG_LabelTextS(oplabel, oppath.c_str());

	AG_ButtonNewFn(parent, 0, "Browse", EventReceiver, "%p",
			RegisterEventHandler((EVENT_FUNC_PTR)&AGOL_Settings::OnBrowseOdamexPath));

	return oplabel;
}
Пример #5
0
/* Set the label text (format string). */
void
AG_BoxSetLabelS(AG_Box *box, const char *s)
{
	AG_ObjectLock(box);
	if (s != NULL) {
		if (box->lbl == NULL) {
			box->lbl = AG_LabelNewS(box, 0, s);
			AG_SetStyle(box->lbl, "font-size", "80%");
		} else {
			AG_LabelTextS(box->lbl, s);
		}
	} else {
		AG_ObjectDetach(box->lbl);
		AG_ObjectDestroy(box->lbl);
		box->lbl = NULL;
	}
	AG_Redraw(box);
	AG_ObjectUnlock(box);
}