本文整理汇总了C++中WndProperty::SetCaption方法的典型用法代码示例。如果您正苦于以下问题:C++ WndProperty::SetCaption方法的具体用法?C++ WndProperty::SetCaption怎么用?C++ WndProperty::SetCaption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WndProperty
的用法示例。
在下文中一共展示了WndProperty::SetCaption方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setVariables
static void setVariables(void) {
WndProperty *wp;
TCHAR temptext[MAX_PATH];
TCHAR tmp[MAX_PATH];
for (unsigned int i=0 ; i < NO_WP_FILES; i++)
{
_tcscpy(temptext,szWaypointFile[i]);
_sntprintf(tmp,MAX_PATH,_T("prpFile%1u"),i+1);
wp = (WndProperty*)wf->FindByName(tmp);
if (wp) {
DataFieldFileReader* dfe = static_cast<DataFieldFileReader*>(wp->GetDataField());
if(dfe) {
dfe->ScanDirectoryTop(_T(LKD_WAYPOINTS), _T("*" LKS_WP_WINPILOT));
dfe->ScanDirectoryTop(_T(LKD_WAYPOINTS), _T("*" LKS_WP_XCSOAR));
dfe->ScanDirectoryTop(_T(LKD_WAYPOINTS), _T("*" LKS_WP_CUP));
dfe->ScanDirectoryTop(_T(LKD_WAYPOINTS), _T("*" LKS_WP_COMPE));
dfe->ScanDirectoryTop(_T(LKD_WAYPOINTS), _T("*" LKS_OPENAIP));
dfe->Lookup(temptext);
_sntprintf(tmp,MAX_PATH,_T("%s %1u "), MsgToken(2341),i+1); // [email protected]_ "Waypoint File"
wp->SetCaption(tmp);
}
wp->RefreshDisplay();
}
}
}
示例2: 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();
}
}
}
示例3: SetValues
//.........这里部分代码省略.........
} else {
_stprintf(buffer, TEXT("%.0f ft [?]"),
(top->Altitude*TOFEET));
}
break;
case abMSL:
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, TEXT("%.0f[m] %.0f[ft] MSL"),
top->Altitude, top->Altitude*TOFEET);
} else {
_stprintf(buffer, TEXT("%.0f ft MSL"),
top->Altitude*TOFEET);
}
break;
case abAGL:
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, TEXT("%.0f[m] %.0f[ft] AGL"),
top->AGL, top->AGL*TOFEET);
} else {
_stprintf(buffer, TEXT("%.0f ft AGL"),
top->AGL*TOFEET);
}
break;
case abFL:
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, TEXT("FL%.0f (%.0f[m] %.0f[ft])"),
top->FL, FLAltRounded(top->Altitude),
FLAltRounded(top->Altitude*TOFEET));
} else {
_stprintf(buffer, TEXT("FL%.0f (%.0f ft)"),
top->FL, FLAltRounded(top->Altitude*TOFEET));
}
break;
}
wp->SetText(buffer);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpBase"));
if (wp) {
switch (base->Base){
case abUndef:
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, TEXT("%.0f[m] %.0f[ft] [?]"),
base->Altitude, base->Altitude*TOFEET);
} else {
_stprintf(buffer, TEXT("%.0f ft [?]"),
base->Altitude*TOFEET);
}
break;
case abMSL:
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, TEXT("%.0f[m] %.0f[ft] MSL"),
base->Altitude, base->Altitude*TOFEET);
} else {
_stprintf(buffer, TEXT("%.0f ft MSL"),
base->Altitude*TOFEET);
}
break;
case abAGL:
if (base->Altitude == 0) {
_stprintf(buffer, TEXT("SFC"));
} else {
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, TEXT("%.0f[m] %.0f[ft] AGL"),
base->AGL, base->AGL*TOFEET);
} else {
_stprintf(buffer, TEXT("%.0f ft AGL"),
base->AGL*TOFEET);
}
}
break;
case abFL:
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, TEXT("FL %.0f (%.0f[m] %.0f[ft])"),
base->FL, FLAltRounded(base->Altitude),
FLAltRounded(base->Altitude*TOFEET));
} else {
_stprintf(buffer, TEXT("FL%.0f (%.0f ft)"),
base->FL, FLAltRounded(base->Altitude*TOFEET));
}
break;
}
wp->SetText(buffer);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpRange"));
if (wp) {
if (inside) {
// LKTOKEN [email protected]_ = "Inside"
wp->SetCaption(gettext(TEXT("[email protected]_")));
}
Units::FormatUserDistance(range, buffer, 20);
_stprintf(buffer2, TEXT(" %d")TEXT(DEG), iround(bearing));
_tcscat(buffer, buffer2);
wp->SetText(buffer);
wp->RefreshDisplay();
}
}
示例4: SetValues
//.........这里部分代码省略.........
(top->Altitude*TOFEET));
} else {
_stprintf(buffer, _T("%.0f ft [?]"),
(top->Altitude*TOFEET));
}
break;
case abMSL:
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, _T("%.0f[m] %.0f[ft] MSL"),
top->Altitude, top->Altitude*TOFEET);
} else {
_stprintf(buffer, _T("%.0f ft MSL"),
top->Altitude*TOFEET);
}
break;
case abAGL:
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, _T("%.0f[m] %.0f[ft] AGL"),
top->AGL, top->AGL*TOFEET);
} else {
_stprintf(buffer, _T("%.0f ft AGL"),
top->AGL*TOFEET);
}
break;
case abFL:
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, _T("FL%.0f (%.0f[m] %.0f[ft])"),
top->FL, FLAltRounded(top->Altitude),
FLAltRounded(top->Altitude*TOFEET));
} else {
_stprintf(buffer, _T("FL%.0f (%.0f ft)"),
top->FL, FLAltRounded(top->Altitude*TOFEET));
}
break;
}
wp->SetText(buffer);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpBase"));
if (wp) {
switch (base->Base){
case abUndef:
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, _T("%.0f[m] %.0f[ft] [?]"),
base->Altitude, base->Altitude*TOFEET);
} else {
_stprintf(buffer, _T("%.0f ft [?]"),
base->Altitude*TOFEET);
}
break;
case abMSL:
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, _T("%.0f[m] %.0f[ft] MSL"),
base->Altitude, base->Altitude*TOFEET);
} else {
_stprintf(buffer, _T("%.0f ft MSL"),
base->Altitude*TOFEET);
}
break;
case abAGL:
if (base->Altitude == 0) {
_stprintf(buffer, _T("SFC"));
} else {
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, _T("%.0f[m] %.0f[ft] AGL"),
base->AGL, base->AGL*TOFEET);
} else {
_stprintf(buffer, _T("%.0f ft AGL"),
base->AGL*TOFEET);
}
}
break;
case abFL:
if (Units::GetUserAltitudeUnit() == unMeter) {
_stprintf(buffer, _T("FL %.0f (%.0f[m] %.0f[ft])"),
base->FL, FLAltRounded(base->Altitude),
FLAltRounded(base->Altitude*TOFEET));
} else {
_stprintf(buffer, _T("FL%.0f (%.0f ft)"),
base->FL, FLAltRounded(base->Altitude*TOFEET));
}
break;
}
wp->SetText(buffer);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpRange"));
if (wp) {
if (inside) {
wp->SetCaption(gettext(_T("Inside")));
}
Units::FormatUserDistance(range, buffer, 20);
_stprintf(buffer2, _T(" %d")_T(DEG), iround(bearing));
_tcscat(buffer, buffer2);
wp->SetText(buffer);
wp->RefreshDisplay();
}
}
示例5: ReduceKeysByWaypointList
//.........这里部分代码省略.........
{
EqCnt=0; /* reset number of found waypoints */
NumChar =0;
for (i=NUMRESWP; i< WayPointList.size(); i++)
{
NameLen = _tcslen(WayPointList[i].Name);
Offset = 0;
if(cursor > NameLen)
CharEqual = false;
else
{
do
{
k=0;
CharEqual = true;
while((k < (cursor)) && ((k+Offset) < NameLen) && CharEqual)
{
LKASSERT(k < MAX_TEXTENTRY);
LKASSERT((k+Offset) < NameLen);
char ac = (char)WayPointList[i].Name[k+Offset];
char bc = (char)edittext[k];
if( ToUpper(ac) != ToUpper(bc) ) /* waypoint has string ?*/
{
CharEqual = false;
}
k++;
}
Offset++;
}
while(((Offset-1+cursor) < NameLen) && !CharEqual );
Offset--;
}
if(CharEqual)
{
if(Offset < IdenticalOffset)
{
IdenticalIndex = i; /* remember first found equal name */
IdenticalOffset = Offset; /* remember first found equal name */
// StartupStore(_T("Found Best Fit %i Idx %i %s\n"), i, IdenticalIndex, WayPointList[IdenticalIndex].Name);
}
EqCnt++;
LKASSERT((cursor+Offset)<=NAME_SIZE);
LKASSERT(i<=WayPointList.size());
TCHAR newChar = ToUpper(WayPointList[i].Name[cursor+Offset]);
bool existing = false;
j=0;
while(( j < NumChar) && (!existing)) /* new character already in list? */
{
// StartupStore(_T(". j=%i MAX_SEL_LIST_SIZE= %i\n"),j,MAX_SEL_LIST_SIZE);
LKASSERT(j<MAX_SEL_LIST_SIZE);
if(SelList[j] == (unsigned char)newChar)
existing = true;
j++;
}
if(!existing && (NumChar <MAX_SEL_LIST_SIZE)) /* add new character to key enable list */
{
// StartupStore(_T(". j=%i MAX_SEL_LIST_SIZE= %i\n"),j,MAX_SEL_LIST_SIZE);
LKASSERT(NumChar<MAX_SEL_LIST_SIZE);
SelList[NumChar++] = newChar;
}
}
}
SelList[NumChar++] = '\0';
RemoveKeys((char*)SelList, NumChar);
wp = (WndProperty*)wf->FindByName(TEXT("prpText"));
if (wp)
{
if(EqCnt ==1)
{
LKASSERT(IdenticalIndex<= (int)WayPointList.size());
wp->SetText(WayPointList[IdenticalIndex].Name);
}
else
{
if((cursor >0) && (EqCnt >0))
{
LKASSERT(cursor < NAME_SIZE);
LKASSERT(IdenticalIndex<=(int)WayPointList.size());
_stprintf(Found,_T("%s"),WayPointList[IdenticalIndex].Name);
for( i = 0; i < cursor; i++)
Found[i+IdenticalOffset] = toupper(WayPointList[IdenticalIndex].Name[i+IdenticalOffset]);
wp->SetText(Found);
}
}
}
}
wp = (WndProperty*)wf->FindByName(TEXT("prpMatch"));
if (wp)
{
_stprintf(Found,_T("%s:%i"),MsgToken(948),EqCnt); /* [email protected]_ Found */
wp->SetCaption(Found);
}
}
示例6: RedrawSampleFont
static void RedrawSampleFont(void)
{
if (!IsInitialized) {
return;
}
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpFontName"));
if(wp) {
_tcsncpy(NewLogFont.lfFaceName,wp->GetDataField()->GetAsString(), LF_FACESIZE-1);
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontHeight"));
if(wp) {
NewLogFont.lfHeight = wp->GetDataField()->GetAsInteger();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontWeight"));
if(wp) {
NewLogFont.lfWeight= wp->GetDataField()->GetAsInteger();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontItalic"));
if(wp) {
if ( wp->GetDataField()->GetAsInteger() ) {
NewLogFont.lfItalic=1;
}
else {
NewLogFont.lfItalic=0;
}
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontPitchAndFamily"));
if (wp) {
NewLogFont.lfPitchAndFamily=wp->GetDataField()->GetAsInteger();
}
//KT
wp = (WndProperty*)wf->FindByName(TEXT("prpFontTrueType"));
if(wp) {
if ( wp->GetDataField()->GetAsBoolean() )
{
wp = (WndProperty*)wf->FindByName(TEXT("prpFontRenderer"));
if(wp)
{
if ( wp->GetDataField()->GetAsInteger() )
{
NewLogFont.lfQuality = CLEARTYPE_COMPAT_QUALITY;
}
else
{
NewLogFont.lfQuality = ANTIALIASED_QUALITY;
}
}
}
else {
NewLogFont.lfQuality = NONANTIALIASED_QUALITY;
}
}
DeleteObject(NewFont);
NewFont = CreateFontIndirect (&NewLogFont);
if ( _tcscmp(OriginalFontRegKey, szRegistryFontMapWindowBoldFont) == 0 ) {
wf->SetFont(NewFont);
wf->SetTitleFont(NewFont);
wf->SetVisible(false);
wf->SetVisible(true);
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontSample"));
if(wp) {
if (GetObjectType(NewFont) == OBJ_FONT) {
wp->SetFont(NewFont);
wp->SetCaption(TEXT("<AbCdEfGh1234>"));
wp->SetVisible(false);
wp->SetVisible(true);
wp->RefreshDisplay();
}
else {
wp->SetCaption(TEXT("Error Creating Font!"));
wp->RefreshDisplay();
}
}
}
示例7: SetValues
static void SetValues(WndForm* wf) {
WndProperty* wp;
WndButton *wb;
TCHAR buffer[80];
TCHAR buffer2[160]; // must contain buffer
int bearing;
int hdist;
int vdist;
bool inside = false;
{
ScopeLock guard(CAirspaceManager::Instance().MutexRef());
CAirspace* airspace = CAirspaceManager::Instance().GetAirspacesForDetails();
if(airspace) {
// Get an object instance copy with actual values
airspace_copy = CAirspaceManager::Instance().GetAirspaceCopy(airspace);
inside = CAirspaceManager::Instance().AirspaceCalculateDistance( airspace, &hdist, &bearing, &vdist);
} else {
// error : CAirspaceManager are closed ?
return;
}
}
if (wf!=NULL) {
TCHAR capbuffer[250];
_stprintf(capbuffer,_T("%s ("),airspace_copy.Name());
if (airspace_copy.Enabled()) {
_tcscat(capbuffer,MsgToken(1643)); // ENABLED
} else {
_tcscat(capbuffer,MsgToken(1600)); // DISABLED
}
_tcscat(capbuffer,_T(")")); // DISABLED
wf->SetCaption(capbuffer);
}
wp = (WndProperty*)wf->FindByName(TEXT("prpType"));
if (wp) {
if (airspace_copy.Flyzone()) {
_stprintf(buffer,TEXT("%s %s"), CAirspaceManager::GetAirspaceTypeText(airspace_copy.Type()), TEXT("FLY"));
/*
if( _tcsnicmp( airspace_copy.Name(), airspace_copy.TypeName() ,_tcslen(airspace_copy.TypeName())) == 0)
_stprintf(buffer,TEXT("%s"),airspace_copy.Name());
else
_stprintf(buffer,TEXT("%s %s"),airspace_copy.TypeName() // fixed strings max. 20
,airspace_copy.Name()); // NAME_SIZE 30 => max. 30 char
*/
} else {
_stprintf(buffer,TEXT("%s %s"), TEXT("NOFLY"), CAirspaceManager::GetAirspaceTypeText(airspace_copy.Type()));
}
wp->SetText( buffer );
// wp->SetBackColor( airspace_copy.TypeColor());
// wp->SetForeColor( ContrastTextColor(airspace_copy.TypeColor()));
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTop"));
if (wp) {
CAirspaceManager::Instance().GetAirspaceAltText(buffer, sizeof(buffer)/sizeof(buffer[0]), airspace_copy.Top());
wp->SetText(buffer);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpBase"));
if (wp) {
CAirspaceManager::Instance().GetAirspaceAltText(buffer, sizeof(buffer)/sizeof(buffer[0]), airspace_copy.Base());
wp->SetText(buffer);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpRange"));
if (wp) {
Units::FormatUserDistance(abs(hdist), buffer, 20);
if (inside) {
// LKTOKEN [email protected]_ = "Inside"
wp->SetCaption(MsgToken(359));
}
if (hdist < 0) {
// LKTOKEN [email protected]_ "to leave"
_stprintf(buffer2, TEXT("%s %d%s %s"), buffer, iround(bearing), MsgToken(2179), MsgToken(1257));
} else {
// LKTOKEN [email protected]_ "to enter"
_stprintf(buffer2, TEXT("%s %d%s %s"), buffer, iround(bearing), MsgToken(2179), MsgToken(1258));
}
wp->SetText(buffer2);
wp->RefreshDisplay();
}
WindowControl* wDetails = wf->FindByName(TEXT("cmdDetails"));
{
ScopeLock guard(CAirspaceManager::Instance().MutexRef());
CAirspace* airspace = CAirspaceManager::Instance().GetAirspacesForDetails();
if(airspace->Comment() != NULL)
{
if(_tcslen(airspace->Comment()) > 10 )
//.........这里部分代码省略.........
示例8: SetValues
static void SetValues(void) {
WndProperty* wp;
WndButton *wb;
TCHAR buffer[80];
TCHAR buffer2[160]; // must contain buffer
int bearing;
int hdist;
int vdist;
bool inside = false;
{
CCriticalSection::CGuard guard(CAirspaceManager::Instance().MutexRef());
CAirspace* airspace = CAirspaceManager::Instance().GetAirspacesForDetails();
if(airspace) {
// Get an object instance copy with actual values
airspace_copy = CAirspaceManager::Instance().GetAirspaceCopy(airspace);
inside = CAirspaceManager::Instance().AirspaceCalculateDistance( airspace, &hdist, &bearing, &vdist);
} else {
// error : CAirspaceManager are closed ?
return;
}
}
if (wf!=NULL) {
TCHAR capbuffer[250];
_stprintf(capbuffer,_T("%s ("),airspace_copy.Name());
if (airspace_copy.Enabled()) {
_tcscat(capbuffer,gettext(TEXT("[email protected]_"))); // ENABLED
} else {
_tcscat(capbuffer,gettext(TEXT("[email protected]_"))); // DISABLED
}
_tcscat(capbuffer,_T(")")); // DISABLED
wf->SetCaption(capbuffer);
}
wp = (WndProperty*)wf->FindByName(TEXT("prpType"));
if (wp) {
if (airspace_copy.Flyzone()) {
_stprintf(buffer,TEXT("%s %s"), CAirspaceManager::Instance().GetAirspaceTypeText(airspace_copy.Type()), gettext(TEXT("FLY")));
/*
if( _tcsnicmp( airspace_copy.Name(), airspace_copy.TypeName() ,_tcslen(airspace_copy.TypeName())) == 0)
_stprintf(buffer,TEXT("%s"),airspace_copy.Name());
else
_stprintf(buffer,TEXT("%s %s"),airspace_copy.TypeName() // fixed strings max. 20
,airspace_copy.Name()); // NAME_SIZE 30 => max. 30 char
*/
} else {
_stprintf(buffer,TEXT("%s %s"), gettext(TEXT("NOFLY")), CAirspaceManager::Instance().GetAirspaceTypeText(airspace_copy.Type()));
}
wp->SetText( buffer );
// wp->SetBackColor( airspace_copy.TypeColor());
// wp->SetForeColor( ContrastTextColor(airspace_copy.TypeColor()));
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTop"));
if (wp) {
CAirspaceManager::Instance().GetAirspaceAltText(buffer, sizeof(buffer)/sizeof(buffer[0]), airspace_copy.Top());
wp->SetText(buffer);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpBase"));
if (wp) {
CAirspaceManager::Instance().GetAirspaceAltText(buffer, sizeof(buffer)/sizeof(buffer[0]), airspace_copy.Base());
wp->SetText(buffer);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpRange"));
if (wp) {
Units::FormatUserDistance(abs(hdist), buffer, 20);
if (inside) {
// LKTOKEN [email protected]_ = "Inside"
wp->SetCaption(gettext(TEXT("[email protected]_")));
}
if (hdist < 0) {
// LKTOKEN [email protected]_ "to leave"
_stprintf(buffer2, TEXT("%s %d%s %s"), buffer, iround(bearing), gettext(_T("[email protected]_")), gettext(TEXT("[email protected]_")));
} else {
// LKTOKEN [email protected]_ "to enter"
_stprintf(buffer2, TEXT("%s %d%s %s"), buffer, iround(bearing), gettext(_T("[email protected]_")), gettext(TEXT("[email protected]_")));
}
wp->SetText(buffer2);
wp->RefreshDisplay();
}
// ONLY for DIAGNOSTICS- ENABLE ALSO XML
#if 0
wp = (WndProperty*)wf->FindByName(TEXT("prpWarnLevel"));
if (wp) {
switch (airspace_copy.WarningLevel()) {
default:
// LKTOKEN [email protected]_ "Unknown"
wp->SetText(gettext(TEXT("[email protected]_")));
//.........这里部分代码省略.........