#include <msp/core/algorithm.h>
#include <msp/core/maputils.h>
-#include <msp/core/refptr.h>
#include "button.h"
#include "column.h"
#include "draghandle.h"
input_type = INPUT_NAVIGATION;
}
-Panel::~Panel()
-{
- delete layout;
- layout = nullptr;
-}
-
Layout &Panel::get_or_create_layout()
{
if(!layout)
{
- layout = new Layout;
+ layout = make_unique<Layout>();
layout->set_container(*this);
}
{
if(part.get_name()=="children")
{
- for(const Child *c: children)
+ for(const unique_ptr<Child> &c: children)
if(c->widget->is_visible())
c->widget->render(renderer);
}
{
Widget *sibling = nullptr;
int best_score = 0;
- for(const Child *c: children)
+ for(const unique_ptr<Child> &c: children)
{
if(c->widget==input_focus || !c->widget->is_focusable())
continue;
template<>
void Panel::Loader::unnamed_child<Panel>()
{
- RefPtr<Panel> pnl = new Panel();
+ unique_ptr<Panel> pnl = make_unique<Panel>();
load_sub(*pnl, wdg_map);
obj.add(*pnl.get());
last_widget = pnl.release();