static SsdWidget _alert_widget(event_on_route_info *event) {
	SsdWidget w;
	event_on_route_info *data = (event_on_route_info *) calloc(1, sizeof(*data));
	*data = *event;
	w = ssd_widget_new("alert_widget", NULL, SSD_ALIGN_VCENTER);
	w->data = data;
	w->draw = _draw_alert;
	return w;
}
Beispiel #2
0
SsdWidget ssd_button_new (const char *name, const char *value,
                          const char **bitmap_names, int num_bitmaps,
                          int flags, SsdCallback callback) {

   int i;
   SsdWidget w;
   SsdClickOffsets btn_offsets = BUTTON_CLICK_OFFSETS_DEFAULT;
//   RoadMapImage image;
   struct ssd_button_data *data =
      (struct ssd_button_data *)calloc (1, sizeof(*data));


   w = ssd_widget_new (name, ssd_button_on_key_pressed, flags);

   w->_typeid = "Button";

   w->draw  = draw;
   w->release = release;
   w->flags = flags;
   w->data = data;

   data->state  = BUTTON_STATE_NORMAL;
   // TODO :: Load the bitmaps here
   for (i=0; i<num_bitmaps; i++)
   {
	   set_bitmap_name( data, i, bitmap_names[i] );

	   data->bitmap_images[i] = NULL;
   }


   w->callback = callback;

   set_value (w, value);

#ifdef TOUCH_SCREEN
   ssd_widget_set_pointer_force_click( w );
   ssd_widget_set_click_offsets( w, &btn_offsets );
#endif

   w->short_click  = ssd_button_short_click;
   w->long_click   = ssd_button_long_click;
   w->set_value    = set_value;

   return w;
}