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 _@M1230_ "Team Ref.: " _tcsncpy(sTmp, gettext(TEXT("_@M1230_")), 20); _tcsncat(sTmp, WayPointList[TeamCodeRefWaypoint].Name,10); } else { // LKTOKEN _@M1231_ "Team code: SET REF!" _tcsncpy(sTmp, gettext(TEXT("_@M1231_")), 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; }
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; }
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("_@M877_"))); // Configuration saved }; delete wf; wf = NULL; return changed; }
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; }
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; }
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; }
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; }
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); // show previous test. // this text is replaced by first key down // but used if "OK" is clicked first for don't reset current value. } UpdateTextboxProp(); wf->SetKeyDownNotify(FormKeyDown); wf->ShowModal(); LK_tcsncpy(text, edittext, max_width-1); delete wf; wf=NULL; }
void dlgWindSettingsShowModal(void){ TCHAR filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgWindSettings.xml")); wf = dlgLoadFromXML(CallBackTable, filename, TEXT("IDR_XML_WINDSETTINGS")); if (wf) { WndProperty* wp; wp = (WndProperty*)wf->FindByName(TEXT("prpSpeed")); if (wp) { wp->GetDataField()->SetUnits(Units::GetHorizontalSpeedName()); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpAutoWind")); if (wp) { DataFieldEnum* dfe; dfe = (DataFieldEnum*)wp->GetDataField(); // LKTOKEN _@M418_ = "Manual" dfe->addEnumText(gettext(TEXT("_@M418_"))); // LKTOKEN _@M175_ = "Circling" dfe->addEnumText(gettext(TEXT("_@M175_"))); dfe->addEnumText(gettext(TEXT("ZigZag"))); // LKTOKEN _@M149_ = "Both" dfe->addEnumText(gettext(TEXT("_@M149_"))); dfe->addEnumText(MsgToken(1793)); // External wp->GetDataField()->Set(AutoWindMode); wp->RefreshDisplay(); wp = (WndProperty*)wf->FindByName(TEXT("prpTrailDrift")); if (wp) { wp->GetDataField()->Set(MapWindow::EnableTrailDrift); wp->RefreshDisplay(); } } wf->ShowModal(); wp = (WndProperty*)wf->FindByName(TEXT("prpAutoWind")); if (wp) { if (AutoWindMode != wp->GetDataField()->GetAsInteger()) { AutoWindMode = wp->GetDataField()->GetAsInteger(); } } wp = (WndProperty*)wf->FindByName(TEXT("prpTrailDrift")); if (wp) { if (MapWindow::EnableTrailDrift != wp->GetDataField()->GetAsBoolean()) { MapWindow::EnableTrailDrift = wp->GetDataField()->GetAsBoolean(); } } delete wf; } wf = NULL; }
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; }
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; }
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; }
void dlgAirspaceDetails(int the_circle, int the_area) { index_circle = the_circle; index_area = the_area; if ((index_area<=0) && (index_circle <=0)) { return; } char filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgAirspaceDetails.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_AIRSPACEDETAILS")); if (!wf) return; ASSERT(wf!=NULL); SetValues(); wf->ShowModal(); delete wf; wf = NULL; return; }
void dlgThermalDetails(int indexid) { char filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgThermalDetails.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_THERMALDETAILS")); if (!wf) return; SetValues(indexid); s_selected=indexid; if (wcslen(ThermalHistory[indexid].Near) >0) { TCHAR tcap[100]; wsprintf(tcap,_T("%s %s: %s"), gettext(_T("_@M905_")), // Thermal gettext(_T("_@M456_")), // Near ThermalHistory[indexid].Near ); wf->SetCaption(tcap); } wf->ShowModal(); delete wf; wf = NULL; return; }
void Show() { TCHAR filename[MAX_PATH]; const TCHAR *resName = NULL; if (!ScreenLandscape) { LocalPathS(filename, TEXT("dlgBluetooth_L.xml")); resName = TEXT("IDR_XML_BLUETOOTH_L"); } else { LocalPathS(filename, TEXT("dlgBluetooth.xml")); resName = TEXT("IDR_XML_BLUETOOTH"); } wfBth = dlgLoadFromXML(CallBackTable, filename, resName); if (wfBth) { WndListFrame* BthList = (WndListFrame*) wfBth->FindByName(TEXT("frmBthList")); if (BthList) { BthList->SetBorderKind(BORDERLEFT | BORDERTOP | BORDERRIGHT | BORDERBOTTOM); BthList->SetWidth(wfBth->GetWidth() - BthList->GetLeft() - IBLSCALE(4)); // Bug : we need ClientHeight, but Cleint Rect is Calculated by OnPaint // BthList->SetHeight(wfBth->GetHeight() - BthList->GetTop() - 2); if (BthList->ScrollbarWidth == -1) { BthList->ScrollbarWidth = (int) (SCROLLBARWIDTH_INITIAL * ScreenDScale); } WndOwnerDrawFrame* BthListEntry = (WndOwnerDrawFrame*) wfBth->FindByName(TEXT("frmBthListEntry")); if (BthListEntry) { BthListEntry->SetCanFocus(true); BthListEntry->SetWidth(BthList->GetWidth() - BthList->ScrollbarWidth - 5); } BthList->ResetList(); BthList->Redraw(); } if (wfBth->ShowModal()) { CBtHandler * pBtHandler = CBtHandler::Get(); if (pBtHandler) { pBtHandler->ClearDevices(); pBtHandler->FillDevices(); } RefreshComPortList(); } delete wfBth; wfBth = NULL; } }
void dlgLKTrafficDetails(int indexid) { TCHAR status[80], tpas[30]; char filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgLKTraffic.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_LKTRAFFICDETAILS")); if (!wf) return; ASSERT(wf!=NULL); // cmdTarget Caption name is normally "TARGET" buttonTarget=((WndButton *)wf->FindByName(TEXT("cmdTarget"))); if (buttonTarget) { if ( LKTraffic[indexid].Locked ) { // LKTOKEN _@M754_ = "UNLOCK" _tcscpy(status,gettext(TEXT("_@M754_"))); buttonTarget->SetCaption(status); } } SetValues(indexid); _tcscpy(status,_T("Traffic: ")); if (LKTraffic[indexid].Locked) _tcscat(status,_T("TARGET ")); switch(LKTraffic[indexid].Status) { case LKT_REAL: // LKTOKEN _@M394_ = "Live " _tcscat(status,gettext(TEXT("_@M394_"))); break; case LKT_GHOST: // LKTOKEN _@M323_ = "Ghost " _tcscat(status,gettext(TEXT("_@M323_"))); break; case LKT_ZOMBIE: // LKTOKEN _@M829_ = "Zombie " _tcscat(status,gettext(TEXT("_@M829_"))); break; default: // LKTOKEN _@M753_ = "UNKNOWN! " _tcscat(status,gettext(TEXT("_@M753_"))); break; } Units::TimeToTextDown(tpas,(int)(GPS_INFO.Time - LKTraffic[indexid].Time_Fix)); _stprintf(status,_T("%s (%s\" old)"),status,tpas); wf->SetCaption(status); SelectedTraffic=indexid; wf->ShowModal(); delete wf; wf = NULL; return; }
void dlgNumberEntryKeyboardShowModal(int *value, int width) { wf = NULL; wGrid = NULL; if (width==0) { width = MAX_TEXTENTRY; } max_width = min(MAX_TEXTENTRY, width); char filename[MAX_PATH]; if (InfoBoxLayout::landscape) { LocalPathS(filename, TEXT("frmNumberEntry_Keyboard_L.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_NUMBERENTRY_KEYBOARD_L")); if (!wf) return; } else { LocalPathS(filename, TEXT("frmNumberEntry_Keyboard.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_NUMBERENTRY_KEYBOARD")); if (!wf) return; } wGrid = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmGrid")); cursor = 0; ClearText(); TCHAR text[20]; _stprintf(text, TEXT("%ld"), *value); if (_tcslen(text)>0) { _tcsupr(text); _tcsncpy(edittext, text, max_width-1); edittext[max_width-1]= 0; } UpdateTextboxProp(); wf->SetKeyDownNotify(FormKeyDown); wf->ShowModal(); _tcsncpy(text, edittext, max_width); text[max_width-1]=0; *value = _wtoi(text); delete wf; wf=NULL; //@ 101027 just to be sure }
void dlgOracleShowModal(void){ SHOWTHREAD(_T("dlgOracleShowModal")); wf=NULL; if (!ScreenLandscape) { TCHAR filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgOracle_L.xml")); wf = dlgLoadFromXML(CallBackTable, filename, TEXT("IDR_XML_ORACLE_L")); } else { TCHAR filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgOracle.xml")); wf = dlgLoadFromXML(CallBackTable, filename, TEXT("IDR_XML_ORACLE")); } if (!wf) return; // Since the topology search is made in the cache, and the cache has only items that // are ok to be printed for the current scale, and we want also items for high zoom, // we force high zoom and refresh. First we save current scale, of course. double oldzoom=MapWindow::zoom.Scale(); // set a zoom level for topology visibility scan MapWindow::zoom.EventSetZoom(3); MapWindow::RefreshMap(); // Make the current nearest invalid ResetNearestTopology(); WaitToCallForce=2; // We must wait for data ready, so we shall do it with timer notify. wf->SetTimerNotify(OnTimerNotify); wf->ShowModal(); delete wf; wf = NULL; // Now we restore old zoom MapWindow::zoom.EventSetZoom(oldzoom); // And force rescan of topology in the cache MapWindow::ForceVisibilityScan=true; MapWindow::RefreshMap(); }
int dlgAirspacePatternsShowModal(void){ ItemIndex = -1; if (!ScreenLandscape) { TCHAR filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgAirspacePatterns_L.xml")); wf = dlgLoadFromXML(CallBackTable, filename, TEXT("IDR_XML_AIRSPACEPATTERNS_L")); } else { TCHAR filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgAirspacePatterns.xml")); wf = dlgLoadFromXML(CallBackTable, filename, TEXT("IDR_XML_AIRSPACEPATTERNS")); } if (!wf) return -1; //ASSERT(wf!=NULL); wAirspacePatternsList = (WndListFrame*)wf->FindByName(TEXT("frmAirspacePatternsList")); //ASSERT(wAirspacePatternsList!=NULL); wAirspacePatternsList->SetBorderKind(BORDERLEFT); wAirspacePatternsList->SetEnterCallback(OnAirspacePatternsListEnter); wAirspacePatternsListEntry = (WndOwnerDrawFrame*)wf-> FindByName(TEXT("frmAirspacePatternsListEntry")); //ASSERT(wAirspacePatternsListEntry!=NULL); wAirspacePatternsListEntry->SetCanFocus(true); UpdateList(); wf->ShowModal(); // now retrieve back the properties... delete wf; wf = NULL; return ItemIndex; }
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; }
void dlgHelpShowModal(const TCHAR* Caption, const TCHAR* HelpText) { if (!Caption || !HelpText) { return; } if (!ScreenLandscape) { char filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgHelp_L.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_HELP_L")); } else { char filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgHelp.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_HELP")); } WndProperty* wp; if (wf) { TCHAR fullcaption[100]; _stprintf(fullcaption,TEXT("%s: %s"), gettext(TEXT("_@M336_")), Caption); // Help wf->SetCaption(fullcaption); wp = (WndProperty*)wf->FindByName(TEXT("prpHelpText")); if (wp) { wp->SetText(LKgethelptext(HelpText)); wp->RefreshDisplay(); } wf->ShowModal(); delete wf; } wf = NULL; }
void dlgOverlaysShowModal(void){ WndProperty *wp; TCHAR filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgOverlays.xml")); wf = dlgLoadFromXML(CallBackTable, filename, TEXT("IDR_XML_OVERLAYS")); if (!wf) return; setVariables(); wf->ShowModal(); wp = (WndProperty*)wf->FindByName(TEXT("prpTopLeft")); if (wp) Overlay_TopLeft = (wp->GetDataField()->GetAsInteger()); wp = (WndProperty*)wf->FindByName(TEXT("prpTopMid")); if (wp) Overlay_TopMid = (wp->GetDataField()->GetAsInteger()); wp = (WndProperty*)wf->FindByName(TEXT("prpTopRight")); if (wp) Overlay_TopRight = (wp->GetDataField()->GetAsInteger()); wp = (WndProperty*)wf->FindByName(TEXT("prpTopDown")); if (wp) Overlay_TopDown = (wp->GetDataField()->GetAsInteger()); wp = (WndProperty*)wf->FindByName(TEXT("prpLeftTop")); if (wp) Overlay_LeftTop = (wp->GetDataField()->GetAsInteger()); wp = (WndProperty*)wf->FindByName(TEXT("prpLeftMid")); if (wp) Overlay_LeftMid = (wp->GetDataField()->GetAsInteger()); wp = (WndProperty*)wf->FindByName(TEXT("prpLeftBottom")); if (wp) Overlay_LeftBottom = (wp->GetDataField()->GetAsInteger()); wp = (WndProperty*)wf->FindByName(TEXT("prpLeftDown")); if (wp) Overlay_LeftDown = (wp->GetDataField()->GetAsInteger()); wp = (WndProperty*)wf->FindByName(TEXT("prpRightTop")); if (wp) Overlay_RightTop = (wp->GetDataField()->GetAsInteger()); wp = (WndProperty*)wf->FindByName(TEXT("prpRightMid")); if (wp) Overlay_RightMid = (wp->GetDataField()->GetAsInteger()); wp = (WndProperty*)wf->FindByName(TEXT("prpRightBottom")); if (wp) Overlay_RightBottom = (wp->GetDataField()->GetAsInteger()); delete wf; wf = NULL; }
int dlgWaypointOutOfTerrain(TCHAR *Message){ WndFrame* wfrm; int res = 0; #ifdef HAVEEXCEPTIONS __try{ #endif char filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgWaypointOutOfTerrain.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_WAYPOINTTERRAIN")); if (wf) { wfrm = (WndFrame*)wf->FindByName(TEXT("frmWaypointOutOfTerrainText")); wfrm->SetCaption(Message); wfrm->SetCaptionStyle( DT_EXPANDTABS | DT_CENTER | DT_NOCLIP | DT_WORDBREAK); res = wf->ShowModal(); delete wf; } wf = NULL; #ifdef HAVEEXCEPTIONS }__except(EXCEPTION_EXECUTE_HANDLER ){ res = 0; // ToDo: log that problem }; #endif return(res); }
bool dlgFontEditShowModal(const TCHAR * FontDescription, const TCHAR * FontRegKey, LOGFONT autoLogFont){ bool bRetVal=false; char filename[MAX_PATH]; IsInitialized=false; LocalPathS(filename, TEXT("dlgFontEdit.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_FONTEDIT")); int UseCustomFontsold = UseCustomFonts; UseCustomFonts=1;// global var InitializeOneFont (&NewFont, FontRegKey, autoLogFont, &OriginalLogFont); UseCustomFonts=UseCustomFontsold; OriginalFontRegKey=FontRegKey; NewLogFont=OriginalLogFont; resetLogFont = autoLogFont; if (wf) { InitGUI(FontDescription); LoadGUI(); if (wf->ShowModal()==mrOK) { SaveValues(FontRegKey); bRetVal=true; } delete wf; } wf = NULL; return bRetVal; }
void dlgStartTaskShowModal(bool *validStart, double Time, double Speed, double Altitude){ char filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgStartTask.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_STARTTASK")); if (wf) { WndProperty* wp; TCHAR Temp[80]; wp = (WndProperty*)wf->FindByName(TEXT("prpTime")); if (wp) { Units::TimeToText(Temp, (int)TimeLocal((int)Time)); wp->SetText(Temp); } wp = (WndProperty*)wf->FindByName(TEXT("prpSpeed")); if (wp) { _stprintf(Temp, TEXT("%.0f %s"), (double) TASKSPEEDMODIFY * Speed, Units::GetTaskSpeedName()); wp->SetText(Temp); } wp = (WndProperty*)wf->FindByName(TEXT("prpAltitude")); if (wp) { _stprintf(Temp, TEXT("%.0f %s"), (double) Altitude*ALTITUDEMODIFY, Units::GetAltitudeName()); wp->SetText(Temp); } wf->ShowModal(); delete wf; } wf = NULL; *validStart = startIsValid; }
BOOL CDevCProbe::Config(){ char filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgDevCProbe.xml")); m_wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_DEVCPROBE")); ((WndButton *)m_wf->FindByName(TEXT("cmdClose")))->SetOnClickNotify(OnCloseClicked); ((WndButton *)m_wf->FindByName(TEXT("cmdSetCompassCal")))->SetOnClickNotify(OnCompassCalClicked); ((WndButton *)m_wf->FindByName(TEXT("cmdSetCalGyro")))->SetOnClickNotify(OnCalGyroClicked); ((WndButton *)m_wf->FindByName(TEXT("cmdZeroDeltaPress")))->SetOnClickNotify(OnZeroDeltaPressClicked); GetFirmwareVersion(m_pDevice); if(m_wf) { m_wf->SetTimerNotify(OnTimer); m_wf->ShowModal(); delete m_wf; m_wf=NULL; } return TRUE; }
/* * only called by #CAirspaceManager::ProcessAirspaceDetailQueue() * for display AirspaceDetails, use #PopupAirspaceDetail */ void dlgAirspaceDetails() { SHOWTHREAD(_T("dlgAirspaceDetails")); TCHAR filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgAirspaceDetails.xml")); wf = dlgLoadFromXML(CallBackTable, filename, TEXT("IDR_XML_AIRSPACEDETAILS")); if (!wf) return; wf->SetTimerNotify(1000, OnTimer); SetValues(); wf->ShowModal(); delete wf; wf = NULL; return; }
void dlgProfilesShowModal(void){ wf = NULL; char filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgProfiles.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_PROFILES")); if (!wf) return; ASSERT(wf!=NULL); ((WndButton *)wf->FindByName(TEXT("cmdClose"))) ->SetOnClickNotify(OnCloseClicked); ((WndButton *)wf->FindByName(TEXT("cmdLoad"))) ->SetOnClickNotify(OnLoadClicked); ((WndButton *)wf->FindByName(TEXT("cmdSaveExisting"))) ->SetOnClickNotify(OnSaveExistingClicked); ((WndButton *)wf->FindByName(TEXT("cmdSaveNew"))) ->SetOnClickNotify(OnSaveNewClicked); WndProperty* wp; wp = (WndProperty*)wf->FindByName(TEXT("prpFile")); if (wp) { DataFieldFileReader* dfe; dfe = (DataFieldFileReader*)wp->GetDataField(); TCHAR suff[10]; _stprintf(suff,_T("*%S"),LKS_PRF); dfe->ScanDirectoryTop(_T(LKD_CONF),suff); dfe->Set(0); } wf->ShowModal(); delete wf; wf = NULL; }
void dlgTaskCalculatorShowModal(void){ TCHAR filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgTaskCalculator.xml")); wf = dlgLoadFromXML(CallBackTable, filename, TEXT("IDR_XML_TASKCALCULATOR")); if (!wf) return; double MACCREADY_enter = MACCREADY; double CRUISE_EFFICIENCY_enter = CRUISE_EFFICIENCY; emc = EffectiveMacCready(&GPS_INFO, &CALCULATED_INFO); cruise_efficiency = CRUISE_EFFICIENCY; // find start value for range Range = AdjustAATTargets(2.0); RefreshCalculator(); if (!AATEnabled || !ValidTaskPoint(ActiveWayPoint+1)) { ((WndButton *)wf->FindByName(TEXT("Optimise")))->SetVisible(false); } if (!ValidTaskPoint(ActiveWayPoint)) { ((WndButton *)wf->FindByName(TEXT("Target")))->SetVisible(false); } if (wf->ShowModal() == mrCancle) { // todo: restore task settings. CheckSetMACCREADY(MACCREADY_enter); CRUISE_EFFICIENCY = CRUISE_EFFICIENCY_enter; } delete wf; wf = NULL; }
void dlgTaskWaypointShowModal(int itemindex, int tasktype, bool addonly){ wf = NULL; if (!ScreenLandscape) { char filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgTaskWaypoint_L.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_TASKWAYPOINT_L")); } else { char filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgTaskWaypoint.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_TASKWAYPOINT")); } if (ISPARAGLIDER) { if(DoOptimizeRoute()) AATEnabled=TRUE; EnableMultipleStartPoints=false; } twItemIndex = itemindex; twType = tasktype; if (!wf) return; //ASSERT(wf!=NULL); // wf->SetKeyDownNotify(FormKeyDown); wStart = ((WndFrame *)wf->FindByName(TEXT("frmStart"))); wTurnpoint = ((WndFrame *)wf->FindByName(TEXT("frmTurnpoint"))); wAATTurnpoint = ((WndFrame *)wf->FindByName(TEXT("frmAATTurnpoint"))); wFinish = ((WndFrame *)wf->FindByName(TEXT("frmFinish"))); //ASSERT(wStart!=NULL); //ASSERT(wTurnpoint!=NULL); //ASSERT(wAATTurnpoint!=NULL); //ASSERT(wFinish!=NULL); WndButton* wb; if (addonly) { wb = (WndButton *)wf->FindByName(TEXT("butSelect")); if (wb) { wb->SetVisible(false); } wb = (WndButton *)wf->FindByName(TEXT("butRemove")); if (wb) { wb->SetVisible(false); } wb = (WndButton *)wf->FindByName(TEXT("butDetails")); if (wb) { wb->SetVisible(false); } wb = (WndButton *)wf->FindByName(TEXT("butDown")); if (wb) { wb->SetVisible(false); } wb = (WndButton *)wf->FindByName(TEXT("butUp")); if (wb) { wb->SetVisible(false); } } else { if (!ValidTaskPoint(twItemIndex-1)) { wb = (WndButton *)wf->FindByName(TEXT("butUp")); if (wb) { wb->SetVisible(false); } } if (!ValidTaskPoint(twItemIndex+1)) { wb = (WndButton *)wf->FindByName(TEXT("butDown")); if (wb) { wb->SetVisible(false); } } } SetWaypointValues(true); switch (twType) { case 0: wStart->SetVisible(1); wTurnpoint->SetVisible(0); wAATTurnpoint->SetVisible(0); wFinish->SetVisible(0); break; case 1: wStart->SetVisible(0); if (AATEnabled) { wTurnpoint->SetVisible(0); wAATTurnpoint->SetVisible(1); } else { wTurnpoint->SetVisible(1); wAATTurnpoint->SetVisible(0); } wFinish->SetVisible(0); break; case 2: wStart->SetVisible(0); wTurnpoint->SetVisible(0); wAATTurnpoint->SetVisible(0); wFinish->SetVisible(1); break; } // set properties... SetValues(true); UpdateCaption(); wf->ShowModal(); // now retrieve changes GetWaypointValues(); ReadValues(); delete wf; wf = NULL; }