void
AirspaceListWidget::UpdateList()
{
  AirspaceFilterData data;
  data.Clear();

  if (dialog_state.type != WILDCARD)
    data.cls = (AirspaceClass)dialog_state.type;

  const TCHAR *name_filter = filter_widget.GetValueString(NAME);
  if (!StringIsEmpty(name_filter))
    data.name_prefix = name_filter;

  if (dialog_state.direction != WILDCARD) {
    data.direction = dialog_state.direction == 0
      ? CommonInterface::Basic().attitude.heading
      : Angle::Degrees(dialog_state.direction);
  }

  if (positive(dialog_state.distance))
    data.distance = dialog_state.distance;

  items = FilterAirspaces(*airspaces,
                          CommonInterface::Basic().location,
                          data);

  GetList().SetLength(std::max((size_t)1, items.size()));
  GetList().Invalidate();
}
Beispiel #2
0
static void
UpdateList()
{
  AirspaceFilterData data;
  data.Clear();

  if (dialog_state.type != WILDCARD)
    data.cls = (AirspaceClass)dialog_state.type;

  const TCHAR *name_filter = name_control->GetDataField()->GetAsString();
  if (!StringIsEmpty(name_filter))
    data.name_prefix = name_filter;

  if (dialog_state.direction != WILDCARD) {
    data.direction = dialog_state.direction == 0
      ? CommonInterface::Basic().attitude.heading
      : Angle::Degrees(dialog_state.direction);
  }

  if (positive(dialog_state.distance))
    data.distance = dialog_state.distance;

  airspace_list = FilterAirspaces(*airspaces,
                                  CommonInterface::Basic().location,
                                  data);

  airspace_list_control->SetLength(std::max((size_t)1, airspace_list.size()));
  airspace_list_control->Invalidate();
}