static int ssd_dialog_short_click (RoadMapGuiPoint *point) { int res; if (LastPointerPoint.x < 0) { SsdWidget container = RoadMapDialogCurrent->container; if (ssd_widget_find_by_pos (container, point, TRUE )) { //return 1; LastPointerPoint = *point; } else { return 0; } } res = ssd_widget_short_click (RoadMapDialogCurrent->container, &LastPointerPoint); if (!res && RoadMapDialogCurrent->scroll_container) res = ssd_widget_short_click (RoadMapDialogCurrent->scroll_container, &LastPointerPoint); // TEMPORARY SOLUTION // TODO :: Add option to make the container as clicked anyway if ( !res && ( ssd_widget_find_by_pos ( RoadMapDialogCurrent->container, &LastPointerPoint, TRUE ) || ssd_widget_find_by_pos ( RoadMapDialogCurrent->scroll_container, &LastPointerPoint, TRUE ) ) ) { res = 1; } roadmap_screen_redraw (); return res; }
int ssd_widget_short_click (SsdWidget widget, const RoadMapGuiPoint *point) { SsdWidget widget_next = widget; if (!widget) { return 0; } /* 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->short_click && widget_next->short_click( widget_next, point ) ) || ( widget_next->children && ssd_widget_short_click( widget_next->children, point ) ) ) { return 1; } } widget_next = widget_next->next; } return 0; }