本文整理汇总了C++中CButton::SetRepeat方法的典型用法代码示例。如果您正苦于以下问题:C++ CButton::SetRepeat方法的具体用法?C++ CButton::SetRepeat怎么用?C++ CButton::SetRepeat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::SetRepeat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MoveAdjust
void CScroll::MoveAdjust()
{
CButton* pc;
Math::Point pos, dim;
if ( m_dim.y < m_dim.x*2.0f ) // very short lift?
{
delete m_buttonUp;
m_buttonUp = 0;
delete m_buttonDown;
m_buttonDown = 0;
}
else
{
if ( m_buttonUp == 0 )
{
m_buttonUp = new CButton();
pc = m_buttonUp;
pc->Create(Math::Point(0.0f, 0.0f), Math::Point(0.0f, 0.0f), 49, EVENT_NULL);
pc->SetRepeat(true);
m_eventUp = pc->GetEventType();
}
if ( m_buttonDown == 0 )
{
m_buttonDown = new CButton();
pc = m_buttonDown;
pc->Create(Math::Point(0.0f, 0.0f), Math::Point(0.0f, 0.0f), 50, EVENT_NULL);
pc->SetRepeat(true);
m_eventDown = pc->GetEventType();
}
}
if ( m_buttonUp != 0 )
{
pos.x = m_pos.x;
pos.y = m_pos.y+m_dim.y-m_dim.x/0.75f;
dim.x = m_dim.x;
dim.y = m_dim.x/0.75f;
m_buttonUp->SetPos(pos);
m_buttonUp->SetDim(dim);
}
if ( m_buttonDown != 0 )
{
pos.x = m_pos.x;
pos.y = m_pos.y;
dim.x = m_dim.x;
dim.y = m_dim.x/0.75f;
m_buttonDown->SetPos(pos);
m_buttonDown->SetDim(dim);
}
AdjustGlint();
}
示例2: CreateInterface
//.........这里部分代码省略.........
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++ )
{
psl = pw->CreateSlider(pos, ddim, 0, static_cast<EventType>(EVENT_INTERFACE_PCRb+i));
psl->SetState(STATE_SHADOW);
psl->SetLimit(0.0f, 255.0f);
psl->SetArrowStep(16.0f);
pos.y -= 20.0f/480.0f;
}
// Rotation
pos.x = 100.0f/640.0f;
pos.y = 113.0f/480.0f;
ddim.x = 20.0f/640.0f;
ddim.y = 20.0f/480.0f;
pb = pw->CreateButton(pos, ddim, 55, EVENT_INTERFACE_PLROT); // <
pb->SetState(STATE_SHADOW);
pb->SetRepeat(true);
pos.x = 290.0f/640.0f;
pos.y = 113.0f/480.0f;
ddim.x = 20.0f/640.0f;
ddim.y = 20.0f/480.0f;
pb = pw->CreateButton(pos, ddim, 48, EVENT_INTERFACE_PRROT); // >
pb->SetState(STATE_SHADOW);
pb->SetRepeat(true);
pos.x = 100.0f/640.0f;
pos.y = 70.0f/480.0f;
ddim.x = 100.0f/640.0f;
ddim.y = 32.0f/480.0f;
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_POK);
pb->SetState(STATE_SHADOW);
pos.x = 210.0f/640.0f;
pos.y = 70.0f/480.0f;
ddim.x =100.0f/640.0f;
ddim.y = 32.0f/480.0f;
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_PCANCEL);
pb->SetState(STATE_SHADOW);
pos.x = 340.0f/640.0f;
pos.y = 70.0f/480.0f;
ddim.x =194.0f/640.0f;
ddim.y = 32.0f/480.0f;
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_PDEF);
pb->SetState(STATE_SHADOW);
m_apperanceTab = 0;
m_apperanceAngle = -0.6f;
m_main->GetPlayerProfile()->LoadApperance();
UpdatePerso();
m_main->ScenePerso();
CameraPerso();
}