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


C++ CSlider::SetArrowStep方法代码示例

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


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

示例1: DimMap

void CMainMap::DimMap()
{
    CWindow*    pw;
    CMap*       pm;
    CSlider*    ps;
    Math::Point     pos, dim;
    float       value;

    pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW1));
    if (pw == nullptr)
        return;
    pm = static_cast<CMap*>(pw->SearchControl(EVENT_OBJECT_MAP));
    if (pm == nullptr)
        return;

    pm->SetState(STATE_VISIBLE, (m_mapMode != 0));

    dim.x = 100.0f/640.0f;
    dim.y = 100.0f/480.0f;
    pos.x = 540.0f/640.0f;
    pos.y =   0.0f/480.0f;
    pm->SetPos(pos);
    pm->SetDim(dim);

    ps = static_cast<CSlider*>(pw->SearchControl(EVENT_OBJECT_MAPZOOM));
    if (ps != nullptr) {
        ps->SetState(STATE_VISIBLE, (m_mapMode != 0));

        dim.x = SCROLL_WIDTH;
        dim.y =  66.0f / 480.0f;
        pos.x = 523.0f / 640.0f;
        pos.y =   3.0f / 480.0f;
        ps->SetPos(pos);
        ps->SetDim(dim);

        value = pm->GetZoom();
        value = (value-ZOOM_MIN) / (ZOOM_MAX-ZOOM_MIN);
        value = powf(value, 0.5f);
        ps->SetVisibleValue(value);
        ps->SetArrowStep(0.2f);
    }
}
开发者ID:pol51,项目名称:colobot,代码行数:42,代码来源:mainmap.cpp

示例2: CreateInterface

void CScreenSetupGame::CreateInterface()
{
    CWindow*        pw;
    CLabel*         pl;
    CCheck*         pc;
    CSlider*        psl;
    CList*          pli;
    Math::Point     pos, ddim;
    std::string     name;

    CScreenSetup::CreateInterface();
    pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
    if ( pw == nullptr )  return;

    ddim.x = dim.x*6;
    ddim.y = dim.y*0.5f;
    pos.x = ox+sx*3;
    pos.y = 0.65f;

    pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_MOVIES);
    pc->SetState(STATE_SHADOW);
    pos.y -= 0.048f;
    pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_SCROLL);
    pc->SetState(STATE_SHADOW);
    pos.y -= 0.048f;
    pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_INVERTX);
    pc->SetState(STATE_SHADOW);
    pos.y -= 0.048f;
    pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_INVERTY);
    pc->SetState(STATE_SHADOW);
    pos.y -= 0.048f;
    pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_EFFECT);
    pc->SetState(STATE_SHADOW);
    pos.y -= 0.048f;
    pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_BLOOD);
    pc->SetState(STATE_SHADOW);
    pos.y -= 0.048f;
    pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_AUTOSAVE_ENABLE);
    pc->SetState(STATE_SHADOW);
    pos.y -= 0.048f;

    pos.y -= ddim.y;
    ddim.x = dim.x*2.5f;
    psl = pw->CreateSlider(pos, ddim, -1, EVENT_INTERFACE_AUTOSAVE_INTERVAL);
    psl->SetState(STATE_SHADOW);
    psl->SetLimit(1.0f, 30.0f);
    psl->SetArrowStep(1.0f);
    pos.y += ddim.y/2;
    GetResource(RES_EVENT, EVENT_INTERFACE_AUTOSAVE_INTERVAL, name);
    pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL1, name);
    pl->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);
    pos.y -= ddim.y/2;
    pos.x = ox+sx*3+dim.x*4.0f;
    psl = pw->CreateSlider(pos, ddim, -1, EVENT_INTERFACE_AUTOSAVE_SLOTS);
    psl->SetState(STATE_SHADOW);
    psl->SetLimit(1.0f, 10.0f);
    psl->SetArrowStep(1.0f);
    pos.y += ddim.y/2;
    GetResource(RES_EVENT, EVENT_INTERFACE_AUTOSAVE_SLOTS, name);
    pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL1, name);
    pl->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);
    pos.y -= ddim.y/2;

    ddim.x = dim.x*6;
    ddim.y = dim.y*0.5f;
    pos.x = ox+sx*10;
    pos.y = 0.65f;
    pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_TOOLTIP);
    pc->SetState(STATE_SHADOW);
    pos.y -= 0.048f;
    pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_GLINT);
    pc->SetState(STATE_SHADOW);
    pos.y -= 0.048f;
    pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_RAIN);
    pc->SetState(STATE_SHADOW);
    pos.y -= 0.048f;
    pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_BGPAUSE);
    pc->SetState(STATE_SHADOW);
    pos.y -= 0.048f;
    pos.y -= 0.048f;
    pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_EDITMODE);
    pc->SetState(STATE_SHADOW);
    if ( m_simulationSetup )
    {
        pc->SetState(STATE_DEAD);
    }
    pos.y -= 0.048f;
    pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_EDITVALUE);
    pc->SetState(STATE_SHADOW);

    ddim.y = dim.y*3.0f;
    pos.y -= ddim.y;
    pli = pw->CreateList(pos, ddim, 0, EVENT_INTERFACE_LANGUAGE);
    pli->SetState(STATE_SHADOW);
    // TODO: Add something like GetSupportedLanguages() and GetLanguageFriendlyName() for this
    pli->SetItemName(1+LANGUAGE_ENV, "[System default]");
    pli->SetItemName(1+LANGUAGE_ENGLISH, "English");
    pli->SetItemName(1+LANGUAGE_FRENCH, "French");
    pli->SetItemName(1+LANGUAGE_GERMAN, "German");
    pli->SetItemName(1+LANGUAGE_POLISH, "Polish");
