本文整理汇总了C++中CSlider::GetVisibleValue方法的典型用法代码示例。如果您正苦于以下问题:C++ CSlider::GetVisibleValue方法的具体用法?C++ CSlider::GetVisibleValue怎么用?C++ CSlider::GetVisibleValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSlider
的用法示例。
在下文中一共展示了CSlider::GetVisibleValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChangeSetupButtons
void CScreenSetupGame::ChangeSetupButtons()
{
CWindow* pw;
CSlider* ps;
CList* pli;
float value;
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if ( pw == nullptr ) return;
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_AUTOSAVE_INTERVAL));
if ( ps != nullptr )
{
value = ps->GetVisibleValue();
m_main->SetAutosaveInterval(static_cast<int>(round(value)));
}
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_AUTOSAVE_SLOTS));
if ( ps != nullptr )
{
value = ps->GetVisibleValue();
m_main->SetAutosaveSlots(static_cast<int>(round(value)));
}
pli = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_LANGUAGE));
if ( pli != nullptr )
{
m_settings->SetLanguage(static_cast<Language>(pli->GetSelect()-1));
// TODO: A really ugly way to apply the change immediately
m_main->ChangePhase(m_main->GetPhase());
}
}
示例2: ZoomMap
void CMainMap::ZoomMap()
{
CWindow* pw;
CMap* pm;
CSlider* ps;
float zoom;
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;
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_OBJECT_MAPZOOM));
if (ps == nullptr)
return;
zoom = ps->GetVisibleValue();
zoom = powf(zoom, 2.0f);
zoom = ZOOM_MIN+zoom*(ZOOM_MAX - ZOOM_MIN);
pm->SetZoom(zoom);
DimMap();
}
示例3: ColorPerso
void CScreenApperance::ColorPerso()
{
CWindow* pw;
CSlider* ps;
Gfx::Color color;
PlayerApperance& apperance = m_main->GetPlayerProfile()->GetApperance();
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if ( pw == nullptr ) return;
color.a = 0.0f;
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCRa));
if ( ps != nullptr ) color.r = ps->GetVisibleValue()/255.0f;
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCGa));
if ( ps != nullptr ) color.g = ps->GetVisibleValue()/255.0f;
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCBa));
if ( ps != nullptr ) color.b = ps->GetVisibleValue()/255.0f;
if ( m_apperanceTab == 1 ) apperance.colorCombi = color;
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCRb));
if ( ps != nullptr ) color.r = ps->GetVisibleValue()/255.0f;
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCGb));
if ( ps != nullptr ) color.g = ps->GetVisibleValue()/255.0f;
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCBb));
if ( ps != nullptr ) color.b = ps->GetVisibleValue()/255.0f;
if ( m_apperanceTab == 0 ) apperance.colorHair = color;
else apperance.colorBand = color;
}
示例4: ChangeSetupButtons
void CScreenSetupSound::ChangeSetupButtons()
{
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 = ps->GetVisibleValue();
m_sound->SetAudioVolume(static_cast<int>(value));
}
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_VOLMUSIC));
if ( ps != nullptr )
{
value = ps->GetVisibleValue();
m_sound->SetMusicVolume(static_cast<int>(value));
}
}
示例5: EventProcess
bool CStudio::EventProcess(const Event &event)
{
CWindow* pw;
CEdit* edit;
CSlider* slider;
if ( m_dialog != SD_NULL ) // dialogue exists?
{
return EventDialog(event);
}
if ( event.type == EVENT_FRAME )
{
EventFrame(event);
}
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW3));
if ( pw == nullptr ) return false;
edit = static_cast<CEdit*>(pw->SearchControl(EVENT_STUDIO_EDIT));
if ( edit == nullptr ) return false;
if ( event.type == pw->GetEventTypeClose() )
{
Event newEvent = event;
newEvent.type = EVENT_STUDIO_OK;
m_event->AddEvent(newEvent);
}
if ( event.type == EVENT_STUDIO_EDIT ) // text modifief?
{
ColorizeScript(edit);
}
if ( event.type == EVENT_STUDIO_LIST ) // list clicked?
{
m_main->StartDisplayInfo(const_cast<char *>(m_helpFilename.c_str()), -1); // TODO change to std::string when RobotMain changes
}
if ( event.type == EVENT_STUDIO_NEW ) // new?
{
m_script->New(edit, "");
}
if ( event.type == EVENT_STUDIO_OPEN ) // open?
{
StartDialog(SD_OPEN);
}
if ( event.type == EVENT_STUDIO_SAVE ) // save?
{
StartDialog(SD_SAVE);
}
if ( event.type == EVENT_STUDIO_UNDO ) // undo?
{
edit->Undo();
}
if ( event.type == EVENT_STUDIO_CUT ) // cut?
{
edit->Cut();
}
if ( event.type == EVENT_STUDIO_COPY ) // copy?
{
edit->Copy();
}
if ( event.type == EVENT_STUDIO_PASTE ) // paste?
{
edit->Paste();
}
if ( event.type == EVENT_STUDIO_SIZE ) // size?
{
slider = static_cast< CSlider* >(pw->SearchControl(EVENT_STUDIO_SIZE));
if ( slider == nullptr ) return false;
m_main->SetFontSize(9.0f+slider->GetVisibleValue()*12.0f);
ViewEditScript();
}
if ( event.type == EVENT_STUDIO_TOOL && // instructions?
m_dialog == SD_NULL )
{
m_main->StartDisplayInfo(SATCOM_HUSTON, false);
}
if ( event.type == EVENT_STUDIO_HELP && // help?
m_dialog == SD_NULL )
{
m_main->StartDisplayInfo(SATCOM_PROG, false);
}
if ( event.type == EVENT_STUDIO_COMPILE ) // compile?
{
if ( m_script->GetScript(edit) ) // compile
{
std::string res;
GetResource(RES_TEXT, RT_STUDIO_COMPOK, res);
SetInfoText(res, false);
}
else
{
std::string error;
//.........这里部分代码省略.........