Beispiel #1
0
static void ssd_widget_draw_one (SsdWidget w, int x, int y, int height) {

   RoadMapGuiRect rect;
   SsdSize size;

   ssd_widget_get_size (w, &size, NULL);

   if (w->flags & SSD_ALIGN_VCENTER) {
      y += (height - size.height) / 2;
   }

   w->position.x = x;
   w->position.y = y;


   if (size.width && size.height) {
      rect.minx = x;
      rect.miny = y;
      rect.maxx = x + size.width - 1;
      rect.maxy = y + size.height - 1;

#if 0
      if (!w->parent) printf("****** start draw ******\n");
      printf("draw - %s:%s x=%d-%d y=%d-%d ofset_x=%d ofset_y=%d \n", w->_typeid, w->name, rect.minx, rect.maxx, rect.miny, rect.maxy, w->offset_x, w->offset_y);
#endif
      if (!RecalculateWidgets && ssd_widget_rect_in_screen(&rect))
           w->draw(w, &rect, 0);

      if (w->children) ssd_widget_draw (w->children, &rect, w->flags);
   }
}
Beispiel #2
0
void ssd_dialog_redraw_screen_recursive( SsdDialog Dialog)
{
   RoadMapGuiRect rect;
   SsdWidget      container = Dialog->container;

   if( (SSD_DIALOG_FLOAT & container->flags) && Dialog->next)
      ssd_dialog_redraw_screen_recursive( Dialog->next);

   rect.minx = 0;
   rect.miny = 0;
   rect.maxx = roadmap_canvas_width() - 1;
   rect.maxy = roadmap_canvas_height() - 1;

   ssd_widget_reset_cache  ( container);
   ssd_widget_draw         ( container, &rect, 0);
}
Beispiel #3
0
static void draw_dialog (SsdDialog dialog) {

   if (!dialog) {
      return;

   } else {
      RoadMapGuiRect rect;
      rect.minx = 0;
#ifndef TOUCH_SCREEN
      if (is_screen_wide())
         rect.miny = 1;
      else
         rect.miny = roadmap_bar_top_height()+1;
      rect.maxx = roadmap_canvas_width() -1;
#else
      rect.miny = 1;
      rect.maxx = roadmap_canvas_width() -1;
#endif

#ifdef TOUCH_SCREEN
      rect.maxy = roadmap_canvas_height() - 1;
#else
      rect.maxy = roadmap_canvas_height() - 1 - roadmap_bar_bottom_height() ;
#endif

      ssd_widget_reset_cache (dialog->container);
      ssd_widget_draw (dialog->container, &rect, 0);

      if ((dialog->container->flags & SSD_CONTAINER_TITLE) && (dialog->scroll_container != NULL) && (dialog->scroll_container->offset_y < 0)){
         SsdWidget title;
         SsdSize size;
         title = ssd_widget_get (dialog->container, "title_bar");
         ssd_widget_get_size(title, &size, NULL);
#ifndef TOUCH_SCREEN
        if (!is_screen_wide()){
           rect.miny = roadmap_bar_top_height();
        }
        else{
           rect.miny = 0;
        }
#else
        rect.miny = 1;
#endif
        rect.maxy = rect.miny + size.height-1 ;
        title->draw(title, &rect, 0);
        rect.miny +=1;
        ssd_widget_draw(title->children, &rect, 0);
      }


#ifndef TOUCH_SCREEN
      roadmap_bar_draw_bottom_bar(TRUE);
      if ((dialog->container->flags & SSD_CONTAINER_TITLE) && (dialog->scroll_container != NULL) && (dialog->scroll_container->offset_y < 0))
        if (!is_screen_wide())
           roadmap_bar_draw_top_bar(TRUE);
#endif

      ssd_dialog_sort_tab_order( dialog);
      ssd_dialog_sort_tab_order_by_gui_position();
   }
}