|
@@ -140,10 +140,11 @@ int ElementTabSet::GetActiveTab() const
|
|
|
return active_tab;
|
|
return active_tab;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// Process the incoming event.
|
|
|
|
|
-void ElementTabSet::ProcessEvent(Core::Event& event)
|
|
|
|
|
|
|
+void ElementTabSet::ProcessDefaultAction(Core::Event& event)
|
|
|
{
|
|
{
|
|
|
- if (event.GetCurrentElement() == this && event == Core::EventId::Click)
|
|
|
|
|
|
|
+ Element::ProcessDefaultAction(event);
|
|
|
|
|
+
|
|
|
|
|
+ if (event == Core::EventId::Click)
|
|
|
{
|
|
{
|
|
|
// Find the tab that this click occured on
|
|
// Find the tab that this click occured on
|
|
|
Core::Element* tabs = GetChildByTag("tabs");
|
|
Core::Element* tabs = GetChildByTag("tabs");
|
|
@@ -178,7 +179,6 @@ void ElementTabSet::OnChildAdd(Core::Element* child)
|
|
|
{
|
|
{
|
|
|
// Set up the new button and append it
|
|
// Set up the new button and append it
|
|
|
child->SetProperty(Core::PropertyId::Display, Core::Property(Core::Style::Display::InlineBlock));
|
|
child->SetProperty(Core::PropertyId::Display, Core::Property(Core::Style::Display::InlineBlock));
|
|
|
- child->AddEventListener(Core::EventId::Click, this);
|
|
|
|
|
|
|
|
|
|
if (child->GetParentNode()->GetChild(active_tab) == child)
|
|
if (child->GetParentNode()->GetChild(active_tab) == child)
|
|
|
child->SetPseudoClass("selected", true);
|
|
child->SetPseudoClass("selected", true);
|
|
@@ -195,17 +195,6 @@ void ElementTabSet::OnChildAdd(Core::Element* child)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void ElementTabSet::OnChildRemove(Core::Element* child)
|
|
|
|
|
-{
|
|
|
|
|
- Core::Element::OnChildRemove(child);
|
|
|
|
|
-
|
|
|
|
|
- // If its a tab, remove its event listener
|
|
|
|
|
- if (child->GetParentNode() == GetChildByTag("tabs"))
|
|
|
|
|
- {
|
|
|
|
|
- child->RemoveEventListener(Core::EventId::Click, this);
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
Core::Element* ElementTabSet::GetChildByTag(const Rml::Core::String& tag)
|
|
Core::Element* ElementTabSet::GetChildByTag(const Rml::Core::String& tag)
|
|
|
{
|
|
{
|
|
|
// Look for the existing child
|
|
// Look for the existing child
|