本文整理汇总了C++中DataFieldEnum::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ DataFieldEnum::Set方法的具体用法?C++ DataFieldEnum::Set怎么用?C++ DataFieldEnum::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataFieldEnum
的用法示例。
在下文中一共展示了DataFieldEnum::Set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddEnum
void
RASPSettingsPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
WndProperty *wp;
wp = AddEnum(_("Field"), nullptr);
DataFieldEnum *dfe = (DataFieldEnum *)wp->GetDataField();
dfe->EnableItemHelp(true);
dfe->addEnumText(_("Terrain"));
for (unsigned i = 1; i < RasterWeather::MAX_WEATHER_MAP; i++) {
const TCHAR *label = RASP.ItemLabel(i);
if (label != NULL)
dfe->AddChoice(i, label, nullptr, RASP.ItemHelp(i));
}
dfe->Set(RASP.GetParameter());
wp->RefreshDisplay();
wp = AddEnum(_("Time"), nullptr);
dfe = (DataFieldEnum *)wp->GetDataField();
dfe->addEnumText(_("Now"));
for (unsigned i = 1; i < RasterWeather::MAX_WEATHER_TIMES; i++) {
if (RASP.isWeatherAvailable(i)) {
TCHAR timetext[10];
_stprintf(timetext, _T("%04d"), RASP.IndexToTime(i));
dfe->addEnumText(timetext, i);
}
}
dfe->Set(RASP.GetTime());
wp->RefreshDisplay();
}
示例2: 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();
}
}
示例3: LoadDialog
void
dlgWeatherShowModal()
{
wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
_T("IDR_XML_WEATHER"));
if (wf == NULL)
return;
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(_T("prpTime"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_T("Now"));
for (unsigned i = 1; i < RasterWeather::MAX_WEATHER_TIMES; i++) {
if (RASP.isWeatherAvailable(i)) {
TCHAR timetext[10];
_stprintf(timetext, _T("%04d"), RASP.IndexToTime(i));
dfe->addEnumText(timetext, i);
}
}
dfe->Set(RASP.GetTime());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpDisplayItem"));
DataFieldEnum* dfe;
if (wp) {
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_("Terrain"));
for (int i = 1; i <= 15; i++) {
const TCHAR *label = RASP.ItemLabel(i);
if (label != NULL)
dfe->addEnumText(label, i);
}
dfe->Set(RASP.GetParameter());
wp->RefreshDisplay();
}
wf->ShowModal();
wp = (WndProperty*)wf->FindByName(_T("prpTime"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
RASP.SetTime(dfe->GetAsInteger());
}
wp = (WndProperty*)wf->FindByName(_T("prpDisplayItem"));
if (wp)
RASP.SetParameter(wp->GetDataField()->GetAsInteger());
delete wf;
}
示例4: assert
static void
SetPort(DataFieldEnum &df, DeviceConfig::PortType type, const TCHAR *value)
{
assert(value != NULL);
if (!df.Set(value))
df.Set(AddPort(df, type, value));
}
示例5: assert
static void
LoadGUI()
{
assert(!locked);
locked = true;
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(_T("prpFontName"));
if (wp) {
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
if (dfe) {
dfe->Set(0);
unsigned i;
for (i = 0; i < dfe->Count(); i++) {
if (_tcsncmp(dfe->GetAsString(), NewLogFont.lfFaceName, LF_FACESIZE)
== 0)
break;
dfe->Inc();
}
if (i == dfe->Count())
dfe->Set(dfe->addEnumText(NewLogFont.lfFaceName));
}
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpFontHeight"));
if (wp) {
DataFieldInteger* dfi = (DataFieldInteger*)wp->GetDataField();
if (dfi)
dfi->Set(NewLogFont.lfHeight);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpFontWeight"));
if (wp) {
DataFieldBoolean* dfi = (DataFieldBoolean*)wp->GetDataField();
if (dfi)
dfi->Set(NewLogFont.lfWeight > 500);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpFontItalic"));
if (wp) {
DataFieldBoolean* dfb = (DataFieldBoolean*)wp->GetDataField();
if (dfb)
dfb->Set(NewLogFont.lfItalic);
wp->RefreshDisplay();
}
locked = false;
RedrawSampleFont();
}
示例6: assert
void
RouteConfigPanel::Init(WndForm *_wf)
{
assert(_wf != NULL);
wf = _wf;
WndProperty *wp;
const SETTINGS_COMPUTER &settings_computer = XCSoarInterface::SettingsComputer();
wp = (WndProperty*)wf->FindByName(_T("prpFinalGlideTerrain"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_("Off"), SETTINGS_COMPUTER::FGT_OFF);
dfe->addEnumText(_("Line"), SETTINGS_COMPUTER::FGT_LINE);
dfe->addEnumText(_("Shade"), SETTINGS_COMPUTER::FGT_SHADE);
dfe->Set(settings_computer.FinalGlideTerrain);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpRoutePlannerMode"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_("None"));
dfe->addEnumText(_("Terrain"));
dfe->addEnumText(_("Airspace"));
dfe->addEnumText(_("Both"));
dfe->Set(settings_computer.route_planner.mode);
wp->RefreshDisplay();
}
LoadFormProperty(*wf, _T("prpRoutePlannerAllowClimb"),
settings_computer.route_planner.allow_climb);
LoadFormProperty(*wf, _T("prpRoutePlannerUseCeiling"),
settings_computer.route_planner.use_ceiling);
wp = (WndProperty*)wf->FindByName(_T("prpTurningReach"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_("Off"));
dfe->addEnumText(_("Straight"));
dfe->addEnumText(_("Turning"));
dfe->Set(settings_computer.route_planner.reach_calc_mode);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpReachPolarMode"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_("Task"));
dfe->addEnumText(_("Safety MC"));
dfe->Set(settings_computer.route_planner.reach_polar_mode);
wp->RefreshDisplay();
}
}
示例7: setVariables
static void setVariables(void) {
WndProperty *wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpPGOptimizeRoute"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
// LKTOKEN [email protected]_ = "Disabled"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "Enabled"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->Set(PGOptimizeRoute);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpPGNumberOfGates"));
if (wp) {
wp->GetDataField()->SetAsInteger(PGNumberOfGates);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpPGOpenTimeH"));
if (wp) {
wp->GetDataField()->SetAsInteger(PGOpenTimeH);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpPGOpenTimeM"));
if (wp) {
wp->GetDataField()->SetAsInteger(PGOpenTimeM);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpPGCloseTimeH"));
if (wp) {
wp->GetDataField()->SetAsInteger(PGCloseTimeH);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpPGCloseTimeM"));
if (wp) {
wp->GetDataField()->SetAsInteger(PGCloseTimeM);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpPGGateIntervalTime"));
if (wp) {
wp->GetDataField()->SetAsInteger(PGGateIntervalTime);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpPGStartOut"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
// LKTOKEN [email protected]_ = "IN (Exit)"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "OUT (Enter)"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
dfe->Set(PGStartOut);
wp->RefreshDisplay();
}
}
示例8: LoadDialog
void
dlgWeatherShowModal()
{
WndForm *wf = LoadDialog(nullptr, UIGlobals::GetMainWindow(),
_T("IDR_XML_WEATHER"));
if (wf == NULL)
return;
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(_T("prpTime"));
assert(wp != nullptr);
DataFieldEnum *dfe = (DataFieldEnum *)wp->GetDataField();
dfe->addEnumText(_("Now"));
for (unsigned i = 1; i < RasterWeather::MAX_WEATHER_TIMES; i++) {
if (RASP.isWeatherAvailable(i)) {
TCHAR timetext[10];
_stprintf(timetext, _T("%04d"), RASP.IndexToTime(i));
dfe->addEnumText(timetext, i);
}
}
dfe->Set(RASP.GetTime());
wp->RefreshDisplay();
wp = (WndProperty *)wf->FindByName(_T("prpDisplayItem"));
assert(wp != nullptr);
dfe = (DataFieldEnum *)wp->GetDataField();
dfe->EnableItemHelp(true);
dfe->addEnumText(_("Terrain"));
for (int i = 1; i <= 15; i++) {
const TCHAR *label = RASP.ItemLabel(i);
if (label != NULL)
dfe->AddChoice(i, label, nullptr, RASP.ItemHelp(i));
}
dfe->Set(RASP.GetParameter());
wp->RefreshDisplay();
wf->ShowModal();
wp = (WndProperty *)wf->FindByName(_T("prpTime"));
assert(wp != nullptr);
dfe = (DataFieldEnum *)wp->GetDataField();
RASP.SetTime(dfe->GetValue());
wp = (WndProperty *)wf->FindByName(_T("prpDisplayItem"));
assert(wp != nullptr);
dfe = (DataFieldEnum *)wp->GetDataField();
RASP.SetParameter(dfe->GetValue());
delete wf;
}
示例9: 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();
}
}
示例10: 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();
}
}
示例11: GetTaskData
/*
* Reads task points from the
* protected task manager
* and loads the Task Point UI
* and initializes the pan mode on the map
*/
static void
InitTargetPoints()
{
WndProperty *wp = (WndProperty*)wf->FindByName(_T("prpTaskPoint"));
GetTaskData();
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
TCHAR tp_label[80];
TCHAR tp_short[21];
if (TaskSize <= target_point)
target_point = ActiveTaskPointOnEntry;
else
target_point = max(target_point, ActiveTaskPointOnEntry);
target_point = max(0, min((int)target_point, (int)TaskSize - 1));
for (unsigned i = ActiveTaskPointOnEntry; i < TaskSize; i++) {
_tcsncpy(tp_short, protected_task_manager.get_ordered_taskpoint_name(i), 20);
tp_short[20] = 0;
_stprintf(tp_label, _T("%d %s"), i, tp_short);
dfe->addEnumText(tp_label);
}
dfe->Set(max(0, (int)target_point - (int)ActiveTaskPointOnEntry));
if (TaskSize > target_point) {
const GeoPoint t = protected_task_manager.get_ordered_taskpoint_location(target_point,
XCSoarInterface::Basic().Location);
SetZoom();
XCSoarInterface::SetSettingsMap().TargetPan = true;
XCSoarInterface::SetSettingsMap().EnablePan = true;
XCSoarInterface::SetSettingsMap().PanLocation = t;
XCSoarInterface::SetSettingsMap().TargetPanIndex = target_point;
}
wp->RefreshDisplay();
}
示例12: max
/**
* Reads task points from the protected task manager
* and loads the Task Point UI and initializes the pan mode on the map
*/
static bool
InitTargetPoints()
{
WndProperty *wp = (WndProperty*)wf->FindByName(_T("prpTaskPoint"));
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
if (!GetTaskData(*dfe))
return false;
if (TaskSize <= target_point)
target_point = ActiveTaskPointOnEntry;
else
target_point = max(target_point, ActiveTaskPointOnEntry);
target_point = max(0, min((int)target_point, (int)TaskSize - 1));
dfe->Set(max(0, (int)target_point - (int)ActiveTaskPointOnEntry));
if (TaskSize > target_point) {
SetTarget();
}
wp->RefreshDisplay();
return true;
}
示例13: assert
void
ExperimentalConfigPanel::Init(WndForm *_wf)
{
assert(_wf != NULL);
wf = _wf;
WndProperty *wp;
if (!is_windows_ce() || is_altair()) {
wp = (WndProperty*)wf->FindByName(_T("prpAppInfoBoxModel"));
if (wp) {
wp->hide();
}
}
#if defined(_WIN32_WCE) && !defined(GNAV)
// VENTA-ADDON Model change config menu 11
wp = (WndProperty*)wf->FindByName(_T("prpAppInfoBoxModel"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_("Generic"));
dfe->addEnumText(_T("HP31x"));
dfe->addEnumText(_T("MedionP5"));
dfe->addEnumText(_T("MIO"));
dfe->addEnumText(_T("Nokia500")); // VENTA3
dfe->addEnumText(_T("PN6000"));
dfe->Set((int)GlobalModelType);
wp->RefreshDisplay();
}
#endif
}
示例14: AddEnum
void
RASPSettingsPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
const WeatherUIState &state = CommonInterface::GetUIState().weather;
time = state.time;
WndProperty *wp;
wp = AddEnum(_("Field"), nullptr, this);
DataFieldEnum *dfe = (DataFieldEnum *)wp->GetDataField();
dfe->EnableItemHelp(true);
for (unsigned i = 0; i < rasp.GetItemCount(); i++) {
const auto &mi = rasp.GetItemInfo(i);
const TCHAR *label = mi.label;
if (label != nullptr)
label = gettext(label);
const TCHAR *help = mi.help;
if (help != nullptr)
help = gettext(help);
dfe->AddChoice(i, mi.name, label, help);
}
dfe->Set(state.map);
wp->RefreshDisplay();
AddEnum(_("Time"), nullptr, this);
UpdateTimeControl();
}
示例15: fixed
static void
FilterMode(bool direction)
{
if (direction) {
dialog_state.distance = fixed(-1);
dialog_state.direction = WILDCARD;
DataFieldEnum *df = (DataFieldEnum *)distance_control->GetDataField();
df->Set(WILDCARD);
distance_control->RefreshDisplay();
df = (DataFieldEnum *)direction_control->GetDataField();
df->Set(WILDCARD);
direction_control->RefreshDisplay();
} else {
DataFieldString *df = (DataFieldString *)name_control->GetDataField();
df->Set(_T(""));
name_control->RefreshDisplay();
}
}