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


C++ CList::GetDim方法代码示例

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


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

示例1: CreateInterface

void CScreenLevelList::CreateInterface()
{
    CWindow*        pw;
    CEdit*          pe;
    CLabel*         pl;
    CButton*        pb;
    CCheck*         pc;
    CList*          pli;
    Math::Point     pos, ddim;
    int             res;
    std::string     name;

    if ( m_category == LevelCategory::FreeGame )
    {
        m_accessChap = m_main->GetPlayerProfile()->GetChapPassed(LevelCategory::Missions);
    }

    pos.x = 0.10f;
    pos.y = 0.10f;
    ddim.x = 0.80f;
    ddim.y = 0.80f;
    pw = m_interface->CreateWindows(pos, ddim, 12, EVENT_WINDOW5);
    pw->SetClosable(true);
    if ( m_category == LevelCategory::Exercises    )  res = RT_TITLE_TRAINER;
    if ( m_category == LevelCategory::Challenges   )  res = RT_TITLE_DEFI;
    if ( m_category == LevelCategory::Missions     )  res = RT_TITLE_MISSION;
    if ( m_category == LevelCategory::FreeGame     )  res = RT_TITLE_FREE;
    if ( m_category == LevelCategory::CodeBattles  )  res = RT_TITLE_CODE_BATTLES;
    if ( m_category == LevelCategory::CustomLevels )  res = RT_TITLE_USER;
    GetResource(RES_TEXT, res, name);
    pw->SetName(name);

    pos.x  = 0.10f;
    pos.y  = 0.40f;
    ddim.x = 0.50f;
    ddim.y = 0.50f;
    pw->CreateGroup(pos, ddim, 5, EVENT_INTERFACE_GLINTl);  // orange corner
    pos.x  = 0.40f;
    pos.y  = 0.10f;
    ddim.x = 0.50f;
    ddim.y = 0.50f;
    pw->CreateGroup(pos, ddim, 4, EVENT_INTERFACE_GLINTr);  // blue corner

    // Displays a list of chapters:
    pos.x = ox+sx*3;
    pos.y = oy+sy*10.5f;
    ddim.x = dim.x*7.5f;
    ddim.y = dim.y*0.6f;
    res = RT_PLAY_CHAP_CHAPTERS;
    if ( m_category == LevelCategory::Missions     )  res = RT_PLAY_CHAP_PLANETS;
    if ( m_category == LevelCategory::FreeGame     )  res = RT_PLAY_CHAP_PLANETS;
    if ( m_category == LevelCategory::CustomLevels )  res = RT_PLAY_CHAP_USERLVL;
    GetResource(RES_TEXT, res, name);
    pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL11, name);
    pl->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);

    pos.y = oy+sy*6.7f;
    ddim.y = dim.y*4.5f;
    ddim.x = dim.x*6.5f;
    pli = pw->CreateList(pos, ddim, 0, EVENT_INTERFACE_CHAP);
    pli->SetState(STATE_SHADOW);
    m_chap[m_category] = m_main->GetPlayerProfile()->GetSelectedChap(m_category)-1;
    UpdateSceneChap(m_chap[m_category]);
    if ( m_category != LevelCategory::FreeGame &&
         m_category != LevelCategory::CodeBattles &&
         m_category != LevelCategory::CustomLevels ) // Don't show completion marks in free game, code battles and userlevels
    {
        pli->SetState(STATE_EXTEND);
    }

    // Displays a list of missions:
    pos.x = ox+sx*9.5f;
    pos.y = oy+sy*10.5f;
    ddim.x = dim.x*7.5f;
    ddim.y = dim.y*0.6f;
    res = RT_PLAY_LIST_LEVELS;
    if ( m_category == LevelCategory::Exercises    )  res = RT_PLAY_LIST_EXERCISES;
    if ( m_category == LevelCategory::Challenges   )  res = RT_PLAY_LIST_CHALLENGES;
    if ( m_category == LevelCategory::Missions     )  res = RT_PLAY_LIST_MISSIONS;
    if ( m_category == LevelCategory::FreeGame     )  res = RT_PLAY_LIST_FREEGAME;
    GetResource(RES_TEXT, res, name);
    pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL12, name);
    pl->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);

    pos.y = oy+sy*6.7f;
    ddim.y = dim.y*4.5f;
    ddim.x = dim.x*6.5f;
    pli = pw->CreateList(pos, ddim, 0, EVENT_INTERFACE_LIST);
    pli->SetState(STATE_SHADOW);
    m_sel[m_category] = m_main->GetPlayerProfile()->GetSelectedRank(m_category)-1;
    UpdateSceneList(m_chap[m_category], m_sel[m_category]);
    if ( m_category != LevelCategory::FreeGame &&
         m_category != LevelCategory::CodeBattles &&
         m_category != LevelCategory::CustomLevels ) // Don't show completion marks in free game, code battles and userlevels
    {
        pli->SetState(STATE_EXTEND);
    }
    pos = pli->GetPos();
    ddim = pli->GetDim();

//.........这里部分代码省略.........
开发者ID:CHmSID,项目名称:colobot,代码行数:101,代码来源:screen_level_list.cpp


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