UIView.cpp 490 B

123456789101112131415161718192021222324252627282930313233
  1. #include <TurboBadger/tb_widgets.h>
  2. #include "UI.h"
  3. #include "UIView.h"
  4. using namespace tb;
  5. namespace Atomic
  6. {
  7. UIView::UIView(Context* context) : UIWidget(context, false)
  8. {
  9. widget_ = new TBWidget();
  10. widget_->SetDelegate(this);
  11. GetSubsystem<UI>()->WrapWidget(this, widget_);
  12. UI* ui = GetSubsystem<UI>();
  13. TBRect rect = ui->GetRootWidget()->GetRect();
  14. widget_->SetSize(rect.w, rect.h);
  15. ui->GetRootWidget()->AddChild(widget_);
  16. }
  17. UIView::~UIView()
  18. {
  19. }
  20. }