本文整理汇总了C++中CSlider::SetPos方法的典型用法代码示例。如果您正苦于以下问题:C++ CSlider::SetPos方法的具体用法?C++ CSlider::SetPos怎么用?C++ CSlider::SetPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSlider
的用法示例。
在下文中一共展示了CSlider::SetPos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例2: AdjustDisplayInfo
void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
{
CWindow* pw;
CEdit* edit;
CButton* button;
CSlider* slider;
CGroup* group;
Math::Point pos, dim;
wpos.x = 50.0f / 640.0f;
wpos.y = 30.0f / 480.0f;
wdim.x = 540.0f / 640.0f;
wdim.y = 420.0f / 480.0f;
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
if ( pw != 0 )
{
pw->SetPos(wpos);
pw->SetDim(wdim);
wdim = pw->GetDim();
}
pos.x = (50.0f + 10.0f) / 640.0f;
pos.y = (30.0f + 10.0f + 24.0f + 10.0f + 324.0f - 48.0f) / 480.0f;
dim.x = 48.0f / 640.0f;
dim.y = 48.0f / 480.0f;
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_HUSTON));
if ( button != 0 )
{
button->SetPos(pos);
button->SetDim(dim);
}
pos.y -= (48.0f + 4.0f) / 480.0f;
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_SAT));
if ( button != 0 )
{
button->SetPos(pos);
button->SetDim(dim);
}
//? pos.y -= (48.0f+4.0f)/480.0f;
//? button = (CButton*)pw->SearchControl(EVENT_SATCOM_OBJECT);
//? if ( button != 0 )
//? {
//? button->SetPos(pos);
//? button->SetDim(dim);
//? }
pos.y -= (48.0f + 4.0f) / 480.0f;
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_LOADING));
if ( button != 0 )
{
button->SetPos(pos);
button->SetDim(dim);
}
pos.y -= (48.0f + 4.0f) / 480.0f;
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_PROG));
if ( button != 0 )
{
button->SetPos(pos);
button->SetDim(dim);
}
pos.y -= (48.0f + 4.0f) / 480.0f;
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_SOLUCE));
if ( button != 0 )
{
button->SetPos(pos);
button->SetDim(dim);
}
pos.x = (50.0f + 10.0f + 5.0f) / 640.0f;
pos.y = (30.0f + 10.0f + 4.0f) / 480.0f;
dim.x = (48.0f - 10.0f) / 640.0f;
dim.y = 24.0f / 480.0f;
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_OBJECT_INFOOK));
if ( button != 0 )
{
button->SetPos(pos);
button->SetDim(dim);
}
pos.x = (50.0f + 10.0f + 48.0f + 10.0f) / 640.0f;
pos.y = (30.0f + 10.0f) / 480.0f;
dim.x = 462.0f / 640.0f;
dim.y = 358.0f / 480.0f;
edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1));
if ( edit != 0 )
{
edit->SetPos(pos);
edit->SetDim(dim);
}
pos.x = (50.0f + 10.0f + 48.0f + 10.0f) / 640.0f;
pos.y = (30.0f + 10.0f + 358.0f + 10.0f) / 480.0f;
dim.x = 32.0f / 640.0f;
dim.y = 32.0f / 480.0f;
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_PREV));
if ( button != 0 )
{
button->SetPos(pos);
button->SetDim(dim);
}
//.........这里部分代码省略.........