本文整理汇总了C++中WndProperty::SetText方法的典型用法代码示例。如果您正苦于以下问题:C++ WndProperty::SetText方法的具体用法?C++ WndProperty::SetText怎么用?C++ WndProperty::SetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WndProperty
的用法示例。
在下文中一共展示了WndProperty::SetText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
static void Update()
{
WndProperty* wp;
TCHAR Text[100];
double teammateBearing = XCSoarInterface::Calculated().TeammateBearing;
double teammateRange = XCSoarInterface::Calculated().TeammateRange;
if (XCSoarInterface::SettingsComputer().TeamCodeRefWaypoint >= 0) {
double Value = XCSoarInterface::Calculated().TeammateBearing - XCSoarInterface::Basic().TrackBearing;
if (Value < -180.0)
Value += 360.0;
else
if (Value > 180.0)
Value -= 360.0;
if (Value > 1)
_stprintf(Text, TEXT("%2.0f")TEXT(DEG)TEXT(">"), Value);
else if (Value < -1)
_stprintf(Text, TEXT("<%2.0f")TEXT(DEG), -Value);
else
_tcscpy(Text, TEXT("<>"));
} else {
_tcscpy(Text, TEXT("---"));
}
wp = (WndProperty*)wf->FindByName(TEXT("prpRelBearing"));
if (wp) {
wp->SetText(Text);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpBearing"));
if (wp) {
wp->GetDataField()->SetAsFloat(teammateBearing);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpRange"));
if (wp) {
wp->GetDataField()->SetAsFloat(teammateRange*DISTANCEMODIFY);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpOwnCode"));
if (wp) {
_tcsncpy(Text,XCSoarInterface::Calculated().OwnTeamCode,5);
Text[5] = '\0';
wp->SetText(Text);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpMateCode"));
if (wp) {
wp->SetText(XCSoarInterface::SettingsComputer().TeammateCode);
wp->RefreshDisplay();
}
}
示例2: UpdateValuesTimes
static void UpdateValuesTimes(void) {
WndProperty *wp;
TCHAR Temp[1000];
double sunsettime;
int sunsethours;
int sunsetmins;
sunsettime = DoSunEphemeris(GPS_INFO.Longitude,
GPS_INFO.Latitude);
sunsethours = (int)sunsettime;
sunsetmins = (int)((sunsettime-sunsethours)*60);
wp = (WndProperty*)wf->FindByName(TEXT("prpSunset"));
if (wp) {
_stprintf(Temp, TEXT("%02d:%02d"), sunsethours,sunsetmins);
wp->SetText(Temp);
}
wp = (WndProperty*)wf->FindByName(TEXT("prpLocalTime"));
if (wp) {
Units::TimeToText(Temp, (int)DetectCurrentTime());
wp->SetText(Temp);
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTakeoffTime"));
if (wp) {
if (CALCULATED_INFO.FlightTime>0) {
Units::TimeToText(Temp,
(int)TimeLocal((long)CALCULATED_INFO.TakeOffTime));
wp->SetText(Temp);
} else {
wp->SetText(TEXT(""));
}
}
wp = (WndProperty*)wf->FindByName(TEXT("prpLandingTime"));
if (wp) {
if (!CALCULATED_INFO.Flying) {
Units::TimeToText(Temp,
(int)TimeLocal((long)(CALCULATED_INFO.TakeOffTime
+CALCULATED_INFO.FlightTime)));
wp->SetText(Temp);
} else {
wp->SetText(TEXT(""));
}
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFlightTime"));
if (wp) {
if (CALCULATED_INFO.FlightTime > 0){
Units::TimeToText(Temp, (int)CALCULATED_INFO.FlightTime);
wp->SetText(Temp);
} else {
wp->SetText(TEXT(""));
}
}
}
示例3: UpdateValuesTimes
static void UpdateValuesTimes(void) {
WndProperty *wp;
TCHAR Temp[1000];
double sunsettime;
int sunsethours;
int sunsetmins;
sunsettime = XCSoarInterface::Calculated().TimeSunset;
sunsethours = (int)sunsettime;
sunsetmins = (int)((sunsettime-sunsethours)*60);
wp = (WndProperty*)wf->FindByName(TEXT("prpSunset"));
if (wp) {
_stprintf(Temp, TEXT("%02d:%02d"), sunsethours,sunsetmins);
wp->SetText(Temp);
}
wp = (WndProperty*)wf->FindByName(TEXT("prpLocalTime"));
if (wp) {
Units::TimeToText(Temp, (int)DetectCurrentTime(&XCSoarInterface::Basic()));
wp->SetText(Temp);
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTakeoffTime"));
if (wp) {
if (XCSoarInterface::Calculated().FlightTime>0) {
Units::TimeToText(Temp,
(int)TimeLocal((long)XCSoarInterface::Calculated().TakeOffTime));
wp->SetText(Temp);
} else {
wp->SetText(TEXT(""));
}
}
wp = (WndProperty*)wf->FindByName(TEXT("prpLandingTime"));
if (wp) {
if (!XCSoarInterface::Calculated().Flying) {
Units::TimeToText(Temp,
(int)TimeLocal((long)(XCSoarInterface::Calculated().TakeOffTime
+XCSoarInterface::Calculated().FlightTime)));
wp->SetText(Temp);
} else {
wp->SetText(TEXT(""));
}
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFlightTime"));
if (wp) {
if (XCSoarInterface::Calculated().FlightTime > 0){
Units::TimeToText(Temp, (int)XCSoarInterface::Calculated().FlightTime);
wp->SetText(Temp);
} else {
wp->SetText(TEXT(""));
}
}
}
示例4: UpdateTextboxProp
static void UpdateTextboxProp(void)
{
WndProperty *wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpText"));
if (wp) {
wp->SetText(edittext);
}
}
示例5: Add
void
RowFormWidget::AddReadOnly(const TCHAR *label, const TCHAR *help,
const TCHAR *text)
{
WndProperty *control = Add(label, help, true);
if (text != NULL)
control->SetText(text);
}
示例6:
static void
Update()
{
tstring metar_taf = _T("");
ParsedMETAR parsed;
if (NOAAStore::GetParsedMETAR(station_index, parsed)) {
TCHAR buffer[256];
if (parsed.temperatures_available) {
_stprintf(buffer, _T("%s: %.1f %s\n"), _("Temperature"),
(double)Units::ToUserTemperature(parsed.temperature),
Units::GetTemperatureName());
metar_taf += buffer;
_stprintf(buffer, _T("%s: %.1f %s\n\n"), _("Dew point"),
(double)Units::ToUserTemperature(parsed.dew_point),
Units::GetTemperatureName());
metar_taf += buffer;
}
if (parsed.wind_available) {
TCHAR buffer2[16];
Units::FormatUserWindSpeed(parsed.wind.norm, buffer2, 16);
_stprintf(buffer, _T("%s: %.0f" DEG " %s\n\n"), _("Wind"),
(double)parsed.wind.bearing.value_degrees(), buffer2);
metar_taf += buffer;
}
if (parsed.qnh_available) {
_stprintf(buffer, _T("%s: %.0f hPa\n\n"), _("QNH"),
(double)parsed.qnh.GetQNH());
metar_taf += buffer;
}
}
METAR metar;
if (!NOAAStore::GetMETAR(station_index, metar)) {
metar_taf += _("No METAR available!");
} else {
metar_taf += metar.content.c_str();
}
metar_taf += _T("\n\n");
TAF taf;
if (!NOAAStore::GetTAF(station_index, taf)) {
metar_taf += _("No TAF available!");
} else {
metar_taf += taf.content.c_str();
}
WndProperty* wp = (WndProperty*)wf->FindByName(_T("DetailsText"));
wp->SetText(metar_taf.c_str());
}
示例7: vec
static void
SetValues(void)
{
assert(airspace);
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(_T("prpName"));
if (wp) {
wp->SetText(airspace->get_name_text(true).c_str());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpType"));
if (wp) {
wp->SetText(airspace->get_type_text());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpTop"));
if (wp) {
wp->SetText(airspace->get_top_text().c_str());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpBase"));
if (wp) {
wp->SetText(airspace->get_base_text().c_str());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpRange"));
if (wp) {
const GeoPoint &ac_loc = XCSoarInterface::Basic().Location;
const GeoPoint closest_loc = airspace->closest_point(ac_loc);
const GeoVector vec(ac_loc, closest_loc);
TCHAR buf[80];
_stprintf(buf, _T("%d%s"),
(int)Units::ToUserUnit(vec.Distance, Units::DistanceUnit),
Units::GetDistanceName());
wp->SetText(buf);
wp->RefreshDisplay();
}
}
示例8: dlgStartTaskShowModal
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;
}
示例9: assert
void
SiteConfigPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
buttonWaypoints = ((WndButton *)ConfigPanel::GetForm().FindByName(_T("cmdWaypoints")));
assert (buttonWaypoints);
buttonWaypoints->SetOnClickNotify(OnWaypoints);
WndProperty *wp = Add(_T(""), 0, true);
wp->SetText(GetPrimaryDataPath());
wp->SetEnabled(false);
AddFileReader(_("Map database"),
_("The name of the file (.xcm) containing terrain, topography, and optionally "
"waypoints, their details and airspaces."),
szProfileMapFile, _T("*.xcm\0*.lkm\0"));
AddFileReader(_("Waypoints"),
_("Primary waypoints file. Supported file types are Cambridge/WinPilot files (.dat), "
"Zander files (.wpz) or SeeYou files (.cup)."),
szProfileWaypointFile, _T("*.dat\0*.xcw\0*.cup\0*.wpz\0*.wpt\0"));
AddFileReader(_("More waypoints"),
_("Secondary waypoints file. This may be used to add waypoints for a competition."),
szProfileAdditionalWaypointFile, _T("*.dat\0*.xcw\0*.cup\0*.wpz\0*.wpt\0"));
SetExpertRow(AdditionalWaypointFile);
AddFileReader(_("Watched waypoints"),
_("Waypoint file containing special waypoints for which additional computations like "
"calculation of arrival height in map display always takes place. Useful for "
"waypoints like known reliable thermal sources (e.g. powerplants) or mountain passes."),
szProfileWatchedWaypointFile, _T("*.dat\0*.xcw\0*.cup\0*.wpz\0*.wpt\0"));
SetExpertRow(WatchedWaypointFile);
AddFileReader(_("Airspaces"), _("The file name of the primary airspace file."),
szProfileAirspaceFile, _T("*.txt\0*.air\0*.sua\0"));
AddFileReader(_("More airspaces"), _("The file name of the secondary airspace file."),
szProfileAdditionalAirspaceFile, _T("*.txt\0*.air\0*.sua\0"));
SetExpertRow(AdditionalAirspaceFile);
AddFileReader(_("Terrain file"), _("The name of the file containing digital elevation terrain data."),
szProfileTerrainFile, _T("*.jp2\0"));
SetExpertRow(TerrainFile);
AddFileReader(_("Topography file"), _("Specifies the file defining the topographical features."),
szProfileTopographyFile, _T("*.tpl\0"));
SetExpertRow(TopographyFile);
AddFileReader(_("Waypoint details"),
_("The file may contain extracts from enroute supplements or other contributed "
"information about individual waypoints and airfields."),
szProfileAirfieldFile, _T("*.txt\0"));
SetExpertRow(AirfieldFile);
}
示例10: assert
void
SetFormValue(SubForm &form, const TCHAR *control_name, const TCHAR *value)
{
assert(control_name != NULL);
assert(value != NULL);
WndProperty *ctl = (WndProperty *)form.FindByName(control_name);
assert(ctl != NULL);
ctl->SetText(value);
}
示例11: UpdateAllowedCharacters
static void
UpdateTextboxProp(void)
{
WndProperty *wp;
wp = (WndProperty*)wf->FindByName(_T("prpText"));
if (!wp)
return;
wp->SetText(edittext);
UpdateAllowedCharacters();
}
示例12: time
void
TimeConfigPanel::SetLocalTime(int utc_offset)
{
WndProperty* wp;
TCHAR temp[20];
int time(XCSoarInterface::Basic().time);
Units::TimeToTextHHMMSigned(temp, TimeLocal(time, utc_offset));
wp = (WndProperty*)form.FindByName(_T("prpLocalTime"));
assert(wp != NULL);
wp->SetText(temp);
wp->RefreshDisplay();
}
示例13: UpdateTextboxProp
static void UpdateTextboxProp(void)
{
WndProperty *wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpText"));
if (wp) {
wp->SetText(edittext);
if(WaypointKeyRed)
wp->SetCaption(MsgToken(949));
else
wp->SetCaption(TEXT("Text"));
}
wp = (WndProperty*)wf->FindByName(TEXT("prpUnit"));
if(wp && wKeyboardPopupWndProperty) {
DataField* pField = wKeyboardPopupWndProperty->GetDataField();
if(pField) {
wp->SetCaption(pField->GetUnits());
wp->RefreshDisplay();
wp->Redraw();
}
}
{
WndButton *wb;
if(WaypointKeyRed)
{
ReduceKeysByWaypointList();
wb = (WndButton*) wf->FindByName(TEXT("prpDate")); if(wb != NULL) wb->SetVisible(false);
wb = (WndButton*) wf->FindByName(TEXT("prpTime")); if(wb != NULL) wb->SetVisible(false);
}
wp = (WndProperty*)wf->FindByName(TEXT("prpMatch"));; if(wp != NULL) wp->SetVisible(WaypointKeyRed);
/*
CharUpper(szLanguageFile);
BOOL bGerChar = false;
if( _tcscmp(szLanguageFile,_T("GERMAN.LNG"))==0)
bGerChar = true;
wb = (WndButton*) wf->FindByName(TEXT("prpAe")); if(wb != NULL) wb->SetVisible(bGerChar);
wb = (WndButton*) wf->FindByName(TEXT("prpOe")); if(wb != NULL) wb->SetVisible(bGerChar);
wb = (WndButton*) wf->FindByName(TEXT("prpUe")); if(wb != NULL) wb->SetVisible(bGerChar);
*/
}
}
示例14: Add
void
SiteConfigPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
WndProperty *wp = Add(_T(""), 0, true);
wp->SetText(GetPrimaryDataPath().c_str());
wp->SetEnabled(false);
AddFile(_("Map database"),
_("The name of the file (.xcm) containing terrain, topography, and optionally "
"waypoints, their details and airspaces."),
ProfileKeys::MapFile, _T("*.xcm\0*.lkm\0"), FileType::MAP);
AddFile(_("Waypoints"),
_("Primary waypoints file. Supported file types are Cambridge/WinPilot files (.dat), "
"Zander files (.wpz) or SeeYou files (.cup)."),
ProfileKeys::WaypointFile, WAYPOINT_FILE_PATTERNS,
FileType::WAYPOINT);
AddFile(_("More waypoints"),
_("Secondary waypoints file. This may be used to add waypoints for a competition."),
ProfileKeys::AdditionalWaypointFile, WAYPOINT_FILE_PATTERNS,
FileType::WAYPOINT);
SetExpertRow(AdditionalWaypointFile);
AddFile(_("Watched waypoints"),
_("Waypoint file containing special waypoints for which additional computations like "
"calculation of arrival height in map display always takes place. Useful for "
"waypoints like known reliable thermal sources (e.g. powerplants) or mountain passes."),
ProfileKeys::WatchedWaypointFile, WAYPOINT_FILE_PATTERNS,
FileType::WAYPOINT);
SetExpertRow(WatchedWaypointFile);
AddFile(_("Airspaces"), _("The file name of the primary airspace file."),
ProfileKeys::AirspaceFile, _T("*.txt\0*.air\0*.sua\0"),
FileType::AIRSPACE);
AddFile(_("More airspaces"), _("The file name of the secondary airspace file."),
ProfileKeys::AdditionalAirspaceFile, _T("*.txt\0*.air\0*.sua\0"),
FileType::AIRSPACE);
SetExpertRow(AdditionalAirspaceFile);
AddFile(_("Waypoint details"),
_("The file may contain extracts from enroute supplements or other contributed "
"information about individual waypoints and airfields."),
ProfileKeys::AirfieldFile, _T("*.txt\0"));
SetExpertRow(AirfieldFile);
}
示例15: UpdateTextboxProp
static void UpdateTextboxProp(void)
{
WndProperty *wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpText"));
if (wp) {
wp->SetText(edittext);
}
wp = (WndProperty*)wf->FindByName(TEXT("prpUnit"));
if(wp && wKeyboardPopupWndProperty) {
DataField* pField = wKeyboardPopupWndProperty->GetDataField();
if(pField) {
wp->SetCaption(pField->GetUnits());
wp->RefreshDisplay();
wp->Redraw();
}
}
}