Beispiel #1
0
const Waypoint*
dlgWayPointSelect(SingleWindow &parent, const GeoPoint &location)
{
  wf = LoadDialog(CallBackTable, parent, Layout::landscape ?
      _T("IDR_XML_WAYPOINTSELECT_L") : _T("IDR_XML_WAYPOINTSELECT"));

  if (!wf)
    return NULL;

  assert(wf != NULL);

  wf->SetKeyDownNotify(FormKeyDown);

  ((WndButton *)wf->FindByName(_T("cmdClose")))->
      SetOnClickNotify(OnWPSCloseClicked);

  ((WndButton *)wf->FindByName(_T("cmdSelect")))->
      SetOnClickNotify(OnWPSSelectClicked);

  ((WndButton *)wf->FindByName(_T("cmdFltName")))->
      SetOnClickNotify(OnFilterNameButton);

  wWayPointList = (WndListFrame*)wf->FindByName(_T("frmWayPointList"));
  assert(wWayPointList != NULL);
  wWayPointList->SetActivateCallback(OnWaypointListEnter);
  wWayPointList->SetPaintItemCallback(OnPaintListItem);

  wbName = (WndButton*)wf->FindByName(_T("cmdFltName"));
  wpDistance = (WndProperty*)wf->FindByName(_T("prpFltDistance"));
  wpDirection = (WndProperty*)wf->FindByName(_T("prpFltDirection"));
  wpType = (WndProperty *)wf->FindByName(_T("prpFltType"));

  g_location = location;
  PrepareData();
  UpdateList();

  wf->SetTimerNotify(OnTimerNotify);

  if (wf->ShowModal() != mrOK) {
    delete wf;
    return NULL;
  }

  unsigned ItemIndex = wWayPointList->GetCursorIndex();
  if (ItemIndex >= WayPointSelectInfo.size())
    return NULL;

  delete wf;
  return WayPointSelectInfo[ItemIndex].way_point;
}
Beispiel #2
0
void dlgBrightnessShowModal(){
  wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
		      _T("IDR_XML_BRIGHTNESS"));
  if (wf == NULL)
    return;

  LoadFormProperty(*wf, _T("prpBrightness"), BrightnessValue);
  LoadFormProperty(*wf, _T("prpAuto"), EnableAutoBrightness);

  wf->ShowModal();

  UpdateValues();

  delete wf;
}
Beispiel #3
0
void
dlgTeamCodeShowModal(void)
{
  WndProperty* wp = NULL;
  WndButton *buttonCode = NULL;

  if (Layout::landscape)
    wf = LoadDialog(CallBackTable,
        XCSoarInterface::main_window, _T("IDR_XML_TEAMCODE_L"));
  else
    wf = LoadDialog(CallBackTable,
        XCSoarInterface::main_window, _T("IDR_XML_TEAMCODE"));

  if (!wf)
    return;

  // set event for button
  buttonCode = ((WndButton *)wf->FindByName(_T("cmdSetCode")));
  if (buttonCode) {
    buttonCode->SetOnClickNotify(OnCodeClicked);
  }

  // Set unit for range
  wp = (WndProperty*)wf->FindByName(_T("prpRange"));
  if (wp) {
    wp->GetDataField()->SetUnits(Units::GetDistanceName());
  }

  Update();

  wf->SetTimerNotify(OnTimerNotify);

  wf->ShowModal();

  delete wf;
}
Beispiel #4
0
void
dlgNOAADetailsShowModal(SingleWindow &parent, NOAAStore::iterator iterator)
{
  station_iterator = iterator;

  wf = LoadDialog(CallBackTable, parent, Layout::landscape ?
                  _T("IDR_XML_NOAA_DETAILS_L") : _T("IDR_XML_NOAA_DETAILS"));
  assert(wf != NULL);

  Update();

  wf->ShowModal();

  delete wf;
}
Beispiel #5
0
void plMultipassMtlDlg::SetThing(ReferenceTarget *m)
{
    assert(m->SuperClassID() == MATERIAL_CLASS_ID);
    assert(m->ClassID() == MULTIMTL_CLASS_ID);

    // Bad?
    if (fMtl) 
        fMtl->SetParamDlg(NULL);
    fMtl = (plMultipassMtl *)m;
    if (fMtl)
        fMtl->SetParamDlg(this);

    LoadDialog();
    IUpdateMtlDisplay();
}
Beispiel #6
0
void
dlgSwitchesShowModal(void)
{
  wf = LoadDialog(CallBackTable, XCSoarInterface::main_window,
		              _T("IDR_XML_SWITCHES"));
  if (wf == NULL)
    return;

  wf->SetTimerNotify(OnTimerNotify);

  UpdateValues();
  wf->ShowModal();

  delete wf;
}
Beispiel #7
0
void
dlgHelpShowModal(SingleWindow &parent,
                 const TCHAR* Caption, const TCHAR* HelpText)
{
  if (!Caption || !HelpText) {
    return;
  }

  if (!Layout::landscape) {
    wf = LoadDialog(CallBackTable,
                        parent,
                        _T("IDR_XML_HELP_L"));
  } else {
    wf = LoadDialog(CallBackTable,
                        parent,
                        _T("IDR_XML_HELP"));
  }

  if (wf == NULL)
    return;

  WndProperty* wp;

  TCHAR fullcaption[100];
  _stprintf(fullcaption,_T("Help: %s"), Caption);

  wf->SetCaption(fullcaption);

  wp = (WndProperty*)wf->FindByName(_T("prpHelpText"));
  if (wp) {
    wp->SetText(HelpText);
    wp->RefreshDisplay();
  }
  wf->ShowModal();
  delete wf;
}
Beispiel #8
0
bool
dlgStartupShowModal()
{
  LogStartUp(_T("Startup dialog"));

  logo = new LogoView();

  wf = LoadDialog(CallBackTable, XCSoarInterface::main_window,
                  Layout::landscape ? _T("IDR_XML_STARTUP_L") :
                                      _T("IDR_XML_STARTUP"));
  assert(wf != NULL);

  WndProperty* wp = ((WndProperty *)wf->FindByName(_T("prpProfile")));
  assert(wp != NULL);

  DataFieldFileReader* dfe = (DataFieldFileReader*)wp->GetDataField();
  assert(dfe != NULL);

  ((WndButton *)wf->FindByName(_T("cmdClose")))
    ->SetOnClickNotify(OnCloseClicked);

  ((WndButton *)wf->FindByName(_T("cmdQuit")))->SetOnClickNotify(OnQuit);

  dfe->SetNotNullable();
  dfe->ScanDirectoryTop(_T("*.prf"));
  dfe->Lookup(Profile::GetPath());
  wp->RefreshDisplay();

  if (dfe->GetNumFiles() <= 1) {
    SelectProfile(dfe->GetPathFile());

    delete wf;
    delete logo;
    return true;
  }

  if (wf->ShowModal() != mrOK) {
    delete wf;
    delete logo;
    return false;
  }

  SelectProfile(dfe->GetPathFile());

  delete wf;
  delete logo;
  return true;
}
Beispiel #9
0
bool
dlgStartupShowModal()
{
  LogStartUp(_T("Startup dialog"));

  wf = LoadDialog(CallBackTable, XCSoarInterface::main_window,
                  Layout::landscape ? _T("IDR_XML_STARTUP_L") :
                                      _T("IDR_XML_STARTUP"));
  assert(wf != NULL);

  WndProperty* wp = ((WndProperty *)wf->FindByName(_T("prpProfile")));
  assert(wp != NULL);

  DataFieldFileReader* dfe = (DataFieldFileReader*)wp->GetDataField();
  assert(dfe != NULL);

  ((WndButton *)wf->FindByName(_T("cmdClose")))
    ->SetOnClickNotify(OnCloseClicked);

  ((WndButton *)wf->FindByName(_T("cmdQuit")))->SetOnClickNotify(OnQuit);

  dfe->ScanDirectoryTop(is_altair() ? _T("config/*.prf") : _T("*.prf"));
  dfe->Lookup(startProfileFile);
  wp->RefreshDisplay();

  if (dfe->GetNumFiles() <= 2) {
    delete wf;
    return true;
  }

  if (wf->ShowModal() != mrOK) {
    delete wf;
    return false;
  }

  const TCHAR *path = dfe->GetPathFile();
  if (!string_is_empty(path)) {
    _tcscpy(startProfileFile, path);

    /* When a profile from a secondary data path is used, this path
       becomes the primary data path */
    TCHAR temp[MAX_PATH];
    SetPrimaryDataPath(DirName(path, temp));
  }

  delete wf;
  return true;
}
Beispiel #10
0
void CompositeDlg::VScroll(int code, short int cpos ) {
	switch (code) {
		case SB_LINEUP: 	theTex->offset--;		break;
		case SB_LINEDOWN:	theTex->offset++;		break;
		case SB_PAGEUP:		theTex->offset -= NDLG;	break;
		case SB_PAGEDOWN:	theTex->offset += NDLG;	break;
		
		case SB_THUMBPOSITION: 
		case SB_THUMBTRACK:
			theTex->offset = cpos;
			break;
		}
	theTex->ClampOffset();
	UpdateSubTexNames();						
	LoadDialog(ip->GetTime());
	}
