예제 #1
0
extern void set_menus_front_end(void *arg, void *arg2, GtkTreePath *path,
				int type)
{
	GtkTreeView *tree_view = (GtkTreeView *)arg;
	popup_info_t *popup_win = (popup_info_t *)arg;
	GtkMenu *menu = (GtkMenu *)arg2;
	List button_list = (List)arg2;

	switch (type) {
	case TAB_CLICKED:
		make_fields_menu(NULL, menu, display_data_front_end,
				 SORTID_CNT);
		break;
	case ROW_CLICKED:
		make_options_menu(tree_view, path, menu,
				  options_data_front_end);
		break;
	case ROW_LEFT_CLICKED:
		highlight_grid(tree_view, SORTID_NODE_INX,
			       SORTID_COLOR_INX, button_list);
		break;
	case FULL_CLICKED:
	{
		GtkTreeModel *model = gtk_tree_view_get_model(tree_view);
		GtkTreeIter iter;
		if (!gtk_tree_model_get_iter(model, &iter, path)) {
			g_error("error getting iter from model\n");
			break;
		}

		popup_all_front_end(model, &iter, INFO_PAGE);

		break;
	}
	case POPUP_CLICKED:
		make_fields_menu(popup_win, menu,
				 popup_win->display_data, SORTID_CNT);
		break;
	default:
		g_error("UNKNOWN type %d given to set_fields\n", type);
	}
}
예제 #2
0
extern void set_menus_admin(void *arg, GtkTreePath *path,
                            GtkMenu *menu, int type)
{
    GtkTreeView *tree_view = (GtkTreeView *)arg;
    popup_info_t *popup_win = (popup_info_t *)arg;
    switch(type) {
    case TAB_CLICKED:
        make_fields_menu(NULL, menu, display_data_admin, SORTID_CNT);
        break;
    case ROW_CLICKED:
        make_options_menu(tree_view, path, menu, options_data_admin);
        break;
    case POPUP_CLICKED:
        make_fields_menu(popup_win, menu,
                         popup_win->display_data, SORTID_CNT);
        break;
    default:
        g_error("UNKNOWN type %d given to set_fields\n", type);
    }
}
예제 #3
0
파일: bb_info.c 프로젝트: HDOD/slurm
/* creates a popup windo depending on what is clicked */
extern void set_menus_bb(void *arg, void *arg2, GtkTreePath *path, int type)
{
	GtkTreeView *tree_view = (GtkTreeView *)arg;
	popup_info_t *popup_win = (popup_info_t *)arg;
	GtkMenu *menu = (GtkMenu *)arg2;

	switch(type) {
	case TAB_CLICKED:
		make_fields_menu(NULL, menu, display_data_bb, SORTID_CNT);
		break;
	case ROW_CLICKED:
		make_options_menu(tree_view, path, menu, options_data_bb);
		break;
	case ROW_LEFT_CLICKED:
		/* Highlights the node in th node grid */
		/* since we are not using this we will keep it empty */
		/* NOP */
		break;
	case FULL_CLICKED:
	{
		GtkTreeModel *model = gtk_tree_view_get_model(tree_view);
		GtkTreeIter iter;
		if (!gtk_tree_model_get_iter(model, &iter, path)) {
			g_error("error getting iter from model\n");
			break;
		}

		popup_all_bb(model, &iter, INFO_PAGE);

		break;
	}
	case POPUP_CLICKED:
		make_fields_menu(popup_win, menu,
				 popup_win->display_data, SORTID_CNT);
		break;
	default:
		g_error("UNKNOWN type %d given to set_fields\n", type);
	}
}
예제 #4
0
extern void set_menus_submit(void *arg, void *arg2,
			     GtkTreePath *path, int type)
{
	GtkTreeView *tree_view = (GtkTreeView *)arg;
	popup_info_t *popup_win = (popup_info_t *)arg;
	GtkMenu *menu = (GtkMenu *)arg2;
	/* List button_list = (List)arg2; */

	switch(type) {
	case TAB_CLICKED:
		make_fields_menu(NULL, menu, display_data_submit, SORTID_CNT);
		break;
	case ROW_CLICKED:
		make_options_menu(tree_view, path, menu, options_data_submit);
		break;
	case POPUP_CLICKED:
		make_fields_menu(popup_win, menu,
				 popup_win->display_data, SORTID_CNT);
		break;
	default:
		g_error("UNKNOWN type %d given to set_fields\n", type);
	}
}
예제 #5
0
파일: intro.c 프로젝트: callaa/luola
/* Load some graphics and create menus */
void init_intro (LDAT *miscfile) {
    struct MenuDrawingOptions mainmenu, optionsmenu;
    struct MenuValue optsval;
    int logoy=10;
    int yoffset=250;
    int optionsy=80;
    /* Load the input device icons */
    keyb_icon = load_image_ldat (miscfile, 1, T_ALPHA, "KEYBOARD", 0);
    pad_icon = load_image_ldat (miscfile, 1, T_ALPHA, "PAD", 0);

    switch(luola_options.videomode) {
        case VID_640:
            yoffset = 250;
            logoy = 10;
            optionsy = 80;
            break;
        case VID_800:
            yoffset = 280;
            logoy = 40;
            optionsy = 120;
            break;
        case VID_1024:
            yoffset = 380;
            logoy = 90;
            optionsy = 220;
            break;
    }

    /* Menu drawing options */
    mainmenu.area.x = 0;
    mainmenu.area.y = yoffset;
    mainmenu.area.w = screen->w;
    mainmenu.area.h = screen->h-yoffset;
    mainmenu.spacing = MENU_SPACING;
    mainmenu.selection_color = map_rgba(0,128,255,255);
    mainmenu.left_offset = screen->h/2;

    optionsmenu = mainmenu;
    optionsmenu.area.y = optionsy;
    optionsmenu.left_offset = 130;

    /* Load graphics */
    intr_logo = load_image_ldat (miscfile, 1, 2, "LOGO", 0);
    if (intr_logo) {
        intr_logo_rect.x = screen->w / 2 - intr_logo->w / 2;
        intr_logo_rect.y = logoy;
        centered_string (intr_logo, Smallfont, intr_logo->h - 20, VERSION,
                         font_color_red);
    }

    /* Build main menu */
    intro_menu = create_menu(0,NULL,&mainmenu,
            "enabled","disabled",INTRO_RVAL_EXIT);
    add_menu_item(intro_menu,MNU_ITEM_RETURN,INTRO_RVAL_STARTGAME,
            menu_txt_label("Start game"),MnuNullValue);
    optsval.value = (int*)make_options_menu(intro_menu,&optionsmenu);
    add_menu_item(intro_menu,MNU_ITEM_SUBMENU,0,
            menu_txt_label("Settings"),optsval);
    add_menu_item(intro_menu,MNU_ITEM_RETURN,INTRO_RVAL_EXIT,
            menu_txt_label("Exit"),MnuNullValue);

    intro_menu->predraw = draw_logo;

    /* Misc. variable initialization */
    intr_message.show = 0;
    intr_message.text = NULL;
    intr_message.setkey = NULL;
    intr_message.framecolor = map_rgba(200,80,80,220);
    intr_message.fillcolor = map_rgba(0,0,0,220);
}