Ejemplo n.º 1
0
static void
OnPaintListItem(Canvas &canvas, const PixelRect rc, unsigned i)
{
  if (waypoint_select_info.empty()) {
    assert(i == 0);

    const UPixelScalar line_height = rc.bottom - rc.top;
    const Font &name_font =
      *UIGlobals::GetDialogLook().list.font;
    canvas.SetTextColor(COLOR_BLACK);
    canvas.Select(name_font);
    canvas.text(rc.left + line_height + Layout::FastScale(2),
                rc.top + line_height / 2 - name_font.GetHeight() / 2,
                filter_data.IsDefined() || way_points.IsEmpty() ?
                _("No Match!") : _("Choose a filter or click here"));
    return;
  }

  assert(i < waypoint_select_info.size());

  const struct WaypointSelectInfo &info = waypoint_select_info[i];

  WaypointListRenderer::Draw(canvas, rc, *info.waypoint,
                             GeoVector(info.distance, info.direction),
                             UIGlobals::GetDialogLook(),
                             UIGlobals::GetMapLook().waypoint,
                             CommonInterface::GetMapSettings().waypoint);
}
Ejemplo n.º 2
0
static void
OnPaintListItem(Canvas &canvas, const RECT rc, unsigned i)
{
  if (WayPointSelectInfo.empty()) {
    assert(i == 0);

    canvas.text(rc.left + Layout::FastScale(2), rc.top + Layout::FastScale(2),
                filter_data.defined() || way_points.empty()
                ? _("No Match!")
                : _("Choose a filter or click here"));
    return;
  }

  assert(i < WayPointSelectInfo.size());

  PaintWaypoint(canvas, rc, WayPointSelectInfo[i]);
}