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


C++ Card::example_translation方法代码示例

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


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

示例1: PrintCard

void MainScreenHandler::PrintCard (const Card& card, bool convert_to_romaji)
{
  DrawBgImage ();
  ResetTextBoxesPositions ();
 	if (screen_mode_ == MainScreenMode::KANJI)
  {
    kanji_->text(card.symbol());
    on_reading_->text(card.reading(), convert_to_romaji);
    kun_reading_->text(card.reading2(), convert_to_romaji);
    translation_->text(card.translation());
    example_kanji_->text(card.example_symbol());
    example_reading_->text(card.example_reading(), convert_to_romaji);
    example_translation_->text(card.example_translation());

    // Make all but the kanji and its caption invisible.
    caption_on_reading_->visible(false);
    caption_kun_reading_->visible(false);
    caption_translation_->visible(false);
    caption_example_->visible(false);
    on_reading_->visible(false);
    kun_reading_->visible(false);
    translation_->visible(false);
    example_kanji_->visible(false);
    example_reading_->visible(false);
    example_translation_->visible(false);

    screens_handler_->tbh()->PrintAll(Screen::MAIN);
  }
  else if (screen_mode_ == MainScreenMode::VERTICAL_TEXTBOXES ||
           screen_mode_ == MainScreenMode::VERTICAL_TEXTBOXES_VISIBLE)
  {
    bool convert_to_romaji1, convert_to_romaji2, convert_to_romaji3;
    convert_to_romaji1 = convert_to_romaji2 = convert_to_romaji3 = false;
    std::string box1text, box2text, box3text;
    if (game_mode_ == GameMode::KANJI_QUIZ)
    {
      box1text = card.translation();
      box2text = card.reading();
      box3text = card.reading2();
      convert_to_romaji2 = convert_to_romaji3 = convert_to_romaji;
    }
    else if (game_mode_ == GameMode::VOCABULARY)
    {
      box1text = card.symbol();
      box2text = card.reading();
      box3text = card.translation();
      convert_to_romaji2 = convert_to_romaji;
    }
    else if (game_mode_ == GameMode::VOCABULARY_QUIZ)
    {
      box1text = card.translation();
      box2text = card.reading();
      convert_to_romaji2 = convert_to_romaji;
    }

    if (boxes_number_ >= 1)
    {
      box1_->text(box1text, convert_to_romaji1);
      if (boxes_number_ >= 2)
      {
        box2_->text(box2text, convert_to_romaji2);
        if (boxes_number_ >= 3)
          box3_->text(box3text, convert_to_romaji3);
      }
    }

    if (screen_mode_ == MainScreenMode::VERTICAL_TEXTBOXES)
    {
      if (boxes_number_ >= 2)
      {
        caption_box2_->visible(false);
        box2_->visible(false);
        if (boxes_number_>= 3)
        {
          caption_box3_->visible(false);
          box3_->visible(false);
        }
      }
    }

    screens_handler_->tbh()->PrintAll(Screen::MAIN);
  }
}
开发者ID:eldruin,项目名称:DSMemorizer,代码行数:83,代码来源:mainscreenhandler.cpp


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