本文整理汇总了C++中CSlider::SetVisibleValue方法的典型用法代码示例。如果您正苦于以下问题:C++ CSlider::SetVisibleValue方法的具体用法?C++ CSlider::SetVisibleValue怎么用?C++ CSlider::SetVisibleValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSlider
的用法示例。
在下文中一共展示了CSlider::SetVisibleValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateSetupButtons
void CScreenSetupSound::UpdateSetupButtons()
{
CWindow* pw;
CSlider* ps;
float value;
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if ( pw == nullptr ) return;
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_VOLSOUND));
if ( ps != nullptr )
{
value = static_cast<float>(m_sound->GetAudioVolume());
ps->SetVisibleValue(value);
}
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_VOLMUSIC));
if ( ps != nullptr )
{
value = static_cast<float>(m_sound->GetMusicVolume());
ps->SetVisibleValue(value);
}
}
示例2: 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);
}
}
示例3: UpdateSetupButtons
void CScreenSetupGame::UpdateSetupButtons()
{
CWindow* pw;
CCheck* pc;
CSlider* ps;
CList* pli;
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if ( pw == nullptr ) return;
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_TOOLTIP));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_settings->GetTooltips());
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_GLINT));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_settings->GetInterfaceGlint());
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_RAIN));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_settings->GetInterfaceRain());
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_BGPAUSE));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_settings->GetFocusLostPause());
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_EDITMODE));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_engine->GetEditIndentMode());
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_EDITVALUE));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_engine->GetEditIndentValue()>2);
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_SOLUCE4));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_settings->GetSoluce4());
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_MOVIES));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_settings->GetMovies());
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_SCROLL));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_camera->GetOldCameraScroll());
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_INVERTX));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_camera->GetCameraInvertX());
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_INVERTY));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_camera->GetCameraInvertY());
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_EFFECT));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_camera->GetEffect());
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_BLOOD));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_camera->GetBlood());
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_AUTOSAVE_ENABLE));
if ( pc != nullptr )
{
pc->SetState(STATE_CHECK, m_main->GetAutosave());
}
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_AUTOSAVE_INTERVAL));
if ( ps != nullptr )
{
ps->SetState(STATE_ENABLE, m_main->GetAutosave());
ps->SetVisibleValue(m_main->GetAutosaveInterval());
//.........这里部分代码省略.........
示例4: UpdatePerso
//.........这里部分代码省略.........
{
pl->ClearState(STATE_VISIBLE);
}
}
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL13));
if ( pl != nullptr )
{
if ( m_apperanceTab == 0 ) GetResource(RES_TEXT, RT_PERSO_HAIR, name);
else GetResource(RES_TEXT, RT_PERSO_BAND, name);
pl->SetName(name);
}
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL14));
if ( pl != nullptr )
{
if ( m_apperanceTab == 0 )
{
pl->ClearState(STATE_VISIBLE);
}
else
{
pl->SetState(STATE_VISIBLE);
GetResource(RES_TEXT, RT_PERSO_COMBI, name);
pl->SetName(name);
}
}
for ( i=0 ; i<4 ; i++ )
{
pb = static_cast<CButton*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PFACE1+i)));
if ( pb == nullptr ) break;
pb->SetState(STATE_VISIBLE, m_apperanceTab==0);
pb->SetState(STATE_CHECK, i==apperance.face);
}
for ( i=0 ; i<10 ; i++ )
{
pb = static_cast<CButton*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PGLASS0+i)));
if ( pb == nullptr ) break;
pb->SetState(STATE_VISIBLE, m_apperanceTab==0);
pb->SetState(STATE_CHECK, i==apperance.glasses);
}
for ( i=0 ; i<3*3 ; i++ )
{
pc = static_cast<CColor*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PC0a+i)));
if ( pc == nullptr ) break;
if ( m_apperanceTab == 0 )
{
pc->ClearState(STATE_VISIBLE);
}
else
{
pc->SetState(STATE_VISIBLE);
color.r = PERSO_COLOR[3*10*1+3*i+0]/255.0f;
color.g = PERSO_COLOR[3*10*1+3*i+1]/255.0f;
color.b = PERSO_COLOR[3*10*1+3*i+2]/255.0f;
color.a = 0.0f;
pc->SetColor(color);
pc->SetState(STATE_CHECK, EqColor(color, apperance.colorCombi));
}
pc = static_cast<CColor*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PC0b+i)));
if ( pc == nullptr ) break;
color.r = PERSO_COLOR[3*10*2*m_apperanceTab+3*i+0]/255.0f;
color.g = PERSO_COLOR[3*10*2*m_apperanceTab+3*i+1]/255.0f;
color.b = PERSO_COLOR[3*10*2*m_apperanceTab+3*i+2]/255.0f;
color.a = 0.0f;
pc->SetColor(color);
pc->SetState(STATE_CHECK, EqColor(color, m_apperanceTab?apperance.colorBand:apperance.colorHair));
}
for ( i=0 ; i<3 ; i++ )
{
ps = static_cast<CSlider*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PCRa+i)));
if ( ps == nullptr ) break;
ps->SetState(STATE_VISIBLE, m_apperanceTab==1);
}
if ( m_apperanceTab == 1 )
{
color = apperance.colorCombi;
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCRa));
if ( ps != nullptr ) ps->SetVisibleValue(color.r*255.0f);
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCGa));
if ( ps != nullptr ) ps->SetVisibleValue(color.g*255.0f);
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCBa));
if ( ps != nullptr ) ps->SetVisibleValue(color.b*255.0f);
}
if ( m_apperanceTab == 0 ) color = apperance.colorHair;
else color = apperance.colorBand;
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCRb));
if ( ps != nullptr ) ps->SetVisibleValue(color.r*255.0f);
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCGb));
if ( ps != nullptr ) ps->SetVisibleValue(color.g*255.0f);
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCBb));
if ( ps != nullptr ) ps->SetVisibleValue(color.b*255.0f);
}