本文整理汇总了C++中Panel::ResizeChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ Panel::ResizeChildren方法的具体用法?C++ Panel::ResizeChildren怎么用?C++ Panel::ResizeChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel::ResizeChildren方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddVariable
void Panel::AddVariable(void* data, const std::string& name, _Var& var, const char* reg_type_name, bool brand_new )
{
Panel* thisptr = (Panel*)data;
const string& title = var.meta_friendly;
display_mutex.lock();
boost::ptr_unordered_map<const std::string,View>::iterator pnl =
thisptr->context_views.find(name);
// Only add if a widget by the same name doesn't
// already exist
if( pnl == thisptr->context_views.end() )
{
if( reg_type_name == typeid(bool).name() )
{
View* nv = var.meta_flags ? (View*)new Checkbox(title,var) : (View*)new Button(title,var);
//thisptr->context_views[name] = nv;
thisptr->context_views.insert(name,nv);
thisptr->views.push_back(nv);
thisptr->ResizeChildren();
}else if( reg_type_name == typeid(double).name() || reg_type_name == typeid(float).name() || reg_type_name == typeid(int).name() || reg_type_name == typeid(unsigned int).name() )
{
View* nv = new Slider(title,var);
//thisptr->context_views[name] = nv;
thisptr->context_views.insert(name,nv);
thisptr->views.push_back( nv );
thisptr->ResizeChildren();
}else{
View* nv = new TextInput(title,var);
//thisptr->context_views[name] = nv;
thisptr->context_views.insert(name,nv);
thisptr->views.push_back( nv );
thisptr->ResizeChildren();
}
}
display_mutex.unlock();
}