Ejemplo n.º 1
0
int ssd_widget_pointer_down (SsdWidget widget, const RoadMapGuiPoint *point) {

	SsdWidget widget_next = widget;

   if (!widget) return 0;

   /* Find clickable widget and remember.
    * Drag end will check if the release event was at the vicinity of this widget
    */
   PressedPointerPoint = *point;


   /* Check all the overlapping ( in terms of click area ) widgets
   * First widget, that it or its children handle the event - wins
   */
   while ( widget_next != NULL )
   {
	   if ( ssd_widget_contains_point( widget_next, point, TRUE ) )
	   {
		   if ( ( widget_next->pointer_down && widget_next->pointer_down( widget_next, point ) ) ||
				   ( widget_next->children && ssd_widget_pointer_down( widget_next->children, point ) ) )
		   {
			  return 1;
		   }
	   }
	   widget_next = widget_next->next;
   }
   return 0;
}
Ejemplo n.º 2
0
static int ssd_dialog_pressed (RoadMapGuiPoint *point) {
   SsdWidget container = RoadMapDialogCurrent->container;

   if (!ssd_widget_find_by_pos (container, point, TRUE )) {
      LastPointerPoint.x = -1;
      return 0;
   }
   else{
      LastPointerPoint = *point;
   }
   if (!RoadMapDialogKeyEnabled) {
      LastPointerPoint.x = -1;
      return 0;
   }

   if ((RoadMapDialogCurrent->scroll_container != NULL) && (RoadMapDialogCurrent->scroll)){
      ssd_dialog_drag_start(point);
   }


   if ( ssd_widget_pointer_down (RoadMapDialogCurrent->container, point) )
   {
	   roadmap_screen_redraw ();

	   return 1;
   }

   return 1;
}