示例#1
0
static void curses_manage_filters(void)
{
   if (!wdg_filters) {
      wdg_create_object(&wdg_filters, WDG_LIST, WDG_OBJ_WANT_FOCUS);
   }
   wdg_set_size(wdg_filters, 1, 2, -1, SYSMSG_WIN_SIZE - 1);
   wdg_set_title(wdg_filters, "Select a filter...", WDG_ALIGN_LEFT);
   wdg_set_color(wdg_filters, WDG_COLOR_SCREEN, EC_COLOR);
   wdg_set_color(wdg_filters, WDG_COLOR_WINDOW, EC_COLOR);
   wdg_set_color(wdg_filters, WDG_COLOR_BORDER, EC_COLOR_BORDER);
   wdg_set_color(wdg_filters, WDG_COLOR_FOCUS, EC_COLOR_FOCUS);
   wdg_set_color(wdg_filters, WDG_COLOR_TITLE, EC_COLOR_TITLE);
   wdg_list_select_callback(wdg_filters, curses_select_filter);
   wdg_add_destroy_key(wdg_filters, CTRL('Q'), NULL);

   wdg_draw_object(wdg_filters);
   wdg_set_focus(wdg_filters);
   refresh_filter_list();
}
示例#2
0
/*
 * plugin management
 */
static void curses_plugin_mgmt(void)
{
   DEBUG_MSG("curses_plugin_mgmt");
   
   /* create the array for the list widget */
   curses_create_plug_array();
   
   /* if the object already exist, set the focus to it */
   if (wdg_plugin) {
      /* set the new array */
      wdg_list_set_elements(wdg_plugin, wdg_plugin_elements);
      return;
   }
   
   wdg_create_object(&wdg_plugin, WDG_LIST, WDG_OBJ_WANT_FOCUS);
   
   wdg_set_size(wdg_plugin, 1, 2, -1, SYSMSG_WIN_SIZE - 1);
   wdg_set_title(wdg_plugin, "Select a plugin...", WDG_ALIGN_LEFT);
   wdg_set_color(wdg_plugin, WDG_COLOR_SCREEN, EC_COLOR);
   wdg_set_color(wdg_plugin, WDG_COLOR_WINDOW, EC_COLOR);
   wdg_set_color(wdg_plugin, WDG_COLOR_BORDER, EC_COLOR_BORDER);
   wdg_set_color(wdg_plugin, WDG_COLOR_FOCUS, EC_COLOR_FOCUS);
   wdg_set_color(wdg_plugin, WDG_COLOR_TITLE, EC_COLOR_TITLE);

  
   /* set the elements */
   wdg_list_set_elements(wdg_plugin, wdg_plugin_elements);
   
   /* add the destroy callback */
   wdg_add_destroy_key(wdg_plugin, CTRL('Q'), curses_plug_destroy);
  
   /* add the callback */
   wdg_list_select_callback(wdg_plugin, curses_select_plugin);
   wdg_list_add_callback(wdg_plugin, ' ', curses_plugin_help);
     
   wdg_draw_object(wdg_plugin);
   
   wdg_set_focus(wdg_plugin);
}