diff --git a/include/wx/gauge.h b/include/wx/gauge.h index 410a1cff25..6339715580 100644 --- a/include/wx/gauge.h +++ b/include/wx/gauge.h @@ -24,15 +24,14 @@ #define wxGA_HORIZONTAL wxHORIZONTAL #define wxGA_VERTICAL wxVERTICAL +// Available since Windows 7 only. With this style, the value of guage will +// reflect on the taskbar button. +#define wxGA_PROGRESS 0x0010 // Win32 only, is default (and only) on some other platforms #define wxGA_SMOOTH 0x0020 // 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__) diff --git a/include/wx/msw/frame.h b/include/wx/msw/frame.h index d38fd1c674..949372cc7e 100644 --- a/include/wx/msw/frame.h +++ b/include/wx/msw/frame.h @@ -40,9 +40,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); -#if wxUSE_TASKBARBUTTON virtual ~wxFrame(); -#endif // implement base class pure virtuals virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); diff --git a/include/wx/msw/gauge.h b/include/wx/msw/gauge.h index 9748ad1f90..e5dab20020 100644 --- a/include/wx/msw/gauge.h +++ b/include/wx/msw/gauge.h @@ -37,9 +37,7 @@ public: (void)Create(parent, id, range, pos, size, style, validator, name); } -#if wxUSE_TASKBARBUTTON virtual ~wxGauge(); -#endif bool Create(wxWindow *parent, wxWindowID id, diff --git a/include/wx/msw/taskbarbutton.h b/include/wx/msw/taskbarbutton.h index df289d5850..3ead357b71 100644 --- a/include/wx/msw/taskbarbutton.h +++ b/include/wx/msw/taskbarbutton.h @@ -10,9 +10,10 @@ #ifndef _WX_MSW_TASKBARBUTTON_H_ #define _WX_MSW_TASKBARBUTTON_H_ +#include "wx/defs.h" + #if wxUSE_TASKBARBUTTON -#include "wx/defs.h" #include "wx/vector.h" #include "wx/taskbarbutton.h" @@ -62,6 +63,8 @@ private: int m_progressRange; bool m_hasInitThumbnailToolbar; + + wxDECLARE_NO_COPY_CLASS(wxTaskBarButtonImpl); }; #endif // wxUSE_TASKBARBUTTON diff --git a/include/wx/taskbarbutton.h b/include/wx/taskbarbutton.h index 8feace36ab..25912faa92 100644 --- a/include/wx/taskbarbutton.h +++ b/include/wx/taskbarbutton.h @@ -11,9 +11,12 @@ #ifndef _WX_TASKBARBUTTON_H_ #define _WX_TASKBARBUTTON_H_ +#include "wx/defs.h" + #if wxUSE_TASKBARBUTTON -#include "wx/defs.h" +#include "wx/icon.h" +#include "wx/string.h" class WXDLLIMPEXP_FWD_CORE wxTaskBarButton; class WXDLLIMPEXP_FWD_CORE wxTaskBarJumpListCategory; @@ -27,7 +30,7 @@ class WXDLLIMPEXP_FWD_CORE wxTaskBarJumpListImpl; /** State of the task bar button. */ -enum WXDLLIMPEXP_CORE wxTaskBarButtonState +enum wxTaskBarButtonState { wxTASKBAR_BUTTON_NO_PROGRESS = 0, wxTASKBAR_BUTTON_INDETERMINATE = 1, @@ -36,9 +39,12 @@ enum WXDLLIMPEXP_CORE wxTaskBarButtonState wxTASKBAR_BUTTON_PAUSED = 8 }; -class WXDLLIMPEXP_CORE wxThumbBarButton : public wxObject { +class WXDLLIMPEXP_CORE wxThumbBarButton : public wxObject +{ public: - wxThumbBarButton() : m_taskBarButtonParent(NULL) { } + wxThumbBarButton() : m_taskBarButtonParent(NULL) + { } + wxThumbBarButton(int id, const wxIcon& icon, const wxString& tooltip = wxString(), @@ -48,8 +54,6 @@ public: bool shown = true, bool interactive = true); - virtual ~wxThumbBarButton() {} - bool Create(int id, const wxIcon& icon, const wxString& tooltip = wxString(), @@ -96,7 +100,7 @@ private: bool m_interactive; wxTaskBarButton *m_taskBarButtonParent; - DECLARE_DYNAMIC_CLASS(wxThumbBarButton) + wxDECLARE_DYNAMIC_CLASS(wxThumbBarButton); }; class WXDLLIMPEXP_CORE wxTaskBarButton @@ -141,9 +145,11 @@ private: WXWidget m_parent; int m_maxValue; wxTaskBarButton* m_taskBarButton; + + wxDECLARE_NO_COPY_CLASS(wxAppProgressIndicator); }; -enum WXDLLIMPEXP_CORE wxTaskBarJumpListItemType +enum wxTaskBarJumpListItemType { wxTASKBAR_JUMP_LIST_SEPARATOR, wxTASKBAR_JUMP_LIST_TASK, @@ -188,6 +194,8 @@ private: wxString m_tooltip; wxString m_iconPath; int m_iconIndex; + + wxDECLARE_NO_COPY_CLASS(wxTaskBarJumpListItem); }; typedef wxVector wxTaskBarJumpListItems; @@ -217,6 +225,8 @@ private: wxTaskBarJumpList *m_parent; wxTaskBarJumpListItems m_items; wxString m_title; + + wxDECLARE_NO_COPY_CLASS(wxTaskBarJumpListCategory); }; typedef wxVector wxTaskBarJumpListCategories; @@ -240,12 +250,13 @@ public: wxTaskBarJumpListCategory* RemoveCustomCategory(const wxString& title); void DeleteCustomCategory(const wxString& title); - private: friend class wxTaskBarJumpListCategory; void Update(); wxTaskBarJumpListImpl *m_jumpListImpl; + + wxDECLARE_NO_COPY_CLASS(wxTaskBarJumpList); }; #endif // wxUSE_TASKBARBUTTON diff --git a/interface/wx/gauge.h b/interface/wx/gauge.h index 61a4614fa1..d39e94416b 100644 --- a/interface/wx/gauge.h +++ b/interface/wx/gauge.h @@ -13,15 +13,14 @@ #define wxGA_HORIZONTAL wxHORIZONTAL #define wxGA_VERTICAL wxVERTICAL +// Available since Windows 7 only. With this style, the value of guage will +// reflect on the taskbar button. +#define wxGA_PROGRESS 0x0010 // Win32 only, is default (and only) on some other platforms #define wxGA_SMOOTH 0x0020 // QT only, display current completed percentage (text default format "%p%") #define wxGA_TEXT 0x0040 -// Available since Windows 7 only. With this style, the value of guage will -// reflect on the taskbar button. -#define wxGA_PROGRESS 0x0010 - /** @class wxGauge @@ -53,6 +52,10 @@ Display current completed percentage: text default format "%p%" (only supported in wxQt, may be not available on all platforms). @since 3.1.0 + @style{wxGA_PROGRESS} + Reflect the value of guage on the taskbar button, available since + Windows 7 only. + @since 3.1.0 @endStyleTable @library{wxcore} diff --git a/interface/wx/taskbarbutton.h b/interface/wx/taskbarbutton.h index ca9bc4461a..48696270aa 100644 --- a/interface/wx/taskbarbutton.h +++ b/interface/wx/taskbarbutton.h @@ -7,6 +7,7 @@ /** State of the taskbar button. + @since 3.1.0 */ enum wxTaskBarButtonState { @@ -29,6 +30,7 @@ enum wxTaskBarButtonState @onlyfor{wxmsw} @see wxTaskBarButton + @since 3.1.0 */ class WXDLLIMPEXP_CORE wxThumbBarButton { public: @@ -187,6 +189,7 @@ public: @onlyfor{wxmsw} @see wxFrame::MSWGetTaskBarButton() + @since 3.1.0 */ class WXDLLIMPEXP_CORE wxTaskBarButton { @@ -339,6 +342,7 @@ public: @onlyfor{wxmsw} @see wxTaskBarButton + @since 3.1.0 */ class WXDLLIMPEXP_CORE wxAppProgressIndicator { @@ -376,6 +380,8 @@ public: /** Type of jump list item. + + @since 3.1.0 */ enum wxTaskBarJumpListItemType { @@ -398,6 +404,7 @@ enum wxTaskBarJumpListItemType @category{misc} @onlyfor{wxmsw} + @since 3.1.0 */ class WXDLLIMPEXP_CORE wxTaskBarJumpListItem { @@ -521,6 +528,8 @@ public: /** A vector of wxTaskBarJumpListItem pointers. + + @since 3.1.0 */ typedef wxVector wxTaskBarJumpListItems; @@ -537,6 +546,8 @@ typedef wxVector wxTaskBarJumpListItems; @onlyfor{wxmsw} @see wxTaskBarJumpList, wxTaskBarJumpListItem + + @since 3.1.0 */ class WXDLLIMPEXP_CORE wxTaskBarJumpListCategory { @@ -644,6 +655,7 @@ typedef wxVector wxTaskBarJumpListCategories; @onlyfor{wxmsw} @see wxTaskBarJumpListCategory, wxTaskBarJumpListItem + @since 3.1.0 */ class WXDLLIMPEXP_CORE wxTaskBarJumpList { diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 31671f2b36..2cf55d0b17 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -206,9 +206,7 @@ bool wxGenericProgressDialog::Create( const wxString& title, int gauge_style = wxGA_HORIZONTAL; if ( style & wxPD_SMOOTH ) gauge_style |= wxGA_SMOOTH; -#if wxUSE_TASKBARBUTTON gauge_style |= wxGA_PROGRESS; -#endif #ifdef __WXMSW__ maximum /= m_factor; diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 3e6f864027..1f2f2d49c2 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -182,13 +182,12 @@ bool wxFrame::Create(wxWindow *parent, return true; } -#if wxUSE_TASKBARBUTTON wxFrame::~wxFrame() { - if ( m_taskBarButton ) - delete m_taskBarButton; -} +#if wxUSE_TASKBARBUTTON + delete m_taskBarButton; #endif +} // ---------------------------------------------------------------------------- // wxFrame client size calculations diff --git a/src/msw/gauge.cpp b/src/msw/gauge.cpp index 63064cbbe4..204920ba69 100644 --- a/src/msw/gauge.cpp +++ b/src/msw/gauge.cpp @@ -99,11 +99,7 @@ bool wxGauge::Create(wxWindow *parent, m_appProgressIndicator = NULL; if ( (style & wxGA_PROGRESS) != 0 ) { - wxWindow* topParent = GetParent(); - while (topParent != NULL && topParent->GetParent() != NULL) - { - topParent = topParent->GetParent(); - } + wxWindow* topParent = wxGetTopLevelParent(this); if ( topParent != NULL ) { m_appProgressIndicator = @@ -117,16 +113,12 @@ bool wxGauge::Create(wxWindow *parent, return true; } -#if wxUSE_TASKBARBUTTON wxGauge::~wxGauge() { - if ( m_appProgressIndicator ) - { - delete m_appProgressIndicator; - m_appProgressIndicator = NULL; - } -} +#if wxUSE_TASKBARBUTTON + delete m_appProgressIndicator; #endif +} WXDWORD wxGauge::MSWGetStyle(long style, WXDWORD *exstyle) const {