diff options
author | crupest <crupest@outlook.com> | 2022-02-10 21:21:46 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-10 21:21:46 +0800 |
commit | a236a2a146bfcc4eb5c93a85cd99ac330e83a7f5 (patch) | |
tree | 32756f8f90df09b37f30a5753cff69207851fc4a /include/cru/ui/components/Component.h | |
parent | 28d7016c32b39656dafa0936cfedb02159f9e7cd (diff) | |
download | cru-a236a2a146bfcc4eb5c93a85cd99ac330e83a7f5.tar.gz cru-a236a2a146bfcc4eb5c93a85cd99ac330e83a7f5.tar.bz2 cru-a236a2a146bfcc4eb5c93a85cd99ac330e83a7f5.zip |
...
Diffstat (limited to 'include/cru/ui/components/Component.h')
-rw-r--r-- | include/cru/ui/components/Component.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/cru/ui/components/Component.h b/include/cru/ui/components/Component.h index e889ae97..8861f30b 100644 --- a/include/cru/ui/components/Component.h +++ b/include/cru/ui/components/Component.h @@ -17,5 +17,16 @@ class CRU_UI_API Component : public Object { ~Component() = default; virtual controls::Control* GetRootControl() = 0; + + bool IsDeleteByParent() const { return delete_by_parent_; } + void SetDeleteByParent(bool delete_by_parent) { + delete_by_parent_ = delete_by_parent; + } + void DeleteIfDeleteByParent() const { + if (delete_by_parent_) delete this; + } + + private: + bool delete_by_parent_; }; } // namespace cru::ui::components |