예제 #1
0
void CGUIElement_Impl::SetText ( const char *szText )
{
	CEGUI::String strText;

	if ( szText ) strText.assign ( szText );
    m_pWindow->setText ( strText );
}
예제 #2
0
float CGUIFont_Impl::GetTextExtent ( const char* szText, float fScale )
{
	CEGUI::String strText;

	if ( szText ) strText.assign ( szText );
	return m_pFont->getTextExtent ( strText, fScale );
}
예제 #3
0
void CGUITab_Impl::SetCaption ( const char* szCaption )
{
    CEGUI::String strCaption;

    if ( szCaption ) strCaption.assign ( szCaption );
    m_pWindow->setText ( strCaption );
}
예제 #4
0
void CGUILabel_Impl::SetText ( const char *Text )
{
    CEGUI::String strText;

    if ( Text ) strText.assign ( Text );

    // Set the new text and size the text field after it
    m_pWindow->setText ( strText );
}
예제 #5
0
bool OnPlayerShopSubBuyNum(const CEGUI::EventArgs& e)
{
	CEGUI::Window* wnd = WEArgs(e).window;
	if(!wnd) return false;

	CEGUI::Window* goodsWnd = wnd->getParent();
	if (goodsWnd)
	{	
		CGoods* goods = static_cast<CGoods*>(goodsWnd->getUserData());
		if (!goods) return false;

		PlayerShop::tagGoodsItem* pGoodsItem = GetPlayerShop().FindtagGoods(goods);
		if (pGoodsItem!=NULL)
		{
			char str[32];
			// 取得输入框控件名
			CEGUI::String name = wnd->getName();
			name.assign(name, 0, name.find_last_of("/"));
			name += "/BuyNum";

			CEGUI::Window* buyNumWnd = GetWndMgr().getWindow(name);
			int num = atoi(buyNumWnd->getText().c_str());

			if (num<=0)
			{
				sprintf(str,"%d",0);
				wnd->disable();
			}
			else
				sprintf(str,"%d",num--);
			buyNumWnd->setText(ToCEGUIString(str));
			pGoodsItem->readyTradeNum = num;	
		}
	}

	return true;
}