当前位置: 首页>>代码示例>>C++>>正文


C++ DataFieldEnum::Dec方法代码示例

本文整理汇总了C++中DataFieldEnum::Dec方法的典型用法代码示例。如果您正苦于以下问题:C++ DataFieldEnum::Dec方法的具体用法?C++ DataFieldEnum::Dec怎么用?C++ DataFieldEnum::Dec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataFieldEnum的用法示例。


在下文中一共展示了DataFieldEnum::Dec方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: switch

static bool
OnKeyDown(WndForm &sender, unsigned key_code)
{
  DataFieldEnum *dfe;

  /* map the Altair hardware buttons */
  switch (key_code){
  case VK_UP:
    dfe = (DataFieldEnum *)edit_select->GetDataField();
    dfe->Dec();
    edit_select->RefreshDisplay();
    return true;

  case VK_DOWN:
    dfe = (DataFieldEnum *)edit_select->GetDataField();
    dfe->Inc();
    edit_select->RefreshDisplay();
    return true;

  case VK_LEFT:
    dfe = (DataFieldEnum *)edit_content->GetDataField();
    dfe->Dec();
    edit_content->RefreshDisplay();
    return true;

  case VK_RIGHT:
    dfe = (DataFieldEnum *)edit_content->GetDataField();
    dfe->Inc();
    edit_content->RefreshDisplay();
    return true;

  case VK_APP1:
    OnNameAccess(*buttonPaste);
    return true;

  case '6':
    sender.SetModalResult(mrOK);
    return true;

  case '7':
    OnCopy(*buttonPaste);
    return true;

  case '8':
    OnPaste(*buttonPaste);
    return true;

  default:
    return false;
  }
}
开发者ID:macsux,项目名称:XCSoar,代码行数:51,代码来源:dlgConfigInfoboxes.cpp

示例2: switch

static bool
OnKeyDown(unsigned key_code)
{
  DataFieldEnum *dfe;

  /* map the Altair hardware buttons */
  switch (key_code){
  case KEY_UP:
    dfe = (DataFieldEnum *)edit_select->GetDataField();
    dfe->Dec();
    edit_select->RefreshDisplay();
    return true;

  case KEY_DOWN:
    dfe = (DataFieldEnum *)edit_select->GetDataField();
    dfe->Inc();
    edit_select->RefreshDisplay();
    return true;

  case KEY_LEFT:
    dfe = (DataFieldEnum *)edit_content->GetDataField();
    dfe->Dec();
    edit_content->RefreshDisplay();
    return true;

  case KEY_RIGHT:
    dfe = (DataFieldEnum *)edit_content->GetDataField();
    dfe->Inc();
    edit_content->RefreshDisplay();
    return true;

  case KEY_APP1:
    edit_name->BeginEditing();
    return true;

  case '6':
    wf->SetModalResult(mrOK);
    return true;

  case '7':
    OnCopy();
    return true;

  case '8':
    OnPaste();
    return true;

  default:
    return false;
  }
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:51,代码来源:dlgConfigInfoboxes.cpp

示例3: 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();
}
开发者ID:miza,项目名称:LK8000,代码行数:97,代码来源:dlgFontEdit.cpp

示例4: 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();
}
开发者ID:alberiolima,项目名称:LK8000,代码行数:89,代码来源:dlgFontEdit.cpp


注:本文中的DataFieldEnum::Dec方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。