nim_duilib/duilib/Control/Progress.h
jiajia_deng 4933d1f2bc Remove dependency on shared
Signed-off-by: jiajia_deng <2894220@gmail.com>
2019-09-20 16:27:58 +08:00

130 lines
2.6 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef UI_CONTROL_PROGRESS_H_
#define UI_CONTROL_PROGRESS_H_
#pragma once
namespace ui
{
class UILIB_API Progress : public LabelTemplate<Control>
{
public:
Progress();
/// 重写父类方法,提供个性化功能,请参考父类声明
virtual void SetAttribute(const std::wstring& strName, const std::wstring& strValue) override;
virtual void PaintStatusImage(IRenderContext* pRender) override;
virtual void ClearImageCache() override;
/**
* @brief 判断是否是水平进度条
* @return 返回 true 是水平进度条false 为垂直滚动条
*/
bool IsHorizontal();
/**
* @brief 设置水平或垂直滚动条
* @param[in] bHorizontal 为 true 时设置为水平滚动条false 时设置为垂直滚动条,默认为 true
* @return 无
*/
void SetHorizontal(bool bHorizontal = true);
/**
* @brief 获取进度条最小值
* @return 返回进度条最小值
*/
int GetMinValue() const;
/**
* @brief 设置进度条最小值
* @param[in] nMin 最小值数值
* @return 无
*/
void SetMinValue(int nMin);
/**
* @brief 获取进度条最大值
* @return 返回进度条最大值
*/
int GetMaxValue() const;
/**
* @brief 设置进度条最大值
* @param[in] nMax 要设置的最大值
* @return 无
*/
void SetMaxValue(int nMax);
/**
* @brief 获取当前进度百分比
* @return 返回当前进度百分比
*/
double GetValue() const;
/**
* @brief 设置当前进度百分比
* @param[in] nValue 要设置的百分比数值
* @return 无
*/
void SetValue(double nValue);
/**
* @brief 进度条前景图片是否缩放显示
* @return 返回 true 为缩放显示false 为不缩放显示
*/
bool IsStretchForeImage();
/**
* @brief 设置进度条前景图片是否缩放显示
* @param[in] bStretchForeImage true 为缩放显示false 为不缩放显示
* @return 无
*/
void SetStretchForeImage(bool bStretchForeImage = true);
/**
* @brief 获取滚动条背景图片
* @return 返回背景图片位置
*/
std::wstring GetProgressImage() const;
/**
* @brief 设置进度条背景图片
* @param[in] strImage 图片地址
* @return 无
*/
void SetProgressImage(const std::wstring& strImage);
/**
* @brief 获取进度条背景颜色
* @return 返回背景颜色的字符串值,对应 global.xml 中的指定色值
*/
std::wstring GetProgressColor() const;
/**
* @brief 设置进度条背景颜色
* @param[in] 要设置的背景颜色字符串,该字符串必须在 global.xml 中存在
* @return 无
*/
void SetProgressColor(const std::wstring& strProgressColor);
/**
* @brief 获取进度条位置
* @return 返回进度条当前位置
*/
virtual UiRect GetProgressPos();
protected:
bool m_bHorizontal;
bool m_bStretchForeImage;
int m_nMax;
int m_nMin;
double m_nValue;
Image m_progressImage;
std::wstring m_sProgressColor;
std::wstring m_sProgressImageModify;
};
} // namespace ui
#endif // UI_CONTROL_PROGRESS_H_