Files
TTDownloader/third_party/NIM_Duilib_Framework/duilib/Box/TabBox.h
T
tongtong e1e26acc49 第三方框架改为仓内子集并完善构建忽略规则
完整 NIM_Duilib_Framework 仓库移至父目录,third_party 仅保留实际使用的 base、duilib、bin/resources 与许可证;.gitignore 覆盖 MSBuild 与打包产物。
2026-11-15 08:54:17 +08:00

84 lines
1.8 KiB
C++

#ifndef UI_CORE_TABBOX_H_
#define UI_CORE_TABBOX_H_
#pragma once
namespace ui
{
class UILIB_API TabBox : public Box
{
public:
TabBox(Layout* pLayout = new Layout());
/// 重写父类方法,提供个性化功能,请参考父类声明
virtual bool Add(Control* pControl) override;
virtual bool AddAt(Control* pControl, std::size_t iIndex) override;
virtual bool Remove(Control* pControl) override;
virtual bool RemoveAt(std::size_t iIndex) override;
virtual void RemoveAll() override;
virtual void SetAttribute(const std::wstring& strName, const std::wstring& strValue) override;
/**
* @brief 获取当前选择项
* @return 返回当前选择项索引
*/
int GetCurSel() const;
/**
* @brief 根据控件索引选择一个子项
* @param[in] iIndex 要选择的子项索引
* @return 成功返回 true,否则返回 false
*/
bool SelectItem(int iIndex);
/**
* @brief 根据控件指针选择一个子项
* @param[in] pControl 要选择的子项指针
* @return 成功返回 true,否则返回 false
*/
bool SelectItem(Control* pControl);
/**
* @brief 根据控件名称选择一个子项
* @param[in] pControlName 要选择的控件名称
* @return 成功返回 true,否则返回 false
*/
bool SelectItem(const std::wstring& pControlName);
/**
* @brief 设置是否显示动画效果
* @param[in] bFadeSwitch 设置为 true 则显示,false 为不显示动画
* @return 无
*/
void SetFadeSwitch(bool bFadeSwitch);
/**
* @brief 判断是否需要显示动画效果
* @return 返回 true 显示动画,false 为不显示动画效果
*/
bool IsFadeSwitch() { return m_bFadeSwith; }
protected:
/**
* @brief 显示一个 TAB 项
* @param[in] it TAB 项索引
* @return 无
*/
void ShowTabItem(std::size_t it);
/**
* @brief 隐藏一个 TAB 项
* @param[in] it TAB 项索引
* @return 无
*/
void HideTabItem(std::size_t it);
protected:
int m_iCurSel;
bool m_bFadeSwith;
};
}
#endif // UI_CORE_TABBOX_H_