/* handle simple imperative messages with no arguments */ static LVAL simple_menu_message P1C(int, which) { LVAL menu; LVAL arg = NIL; int set = FALSE; menu = xlgaobject(); if (which == 'E') { if (moreargs()) { set = TRUE; arg = (xlgetarg() != NIL) ? s_true : NIL; } } xllastarg(); switch (which) { case 'A': StMObAllocate(menu); break; case 'D': StMObDispose(menu); break; case 'E': if (set) { set_slot_value(menu, s_enabled, arg); StMObEnable(menu, (arg != NIL)); } return(slot_value(menu, s_enabled)); case 'I': StMObInstall(menu); break; case 'R': StMObRemove(menu); break; case 'U': update_menu(menu); break; default: xlfail("unknown message"); } return(NIL); }
static void up_btn() { // Depending on the state what do we do? switch (submenu_state) { case VIEW_SET_MODE: as_config.mode++; as_config.mode %= 3; change_mode(as_config.mode); update_menu(); break; case VIEW_SET_PARAMS: _printf(0,LCD_SEG_L1_3_0 , "%04x", as_read_register(ADDR_CTRL)); break; case VIEW_STATUS: _printf(0,LCD_SEG_L1_3_0, "%1u", as_status.all_flags); break; case VIEW_AXIS: display_chars(0,LCD_SEG_L1_3_0 , "TODO", SEG_SET); break; default: break; } /* update menu screen */ lcd_screen_activate(0); }
Err menu(t_info *info) { preload_menu(info); load_menu(info); info->exit = 0; info->menu_over = 0; while (!info->exit) { SDL_Delay(10); while (SDL_PollEvent(&(info->mysdl.event))) { if (info->mysdl.event.type == SDL_MOUSEMOTION) menu_mousemotion(info, info->mysdl.event); else if (info->mysdl.event.type == SDL_MOUSEBUTTONDOWN) menu_mousebutton(info, info->mysdl.event); else if (info->mysdl.event.type == SDL_KEYDOWN) menu_key(info, info->mysdl.event); else if (info->mysdl.event.type == SDL_VIDEORESIZE) { resize_window(info, info->mysdl.event.resize.w, info->mysdl.event.resize.h); update_menu(info); } else if (info->mysdl.event.type == SDL_QUIT) info->exit = 1; break; } } free_menu(info); SDL_Quit(); return (0); }
void start_plugin() { print_debug("%s : start_plugin\n", GGadu_PLUGIN_NAME); register_signal(update_handler, "update config"); register_signal(update_handler, "get current version"); print_debug("%s : create menu\n", GGadu_PLUGIN_NAME); menu_updatemenu = update_menu(); signal_emit(GGadu_PLUGIN_NAME, "gui register menu", menu_updatemenu, "main-gui"); if (timer != -1) g_source_remove(timer); /* initialize timers */ if ((gint) ggadu_config_var_get(update_handler, "check_automatically")) { timer = g_timeout_add(update_get_interval(), update_check, NULL); print_debug("%s : Timer ID set to %d\n", GGadu_PLUGIN_NAME, timer); } else { print_debug("%s : Resetting timer!\n", GGadu_PLUGIN_NAME); timer = -1; } if ((gint) ggadu_config_var_get(update_handler, "check_on_startup")) /* wait a while before looking for updates */ g_timeout_add(3000, update_check_on_startup, NULL); }
int main(int argc, char** argv) { // BMXPUPBA = BMXPFMSZ - 0x4000; // sizeof(presets) = 17820 bits // 0x5000 = 20480 INTCONbits.MVEC = TRUE; //Multi-vector interrupt mode asm volatile("ei"); //Autorise les macro-ASM (interruptions) // memcpy(&presets, flash_adress, sizeof(presets)); init_Menus(); init_pins(); init_lcd(); init_preset(); create_tab_env(); create_tab_frequenz(); create_tab_period(); init_MIDI(); // init_pwm(); init_dac(); update_menu(); while (42) { boutons(); processEncodeur(); WDTCONbits.WDTCLR = 1; } return (0); }
static void update_cmdline_size(void) { int d; d = (input_stat.prompt_wid + input_stat.len + 1 + line_width - 1)/line_width; if(d >= getmaxy(status_bar)) { int y = getmaxy(stdscr); mvwin(status_bar, y - d, 0); wresize(status_bar, d, line_width); if(prev_mode != MENU_MODE) { if(cfg.last_status) { mvwin(stat_win, y - d - 1, 0); wrefresh(stat_win); } } else { wresize(menu_win, y - d, getmaxx(stdscr)); update_menu(); wrefresh(menu_win); } } }
static void pluma_encodings_combo_box_init (PlumaEncodingsComboBox *menu) { GtkCellRenderer *text_renderer; menu->priv = PLUMA_ENCODINGS_COMBO_BOX_GET_PRIVATE (menu); menu->priv->store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN); /* Setup up the cells */ text_renderer = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (menu), text_renderer, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (menu), text_renderer, "text", NAME_COLUMN, NULL); gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (menu), separator_func, NULL, NULL); menu->priv->changed_id = g_signal_connect (menu, "changed", G_CALLBACK (add_or_remove), menu->priv->store); update_menu (menu); }
void boutons(void) { u8 k; status_bt = (_SW5) + (_SW4 << 1) + (_SW3 << 2) + (_SW2 << 3) + (_SW1 << 4); k = ((prev_status_bt ^ status_bt) ^ 0); if (prev_status_bt != status_bt && (k & status_bt)) { if (k == 0x01) cur_menu = (cur_menu == 0 ? 1 : 0); else if (k == 0x02) cur_menu = (cur_menu == 2 ? 3 : 2); else if (k == 0x04) cur_menu = (cur_menu == 4 ? 5 : 4); else if (k == 0x08) cur_menu = (cur_menu == 6 ? 7 : 6); else if (k == 0x10 && cur_menu < 8) cur_menu = 8; else if (k == 0x10 && saveLoad && cur_menu != 9) cur_menu = 9; else if (k == 0x10 && saveLoad) validSavePreset(); else if (k == 0x10 && !saveLoad) preset_load(curBank, curPreset); light_led(); update_menu(); } prev_status_bt = status_bt; }
static void cmd_ctrl_m(key_info_t key_info, keys_info_t *keys_info) { static menu_info *saved_menu; *mode = NORMAL_MODE; saved_menu = menu; if(execute_menu_cb(curr_view, menu) != 0) { *mode = MENU_MODE; menu_redraw(); return; } if(*mode != MENU_MODE) { reset_popup_menu(saved_menu); } else if(menu != saved_menu) { reset_popup_menu(saved_menu); update_menu(); } if(was_redraw) update_screen(UT_FULL); else update_all_windows(); }
static void cmd_ctrl_m(key_info_t key_info, keys_info_t *keys_info) { static menu_info *saved_menu; vle_mode_set(NORMAL_MODE, VMT_PRIMARY); saved_menu = menu; if(menu->execute_handler != NULL && menu->execute_handler(curr_view, menu)) { vle_mode_set(MENU_MODE, VMT_PRIMARY); menu_redraw(); return; } if(!vle_mode_is(MENU_MODE)) { reset_popup_menu(saved_menu); } else if(menu != saved_menu) { reset_popup_menu(saved_menu); update_menu(); } update_ui_on_leaving(); }
int main(void) { sys_setup_keys(); u8g_setup(); menu_redraw_required = 1; for(;;) { sys_debounce_key(); if ( menu_redraw_required != 0 ) { u8g_FirstPage(&u8g); do { draw_menu(); } while ( u8g_NextPage(&u8g) ); menu_redraw_required = 0; } update_menu(); } }
static void cmd_zH(key_info_t key_info, keys_info_t *keys_info) { if(menu->hor_pos == 0) return; menu->hor_pos = MAX(0, menu->hor_pos - (getmaxx(menu_win) - 4)); update_menu(); }
static void cmd_zl(key_info_t key_info, keys_info_t *keys_info) { if(key_info.count == NO_COUNT_GIVEN) key_info.count = 1; menu->hor_pos += key_info.count; update_menu(); }
static gboolean on_menu_press_cb(GtkWidget* widget, GdkEvent* event, gpointer data) { menuBars menu = data; gdk_threads_enter(); update_menu(menu->win, menu); gdk_threads_leave(); return FALSE; }
void update_menubar(FskGtkWindow win) { menuBars menu = win->menu; while (menu) { update_menu(win, menu); menu = menu->next; } }
// This change the sub menu static void num_pressed() { // Change the sub menu code submenu_state++; submenu_state %= VIEWMODE_MAX; // now update the menu update_menu(); }
void layout_change (void) { setup_panels (); /* update the main menu, because perhaps there was a change in the way how the panel are split (horizontal/vertical), and a change of menu visibility. */ update_menu (); load_hint (1); }
static void cmd_zh(key_info_t key_info, keys_info_t *keys_info) { if(menu->hor_pos == 0) return; if(key_info.count == NO_COUNT_GIVEN) key_info.count = 1; menu->hor_pos = MAX(0, menu->hor_pos - key_info.count); update_menu(); }
void menu_rc_setup(void) { uint8_t cursor = LINE0; uint8_t top = RCSTART; uint8_t temp = 0; int8_t values[RCITEMS]; menu_range_t range; uint8_t i = 0; uint8_t text_link; while(button != BACK) { // Load values from eeprom memcpy(&values[0],&Config.TxSeq,sizeof(int8_t) * RCITEMS); // Print menu print_menu_items(top, RCSTART, &values[0], RCITEMS, (prog_uchar*)rc_menu_ranges, RCOFFSET, (prog_uchar*)RCMenuText, cursor); // Handle menu changes update_menu(RCITEMS, RCSTART, button, &cursor, &top, &temp); range = get_menu_range ((prog_uchar*)rc_menu_ranges, temp - RCSTART); if (button == ENTER) { text_link = pgm_read_byte(&RCMenuText[temp - RCSTART]); values[temp - RCSTART] = do_menu_item(temp, values[temp - RCSTART], range, 0, text_link); } // Update value in config structure memcpy(&Config.TxSeq,&values[0],sizeof(int8_t) * RCITEMS); // Update Ch7. mixer with source from Config.FlapChan if in Aeroplane mode if (Config.MixMode == AEROPLANE) { Config.Channel[CH7].source_a = Config.FlapChan; } if (button == ENTER) { // Update channel sequence for (i = 0; i < MAX_RC_CHANNELS; i++) { if (Config.TxSeq == JRSEQ) { Config.ChannelOrder[i] = pgm_read_byte(&JR[i]); } else if (Config.TxSeq == FUTABASEQ) { Config.ChannelOrder[i] = pgm_read_byte(&FUTABA[i]); } } Save_Config_to_EEPROM(); // Save value and return } } }
void menu_main(void) { static uint8_t main_cursor = LINE0; // These are now static so as to remember the main menu position static uint8_t main_temp = 0; static uint8_t old_menu = 0; button = NONE; // Wait until user's finger is off button 1 Wait_BUTTON1(); while(button != BACK) { // Clear buffer before each update clear_buffer(buffer); // Print menu print_menu_frame(0); // Frame for (uint8_t i = 0; i < 4; i++) { LCD_Display_Text(main_top+i,(const unsigned char*)Verdana8,ITEMOFFSET,(uint8_t)pgm_read_byte(&lines[i])); // Lines } print_cursor(main_cursor); // Cursor write_buffer(buffer,1); // Poll buttons when idle poll_buttons(true); // Handle menu changes update_menu(MAINITEMS, MAINSTART, 0, button, &main_cursor, &main_top, &main_temp); // If main menu item has changed, reset sub-menu positions // and flag to sub-menus that positions need to be reset if (main_temp != old_menu) { cursor = LINE0; menu_temp = 0; old_menu = main_temp; menu_flag = 1; } // If ENTER pressed, jump to menu if (button == ENTER) { do_main_menu_item(main_temp); button = NONE; // Wait until user's finger is off button 1 Wait_BUTTON1(); } } }
void update_menus(WMenuData *mdata) { WMenu *menu; menu=(WMenu*)subthing((WThing*)SCREEN, WTHING_MENU); while(menu!=NULL){ if(menu->data==mdata) update_menu(menu); menu=(WMenu*)next_thing((WThing*)menu, WTHING_MENU); } }
std::map<int, Gtk::Widget*> BacklinksNoteAddin::get_actions_popover_widgets() const { auto widgets = NoteAddin::get_actions_popover_widgets(); auto menu_button = gnote::utils::create_popover_submenu_button("backlinks-menu", _("What links here?")); gnote::utils::add_item_to_ordered_map(widgets, gnote::BACKLINKS_ORDER, menu_button); auto submenu = gnote::utils::create_popover_submenu("backlinks-menu"); update_menu(submenu); gnote::utils::add_item_to_ordered_map(widgets, 100000, submenu); return widgets; }
static void cmd_zt(key_info_t key_info, keys_info_t *keys_info) { if(can_scroll_menu_down(menu)) { if(menu->len - menu->pos >= menu->win_rows - 3 + 1) menu->top = menu->pos; else menu->top = menu->len - (menu->win_rows - 3 + 1); update_menu(); } }
static void cmd_zb(key_info_t key_info, keys_info_t *keys_info) { if(can_scroll_menu_up(menu)) { if(menu->pos < menu->win_rows) menu->top = 0; else menu->top = menu->pos - (menu->win_rows - 3); update_menu(); } }
static void dialog_response_cb (GtkDialog *dialog, gint response_id, PlumaEncodingsComboBox *menu) { if (response_id == GTK_RESPONSE_OK) { update_menu (menu); } gtk_widget_destroy (GTK_WIDGET (dialog)); }
static void cmd_ctrl_d(key_info_t key_info, keys_info_t *keys_info) { const int s = get_effective_menu_scroll_offset(menu); clean_menu_position(menu); menu->top += DIV_ROUND_UP(menu->win_rows - 3, 2); menu->pos += DIV_ROUND_UP(menu->win_rows - 3, 2); if(cfg.scroll_off > 0 && menu->pos - menu->top < s) menu->pos += s - (menu->pos - menu->top); update_menu(); }
static void cmd_ctrl_y(key_info_t key_info, keys_info_t *keys_info) { if(can_scroll_menu_up(menu)) { int off = MAX(cfg.scroll_off, 0); if(menu->pos >= menu->top + menu->win_rows - 3 - off) menu->pos = menu->top - 1 + menu->win_rows - 3 - off; menu->top--; update_menu(); } }
static void cmd_ctrl_e(key_info_t key_info, keys_info_t *keys_info) { if(can_scroll_menu_down(menu)) { int off = MAX(cfg.scroll_off, 0); if(menu->pos <= menu->top + off) menu->pos = menu->top + 1 + off; menu->top++; update_menu(); } }
bool Mixer::command_new ( const char *path, const char *display_name ) { if ( ! Project::create( path, "" ) ) return false; if ( display_name ) Project::name( display_name ); update_menu(); return true; // fl_alert( "Error creating project!" ); }
void menu_battery(void) { uint8_t cursor = LINE0; uint8_t top = BATTSTART; uint8_t temp = 0; int16_t values[BATTITEMS]; menu_range_t range; uint8_t text_link = 0; uint8_t temp_cells = 0; uint16_t temp_minvoltage = 0; while(button != BACK) { // Load values from eeprom memcpy(&values[0],&Config.BatteryType,sizeof(int16_t) * BATTITEMS); // Save pre-edited values temp_cells = Config.BatteryCells; temp_minvoltage = Config.MinVoltage; // Print menu print_menu_items_16(top, BATTSTART, &values[0], (prog_uchar*)batt_menu_ranges, BATTOFFSET, (prog_uchar*)BattMenuText, cursor); // Handle menu changes update_menu(BATTITEMS, BATTSTART, button, &cursor, &top, &temp); range = get_menu_range ((prog_uchar*)batt_menu_ranges, temp - BATTSTART); if (button == ENTER) { text_link = pgm_read_byte(&BattMenuText[temp - BATTSTART]); values[temp - BATTSTART] = do_menu_item(temp, values[temp - BATTSTART], range, 0, text_link); } // See if cell number or min_volts has changed if ((temp_cells != values[1]) || (temp_minvoltage != values[4])) { values[2] = values[1] * values[4]; Config.PowerTrigger = values[2]; } // Update value in config structure memcpy(&Config.BatteryType,&values[0],sizeof(int16_t) * BATTITEMS); if (button == ENTER) { Save_Config_to_EEPROM(); // Save value and return } } }