Intergrate wxAppProgressIndicator into wxGuage.

Update the progress bar of taskbar button if wxGuage has wxGA_PROGRESS style.

Author: Chaobin Zhang

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bryan Petty
2014-09-10 14:56:29 +00:00
parent 04039e01ad
commit 95e8cf9dfb
8 changed files with 106 additions and 87 deletions

View File

@@ -29,6 +29,10 @@
// QT only, display current completed percentage (text default format "%p%")
#define wxGA_TEXT 0x0040
#if wxUSE_TASKBARBUTTON
#define wxGA_PROGRESS 0x0010
#endif
// GTK and Mac always have native implementation of the indeterminate mode
// wxMSW has native implementation only if comctl32.dll >= 6.00
#if !defined(__WXGTK20__) && !defined(__WXMAC__)

View File

@@ -15,6 +15,10 @@
extern WXDLLIMPEXP_DATA_CORE(const char) wxGaugeNameStr[];
#if wxUSE_TASKBARBUTTON
class WXDLLIMPEXP_FWD_CORE wxAppProgressIndicator;
#endif
// Group box
class WXDLLIMPEXP_CORE wxGauge : public wxGaugeBase
{
@@ -33,6 +37,10 @@ public:
(void)Create(parent, id, range, pos, size, style, validator, name);
}
#if wxUSE_TASKBARBUTTON
virtual ~wxGauge();
#endif
bool Create(wxWindow *parent,
wxWindowID id,
int range,
@@ -69,6 +77,10 @@ private:
void SetIndeterminateMode();
void SetDeterminateMode();
#if wxUSE_TASKBARBUTTON
wxAppProgressIndicator* m_appProgressIndicator;
#endif
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGauge)
};

View File

@@ -130,17 +130,17 @@ private:
class WXDLLIMPEXP_CORE wxAppProgressIndicator
{
public:
wxAppProgressIndicator(wxTopLevelWindow *parent, int maxValue);
wxAppProgressIndicator(WXWidget parent, int maxValue);
virtual ~wxAppProgressIndicator();
bool Update(int value);
bool Pulse();
void SetValue(int value);
void SetRange(int range);
void Pulse();
void Reset();
private:
void Init();
wxTopLevelWindow *m_parent;
int m_maxValue;
wxScopedPtr<wxTaskBarButton> m_taskBarButton;
WXWidget m_parent;
wxTaskBarButton* m_taskBarButton;
};
enum WXDLLIMPEXP_CORE wxTaskBarJumpListItemType