当前位置: 首页>>代码示例>>C++>>正文


C++ CControl类代码示例

本文整理汇总了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;
}
开发者ID:cdlewis,项目名称:extremetuxracer,代码行数:30,代码来源:racing.cpp

示例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;
}
开发者ID:ktan2020,项目名称:extremetuxracer-win32,代码行数:28,代码来源:racing.cpp

示例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;
}
开发者ID:EQ4,项目名称:vstgui,代码行数:28,代码来源:uiviewswitchcontainer.cpp

示例4: _FindControl

//-----------------------------------------------------------------------------------------------
void CGUI::MousePress (const SMouseEvent& event)
{
	CControl* Ptr = _FindControl(event);

	if (Ptr != 0)
		Ptr->MousePress(event.X, event.Y);
	else
		_ZeroFocus();
}
开发者ID:bananu7,项目名称:OpenGLUI,代码行数:10,代码来源:GUI.cpp

示例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);
	}
}
开发者ID:sa-tsuklog,项目名称:MyLib,代码行数:10,代码来源:animations.cpp

示例6: EachControlSizeChanged

void CWindow::EachControlSizeChanged()
{
	TRect aScreenRect = iMainEngine.ScreenRect();
	for (TInt i = 0 ; i < iControlArray.Count() ; i++)
	{
		CControl* control = iControlArray[i];
		control->SizeChanged(aScreenRect);
	}
}
开发者ID:flaithbheartaigh,项目名称:wapbrowser,代码行数:9,代码来源:Window.cpp

示例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);
	}
}
开发者ID:sa-tsuklog,项目名称:MyLib,代码行数:10,代码来源:animations.cpp

示例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 );
        }
    }
}
开发者ID:BeyondEngine,项目名称:BeyondEngine,代码行数:12,代码来源:Control.cpp

示例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;
    }
}
开发者ID:grimtraveller,项目名称:sally-project,代码行数:13,代码来源:NumberSelector.cpp

示例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);
}
开发者ID:Beltasbur,项目名称:waifu2x-caffe,代码行数:15,代码来源:CControl.cpp

示例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;
	}	
}
开发者ID:DharmaPatil,项目名称:asp,代码行数:50,代码来源:Form_MsgBox.c

示例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);
        }
    }
}
开发者ID:BeyondEngine,项目名称:BeyondEngine,代码行数:15,代码来源:UIViewAgent.cpp

示例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;
}
开发者ID:flaithbheartaigh,项目名称:wapbrowser,代码行数:15,代码来源:Window.cpp

示例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 );
        }
    }
}
开发者ID:BeyondEngine,项目名称:BeyondEngine,代码行数:17,代码来源:Control.cpp

示例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 );
            }
        }
    }
}
开发者ID:BeyondEngine,项目名称:BeyondEngine,代码行数:17,代码来源:Control.cpp


注:本文中的CControl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。