本文整理汇总了C++中TextButton::Setup方法的典型用法代码示例。如果您正苦于以下问题:C++ TextButton::Setup方法的具体用法?C++ TextButton::Setup怎么用?C++ TextButton::Setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextButton
的用法示例。
在下文中一共展示了TextButton::Setup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderThreadInitReceipts
void UI::RenderThreadInitReceipts()
{
// delay creation of new labels for the rendering thread
if (m_pendingReceipts.size() > 0)
{
for (int index = 0; index < m_pendingReceipts.size(); ++index)
{
char buffer[1024];
//sprintf(buffer, "Copy receipt %s", m_pendingReceipts[index].Identifier.c_str());
//LOGI(buffer);
TextButton* txtReceipt = new TextButton();
OuyaSDK::Receipt* newReceipt = new OuyaSDK::Receipt(m_pendingReceipts[index]);
txtReceipt->DataContext = newReceipt;
//sprintf(buffer, "Setting up receipt ui %s", newReceipt->Identifier.c_str());
//LOGI(buffer);
sprintf(buffer, NVBF_COLORSTR_GRAY "%s (%.2f)", newReceipt->Identifier.c_str(), newReceipt->LocalPrice);
txtReceipt->ActiveText = buffer;
txtReceipt->InactiveText = buffer;
txtReceipt->Setup(2, 32);
m_receipts.push_back(txtReceipt);
}
m_uiChanged = true;
m_pendingReceipts.clear();
}
}
示例2: RenderThreadInitProducts
void UI::RenderThreadInitProducts()
{
// delay creation of new labels for the rendering thread
if (m_pendingProducts.size() > 0)
{
for (int index = 0; index < m_pendingProducts.size(); ++index)
{
char buffer[1024];
//sprintf(buffer, "Copy product %s", m_pendingProducts[index].Identifier.c_str());
//LOGI(buffer);
TextButton* txtProduct = new TextButton();
OuyaSDK::Product* newProduct = new OuyaSDK::Product(m_pendingProducts[index]);
txtProduct->DataContext = newProduct;
//sprintf(buffer, "Setting up product ui %s", newProduct->Identifier.c_str());
//LOGI(buffer);
sprintf(buffer, NVBF_COLORSTR_WHITE "--> %s (%.2f)", newProduct->Identifier.c_str(), newProduct->LocalPrice);
txtProduct->ActiveText = buffer;
sprintf(buffer, NVBF_COLORSTR_GRAY "%s (%.2f)", newProduct->Identifier.c_str(), newProduct->LocalPrice);
txtProduct->InactiveText = buffer;
txtProduct->Setup(2, 32);
txtProduct->Right = &m_uiRequestPurchase;
m_products.push_back(txtProduct);
if (index == 0)
{
m_selectedProduct = m_products[0];
m_products[0]->SetActive(true);
m_uiRequestProducts.Left = m_selectedProduct;
m_uiRequestPurchase.Left = m_selectedProduct;
}
else
{
m_products[index-1]->Down = m_products[index];
m_products[index]->Up = m_products[index-1];
}
}
m_uiChanged = true;
m_pendingProducts.clear();
}
}