UIWindow.cpp 648 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include <TurboBadger/tb_widgets.h>
  2. #include <TurboBadger/tb_widgets_common.h>
  3. #include <TurboBadger/tb_window.h>
  4. #include "../IO/Log.h"
  5. #include "UIEvents.h"
  6. #include "UIWindow.h"
  7. using namespace tb;
  8. namespace Atomic
  9. {
  10. UIWindow::UIWindow(Context* context, bool createWidget) : UIWidget(context, false)
  11. {
  12. if (createWidget)
  13. {
  14. widget_ = new TBWindow();
  15. widget_->SetDelegate(this);
  16. }
  17. }
  18. void UIWindow::ResizeToFitContent()
  19. {
  20. if (!widget_)
  21. return;
  22. ((TBWindow*)widget_)->ResizeToFitContent();
  23. }
  24. UIWindow::~UIWindow()
  25. {
  26. }
  27. bool UIWindow::OnEvent(const tb::TBWidgetEvent &ev)
  28. {
  29. return false;
  30. }
  31. }