Beispiel #11
0
void
dlgTargetShowModal(int _target_point)
{
  if (protected_task_manager == nullptr)
    return;

  wf = LoadDialog(callback_table, UIGlobals::GetMainWindow(),
                  Layout::landscape ? _T("IDR_XML_TARGET_L") :
                                      _T("IDR_XML_TARGET"));
  assert(wf != nullptr);

  SetDataAccessCallback(*wf, _T("prpRange"), OnRangeData);
  SetDataAccessCallback(*wf, _T("prpRadial"), OnRadialData);

  if (!InitTargetPoints(_target_point)) {
    delete wf;
    map = nullptr;
    return;
  }

  optimized_checkbox = (CheckBoxControl*)wf->FindByName(_T("chkbOptimized"));
  assert(optimized_checkbox != nullptr);

  UpdateButtons();

  wf->SetKeyDownFunction(FormKeyDown);

  struct TargetDialogUpdateListener : public NullBlackboardListener {
    virtual void OnCalculatedUpdate(const MoreData &basic,
                                    const DerivedInfo &calculated) {
      map->Invalidate();
      RefreshCalculator();
    }
  };

  TargetDialogUpdateListener blackboard_listener;
  RateLimitedBlackboardListener rate_limited_bl(blackboard_listener,
                                                1800, 300);

  //WindowBlackboardListener
  CommonInterface::GetLiveBlackboard().AddListener(rate_limited_bl);

  wf->ShowModal();
  delete wf;

  CommonInterface::GetLiveBlackboard().RemoveListener(rate_limited_bl);
}
Beispiel #12
0
SimulatorPromptResult
dlgSimulatorPromptShowModal()
{
#ifdef SIMULATOR_AVAILABLE
  int result;

  logo = new LogoView();
  do {
    wf = LoadDialog(CallBackTable, XCSoarInterface::main_window,
                    Layout::landscape ? _T("IDR_XML_SIMULATORPROMPT_L") :
                                        _T("IDR_XML_SIMULATORPROMPT"));
    assert(wf != NULL);

    WndButton* wb;
    wb = ((WndButton *)wf->FindByName(_T("cmdSimulator")));
    assert(wb != NULL);
    wb->SetOnClickNotify(OnSimulatorClicked);

    wb = ((WndButton *)wf->FindByName(_T("cmdFly")));
    assert(wb != NULL);
    wb->SetOnClickNotify(OnFlyClicked);

    wb = ((WndButton *)wf->FindByName(_T("cmdQuit")));
    assert(wb != NULL);
    wb->SetOnClickNotify(OnQuitClicked);

    result = wf->ShowModal();

    delete wf;
  } while (result == mrChangeLayout);
  delete logo;

  switch (result) {
  case mrFly:
    return SPR_FLY;

  case mrSimulator:
    return SPR_SIMULATOR;

  default:
    return SPR_QUIT;
  }
#else
  return SPR_FLY;
#endif
}
Beispiel #13
0
/**
 * The function opens the FLARM Traffic dialog
 */
