本文整理汇总了C++中gwen::controls::TreeNode::SetText方法的典型用法代码示例。如果您正苦于以下问题:C++ TreeNode::SetText方法的具体用法?C++ TreeNode::SetText怎么用?C++ TreeNode::SetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gwen::controls::TreeNode
的用法示例。
在下文中一共展示了TreeNode::SetText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dumpRecursive
void UpdateText(CProfileIterator* profileIterator, bool idle)
{
static bool update=true;
m_ctrl->SetBounds(0,0,this->GetInnerBounds().w,this->GetInnerBounds().h);
// if (!update)
// return;
update=false;
static int test = 1;
test++;
static double time_since_reset = 0.f;
if (!idle)
{
time_since_reset = CProfileManager::Get_Time_Since_Reset();
}
//Gwen::UnicodeString txt = Gwen::Utility::Format( L"FEM Settings %i fps", test );
{
//recompute profiling data, and store profile strings
char blockTime[128];
double totalTime = 0;
int frames_since_reset = CProfileManager::Get_Frame_Count_Since_Reset();
profileIterator->First();
double parent_time = profileIterator->Is_Root() ? time_since_reset : profileIterator->Get_Current_Parent_Total_Time();
Gwen::Controls::TreeNode* curParent = m_node;
double accumulated_time = dumpRecursive(profileIterator,m_node);
Gwen::UnicodeString txt = Gwen::Utility::Format( L"Profiling: %s total time: %.3f ms, unaccounted %.3f %% :: %.3f ms", profileIterator->Get_Current_Parent_Name(), parent_time ,
parent_time > SIMD_EPSILON ? ((parent_time - accumulated_time) / parent_time) * 100 : 0.f, parent_time - accumulated_time);
//sprintf(blockTime,"--- Profiling: %s (total running time: %.3f ms) ---", profileIterator->Get_Current_Parent_Name(), parent_time );
//displayProfileString(xOffset,yStart,blockTime);
m_node->SetText(txt);
//printf("%s (%.3f %%) :: %.3f ms\n", "Unaccounted:",);
}
static bool once1 = true;
if (once1)
{
once1 = false;
m_ctrl->ExpandAll();
}
}
示例2: name
float dumpRecursive(CProfileIterator* profileIterator, Gwen::Controls::TreeNode* parentNode)
{
profileIterator->First();
if (profileIterator->Is_Done())
return 0.f;
float accumulated_time=0,parent_time = profileIterator->Is_Root() ? CProfileManager::Get_Time_Since_Reset() : profileIterator->Get_Current_Parent_Total_Time();
int i;
int frames_since_reset = CProfileManager::Get_Frame_Count_Since_Reset();
//printf("Profiling: %s (total running time: %.3f ms) ---\n", profileIterator->Get_Current_Parent_Name(), parent_time );
float totalTime = 0.f;
int numChildren = 0;
Gwen::UnicodeString txt;
std::vector<Gwen::Controls::TreeNode*> nodes;
for (i = 0; !profileIterator->Is_Done(); i++,profileIterator->Next())
{
numChildren++;
float current_total_time = profileIterator->Get_Current_Total_Time();
accumulated_time += current_total_time;
double fraction = parent_time > SIMD_EPSILON ? (current_total_time / parent_time) * 100 : 0.f;
Gwen::String name(profileIterator->Get_Current_Name());
Gwen::UnicodeString uname = Gwen::Utility::StringToUnicode(name);
txt = Gwen::Utility::Format(L"%s (%.2f %%) :: %.3f ms / frame (%d calls)",uname.c_str(), fraction,(current_total_time / (double)frames_since_reset),profileIterator->Get_Current_Total_Calls());
Gwen::Controls::TreeNode* childNode = (Gwen::Controls::TreeNode*)profileIterator->Get_Current_UserPointer();
if (!childNode)
{
childNode = parentNode->AddNode(L"");
profileIterator->Set_Current_UserPointer(childNode);
}
childNode->SetText(txt);
nodes.push_back(childNode);
totalTime += current_total_time;
//recurse into children
}
for (i=0;i<numChildren;i++)
{
profileIterator->Enter_Child(i);
Gwen::Controls::TreeNode* curNode = nodes[i];
dumpRecursive(profileIterator, curNode);
profileIterator->Enter_Parent();
}
return accumulated_time;
}