static void OpenMenu(AG_HSVPal *pal, int x, int y) { if (pal->menu != NULL) CloseMenu(pal); pal->menu = AG_MenuNew(NULL, 0); pal->menu_item = AG_MenuNode(pal->menu->root, NULL, NULL); { #if 0 AG_MenuAction(pal->menu_item, _("Edit numerically"), NULL, EditNumValues, "%p", pal); #endif AG_MenuAction(pal->menu_item, _("Copy color"), agIconSave.s, CopyColor, "%p", pal); AG_MenuAction(pal->menu_item, _("Paste color"), agIconLoad.s, PasteColor, "%p", pal); AG_MenuAction(pal->menu_item, _("Complementary color"), NULL, SetComplementaryColor, "%p", pal); AG_MenuSeparator(pal->menu_item); AG_MenuFlags(pal->menu_item, _("Show RGB value"), agIconMagnifier.s, &pal->flags, AG_HSVPAL_SHOW_RGB, 0); AG_MenuFlags(pal->menu_item, _("Show HSV value"), agIconMagnifier.s, &pal->flags, AG_HSVPAL_SHOW_HSV, 0); } pal->menu->itemSel = pal->menu_item; pal->menu_win = AG_MenuExpand(pal, pal->menu_item, x, y); }
/* Display a generic popup menu for the display background. */ void AG_WM_BackgroundPopupMenu(AG_DriverSw *dsw) { AG_Menu *me; AG_MenuItem *mi; AG_Window *win; int nWindows = 0; me = AG_MenuNew(NULL, 0); mi = me->itemSel = AG_MenuNode(me->root, NULL, NULL); AG_FOREACH_WINDOW_REVERSE(win, dsw) { if (strcmp(win->caption, "win-popup") == 0) { continue; } AG_MenuAction(mi, win->caption[0] != '\0' ? win->caption : _("Untitled"), agIconWinMaximize.s, UnminimizeWindow, "%p", win); nWindows++; } if (nWindows > 0) { AG_MenuSeparator(mi); } #ifdef AG_DEBUG AG_MenuAction(mi, _("GUI debugger"), agIconMagnifier.s, OpenGuiDebugger, NULL); #endif AG_MenuAction(mi, _("Exit application"), agIconWinClose.s, ExitApplication, NULL); AG_MenuExpand(NULL, mi, AGDRIVER(dsw)->mouse->x + 4, AGDRIVER(dsw)->mouse->y + 4); }
void RG_FillMenu(void *p, AG_MenuItem *mi) { struct rg_fill_feature *fi = p; AG_MenuItem *mi_fill; mi_fill = AG_MenuAction(mi, _("Fill type"), rgIconFill.s, NULL, NULL); { AG_MenuAction(mi_fill, _("Solid fill"), rgIconFill.s, set_type, "%p, %i", fi, FILL_SOLID); AG_MenuAction(mi_fill, _("Horizontal gradient"), rgIconHGrad.s, set_type, "%p, %i", fi, FILL_HGRADIENT); AG_MenuAction(mi_fill, _("Vertical gradient"), rgIconVGrad.s, set_type, "%p, %i", fi, FILL_VGRADIENT); AG_MenuAction(mi_fill, _("Circular gradient"), rgIconCGrad.s, set_type, "%p, %i", fi, FILL_CGRADIENT); AG_MenuAction(mi_fill, _("Pattern"), rgIconTiling.s, set_type, "%p, %i", fi, FILL_PATTERN); } AG_MenuSeparator(mi); AG_MenuAction(mi, _("Swap gradient colors"), rgIconSwap.s, SwapGradientColors, "%p", fi); AG_MenuAction(mi, _("Invert colors"), rgIconInvert.s, InvertColors, "%p", fi); }
void Create_FileMenu(AG_MenuItem *parent) { AG_MenuItem *item; item = AG_MenuAction(parent , gettext("Quick Save"), NULL, OnQuickSave, NULL); item = AG_MenuAction(parent , gettext("Quick Load"), NULL, OnQuickLoad, NULL); AG_MenuSeparator(parent); item = AG_MenuAction(parent , gettext("Save As..."), NULL, OnSaveAs, NULL); item = AG_MenuAction(parent , gettext("Load"), NULL, OnLoadStatus, NULL); AG_MenuSeparator(parent); item = AG_MenuAction(parent, gettext("Cold Reset"), NULL, OnReset, NULL); item = AG_MenuAction(parent, gettext("Hot Reset"), NULL, OnHotReset, NULL); AG_MenuSeparator(parent); item = AG_MenuAction(parent, gettext("Boot Mode"), NULL, FileMenu_BootMode, NULL); AG_MenuSeparator(parent); item = AG_MenuAction(parent , gettext("Quit"), NULL, OnDestroy, NULL); // item = AG_MenuAction(parent , gettext("Quit"), NULL, AG_Quit, NULL); }