|
@@ -93,6 +93,8 @@ using namespace tb;
|
|
|
#include "UIFinderWindow.h"
|
|
#include "UIFinderWindow.h"
|
|
|
#include "UIPulldownMenu.h"
|
|
#include "UIPulldownMenu.h"
|
|
|
#include "UIComponent.h"
|
|
#include "UIComponent.h"
|
|
|
|
|
+#include "UIRadioButton.h"
|
|
|
|
|
+#include "UIScrollBar.h"
|
|
|
|
|
|
|
|
#include "SystemUI/SystemUI.h"
|
|
#include "SystemUI/SystemUI.h"
|
|
|
#include "SystemUI/SystemUIEvents.h"
|
|
#include "SystemUI/SystemUIEvents.h"
|
|
@@ -150,12 +152,12 @@ UI::~UI()
|
|
|
|
|
|
|
|
TBFile::SetReaderFunction(0);
|
|
TBFile::SetReaderFunction(0);
|
|
|
TBID::tbidRegisterCallback = 0;
|
|
TBID::tbidRegisterCallback = 0;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
tb::TBWidgetsAnimationManager::Shutdown();
|
|
tb::TBWidgetsAnimationManager::Shutdown();
|
|
|
|
|
|
|
|
delete rootWidget_;
|
|
delete rootWidget_;
|
|
|
widgetWrap_.Clear();
|
|
widgetWrap_.Clear();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// leak
|
|
// leak
|
|
|
//delete TBUIRenderer::renderer_;
|
|
//delete TBUIRenderer::renderer_;
|
|
|
|
|
|
|
@@ -355,7 +357,7 @@ void UI::SetFocusedView(UIView* uiView)
|
|
|
while (itr != uiViews_.End())
|
|
while (itr != uiViews_.End())
|
|
|
{
|
|
{
|
|
|
if ((*itr)->GetAutoFocus())
|
|
if ((*itr)->GetAutoFocus())
|
|
|
- {
|
|
|
|
|
|
|
+ {
|
|
|
SetFocusedView(*itr);
|
|
SetFocusedView(*itr);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -476,7 +478,7 @@ void UI::HandleUpdate(StringHash eventType, VariantMap& eventData)
|
|
|
exitRequested_ = false;
|
|
exitRequested_ = false;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
tooltipHoverTime_ += eventData[Update::P_TIMESTEP].GetFloat();
|
|
tooltipHoverTime_ += eventData[Update::P_TIMESTEP].GetFloat();
|
|
|
|
|
|
|
|
if (tooltipHoverTime_ >= 0.5f)
|
|
if (tooltipHoverTime_ >= 0.5f)
|
|
@@ -504,7 +506,7 @@ void UI::HandleUpdate(StringHash eventType, VariantMap& eventData)
|
|
|
tooltip_->Show(mousePosition.x_ + 8, mousePosition.y_ + 8);
|
|
tooltip_->Show(mousePosition.x_ + 8, mousePosition.y_ + 8);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- else
|
|
|
|
|
|
|
+ else
|
|
|
{
|
|
{
|
|
|
if (tooltip_) tooltip_->Close();
|
|
if (tooltip_) tooltip_->Close();
|
|
|
}
|
|
}
|
|
@@ -619,6 +621,14 @@ UIWidget* UI::WrapWidget(tb::TBWidget* widget)
|
|
|
return slider;
|
|
return slider;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (widget->IsOfType<TBScrollBar>())
|
|
|
|
|
+ {
|
|
|
|
|
+ UIScrollBar* slider = new UIScrollBar(context_, false);
|
|
|
|
|
+ slider->SetWidget(widget);
|
|
|
|
|
+ WrapWidget(slider, widget);
|
|
|
|
|
+ return slider;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (widget->IsOfType<TBColorWidget>())
|
|
if (widget->IsOfType<TBColorWidget>())
|
|
|
{
|
|
{
|
|
|
UIColorWidget* colorWidget = new UIColorWidget(context_, false);
|
|
UIColorWidget* colorWidget = new UIColorWidget(context_, false);
|
|
@@ -734,6 +744,14 @@ UIWidget* UI::WrapWidget(tb::TBWidget* widget)
|
|
|
return nwidget;
|
|
return nwidget;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (widget->IsOfType<TBRadioButton>())
|
|
|
|
|
+ {
|
|
|
|
|
+ UIRadioButton* nwidget = new UIRadioButton(context_, false);
|
|
|
|
|
+ nwidget->SetWidget(widget);
|
|
|
|
|
+ WrapWidget(nwidget, widget);
|
|
|
|
|
+ return nwidget;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (widget->IsOfType<TBBarGraph>())
|
|
if (widget->IsOfType<TBBarGraph>())
|
|
|
{
|
|
{
|
|
|
UIBargraph* nwidget = new UIBargraph(context_, false);
|
|
UIBargraph* nwidget = new UIBargraph(context_, false);
|
|
@@ -757,7 +775,7 @@ UIWidget* UI::WrapWidget(tb::TBWidget* widget)
|
|
|
WrapWidget(nwidget, widget);
|
|
WrapWidget(nwidget, widget);
|
|
|
return nwidget;
|
|
return nwidget;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (widget->IsOfType<TBPromptWindow>())
|
|
if (widget->IsOfType<TBPromptWindow>())
|
|
|
{
|
|
{
|
|
|
UIPromptWindow* nwidget = new UIPromptWindow(context_, NULL, "", false);
|
|
UIPromptWindow* nwidget = new UIPromptWindow(context_, NULL, "", false);
|