static void FileMenu_BootMode(AG_Event *event) { AG_Menu *self = (AG_Menu *)AG_SELF(); AG_MenuItem *item = (AG_MenuItem *)AG_SENDER(); AG_Window *w; AG_Button *btn[3]; AG_Box *box; AG_Box *box2; char *label; AG_Label *lbl; w = AG_WindowNew(AG_WINDOW_NOMINIMIZE | AG_WINDOW_NOMAXIMIZE | FILEDIALOG_WINDOW_DEFAULT); AG_WindowSetMinSize(w, 230, 80); label = gettext("Select mode (Notice: If select , reboot.)"); AG_WindowSetMinSize(w, 230, 80); box = AG_BoxNewHorizNS(w, AG_BOX_HFILL); AG_WidgetSetSize(box, 230, 32); lbl = AG_LabelNew(AGWIDGET(box), AG_LABEL_EXPAND, "%s", label); box = AG_BoxNewVert(w, AG_BOX_HFILL); AG_WidgetSetSize(box, 230, 32); box2 = AG_BoxNewHoriz(box, 0); btn[0] = AG_ButtonNewFn (AGWIDGET(box2), 0, gettext("BASIC"), SetBootMode, "%i", FALSE); box2 = AG_BoxNewVert(box, 0); btn[1] = AG_ButtonNewFn (AGWIDGET(box2), 0, gettext("DOS"), SetBootMode, "%i", TRUE); box2 = AG_BoxNewVert(box, 0); btn[2] = AG_ButtonNewFn (AGWIDGET(box2), 0, gettext("Cancel"), OnPushCancel, NULL); AG_ActionFn(AGWIDGET(w), "window-close", OnPushCancel, NULL); AG_WindowSetCaption(w, gettext("Boot Mode")); AG_WindowShow(w); }
static void * Edit(void *p, VG_View *vv) { VG_Text *vt = p; AG_Box *box = AG_BoxNewVert(NULL, AG_BOX_EXPAND); AG_Pane *vPane; AG_Textbox *tb; AG_Box *bAl, *bAlv; vPane = AG_PaneNewVert(box, AG_PANE_EXPAND); AG_LabelNew(vPane->div[0], 0, _("Text: ")); tb = AG_TextboxNewS(vPane->div[0], AG_TEXTBOX_MULTILINE|AG_TEXTBOX_EXPAND, NULL); AG_TextboxBindUTF8(tb, vt->text, sizeof(vt->text)); bAlv = AG_BoxNewVertNS(vPane->div[1], AG_BOX_HFILL|AG_BOX_FRAME); AG_LabelNew(bAlv, 0, _("Alignment: ")); bAl = AG_BoxNewHorizNS(bAlv, AG_BOX_HFILL|AG_BOX_HOMOGENOUS); AG_ButtonNewFn(bAl, 0, _("TL"), SetAlign, "%p,%i", vt, VG_ALIGN_TL); AG_ButtonNewFn(bAl, 0, _("TC"), SetAlign, "%p,%i", vt, VG_ALIGN_TC); AG_ButtonNewFn(bAl, 0, _("TR"), SetAlign, "%p,%i", vt, VG_ALIGN_TR); bAl = AG_BoxNewHorizNS(bAlv, AG_BOX_HFILL|AG_BOX_HOMOGENOUS); AG_ButtonNewFn(bAl, 0, _("ML"), SetAlign, "%p,%i", vt, VG_ALIGN_ML); AG_ButtonNewFn(bAl, 0, _("MC"), SetAlign, "%p,%i", vt, VG_ALIGN_MC); AG_ButtonNewFn(bAl, 0, _("MR"), SetAlign, "%p,%i", vt, VG_ALIGN_MR); bAl = AG_BoxNewHorizNS(bAlv, AG_BOX_HFILL|AG_BOX_HOMOGENOUS); AG_ButtonNewFn(bAl, 0, _("BL"), SetAlign, "%p,%i", vt, VG_ALIGN_BL); AG_ButtonNewFn(bAl, 0, _("BC"), SetAlign, "%p,%i", vt, VG_ALIGN_BC); AG_ButtonNewFn(bAl, 0, _("BR"), SetAlign, "%p,%i", vt, VG_ALIGN_BR); AG_ButtonNewFn(vPane->div[1], AG_BUTTON_HFILL, _("Select font"), SelectFontDlg, "%p,%p", vt, vv); AG_CheckboxNewFlag(vPane->div[1], 0, _("Underline"), &vt->fontFlags, VG_TEXT_UNDERLINE); AG_CheckboxNewFlag(vPane->div[1], 0, _("Scale to view"), &vt->fontFlags, VG_TEXT_SCALED); return (box); }