本文整理汇总了C++中DataFieldEnum::GetAsString方法的典型用法代码示例。如果您正苦于以下问题:C++ DataFieldEnum::GetAsString方法的具体用法?C++ DataFieldEnum::GetAsString怎么用?C++ DataFieldEnum::GetAsString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataFieldEnum
的用法示例。
在下文中一共展示了DataFieldEnum::GetAsString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: switch
/**
* @return true if the value has changed
*/
static bool
FinishPortField(DeviceConfig &config, const DataFieldEnum &df)
{
unsigned value = df.GetAsInteger();
/* decode the port type from the upper 16 bits of the id; we don't
need the rest, because that's just some serial we don't care
about */
const DeviceConfig::PortType new_type =
(DeviceConfig::PortType)(value >> 16);
switch (new_type) {
case DeviceConfig::PortType::DISABLED:
case DeviceConfig::PortType::AUTO:
case DeviceConfig::PortType::INTERNAL:
case DeviceConfig::PortType::TCP_LISTENER:
if (new_type == config.port_type)
return false;
config.port_type = new_type;
return true;
case DeviceConfig::PortType::SERIAL:
/* Serial Port */
if (new_type == config.port_type &&
_tcscmp(config.path, df.GetAsString()) == 0)
return false;
config.port_type = new_type;
config.path = df.GetAsString();
return true;
case DeviceConfig::PortType::RFCOMM:
/* Bluetooth */
if (new_type == config.port_type &&
_tcscmp(config.bluetooth_mac, df.GetAsString()) == 0)
return false;
config.port_type = new_type;
config.bluetooth_mac = df.GetAsString();
return true;
case DeviceConfig::PortType::IOIOUART:
/* IOIO UART */
if (new_type == config.port_type &&
config.ioio_uart_id == (unsigned)_ttoi(df.GetAsString()))
return false;
config.port_type = new_type;
config.ioio_uart_id = (unsigned)_ttoi(df.GetAsString());
return true;
}
/* unreachable */
assert(false);
return false;
}
示例3: SaveFormProperty
bool
InfoBoxContentWind::PnlSetupOnTabPreHide()
{
const NMEAInfo &basic = XCSoarInterface::Basic();
SETTINGS_COMPUTER &settings_computer =
XCSoarInterface::SetSettingsComputer();
const bool external_wind = basic.external_wind_available &&
settings_computer.ExternalWind;
if (!external_wind)
SaveFormProperty(*dlgInfoBoxAccess::GetWindowForm(), _T("prpAutoWind"), szProfileAutoWind,
settings_computer.AutoWindMode);
DataFieldEnum* dfe = (DataFieldEnum*)((WndProperty*)dlgInfoBoxAccess::GetWindowForm()->FindByName(_T("prpAutoWind")))->GetDataField();
if (_tcscmp(dfe->GetAsString(), _("Manual")) == 0)
settings_computer.ManualWindAvailable.Update(basic.clock);
SaveFormProperty(*dlgInfoBoxAccess::GetWindowForm(), _T("prpTrailDrift"),
XCSoarInterface::SetSettingsMap().EnableTrailDrift);
ActionInterface::SendSettingsMap();
return true;
}
示例4: switch
/**
* @return true if the value has changed
*/
static bool
FinishPortField(DeviceConfig &config, const DataFieldEnum &df)
{
unsigned value = df.GetValue();
/* decode the port type from the upper 16 bits of the id; we don't
need the rest, because that's just some serial we don't care
about */
const DeviceConfig::PortType new_type =
(DeviceConfig::PortType)(value >> 16);
switch (new_type) {
case DeviceConfig::PortType::DISABLED:
case DeviceConfig::PortType::AUTO:
case DeviceConfig::PortType::INTERNAL:
case DeviceConfig::PortType::DROIDSOAR_V2:
case DeviceConfig::PortType::NUNCHUCK:
case DeviceConfig::PortType::I2CPRESSURESENSOR:
case DeviceConfig::PortType::IOIOVOLTAGE:
case DeviceConfig::PortType::TCP_CLIENT:
case DeviceConfig::PortType::TCP_LISTENER:
case DeviceConfig::PortType::UDP_LISTENER:
case DeviceConfig::PortType::RFCOMM_SERVER:
if (new_type == config.port_type)
return false;
config.port_type = new_type;
return true;
case DeviceConfig::PortType::SERIAL:
case DeviceConfig::PortType::PTY:
/* Serial Port */
if (new_type == config.port_type &&
StringIsEqual(config.path, df.GetAsString()))
return false;
config.port_type = new_type;
config.path = df.GetAsString();
return true;
case DeviceConfig::PortType::RFCOMM:
/* Bluetooth */
if (new_type == config.port_type &&
StringIsEqual(config.bluetooth_mac, df.GetAsString()))
return false;
config.port_type = new_type;
config.bluetooth_mac = df.GetAsString();
return true;
case DeviceConfig::PortType::IOIOUART:
/* IOIO UART */
if (new_type == config.port_type &&
config.ioio_uart_id == (unsigned)ParseUnsigned(df.GetAsString()))
return false;
config.port_type = new_type;
config.ioio_uart_id = (unsigned)ParseUnsigned(df.GetAsString());
return true;
}
gcc_unreachable();
assert(false);
return false;
}
示例5: LoadGUI
void LoadGUI()
{
#define MAX_ENUM 10
IsInitialized=false;
int i=0;
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpFontName"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
if (dfe)
{
for (i=0 ;i < MAX_ENUM ; i++) {
dfe->Dec();
} // rewind
bool bFound=false;
for (i=0 ;i < MAX_ENUM ; i++ ) {
if (_tcsncmp(dfe->GetAsString(), NewLogFont.lfFaceName, LF_FACESIZE) == 0) {
bFound=true;
break;
}
dfe->Inc();
}
if (!bFound) {
dfe->addEnumText(NewLogFont.lfFaceName);
for (i=0 ;i < MAX_ENUM ; i++) {
dfe->Dec();
} // rewind
for (i=0 ;i < MAX_ENUM ; i++ ) {
if (_tcsncmp(dfe->GetAsString(), NewLogFont.lfFaceName,LF_FACESIZE) == 0) {
break;
}
dfe->Inc();
}
}
}
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontHeight"));
if (wp) {
DataFieldInteger * dfi;
dfi = (DataFieldInteger*)wp->GetDataField();
if (dfi)
{
dfi->Set(NewLogFont.lfHeight);
}
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontWeight"));
if (wp) {
DataFieldInteger* dfi;
dfi = (DataFieldInteger*)wp->GetDataField();
if (dfi)
{
dfi->Set(NewLogFont.lfWeight);
}
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontItalic"));
if (wp) {
DataFieldBoolean* dfb;
dfb = (DataFieldBoolean*)wp->GetDataField();
if (dfb)
{
dfb->Set(NewLogFont.lfItalic);
}
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontPitchAndFamily"));
if (wp) {
DataFieldEnum * dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
if (dfe)
{
dfe->SetAsInteger(NewLogFont.lfPitchAndFamily);
}
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontTrueType"));
if (wp) {
DataFieldBoolean* dfb;
dfb = (DataFieldBoolean*)wp->GetDataField();
if (dfb)
{
dfb->Set(NewLogFont.lfQuality != NONANTIALIASED_QUALITY); //was dfb->Set(NewLogFont.lfQuality == LKFONT_QUALITY); dont know why
}
wp->RefreshDisplay();
}
IsInitialized=true;
RedrawSampleFont();
}
示例6: LoadGUI
void LoadGUI()
{
#define MAX_ENUM 10
IsInitialized=false;
int i=0;
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpFontName"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
if (dfe)
{
for (i=0 ;i < MAX_ENUM ; i++) {
dfe->Dec();
} // rewind
bool bFound=false;
for (i=0 ;i < MAX_ENUM ; i++ ) {
if (_tcsncmp(dfe->GetAsString(), NewLogFont.lfFaceName, LF_FACESIZE) == 0) {
bFound=true;
break;
}
dfe->Inc();
}
if (!bFound) {
dfe->addEnumText(NewLogFont.lfFaceName);
for (i=0 ;i < MAX_ENUM ; i++) {
dfe->Dec();
} // rewind
for (i=0 ;i < MAX_ENUM ; i++ ) {
if (_tcsncmp(dfe->GetAsString(), NewLogFont.lfFaceName,LF_FACESIZE) == 0) {
break;
}
dfe->Inc();
}
}
}
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontHeight"));
if (wp) {
DataFieldInteger * dfi;
dfi = (DataFieldInteger*)wp->GetDataField();
if (dfi)
{
dfi->Set(NewLogFont.lfHeight);
}
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontWeight"));
if (wp) {
DataFieldInteger* dfi;
dfi = (DataFieldInteger*)wp->GetDataField();
if (dfi)
{
dfi->Set(NewLogFont.lfWeight);
}
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontItalic"));
if (wp) {
DataFieldBoolean* dfb;
dfb = (DataFieldBoolean*)wp->GetDataField();
if (dfb)
{
dfb->Set(NewLogFont.lfItalic);
}
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpFontPitchAndFamily"));
if (wp) {
DataFieldEnum * dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
if (dfe)
{
dfe->SetAsInteger(NewLogFont.lfPitchAndFamily);
}
wp->RefreshDisplay();
}
// This is useless, because we ApplyClearType later on. We always use a general common quality.
ApplyClearType(&NewLogFont);
IsInitialized=true;
RedrawSampleFont();
}