//.........这里部分代码省略.........
开发者ID:2asoft,项目名称:colobot,代码行数:101,代码来源:screen_setup_game.cpp

示例3: CreateInterface


//.........这里部分代码省略.........

    // Color A
    pos.x  = 340.0f/640.0f;
    pos.y  = 300.0f/480.0f;
    ddim.x = 200.0f/640.0f;
    ddim.y =  16.0f/480.0f;
    pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL14, "");
    pl->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);

    pos.y  = 282.0f/480.0f;
    ddim.x =  18.0f/640.0f;
    ddim.y =  18.0f/480.0f;
    for ( int j=0 ; j<3 ; j++ )
    {
        pos.x  = 340.0f/640.0f;
        for ( int i=0 ; i<3 ; i++ )
        {
            pco = pw->CreateColor(pos, ddim, -1, static_cast<EventType>(EVENT_INTERFACE_PC0a+j*3+i));
            pco->SetState(STATE_SHADOW);
            pos.x += 20.0f/640.0f;
        }
        pos.y -= 20.0f/480.0f;
    }

    pos.x  = 420.0f/640.0f;
    pos.y  = 282.0f/480.0f;
    ddim.x = 100.0f/640.0f;
    ddim.y =  18.0f/480.0f;
    for ( int i=0 ; i<3 ; i++ )
    {
        psl = pw->CreateSlider(pos, ddim, 0, static_cast<EventType>(EVENT_INTERFACE_PCRa+i));
        psl->SetState(STATE_SHADOW);
        psl->SetLimit(0.0f, 255.0f);
        psl->SetArrowStep(16.0f);
        pos.y -= 20.0f/480.0f;
    }

    // Color B
    pos.x  = 340.0f/640.0f;
    pos.y  = 192.0f/480.0f;
    ddim.x = 200.0f/640.0f;
    ddim.y =  16.0f/480.0f;
    pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL13, "");
    pl->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);

    pos.y  = 174.0f/480.0f;
    ddim.x =  18.0f/640.0f;
    ddim.y =  18.0f/480.0f;
    for ( int j=0 ; j<3 ; j++ )
    {
        pos.x  = 340.0f/640.0f;
        for ( int i=0 ; i<3 ; i++ )
        {
            pco = pw->CreateColor(pos, ddim, -1, static_cast<EventType>(EVENT_INTERFACE_PC0b+j*3+i));
            pco->SetState(STATE_SHADOW);
            pos.x += 20.0f/640.0f;
        }
        pos.y -= 20.0f/480.0f;
    }

    pos.x  = 420.0f/640.0f;
    pos.y  = 174.0f/480.0f;
    ddim.x = 100.0f/640.0f;
    ddim.y =  18.0f/480.0f;
    for ( int i=0 ; i<3 ; i++ )
    {
开发者ID:BTML,项目名称:colobot,代码行数:67,代码来源:screen_apperance.cpp


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