|
@@ -10,6 +10,8 @@
|
|
|
|
|
|
|
|
namespace tb {
|
|
namespace tb {
|
|
|
|
|
|
|
|
|
|
+class TBTabContainer;
|
|
|
|
|
+
|
|
|
/** TBTabLayout is a TBLayout used in TBTabContainer to apply
|
|
/** TBTabLayout is a TBLayout used in TBTabContainer to apply
|
|
|
some default properties on any TBButton added to it. */
|
|
some default properties on any TBButton added to it. */
|
|
|
class TBTabLayout : public TBLayout
|
|
class TBTabLayout : public TBLayout
|
|
@@ -18,14 +20,22 @@ public:
|
|
|
// For safe typecasting
|
|
// For safe typecasting
|
|
|
TBOBJECT_SUBCLASS(TBTabLayout, TBLayout);
|
|
TBOBJECT_SUBCLASS(TBTabLayout, TBLayout);
|
|
|
|
|
|
|
|
|
|
+ TBTabLayout(TBTabContainer *tabContainer)
|
|
|
|
|
+ : tabContainer_(tabContainer) {}
|
|
|
|
|
+
|
|
|
virtual void OnChildAdded(TBWidget *child);
|
|
virtual void OnChildAdded(TBWidget *child);
|
|
|
|
|
+ virtual void OnChildRemove(TBWidget *child);
|
|
|
|
|
+
|
|
|
virtual PreferredSize OnCalculatePreferredContentSize(const SizeConstraints &constraints);
|
|
virtual PreferredSize OnCalculatePreferredContentSize(const SizeConstraints &constraints);
|
|
|
|
|
+private:
|
|
|
|
|
+ TBTabContainer *tabContainer_;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/** TBTabContainer - A container with tabs for multiple pages. */
|
|
/** TBTabContainer - A container with tabs for multiple pages. */
|
|
|
|
|
|
|
|
class TBTabContainer : public TBWidget
|
|
class TBTabContainer : public TBWidget
|
|
|
{
|
|
{
|
|
|
|
|
+ friend class TBTabLayout;
|
|
|
public:
|
|
public:
|
|
|
// For safe typecasting
|
|
// For safe typecasting
|
|
|
TBOBJECT_SUBCLASS(TBTabContainer, TBWidget);
|
|
TBOBJECT_SUBCLASS(TBTabContainer, TBWidget);
|