本文整理汇总了C++中WndProperty类的典型用法代码示例。如果您正苦于以下问题:C++ WndProperty类的具体用法?C++ WndProperty怎么用?C++ WndProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WndProperty类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: LoadOptionalFormProperty
void
LoadOptionalFormProperty(WndForm &form, const TCHAR *control_name,
fixed value)
{
assert(control_name != NULL);
WndProperty *ctl = (WndProperty *)form.FindByName(control_name);
if (ctl == NULL)
return;
DataFieldFloat &df = *(DataFieldFloat *)ctl->GetDataField();
assert(df.GetType() == DataField::TYPE_REAL);
df.Set(value);
ctl->RefreshDisplay();
}
开发者ID:macsux,项目名称:XCSoar,代码行数:15,代码来源:Util.cpp
示例2: RefreshFonts
static void
RefreshFonts()
{
WndProperty * wp;
wp = (WndProperty*)wf->FindByName(_T("prpUseCustomFonts"));
if (wp) {
bool bUseCustomFonts =
((DataFieldBoolean*)(wp->GetDataField()))->GetAsBoolean();
ResetFonts(bUseCustomFonts);
ShowFontEditButtons(bUseCustomFonts);
}
// now set SampleTexts on the Fonts frame
WndFrame *sample;
sample = (WndFrame *)wf->FindByName(_T("prpInfoWindowFont"));
if (sample)
sample->SetFont(TempInfoWindowFont);
sample = (WndFrame *)wf->FindByName(_T("prpTitleWindowFont"));
if (sample)
sample->SetFont(TempTitleWindowFont);
sample = (WndFrame *)wf->FindByName(_T("prpMapWindowFont"));
if (sample)
sample->SetFont(TempMapWindowFont);
sample = (WndFrame *)wf->FindByName(_T("prpTitleSmallWindowFont"));
if (sample)
sample->SetFont(TempTitleSmallWindowFont);
sample = (WndFrame *)wf->FindByName(_T("prpMapWindowBoldFont"));
if (sample)
sample->SetFont(TempMapWindowBoldFont);
sample = (WndFrame *)wf->FindByName(_T("prpCDIWindowFont"));
if (sample)
sample->SetFont(TempCDIWindowFont);
sample = (WndFrame *)wf->FindByName(_T("prpMapLabelFont"));
if (sample)
sample->SetFont(TempMapLabelFont);
sample = (WndFrame *)wf->FindByName(_T("prpMapLabelImportantFont"));
if (sample)
sample->SetFont(TempMapLabelImportantFont);
}
开发者ID:,项目名称:,代码行数:48,代码来源:
示例3: assert
void
TaskRulesConfigPanel::Init(WndForm *_wf)
{
assert(_wf != NULL);
wf = _wf;
WndProperty *wp;
const SETTINGS_COMPUTER &settings_computer = XCSoarInterface::SettingsComputer();
LoadFormProperty(*wf, _T("prpStartMaxSpeed"), ugHorizontalSpeed,
settings_computer.ordered_defaults.start_max_speed);
LoadFormProperty(*wf, _T("prpStartMaxSpeedMargin"), ugHorizontalSpeed,
settings_computer.start_max_speed_margin);
LoadFormProperty(*wf, _T("prpStartMaxHeight"), ugAltitude,
settings_computer.ordered_defaults.start_max_height);
LoadFormProperty(*wf, _T("prpStartMaxHeightMargin"), ugAltitude,
settings_computer.start_max_height_margin);
wp = (WndProperty*)wf->FindByName(_T("prpStartHeightRef"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_("AGL"));
dfe->addEnumText(_("MSL"));
dfe->Set(settings_computer.ordered_defaults.start_max_height_ref);
wp->RefreshDisplay();
}
LoadFormProperty(*wf, _T("prpFinishMinHeight"), ugAltitude,
settings_computer.ordered_defaults.finish_min_height);
wp = (WndProperty*)wf->FindByName(_T("prpContests"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(ContestToString(OLC_FAI), OLC_FAI);
dfe->addEnumText(ContestToString(OLC_Classic), OLC_Classic);
dfe->addEnumText(ContestToString(OLC_League), OLC_League);
dfe->addEnumText(ContestToString(OLC_Plus), OLC_Plus);
dfe->addEnumText(ContestToString(OLC_XContest), OLC_XContest);
dfe->addEnumText(ContestToString(OLC_DHVXC), OLC_DHVXC);
dfe->addEnumText(ContestToString(OLC_SISAT), OLC_SISAT);
dfe->Set(settings_computer.contest);
wp->RefreshDisplay();
}
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:48,代码来源:TaskRulesConfigPanel.cpp
示例4: 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
示例5: 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
示例6: GetMinimumHeight
gcc_pure
static unsigned
GetMinimumHeight(const WndProperty &control, const DialogLook &look,
bool vertical)
{
const unsigned padding = Layout::GetTextPadding();
unsigned height = look.text_font.GetHeight();
if (vertical && control.HasCaption())
height *= 2;
height += padding * 2;
if (!control.IsReadOnly() && height < Layout::GetMinimumControlHeight())
height = Layout::GetMinimumControlHeight();
return height;
}
开发者ID:nkgautam,项目名称:XCSoar,代码行数:16,代码来源:RowFormWidget.cpp
示例7: Add
WndProperty *
RowFormWidget::AddFloat(const TCHAR *label, const TCHAR *help,
const TCHAR *display_format,
const TCHAR *edit_format,
double min_value, double max_value,
double step, bool fine,
double value,
DataFieldListener *listener)
{
WndProperty *edit = Add(label, help);
DataFieldFloat *df = new DataFieldFloat(edit_format, display_format,
min_value, max_value,
value, step, fine, listener);
edit->SetDataField(df);
return edit;
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:16,代码来源:EditRowFormWidget.cpp
示例8: LoadFormProperty
void
LoadFormProperty(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);
DataFieldString &df = *(DataFieldString *)ctl->GetDataField();
assert(df.GetType() == DataField::Type::STRING);
df.Set(value);
ctl->RefreshDisplay();
}
开发者ID:MindMil,项目名称:XCSoar,代码行数:16,代码来源:Util.cpp
示例9: FinishPortField
/**
* @return true if the value has changed
*/
static bool
FinishPortField(DeviceConfig &config, WndProperty &port_field)
{
const DataFieldEnum &df = *(const DataFieldEnum *)port_field.GetDataField();
unsigned value = df.GetAsInteger();
if (value + 1 <= num_port_types) {
if (port_types[value].type == config.port_type)
return false;
config.port_type = port_types[value].type;
return true;
} else {
value -= num_port_types;
#ifdef ANDROID
if (config.port_type == DeviceConfig::RFCOMM &&
_tcscmp(config.bluetooth_mac, df.GetAsString()) == 0)
return false;
#else
if (config.port_type == DeviceConfig::SERIAL &&
value == config.port_index)
return false;
#endif
#ifdef ANDROID
config.port_type = DeviceConfig::RFCOMM;
config.bluetooth_mac = df.GetAsString();
#else
config.port_type = DeviceConfig::SERIAL;
config.port_index = value;
#endif
return true;
}
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:38,代码来源:DevicesConfigPanel.cpp
示例10: LoadFormProperty
void
LoadFormProperty(WndForm &form, const TCHAR *control_name,
UnitGroup_t unit_group, int value)
{
assert(control_name != NULL);
WndProperty *ctl = (WndProperty *)form.FindByName(control_name);
if (ctl == NULL)
return;
Units_t unit = Units::GetUserUnitByGroup(unit_group);
DataField *df = ctl->GetDataField();
df->SetUnits(Units::GetUnitName(unit));
df->SetAsInteger(iround(Units::ToUserUnit(fixed(value), unit)));
ctl->RefreshDisplay();
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:16,代码来源:Util.cpp
示例11: Add
WndProperty *
RowFormWidget::AddFloat(const TCHAR *label, const TCHAR *help,
const TCHAR *display_format,
const TCHAR *edit_format,
fixed min_value, fixed max_value,
fixed step, bool fine,
fixed value,
DataField::DataAccessCallback callback)
{
WndProperty *edit = Add(label, help);
DataFieldFloat *df = new DataFieldFloat(edit_format, display_format,
min_value, max_value,
value, step, fine, callback);
edit->SetDataField(df);
return edit;
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:16,代码来源:RowFormWidget.cpp
示例12: setVariables
static void setVariables(void) {
WndProperty *wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpMultimap1"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(MsgToken(239)); // Disabled
dfe->addEnumText(MsgToken(259)); // Enabled
dfe->Set(Multimap1);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpMultimap2"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(MsgToken(239)); // Disabled
dfe->addEnumText(MsgToken(259)); // Enabled
dfe->Set(Multimap2);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpMultimap3"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(MsgToken(239)); // Disabled
dfe->addEnumText(MsgToken(259)); // Enabled
dfe->Set(Multimap3);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpMultimap4"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(MsgToken(239)); // Disabled
dfe->addEnumText(MsgToken(259)); // Enabled
dfe->Set(Multimap4);
wp->RefreshDisplay();
}
}
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:52,代码来源:dlgMultimaps.cpp
示例13: 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);
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:47,代码来源:SiteConfigPanel.cpp
示例14: LoadFormProperty
void
LoadFormProperty(SubForm &form, const TCHAR *control_name,
UnitGroup unit_group, fixed value)
{
assert(control_name != NULL);
WndProperty *ctl = (WndProperty *)form.FindByName(control_name);
assert(ctl != nullptr);
Unit unit = Units::GetUserUnitByGroup(unit_group);
DataFieldFloat &df = *(DataFieldFloat *)ctl->GetDataField();
assert(df.GetType() == DataField::Type::REAL);
df.SetUnits(Units::GetUnitName(unit));
df.Set(Units::ToUserUnit(value, unit));
ctl->RefreshDisplay();
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:17,代码来源:UnitUtil.cpp
示例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();
}
}
}
开发者ID:Acrobot,项目名称:LK8000,代码行数:17,代码来源:dlgTextEntry_Keyboard.cpp
示例16: LoadOptionalFormProperty
void
LoadOptionalFormProperty(WndForm &form, const TCHAR *control_name,
UnitGroup_t unit_group, fixed value)
{
assert(control_name != NULL);
WndProperty *ctl = (WndProperty *)form.FindByName(control_name);
if (ctl == NULL)
return;
Units_t unit = Units::GetUserUnitByGroup(unit_group);
DataFieldFloat &df = *(DataFieldFloat *)ctl->GetDataField();
assert(df.GetType() == DataField::TYPE_REAL);
df.SetUnits(Units::GetUnitName(unit));
df.SetAsInteger(iround(Units::ToUserUnit(fixed(value), unit)));
ctl->RefreshDisplay();
}
开发者ID:macsux,项目名称:XCSoar,代码行数:17,代码来源:UnitUtil.cpp
示例17: assert
void
PagesConfigPanel::Init(WndForm *_wf)
{
assert(_wf != NULL);
wf = _wf;
TCHAR prpName[64];
for (unsigned i = 0; i < MAX_PAGES; i++) {
_stprintf(prpName, _T("prpPageLayout%u"), i);
WndProperty* wp = (WndProperty*)wf->FindByName(prpName);
if (wp) {
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
UpdateComboBox(dfe, i);
wp->RefreshDisplay();
}
}
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:17,代码来源:PagesConfigPanel.cpp
示例18: SetBallast
static void
SetBallast(void)
{
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(_T("prpBallast"));
if (wp) {
if (glide_polar.IsBallastable()) {
DataFieldFloat &df = *(DataFieldFloat *)wp->GetDataField();
df.SetAsFloat(glide_polar.GetBallastLitres());
} else
wp->hide();
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpWingLoading"));
if (wp) {
const fixed wl = glide_polar.GetWingLoading();
if (wl > fixed_zero) {
DataFieldFloat &df = *(DataFieldFloat *)wp->GetDataField();
df.SetAsFloat(wl);
} else
wp->hide();
wp->RefreshDisplay();
}
}
开发者ID:,项目名称:,代码行数:27,代码来源:
示例19:
bool
InfoBoxContentWind::PnlEditOnTabPreShow(TabBarControl::EventType EventType)
{
const NMEAInfo &basic = XCSoarInterface::Basic();
const SETTINGS_COMPUTER &settings_computer =
XCSoarInterface::SettingsComputer();
const bool external_wind = basic.external_wind_available &&
settings_computer.ExternalWind;
WndProperty* wp;
wp = (WndProperty*)dlgInfoBoxAccess::GetWindowForm()->FindByName(_T("prpSpeed"));
if (wp) {
wp->set_enabled(!external_wind);
DataFieldFloat &df = *(DataFieldFloat *)wp->GetDataField();
df.SetMax(Units::ToUserWindSpeed(Units::ToSysUnit(fixed(200), unKiloMeterPerHour)));
df.SetUnits(Units::GetSpeedName());
df.Set(Units::ToUserWindSpeed(CommonInterface::Calculated().wind.norm));
wp->RefreshDisplay();
}
wp = (WndProperty*)dlgInfoBoxAccess::GetWindowForm()->FindByName(_T("prpDirection"));
if (wp) {
wp->set_enabled(!external_wind);
DataFieldFloat &df = *(DataFieldFloat *)wp->GetDataField();
df.Set(CommonInterface::Calculated().wind.bearing.value_degrees());
wp->RefreshDisplay();
}
return true;
}
开发者ID:macsux,项目名称:XCSoar,代码行数:31,代码来源:Weather.cpp
示例20: OnResetClicked
//
// We cannot use setVariables from here, otherwise we would be adding more
// enum text to the selection list, each time we reset.
// We simply set the value, because the enum text list is already set.
//
static void OnResetClicked(WindowControl * Sender){
WndProperty *wp;
extern void Reset_Multimap_Mode(void);
Reset_Multimap_Mode();
wp = (WndProperty*)wf->FindByName(TEXT("prpMultimap1"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->Set(Multimap1);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpMultimap2"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->Set(Multimap2);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpMultimap3"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->Set(Multimap3);
wp->RefreshDisplay();
}
}
开发者ID:Turbo87,项目名称:LK8000,代码行数:34,代码来源:dlgMultimaps.cpp
注:本文中的WndProperty类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论