void
dlgFlarmTrafficShowModal()
{
  // Load dialog from XML
  wf = LoadDialog(CallBackTable, XCSoarInterface::main_window,
                  Layout::landscape ? _T("IDR_XML_FLARMTRAFFIC_L") :
                                      _T("IDR_XML_FLARMTRAFFIC"));
  if (!wf)
    return;

  // Set dialog events
  wf->SetKeyDownNotify(FormKeyDown);
  wf->SetTimerNotify(OnTimerNotify);

  // Set button events
  ((WndButton *)wf->FindByName(_T("cmdDetails")))->
      SetOnClickNotify(OnDetailsClicked);
  ((WndButton *)wf->FindByName(_T("cmdZoomIn")))->
      SetOnClickNotify(OnZoomInClicked);
  ((WndButton *)wf->FindByName(_T("cmdZoomOut")))->
      SetOnClickNotify(OnZoomOutClicked);
  ((WndButton *)wf->FindByName(_T("cmdPrev")))->
      SetOnClickNotify(OnPrevClicked);
  ((WndButton *)wf->FindByName(_T("cmdNext")))->
      SetOnClickNotify(OnNextClicked);
  ((WndButton *)wf->FindByName(_T("cmdClose")))->
      SetOnClickNotify(OnCloseClicked);
  ((WndButton *)wf->FindByName(_T("cmdSwitchData")))->
      SetOnClickNotify(OnSwitchDataClicked);

  // Update Radar and Selection for the first time
  Update();

  // Get the last chosen Side Data configuration
  auto_zoom = (CheckBox *)wf->FindByName(_T("AutoZoom"));
  auto_zoom->set_checked(wdf->GetAutoZoom());

  north_up = (CheckBox *)wf->FindByName(_T("NorthUp"));
  north_up->set_checked(wdf->GetNorthUp());

  // Show the dialog
  wf->ShowModal();

  // After dialog closed -> delete it
  delete wf;
}
/**
 * The function opens the FLARM Traffic Details dialog
 */
