本文整理汇总了C++中dlgLoadFromXML函数的典型用法代码示例。如果您正苦于以下问题:C++ dlgLoadFromXML函数的具体用法?C++ dlgLoadFromXML怎么用?C++ dlgLoadFromXML使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dlgLoadFromXML函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dlgTeamCodeShowModal
void dlgTeamCodeShowModal(void)
{
WndProperty* wp = NULL;
WndButton *buttonCode = NULL;
wf = NULL;
char filename[MAX_PATH];
if (InfoBoxLayout::landscape)
{
LocalPathS(filename, TEXT("dlgTeamCode_L.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_TEAMCODE_L"));
if (!wf) return;
}
else
{
LocalPathS(filename, TEXT("dlgTeamCode.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_TEAMCODE"));
if (!wf) return;
}
TCHAR sTmp[32] = { 0 };
if( WayPointList && ValidWayPoint(TeamCodeRefWaypoint)) {
// LKTOKEN [email protected]_ "Team Ref.: "
_tcsncpy(sTmp, gettext(TEXT("[email protected]_")), 20);
_tcsncat(sTmp, WayPointList[TeamCodeRefWaypoint].Name,10);
} else {
// LKTOKEN [email protected]_ "Team code: SET REF!"
_tcsncpy(sTmp, gettext(TEXT("[email protected]_")), 30);
}
wf->SetCaption(sTmp);
// set event for button
buttonCode = ((WndButton *)wf->FindByName(TEXT("cmdSetCode")));
if (buttonCode) {
buttonCode->SetOnClickNotify(OnCodeClicked);
}
// Set unit for range
wp = (WndProperty*)wf->FindByName(TEXT("prpRange"));
if (wp) {
wp->GetDataField()->SetUnits(Units::GetDistanceName());
}
Update();
wf->SetTimerNotify(OnTimerNotify);
wf->ShowModal();
delete wf;
wf=NULL;
}
示例2: dlgAirspaceShowModal
bool dlgAirspaceShowModal(bool coloredit){
colormode = coloredit;
ItemIndex = -1;
if (!ScreenLandscape) {
TCHAR filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgAirspace_L.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_AIRSPACE_L"));
} else {
TCHAR filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgAirspace.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_AIRSPACE"));
}
if (!wf) return false;
wAirspaceList = (WndListFrame*)wf->FindByName(TEXT("frmAirspaceList"));
LKASSERT(wAirspaceList!=NULL);
wAirspaceList->SetBorderKind(BORDERLEFT);
wAirspaceList->SetEnterCallback(OnAirspaceListEnter);
wAirspaceListEntry = (WndOwnerDrawFrame*)wf->
FindByName(TEXT("frmAirspaceListEntry"));
LKASSERT(wAirspaceListEntry!=NULL);
wAirspaceListEntry->SetCanFocus(true);
// ScrollbarWidth is initialised from DrawScrollBar in WindowControls, so it might not be ready here
if ( wAirspaceList->ScrollbarWidth == -1) {
#if defined (PNA)
#define SHRINKSBFACTOR 1.0 // shrink width factor. Range .1 to 1 where 1 is very "fat"
#else
#define SHRINKSBFACTOR 0.75 // shrink width factor. Range .1 to 1 where 1 is very "fat"
#endif
wAirspaceList->ScrollbarWidth = (int) (SCROLLBARWIDTH_INITIAL * ScreenDScale * SHRINKSBFACTOR);
}
wAirspaceListEntry->SetWidth(wAirspaceList->GetWidth() - wAirspaceList->ScrollbarWidth - 5);
UpdateList();
changed = false;
wf->ShowModal();
delete wf;
wf = NULL;
return changed;
}
示例3: dlgBasicSettingsShowModal
void dlgBasicSettingsShowModal(void){
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgBasicSettings.xml")); // no worry missing _L, it is unused anyway
if (!InfoBoxLayout::landscape)
wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_BASICSETTINGS_L"));
else
wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_BASICSETTINGS"));
WndProperty* wp;
// BallastTimerActive = false;
if (wf) {
wf->SetTimerNotify(OnTimerNotify);
((WndButton *)wf->FindByName(TEXT("buttonDumpBallast")))->SetVisible(!BallastTimerActive);
((WndButton *)wf->FindByName(TEXT("buttonStopDump")))->SetVisible(BallastTimerActive);
wp = (WndProperty*)wf->FindByName(TEXT("prpAltitude"));
if (wp) {
wp->GetDataField()->SetAsFloat(
Units::ToUserAltitude(GPS_INFO.BaroAltitude));
wp->GetDataField()->SetUnits(Units::GetAltitudeName());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpBallastLitres"));
if (wp) {
wp->GetDataField()-> SetAsFloat(GlidePolar::BallastLitres);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpWingLoading"));
if (wp) {
if (GlidePolar::WingLoading>0.1) {
wp->GetDataField()-> SetAsFloat(GlidePolar::WingLoading);
} else {
wp->SetVisible(false);
}
wp->RefreshDisplay();
}
if (CALCULATED_INFO.Flying) {
wp = (WndProperty*)wf->FindByName(TEXT("prpQNH"));
if (wp) {
wp->GetDataField()->SetDisplayFormat(_T("%.0f"));
}
}
wf->ShowModal();
delete wf;
}
wf = NULL;
}
示例4: dlgAirspaceShowModal
bool dlgAirspaceShowModal(bool coloredit){
colormode = coloredit;
ItemIndex = -1;
if (!InfoBoxLayout::landscape) {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgAirspace_L.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_AIRSPACE_L"));
} else {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgAirspace.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_AIRSPACE"));
}
if (!wf) return false;
ASSERT(wf!=NULL);
wAirspaceList = (WndListFrame*)wf->FindByName(TEXT("frmAirspaceList"));
ASSERT(wAirspaceList!=NULL);
wAirspaceList->SetBorderKind(BORDERLEFT);
wAirspaceList->SetEnterCallback(OnAirspaceListEnter);
wAirspaceListEntry = (WndOwnerDrawFrame*)wf->
FindByName(TEXT("frmAirspaceListEntry"));
ASSERT(wAirspaceListEntry!=NULL);
wAirspaceListEntry->SetCanFocus(true);
UpdateList();
changed = false;
wf->ShowModal();
// now retrieve back the properties...
if (changed) {
StoreRegistry();
// DoStatusMessage(TEXT("Configuration saved")); // REMOVE FIXV2
DoStatusMessage(gettext(TEXT("[email protected]_"))); // Configuration saved
};
delete wf;
wf = NULL;
return changed;
}
示例5: dlgChecklistShowModal
void dlgChecklistShowModal(void){
static bool first=true;
if (first) {
LoadChecklist();
first=false;
}
// WndProperty *wp;
if (!ScreenLandscape) {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgChecklist_L.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_CHECKLIST_L"));
} else {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgChecklist.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_CHECKLIST"));
}
nTextLines = 0;
if (!wf) return;
wf->SetKeyDownNotify(FormKeyDown);
((WndButton *)wf->FindByName(TEXT("cmdClose")))->SetOnClickNotify(OnCloseClicked);
wDetails = (WndListFrame*)wf->FindByName(TEXT("frmDetails"));
ASSERT(wDetails!=NULL);
wDetailsEntry =
(WndOwnerDrawFrame*)wf->FindByName(TEXT("frmDetailsEntry"));
ASSERT(wDetailsEntry!=NULL);
wDetailsEntry->SetCanFocus(true);
wDetails->SetBorderKind(BORDERLEFT);
page = 0;
NextPage(0); // JMW just to turn proper pages on/off
wf->ShowModal();
delete wf;
wf = NULL;
}
示例6: dlgWaypointEditShowModal
void dlgWaypointEditShowModal(WAYPOINT *wpt) {
if (!wpt) {
return;
}
global_wpt = wpt;
if (!ScreenLandscape) {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgWaypointEdit_L.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_WAYPOINTEDIT_L"));
} else {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgWaypointEdit.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_WAYPOINTEDIT"));
}
if (wf) {
buttonName = ((WndButton *)wf->FindByName(TEXT("cmdName")));
if (buttonName) {
buttonName->SetOnClickNotify(OnNameClicked);
}
buttonComment = ((WndButton *)wf->FindByName(TEXT("cmdComment")));
if (buttonComment) {
buttonComment->SetOnClickNotify(OnCommentClicked);
}
UpdateButtons();
SetUnits();
SetValues();
wf->SetModalResult(mrCancle);
if (wf->ShowModal()==mrOK) {
////
GetValues();
}
delete wf;
}
wf = NULL;
}
示例7: dlgFlarmTrafficShowModal
void dlgFlarmTrafficShowModal(void){
static bool first=true;
if (first) {
first=false;
}
if (InfoBoxLayout::landscape) {
wf = dlgLoadFromXML(CallBackTable,
TEXT("dlgFlarmTraffic_L.xml"),
XCSoarInterface::main_window,
TEXT("IDR_XML_FLARMTRAFFIC_L"));
} else {
wf = dlgLoadFromXML(CallBackTable,
TEXT("dlgFlarmTraffic.xml"),
XCSoarInterface::main_window,
TEXT("IDR_XML_FLARMTRAFFIC"));
}
nTextLines = 0;
if (!wf) return;
wf->SetKeyDownNotify(FormKeyDown);
((WndButton *)wf->FindByName(TEXT("cmdClose")))->SetOnClickNotify(OnCloseClicked);
wDetails = (WndListFrame*)wf->FindByName(TEXT("frmDetails"));
wDetails->SetEnterCallback(OnListEnter);
assert(wDetails!=NULL);
wDetailsEntry =
(WndOwnerDrawFrame*)wf->FindByName(TEXT("frmDetailsEntry"));
assert(wDetailsEntry!=NULL);
wDetailsEntry->SetCanFocus(true);
wDetails->SetBorderKind(BORDERLEFT);
page = 0;
wDetails->ResetList();
Update();
wf->SetTimerNotify(OnTimerNotify);
wf->ShowModal();
delete wf;
wf = NULL;
}
示例8: dlgChecklistShowModal
void dlgChecklistShowModal(void){
static bool first=true;
if (first) {
LoadChecklist();
first=false;
}
// WndProperty *wp;
if (!InfoBoxLayout::landscape) {
wf = dlgLoadFromXML(CallBackTable,
TEXT("dlgChecklist_L.xml"),
XCSoarInterface::main_window,
TEXT("IDR_XML_CHECKLIST_L"));
} else {
wf = dlgLoadFromXML(CallBackTable,
TEXT("dlgChecklist.xml"),
XCSoarInterface::main_window,
TEXT("IDR_XML_CHECKLIST"));
}
nTextLines = 0;
if (!wf) return;
wf->SetKeyDownNotify(FormKeyDown);
((WndButton *)wf->FindByName(TEXT("cmdClose")))->SetOnClickNotify(OnCloseClicked);
wDetails = (WndListFrame*)wf->FindByName(TEXT("frmDetails"));
assert(wDetails!=NULL);
wDetailsEntry =
(WndOwnerDrawFrame*)wf->FindByName(TEXT("frmDetailsEntry"));
assert(wDetailsEntry!=NULL);
wDetailsEntry->SetCanFocus(true);
wDetails->SetBorderKind(BORDERLEFT);
page = 0;
NextPage(0); // JMW just to turn proper pages on/off
wf->ShowModal();
delete wf;
wf = NULL;
}
示例9: dlgAirspaceShowModal
bool dlgAirspaceShowModal(bool coloredit){
colormode = coloredit;
ItemIndex = -1;
if (!ScreenLandscape) {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgAirspace_L.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_AIRSPACE_L"));
} else {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgAirspace.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_AIRSPACE"));
}
if (!wf) return false;
//ASSERT(wf!=NULL);
wAirspaceList = (WndListFrame*)wf->FindByName(TEXT("frmAirspaceList"));
//ASSERT(wAirspaceList!=NULL);
wAirspaceList->SetBorderKind(BORDERLEFT);
wAirspaceList->SetEnterCallback(OnAirspaceListEnter);
wAirspaceListEntry = (WndOwnerDrawFrame*)wf->
FindByName(TEXT("frmAirspaceListEntry"));
//ASSERT(wAirspaceListEntry!=NULL);
wAirspaceListEntry->SetCanFocus(true);
UpdateList();
changed = false;
wf->ShowModal();
delete wf;
wf = NULL;
return changed;
}
示例10: dlgAirspaceColoursShowModal
int dlgAirspaceColoursShowModal(void){
ItemIndex = -1;
if (!InfoBoxLayout::landscape) {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgAirspaceColours_L.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_AIRSPACECOLOURS_L"));
} else {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgAirspaceColours.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_AIRSPACECOLOURS"));
}
if (!wf) return -1;
ASSERT(wf!=NULL);
wAirspaceColoursList = (WndListFrame*)wf->FindByName(TEXT("frmAirspaceColoursList"));
ASSERT(wAirspaceColoursList!=NULL);
wAirspaceColoursList->SetBorderKind(BORDERLEFT);
wAirspaceColoursList->SetEnterCallback(OnAirspaceColoursListEnter);
wAirspaceColoursListEntry = (WndOwnerDrawFrame*)wf->
FindByName(TEXT("frmAirspaceColoursListEntry"));
ASSERT(wAirspaceColoursListEntry!=NULL);
wAirspaceColoursListEntry->SetCanFocus(true);
UpdateList();
wf->ShowModal();
// now retrieve back the properties...
delete wf;
wf = NULL;
return ItemIndex;
}
示例11: dlgLoggerReplayShowModal
void dlgLoggerReplayShowModal(void){
wf = dlgLoadFromXML(CallBackTable, IDR_XML_LOGGERREPLAY);
WndProperty* wp;
if (wf) {
wp = (WndProperty*)wf->FindByName(TEXT("prpRate"));
if (wp) {
wp->GetDataField()->SetAsFloat(ReplayLogger::TimeScale);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIGCFile"));
if (wp) {
DataFieldFileReader* dfe = static_cast<DataFieldFileReader*>(wp->GetDataField());
if(dfe) {
dfe->ScanDirectoryTop(_T(LKD_LOGS), _T("*" LKS_IGC));
dfe->Lookup(ReplayLogger::GetFilename());
}
wp->RefreshDisplay();
}
wf->ShowModal();
delete wf;
}
wf = NULL;
}
示例12: dlgLoggerReplayShowModal
void dlgLoggerReplayShowModal(void){
TCHAR tsuf[10];
TCHAR filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgLoggerReplay.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
TEXT("IDR_XML_LOGGERREPLAY"));
WndProperty* wp;
if (wf) {
wp = (WndProperty*)wf->FindByName(TEXT("prpRate"));
if (wp) {
wp->GetDataField()->SetAsFloat(ReplayLogger::TimeScale);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIGCFile"));
if (wp) {
DataFieldFileReader* dfe;
dfe = (DataFieldFileReader*)wp->GetDataField();
// dfe->ScanDirectoryTop(_T(""),TEXT("*.igc"));
_stprintf(tsuf,_T("*%s"),_T(LKS_IGC));
dfe->ScanDirectoryTop(_T(LKD_LOGS),tsuf);
dfe->Lookup(ReplayLogger::GetFilename());
wp->RefreshDisplay();
}
wf->ShowModal();
delete wf;
}
wf = NULL;
}
示例13: dlgTextEntryKeyboardShowModal
void dlgTextEntryKeyboardShowModal(TCHAR *text, int width, const TCHAR* szFile, const TCHAR* szResource)
{
first = true;
wf = NULL;
if (width==0) {
width = MAX_TEXTENTRY;
}
max_width = min(MAX_TEXTENTRY, width);
char filename[MAX_PATH];
LocalPathS(filename, szFile);
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
szResource);
if (!wf) return;
cursor = 0;
ClearText();
if (_tcslen(text)>0) {
_tcsupr(text);
LK_tcsncpy(edittext, text, max_width-1);
// position cursor at the end of imported text
cursor=_tcslen(text);
}
UpdateTextboxProp();
wf->SetKeyDownNotify(FormKeyDown);
wf->ShowModal();
LK_tcsncpy(text, edittext, max_width-1);
delete wf;
wf=NULL;
}
示例14: dlgAirspaceColoursShowModal
int dlgAirspaceColoursShowModal(void){
ItemIndex = -1;
wf = dlgLoadFromXML(CallBackTable,
ScreenLandscape ? TEXT("dlgAirspaceColours_L.xml") : TEXT("dlgAirspaceColours_P.xml"),
ScreenLandscape ? IDR_XML_AIRSPACECOLOURS_L : IDR_XML_AIRSPACECOLOURS_P);
if (!wf) return -1;
wAirspaceColoursList = (WndListFrame*)wf->FindByName(TEXT("frmAirspaceColoursList"));
if(wAirspaceColoursList) {
wAirspaceColoursList->SetEnterCallback(OnAirspaceColoursListEnter);
}
wAirspaceColoursListEntry = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmAirspaceColoursListEntry"));
if(wAirspaceColoursListEntry) {
wAirspaceColoursListEntry->SetCanFocus(true);
}
UpdateList();
wf->ShowModal();
delete wf;
wf = NULL;
return ItemIndex;
}
示例15: dlgMultimapsShowModal
void dlgMultimapsShowModal(void){
WndProperty *wp;
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgMultimaps.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_MULTIMAPS"));
if (!wf) return;
setVariables();
wf->ShowModal();
wp = (WndProperty*)wf->FindByName(TEXT("prpMultimap1"));
if (wp) Multimap1 = (wp->GetDataField()->GetAsInteger());
wp = (WndProperty*)wf->FindByName(TEXT("prpMultimap2"));
if (wp) Multimap2 = (wp->GetDataField()->GetAsInteger());
wp = (WndProperty*)wf->FindByName(TEXT("prpMultimap3"));
if (wp) Multimap3 = (wp->GetDataField()->GetAsInteger());
UpdateMultimapOrient();
delete wf;
wf = NULL;
}