本文整理汇总了C++中CControl类的典型用法代码示例。如果您正苦于以下问题:C++ CControl类的具体用法?C++ CControl怎么用?C++ CControl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: racing_init
// ---------------------------- init ----------------------------------
void racing_init (void) {
CControl *ctrl = Players.GetCtrl (g_game.player_id);
if (param.view_mode < 0 || param.view_mode >= NUM_VIEW_MODES) {
param.view_mode = ABOVE;
}
set_view_mode (ctrl, (TViewMode)param.view_mode);
left_turn = right_turn = trick_modifier = false;
ctrl->turn_fact = 0.0;
ctrl->turn_animation = 0.0;
ctrl->is_braking = false;
ctrl->is_paddling = false;
ctrl->jumping = false;
ctrl->jump_charging = false;
lastsound = -1;
newsound = -1;
if (g_game.prev_mode != PAUSED) ctrl->Init ();
g_game.raceaborted = false;
SetSoundVolumes ();
Music.PlayTheme (g_game.theme_id, MUS_RACING);
g_game.fps = 0;
g_game.timesteps = 0;
g_game.finish = false;
}
示例2: Enter
// ---------------------------- init ----------------------------------
void CRacing::Enter (void) {
CControl *ctrl = Players.GetCtrl (g_game.player_id);
if (param.view_mode < 0 || param.view_mode >= NUM_VIEW_MODES) {
param.view_mode = ABOVE;
}
set_view_mode (ctrl, (TViewMode)param.view_mode);
left_turn = right_turn = trick_modifier = false;
ctrl->turn_fact = 0.0;
ctrl->turn_animation = 0.0;
ctrl->is_braking = false;
ctrl->is_paddling = false;
ctrl->jumping = false;
ctrl->jump_charging = false;
lastsound = -1;
newsound = -1;
if (State::manager.PreviousState() != &Paused) ctrl->Init ();
g_game.raceaborted = false;
SetSoundVolumes ();
Music.PlayTheme (g_game.theme_id, MUS_RACING);
g_game.finish = false;
}
示例3: findControlTag
//-----------------------------------------------------------------------------
static CControl* findControlTag (CViewContainer* parent, int32_t tag, bool reverse = true)
{
CControl* result = 0;
ViewIterator it (parent);
while (*it)
{
CView* view = *it;
CControl* control = dynamic_cast<CControl*> (view);
if (control)
{
if (control->getTag () == tag)
result = control;
}
else if (reverse)
{
CViewContainer* container = dynamic_cast<CViewContainer*> (view);
if (container)
result = findControlTag (container, tag);
}
if (result)
break;
++it;
}
if (result == 0 && !reverse)
return findControlTag (dynamic_cast<CViewContainer*> (parent->getParentView ()), reverse);
return result;
}
示例4: _FindControl
//-----------------------------------------------------------------------------------------------
void CGUI::MousePress (const SMouseEvent& event)
{
CControl* Ptr = _FindControl(event);
if (Ptr != 0)
Ptr->MousePress(event.X, event.Y);
else
_ZeroFocus();
}
示例5: animationTick
//-----------------------------------------------------------------------------
void ControlValueAnimation::animationTick (CView* view, IdStringPtr name, float pos)
{
CControl* control = dynamic_cast<CControl*> (view);
if (control)
{
float value = startValue + (endValue - startValue) * pos;
control->setValue (value);
}
}
示例6: EachControlSizeChanged
void CWindow::EachControlSizeChanged()
{
TRect aScreenRect = iMainEngine.ScreenRect();
for (TInt i = 0 ; i < iControlArray.Count() ; i++)
{
CControl* control = iControlArray[i];
control->SizeChanged(aScreenRect);
}
}
示例7: animationFinished
//-----------------------------------------------------------------------------
void ControlValueAnimation::animationFinished (CView* view, IdStringPtr name, bool wasCanceled)
{
CControl* control = dynamic_cast<CControl*> (view);
if (control)
{
if (!wasCanceled || forceEndValueOnFinish)
control->setValue (endValue);
}
}
示例8: SetLayerId
void CControl::SetLayerId( size_t layerid )
{
m_uLayerID = layerid;
for ( auto child : GetChildren() )
{
CControl* pChild = ( CControl*) child;
if ( pChild )
{
pChild->SetLayerId( m_uLayerID + 1 );
}
}
}
示例9: while
void CNumberSelector::Enable(bool enable)
{
SallyAPI::GUI::CForm::Enable(enable);
// Send Timer Event to all Childs
std::list<CControl*>::iterator iter = m_GUIControlList.begin();
while (iter != m_GUIControlList.end())
{
CControl* control = *iter;
control->Enable(enable);
++iter;
}
}
示例10: DispatchSubProc
// ダイアログプロシージャ(形式上)
LRESULT CALLBACK CControl::DispatchSubProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
// ダイアログの 32 ビット整数に格納されている
// this ポインタを取りだす
CControl *pcControl = (CControl *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
if(pcControl == NULL)
{
// たぶんここが実行されることはない
return NULL;
}
// メンバ関数のダイアログプロシージャを呼び出す
return pcControl->SubProc(hWnd, uMsg, wParam, lParam);
}
示例11: MsgBoxDlgProc
void MsgBoxDlgProc(LPWindow pWindow, LPGuiMsgInfo pGuiMsgInfo)
{
CControl* pControl;
switch(pGuiMsgInfo->ID)
{
case WM_LOAD:
pWindow->DrawFunc(pWindow);
break;
case WM_SHOW:
pWindow->DrawFunc(pWindow);
break;
case WM_CLOSE:
if(pWindow->pParentWindow != NULL)
{
//·µ»Ø¸¸´°¿Ú
g_pCurWindow = pWindow->pParentWindow;
PostWindowMsg(g_pCurWindow, WM_RETURN, 0, 0);
}
break;
case WM_UPDATECTRL:
pControl = (CControl*)(pGuiMsgInfo->wParam);
if(pControl != NULL)
{
pControl->DrawFunc(pControl);
}
break;
case WM_KEYDOWN:
switch(pGuiMsgInfo->wParam)
{
case KEY_BACK: //·µ»Ø
PostWindowMsg(pWindow, WM_CLOSE, 0, 0);
break;
case KEY_OK: //È·¶¨
PostWindowMsg(pWindow, WM_CLOSE, 0, 0);
break;
default:
break;
}
break;
default:
break;
}
}
示例12: OutView
void CUIViewAgent::OutView()
{
m_pMainFrame->m_pToolBook->DeleteAllPages();
m_pMainFrame->m_Manager.GetPane(m_pMainFrame->m_pToolPanel).Hide();
m_pMainFrame->m_Manager.Update();
if(m_pMainFrame->m_pSelectedComponentProxy)
{
CControl *pWindow = dynamic_cast<CControl*>(
m_pMainFrame->m_pSelectedComponentProxy->GetHostComponent());
if(pWindow)
{
pWindow->SetEditorSelect(false);
}
}
}
示例13: HandleEachControlCommandL
TBool CWindow::HandleEachControlCommandL(TInt aCommand)
{
TBool cmdResult = EFalse;
//自顶向底处理
for (TInt i = iControlArray.Count() - 1 ; i >= 0 ; i--)
{
CControl* control = iControlArray[i];
cmdResult = control->HandleCommandL(aCommand);
if(cmdResult)
{
break; //事件已响应,结束处理
}
}
return cmdResult;
}
示例14: Uninitialize
void CControl::Uninitialize()
{
super::Uninitialize();
m_bUninitialize = true;
CWindowManager::GetInstance()->LogoutControl( this );
// TODO: There is a worse solution, wait for the frame fix
// bug describe
// If delete the component , the child didn't render again
for ( auto child : GetChildren() )
{
CControl* control = down_cast<CControl*>(child);
if ( control && control->GetRootFlag() )
{
CWindowManager::GetInstance()->RemoveFromRoot( control );
}
}
}
示例15: CalcRealSize
void CControl::SetPercentSize( const CVec2& size )
{
if ( m_vec2PercentSize != size )
{
m_vec2PercentSize = size;
CalcRealSize();
UpdateQuadP();
for ( auto childWnd : GetChildren() )
{
if ( childWnd->GetType() == eNT_NodeGUI )
{
CControl* child =( CControl*) childWnd;
child->OnParentSizeChange( m_vec2Size.x , m_vec2Size.y );
}
}
}
}