void
dlgFlarmTrafficDetailsShowModal(FlarmId id)
{
  if (wf)
    return;

  target_id = id;

  // Load dialog from XML
  wf = LoadDialog(CallBackTable,
      XCSoarInterface::main_window, Layout::landscape ?
      _T("IDR_XML_FLARMTRAFFICDETAILS_L") : _T("IDR_XML_FLARMTRAFFICDETAILS"));

  if (!wf)
    return;

  // Set dialog events
  wf->SetTimerNotify(OnTimerNotify);
  ((WndButton *)wf->FindByName(_T("cmdClose")))->
      SetOnClickNotify(OnCloseClicked);
  ((WndButton *)wf->FindByName(_T("cmdSetAsTeamMate")))->
      SetOnClickNotify(OnTeamClicked);
  ((WndButton *)wf->FindByName(_T("cmdCallsign")))->
      SetOnClickNotify(OnCallsignClicked);

  ((WndSymbolButton*)wf->FindByName(_T("cmdFriendGreen")))->
      SetOnClickNotify(OnFriendGreenClicked);
  ((WndSymbolButton*)wf->FindByName(_T("cmdFriendBlue")))->
      SetOnClickNotify(OnFriendBlueClicked);
  ((WndSymbolButton*)wf->FindByName(_T("cmdFriendYellow")))->
      SetOnClickNotify(OnFriendYellowClicked);
  ((WndSymbolButton*)wf->FindByName(_T("cmdFriendMagenta")))->
      SetOnClickNotify(OnFriendMagentaClicked);
  ((WndButton*)wf->FindByName(_T("cmdFriendClear")))->
      SetOnClickNotify(OnFriendClearClicked);

  // Update fields for the first time
  Update();

  // Show the dialog
  wf->ShowModal();

  // After dialog closed -> delete it
  delete wf;
  wf = NULL;
}
Beispiel #15
0
void
dlgAirspaceDetails(const AbstractAirspace& the_airspace)
{
  airspace = &the_airspace;

  wf = LoadDialog(CallBackTable,
                      XCSoarInterface::main_window,
                      _T("IDR_XML_AIRSPACEDETAILS"));
  if (!wf) return;

  SetValues();

  wf->ShowModal();

  delete wf;
  wf = NULL;
}
Beispiel #16
0
void dlgConfigFontsShowModal()
{
  wf = LoadDialog(CallBackTable, XCSoarInterface::main_window,
                  Layout::landscape ?
                  _T("IDR_XML_CONFIG_FONTS_L") : _T("IDR_XML_CONFIG_FONTS"));

  if (wf == NULL)
    return;

  ((WndButton *)wf->FindByName(_T("cmdClose")))->SetOnClickNotify(OnCloseClicked);

  UISettings &ui_settings = CommonInterface::SetUISettings();

  LoadFormProperty(*wf, _T("prpUseCustomFonts"), ui_settings.custom_fonts);

  ShowFontEditButtons(ui_settings.custom_fonts);
  RefreshFonts();

  FontRegistryChanged = false;
  changed = false;

  wf->ShowModal();

  changed |= SaveFormProperty(*wf, _T("prpUseCustomFonts"),
                              szProfileUseCustomFonts,
                              ui_settings.custom_fonts);

  TempInfoWindowFont.reset();
  TempTitleWindowFont.reset();
  TempMapWindowFont.reset();
  TempTitleSmallWindowFont.reset();
  TempMapWindowBoldFont.reset();
  TempCDIWindowFont.reset();
  TempMapLabelFont.reset();
  TempMapLabelImportantFont.reset();

  if (changed) {
    Profile::Save();

    MessageBoxX(_("Changes to configuration saved.  Restart XCSoar to apply changes."),
                _T(""), MB_OK);
  }

  delete wf;
}
Beispiel #17
0
void
dlgTeamCodeShowModal()
{
  wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
                  Layout::landscape ? _T("IDR_XML_TEAMCODE_L") :
                                      _T("IDR_XML_TEAMCODE"));

  if (!wf)
    return;

  Update(CommonInterface::Basic(), CommonInterface::Calculated());

  const ScopeCalculatedListener l(CommonInterface::GetLiveBlackboard(),
                                  Update);

  wf->ShowModal();

  delete wf;
}
Beispiel #18
0
void
dlgCreditsShowModal(SingleWindow &parent)
{
  wf = LoadDialog(CallBackTable, parent, Layout::landscape ?
                  _T("IDR_XML_CREDITS_L") : _T("IDR_XML_CREDITS"));
  assert(wf != NULL);

  tab = ((TabbedControl *)wf->FindByName(_T("tab")));
  assert(tab != NULL);

  wf->SetKeyDownNotify(FormKeyDown);

  LoadTextFromResource(_T("LICENSE"), _T("prpLicense"));
  LoadTextFromResource(_T("AUTHORS"), _T("prpAuthors"));

  wf->ShowModal();

  delete wf;
}
bool
dlgTaskPointShowModal(SingleWindow &parent, OrderedTask** task,
                      const unsigned index)
{
  ordered_task = *task;
  task_modified = false;
  active_index = index;

  wf = LoadDialog(CallBackTable, parent,
                  Layout::landscape ? _T("IDR_XML_TASKPOINT_L") :
                                      _T("IDR_XML_TASKPOINT"));
  assert(wf != NULL);

  wTaskView = (WndFrame*)wf->FindByName(_T("frmTaskView"));
  assert(wTaskView != NULL);

  WndFrame* wType = (WndFrame*) wf->FindByName(_T("lblType"));
  assert (wType);
  wType->SetFont(Fonts::MapBold);

  WndFrame* wLocation = (WndFrame*) wf->FindByName(_T("lblLocation"));
  assert (wLocation);
  wLocation->SetFont(Fonts::MapBold);

  do {
    RefreshView();
    next_previous=0;
    if (wf->ShowModal() == mrOK)
      ReadValues();
    active_index += next_previous;
  } while (next_previous != 0);

  delete wf;

  if (*task != ordered_task) {
    *task = ordered_task;
    task_modified = true;
  } 
  if (task_modified) {
    ordered_task->update_geometry();
  }
  return task_modified;
}
Beispiel #20
0
int
ListPicker(SingleWindow &parent, const TCHAR *caption,
           unsigned num_items, unsigned initial_value, unsigned item_height,
           WndListFrame::PaintItemCallback_t paint_callback,
           ListHelpCallback_t _help_callback)
{
  assert(num_items <= 0x7fffffff);
  assert((num_items == 0 && initial_value == 0) || initial_value < num_items);
  assert(item_height > 0);
  assert(paint_callback != NULL);

  wf = LoadDialog(CallBackTable, parent, !Layout::landscape
                  ? _T("IDR_XML_COMBOPICKER_L")
                  : _T("IDR_XML_COMBOPICKER"));
  assert(wf != NULL);

  if (caption != NULL)
    wf->SetCaption(caption);

  list_control = (WndListFrame *)wf->FindByName(_T("frmComboPopupList"));
  assert(list_control != NULL);
  list_control->SetItemHeight(item_height);
  list_control->SetLength(num_items);
  list_control->SetCursorIndex(initial_value);
  list_control->SetActivateCallback(OnComboPopupListEnter);
  list_control->SetPaintItemCallback(paint_callback);

  help_callback = _help_callback;

  WndButton *help_button = (WndButton *)wf->FindByName(_T("cmdHelp"));
  assert(help_button != NULL);
  if (help_callback != NULL)
    help_button->SetOnClickNotify(OnHelpClicked);
  else
    help_button->hide();

  int result = wf->ShowModal() == mrOK
    ? (int)list_control->GetCursorIndex()
    : -1;
  delete wf;

  return result;
}
Beispiel #21
0
void
dlgConfigWaypointsShowModal()
{
  WndForm *wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
                           Layout::landscape
                           ? _T("IDR_XML_CONFIG_WAYPOINTS_L")
                           : _T("IDR_XML_CONFIG_WAYPOINTS"));
  assert(wf != nullptr);

  WaypointsNeedSave = false;

  wf->ShowModal();

  if (WaypointsNeedSave &&
      ShowMessageBox(_("Save changes to waypoint file?"), _("Waypoints edited"),
                  MB_YESNO | MB_ICONQUESTION) == IDYES)
      SaveWaypoints();

  delete wf;
}
Beispiel #22
0
bool
dlgPlaneDetailsShowModal(SingleWindow &parent, Plane &_plane)
{
  plane = _plane;

  dialog = LoadDialog(CallBackTable, parent, Layout::landscape ?
                      _T("IDR_XML_PLANE_DETAILS_L") : _T("IDR_XML_PLANE_DETAILS"));
  assert(dialog != NULL);

  Update();
  bool result = (dialog->ShowModal() == mrOK);
  if (result) {
    UpdatePlane();
    _plane = plane;
  }

  delete dialog;

  return result;
}
Beispiel #23
0
void
dlgNOAADetailsShowModal(SingleWindow &parent, unsigned _station_index)
{
  assert(_station_index < NOAAStore::Count());
  station_index = _station_index;

  wf = LoadDialog(CallBackTable, parent, Layout::landscape ?
                  _T("IDR_XML_NOAA_DETAILS_L") : _T("IDR_XML_NOAA_DETAILS"));
  assert(wf != NULL);

  TCHAR caption[100];
  _stprintf(caption, _T("%s: %s"), _("METAR and TAF"),
            NOAAStore::GetCodeT(station_index));
  wf->SetCaption(caption);

  Update();

  wf->ShowModal();

  delete wf;
}
Beispiel #24
0
void dlgVoiceShowModal(){
  wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
		      _T("IDR_XML_VOICE"));

  
  if (!wf) return;

  LoadIntoForm(*wf, CommonInterface::GetComputerSettings().voice);

  wf->ShowModal();

  bool changed = false;

  changed = SaveFromForm(*wf, CommonInterface::SetComputerSettings().voice);
  delete wf;

  if (changed) {
    Profile::Save();
    LogDebug(_T("Voice configuration: Changes saved"));
  }
}
Beispiel #25
0
void
dlgConfigWaypointsShowModal()
{
  wf = LoadDialog(CallBackTable, XCSoarInterface::main_window,
                  Layout::landscape ? _T("IDR_XML_CONFIG_WAYPOINTS_L") :
                                      _T("IDR_XML_CONFIG_WAYPOINTS"));
  assert(wf != NULL);

  ((WndButton *)wf->FindByName(_T("cmdClose")))->SetOnClickNotify(OnCloseClicked);

  WaypointsNeedSave = false;

  wf->ShowModal();

  if (WaypointsNeedSave &&
      MessageBoxX(_("Save changes to waypoint file?"), _("Waypoints edited"),
                  MB_YESNO | MB_ICONQUESTION) == IDYES)
      SaveWaypoints();

  delete wf;
}
Beispiel #26
0
void
dlgAnalysisShowModal(SingleWindow &parent, const Look &_look,
                     const FullBlackboard &_blackboard,
                     const GlideComputer &_glide_computer,
                     const ProtectedTaskManager *_protected_task_manager,
                     const Airspaces *_airspaces,
                     const RasterTerrain *_terrain,
                     int _page)
{
    look = &_look;
    blackboard = &_blackboard;
    glide_computer = &_glide_computer;
    protected_task_manager = _protected_task_manager;
    airspaces = _airspaces;
    terrain = _terrain;

    wf = LoadDialog(CallBackTable, parent,
                    Layout::landscape ? _T("IDR_XML_ANALYSIS_L") :
                    _T("IDR_XML_ANALYSIS"));
    assert(wf != NULL);

    wf->SetKeyDownNotify(FormKeyDown);

    wGrid = (ChartControl*)wf->FindByName(_T("frmGrid"));
    wInfo = (WndFrame *)wf->FindByName(_T("frmInfo"));
    wCalc = (WndButton *)wf->FindByName(_T("cmdCalc"));

    ((WndButton *)wf->FindByName(_T("cmdClose")))->
    SetOnClickNotify(OnCloseClicked);

    if (_page >= 0)
        page = (analysis_page)_page;

    Update();

    wf->SetTimerNotify(OnTimer, 2500);
    wf->ShowModal();

    delete wf;
}
Beispiel #27
0
bool
dlgWaypointEditShowModal(Waypoint &way_point)
{
  global_wpt = &way_point;

  wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
                  Layout::landscape ?
                  _T("IDR_XML_WAYPOINTEDIT_L") : _T("IDR_XML_WAYPOINTEDIT"));
  assert(wf != NULL);

  buttonName = ((WndButton *)wf->FindByName(_T("cmdName")));
  buttonComment = ((WndButton *)wf->FindByName(_T("cmdComment")));
  assert(buttonName != NULL);
  assert(buttonComment != NULL);

  UpdateButtons();

  SetUnits();

  SetValues();

  if (CommonInterface::GetUISettings().coordinate_format ==
      CoordinateFormat::UTM) {
    ShowMessageBox(
        _("Sorry, the waypoint editor is not yet available for the UTM coordinate format."),
        _("Waypoint Editor"), MB_OK);
    return false;
  }

  wf->SetModalResult(mrCancel);

  bool retval = false;
  if (wf->ShowModal() == mrOK) {
    GetValues();
    retval = true;
  }

  delete wf;
  return retval;
}
Beispiel #28
0
void
dlgAnalysisShowModal(SingleWindow &parent, const Look &_look,
                     const FullBlackboard &_blackboard,
                     GlideComputer &_glide_computer,
                     const ProtectedTaskManager *_protected_task_manager,
                     const Airspaces *_airspaces,
                     const RasterTerrain *_terrain,
                     int _page)
{
  look = &_look;
  blackboard = &_blackboard;
  glide_computer = &_glide_computer;
  protected_task_manager = _protected_task_manager;
  airspaces = _airspaces;
  terrain = _terrain;

  wf = LoadDialog(CallBackTable, parent,
                  Layout::landscape ? _T("IDR_XML_ANALYSIS_L") :
                                      _T("IDR_XML_ANALYSIS"));
  assert(wf != NULL);

  wf->SetKeyDownFunction(FormKeyDown);

  wGrid = (ChartControl*)wf->FindByName(_T("frmGrid"));
  wInfo = (WndFrame *)wf->FindByName(_T("frmInfo"));
  wCalc = (WndButton *)wf->FindByName(_T("cmdCalc"));

  if (_page >= 0)
    page = (AnalysisPage)_page;

  Update();

  auto update_timer = MakeLambdaTimer([](){ Update(); });
  update_timer.Schedule(2500);

  wf->ShowModal();
  update_timer.Cancel();

  delete wf;
}
Beispiel #29
0
void
dlgPlanesShowModal(SingleWindow &parent)
{
  dialog = LoadDialog(CallBackTable, parent,
                      Layout::landscape ?
                      _T("IDR_XML_PLANES_L") : _T("IDR_XML_PLANES"));
  assert(dialog != NULL);

  UPixelScalar item_height = Fonts::map_bold.GetHeight() + Layout::Scale(6) +
                         Fonts::map_label.GetHeight();

  plane_list = (WndListFrame*)dialog->FindByName(_T("List"));
  assert(plane_list != NULL);
  plane_list->SetItemHeight(item_height);
  plane_list->SetPaintItemCallback(OnPlaneListPaint);
  plane_list->SetActivateCallback(ListItemSelected);

  UpdateList();
  dialog->ShowModal();

  delete dialog;
}
Beispiel #30
0
void
dlgAirspaceDetails(const AbstractAirspace& the_airspace,
                   ProtectedAirspaceWarningManager *_airspace_warnings)
{
  if (wf)
    return;

  airspace = &the_airspace;
  airspace_warnings = _airspace_warnings;

  wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
                  _T("IDR_XML_AIRSPACEDETAILS"));
  assert(wf != NULL);

  SetValues();
  UpdateAckButton();

  wf->ShowModal();

  delete wf;
  wf = NULL;
}