当前位置: 首页>>代码示例>>C++>>正文


C++ LoadDialog函数代码示例

本文整理汇总了C++中LoadDialog函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadDialog函数的具体用法?C++ LoadDialog怎么用?C++ LoadDialog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了LoadDialog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: dlgWayPointSelect

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;
}
开发者ID:hnpilot,项目名称:XCSoar,代码行数:50,代码来源:dlgWayPointSelect.cpp

示例2: dlgBrightnessShowModal

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;
}
开发者ID:damianob,项目名称:xcsoar,代码行数:15,代码来源:dlgBrightness.cpp

示例3: dlgTeamCodeShowModal

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;
}
开发者ID:hnpilot,项目名称:XCSoar,代码行数:36,代码来源:dlgTeamCode.cpp

示例4: dlgNOAADetailsShowModal

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;
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:15,代码来源:dlgNOAADetails.cpp

示例5: dlgSwitchesShowModal

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;
}
开发者ID:galippi,项目名称:xcsoar,代码行数:15,代码来源:dlgSwitches.cpp

示例6: dlgHelpShowModal

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;
}
开发者ID:Plantain,项目名称:XCSoar,代码行数:36,代码来源:dlgHelp.cpp

示例7: dlgStartupShowModal

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;
}
开发者ID:macsux,项目名称:XCSoar,代码行数:48,代码来源:dlgStartup.cpp

示例8: dlgStartupShowModal

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;
}
开发者ID:galippi,项目名称:xcsoar,代码行数:48,代码来源:dlgStartup.cpp

示例9: switch

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());
	}
开发者ID:2asoft,项目名称:xray,代码行数:16,代码来源:composit.cpp

示例10: dlgTargetShowModal

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);
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:47,代码来源:TargetDialog.cpp

示例11: dlgSimulatorPromptShowModal

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
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:46,代码来源:dlgSimulatorPrompt.cpp

示例12: dlgFlarmTrafficShowModal

/**
 * 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;
}
开发者ID:galippi,项目名称:xcsoar,代码行数:49,代码来源:dlgFlarmTraffic.cpp

示例13: dlgFlarmTrafficDetailsShowModal

/**
 * 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;
}
开发者ID:macsux,项目名称:XCSoar,代码行数:49,代码来源:dlgFlarmTrafficDetails.cpp

示例14: dlgAirspaceDetails

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;
}
开发者ID:Plantain,项目名称:XCSoar,代码行数:17,代码来源:dlgAirspaceDetails.cpp

示例15: dlgConfigFontsShowModal

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;
}
开发者ID:macsux,项目名称:XCSoar,代码行数:45,代码来源:dlgConfigFonts.cpp


注:本文中的LoadDialog函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。