Make ui::grid_layout::get return shared_ptr
This commit is contained in:
parent
754566ec15
commit
fa581d0ed3
2 changed files with 5 additions and 5 deletions
|
|
@ -28,7 +28,7 @@ namespace psemek::ui
|
||||||
virtual void set_row_weight(std::size_t i, float w);
|
virtual void set_row_weight(std::size_t i, float w);
|
||||||
virtual void set_column_weight(std::size_t i, float w);
|
virtual void set_column_weight(std::size_t i, float w);
|
||||||
|
|
||||||
virtual element * get(std::size_t i, std::size_t j) const;
|
virtual std::shared_ptr<element> get(std::size_t i, std::size_t j) const;
|
||||||
virtual std::shared_ptr<element> set(std::size_t i, std::size_t j, std::shared_ptr<element> c);
|
virtual std::shared_ptr<element> set(std::size_t i, std::size_t j, std::shared_ptr<element> c);
|
||||||
virtual std::shared_ptr<element> remove(std::size_t i, std::size_t j);
|
virtual std::shared_ptr<element> remove(std::size_t i, std::size_t j);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace psemek::ui
|
||||||
{
|
{
|
||||||
for (std::size_t i = 0; i < row_count(); ++i)
|
for (std::size_t i = 0; i < row_count(); ++i)
|
||||||
for (std::size_t j = 0; j < column_count(); ++j)
|
for (std::size_t j = 0; j < column_count(); ++j)
|
||||||
if (get(i, j) == c) return true;
|
if (get(i, j).get() == c) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -42,7 +42,7 @@ namespace psemek::ui
|
||||||
{
|
{
|
||||||
for (std::size_t j = 0; j < column_count(); ++j)
|
for (std::size_t j = 0; j < column_count(); ++j)
|
||||||
{
|
{
|
||||||
if (get(i, j) == c)
|
if (get(i, j).get() == c)
|
||||||
{
|
{
|
||||||
return remove(i, j);
|
return remove(i, j);
|
||||||
}
|
}
|
||||||
|
|
@ -100,9 +100,9 @@ namespace psemek::ui
|
||||||
post_reshape();
|
post_reshape();
|
||||||
}
|
}
|
||||||
|
|
||||||
element * grid_layout::get(std::size_t i, std::size_t j) const
|
std::shared_ptr<element> grid_layout::get(std::size_t i, std::size_t j) const
|
||||||
{
|
{
|
||||||
return children_(i, j).get();
|
return children_(i, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<element> grid_layout::set(std::size_t i, std::size_t j, std::shared_ptr<element> c)
|
std::shared_ptr<element> grid_layout::set(std::size_t i, std::size_t j, std::shared_ptr<element> c)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue