mirror of https://github.com/axmolengine/axmol.git
Merge pull request #15170 from geron-cn/uitabcontrol
add TabControl TabHeader to tolua
This commit is contained in:
commit
b5a44bc2f4
|
@ -89,8 +89,7 @@ namespace ui
|
|||
}
|
||||
else
|
||||
{
|
||||
headerCell->setSelected(false);
|
||||
container->setVisible(false);
|
||||
deactiveTabItem(tabItem);
|
||||
}
|
||||
|
||||
headerCell->setContentSize(Size(_headerWidth, _headerHeight));
|
||||
|
@ -309,14 +308,14 @@ namespace ui
|
|||
{
|
||||
if (tabIndex <= -1 || tabIndex >= (int)_tabItems.size())
|
||||
{
|
||||
deactiveHeader(_selectedItem);
|
||||
deactiveTabItem(_selectedItem);
|
||||
_selectedItem = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
deactiveHeader(_selectedItem);
|
||||
deactiveTabItem(_selectedItem);
|
||||
auto tabItem = _tabItems.at(tabIndex);
|
||||
activeHeader(tabItem);
|
||||
activeTabItem(tabItem);
|
||||
_selectedItem = tabItem;
|
||||
}
|
||||
}
|
||||
|
@ -327,7 +326,7 @@ namespace ui
|
|||
auto tabItem = _tabItems.at(tabIndex);
|
||||
if (tabItem == _selectedItem)
|
||||
{
|
||||
deactiveHeader(_selectedItem);
|
||||
deactiveTabItem(_selectedItem);
|
||||
_selectedItem = nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -396,7 +395,7 @@ namespace ui
|
|||
}
|
||||
}
|
||||
|
||||
void TabControl::activeHeader(TabItem* item)
|
||||
void TabControl::activeTabItem(TabItem* item)
|
||||
{
|
||||
if (item != nullptr)
|
||||
{
|
||||
|
@ -408,7 +407,7 @@ namespace ui
|
|||
}
|
||||
}
|
||||
|
||||
void TabControl::deactiveHeader(TabItem* item)
|
||||
void TabControl::deactiveTabItem(TabItem* item)
|
||||
{
|
||||
if (item != nullptr)
|
||||
{
|
||||
|
|
|
@ -364,8 +364,8 @@ namespace ui {
|
|||
|
||||
// format tab header and container after insert
|
||||
void initAfterInsert(int index);
|
||||
void activeHeader(TabItem* item);
|
||||
void deactiveHeader(TabItem* item);
|
||||
void activeTabItem(TabItem* item);
|
||||
void deactiveTabItem(TabItem* item);
|
||||
Vec2 getHeaderAnchorWithDock() const;
|
||||
|
||||
TabItem* _selectedItem;
|
||||
|
|
|
@ -30,7 +30,7 @@ headers = %(cocosdir)s/cocos/ui/CocosGUI.h
|
|||
|
||||
# what classes to produce code for. You can use regular expressions here. When testing the regular
|
||||
# expression, it will be enclosed in "^$", like this: "^Menu*$".
|
||||
classes = Helper Widget Layout Button CheckBox ImageView Text TextAtlas TextBMFont LoadingBar Slider TextField ScrollView ListView PageView LayoutParameter LinearLayoutParameter RelativeLayoutParameter Rich.* HBox VBox RelativeBox Scale9Sprite EditBox LayoutComponent AbstractCheckButton RadioButton RadioButtonGroup
|
||||
classes = Helper Widget Layout Button CheckBox ImageView Text TextAtlas TextBMFont LoadingBar Slider TextField ScrollView ListView PageView LayoutParameter LinearLayoutParameter RelativeLayoutParameter Rich.* HBox VBox RelativeBox Scale9Sprite EditBox LayoutComponent AbstractCheckButton RadioButton RadioButtonGroup TabControl TabHeader
|
||||
|
||||
# what should we skip? in the format ClassName::[function function]
|
||||
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
|
||||
|
|
Loading…
Reference in New Issue