Пример #1
0
/* 
 * called to create the file dialog
 */
void wdg_create_file(struct wdg_object *wo)
{
   struct wdg_file_handle *ww;
   
   WDG_DEBUG_MSG("wdg_create_file");
   
   /* set the callbacks */
   wo->destroy = wdg_file_destroy;
   wo->resize = wdg_file_resize;
   wo->redraw = wdg_file_redraw;
   wo->get_focus = wdg_file_get_focus;
   wo->lost_focus = wdg_file_lost_focus;
   wo->get_msg = wdg_file_get_msg;

   WDG_SAFE_CALLOC(wo->extend, 1, sizeof(struct wdg_file_handle));
   
   /* 
    * remember the initial path.
    * this has to be restored after the file is selected 
    */
   ww = (struct wdg_file_handle *)wo->extend;
   getcwd(ww->initpath, PATH_MAX);
  
   /* default geometry */
   ww->x = 50;
   ww->y = 18;
}
Пример #2
0
/* 
 * called to create a window
 */
void wdg_create_scroll(struct wdg_object *wo)
{
   WDG_DEBUG_MSG("wdg_create_scroll");
   
   /* set the callbacks */
   wo->destroy = wdg_scroll_destroy;
   wo->resize = wdg_scroll_resize;
   wo->redraw = wdg_scroll_redraw;
   wo->get_focus = wdg_scroll_get_focus;
   wo->lost_focus = wdg_scroll_lost_focus;
   wo->get_msg = wdg_scroll_get_msg;

   WDG_SAFE_CALLOC(wo->extend, 1, sizeof(struct wdg_scroll));
}
Пример #3
0
/* 
 * called to create the menu
 */
void wdg_create_input(struct wdg_object *wo)
{
   WDG_DEBUG_MSG("wdg_create_input");
   
   /* set the callbacks */
   wo->destroy = wdg_input_destroy;
   wo->resize = wdg_input_resize;
   wo->redraw = wdg_input_redraw;
   wo->get_focus = wdg_input_get_focus;
   wo->lost_focus = wdg_input_lost_focus;
   wo->get_msg = wdg_input_get_msg;

   WDG_SAFE_CALLOC(wo->extend, 1, sizeof(struct wdg_input_handle));
}
Пример #4
0
/* 
 * called to create a window
 */
void wdg_create_dialog(struct wdg_object *wo)
{
   struct wdg_dialog *ww;

   WDG_DEBUG_MSG("wdg_create_dialog");
   
   /* set the callbacks */
   wo->destroy = wdg_dialog_destroy;
   wo->resize = wdg_dialog_resize;
   wo->redraw = wdg_dialog_redraw;
   wo->get_focus = wdg_dialog_get_focus;
   wo->lost_focus = wdg_dialog_lost_focus;
   wo->get_msg = wdg_dialog_get_msg;

   WDG_SAFE_CALLOC(wo->extend, 1, sizeof(struct wdg_dialog));

   ww = (struct wdg_dialog *)wo->extend;
  
   /* initialize the labels, the other fields are zeroed by the calloc */
   ww->buttons[0].label = " Ok ";
   ww->buttons[1].label = " Yes ";
   ww->buttons[2].label = " No ";
   ww->buttons[3].label = " Cancel ";
}