Hide wxSlider labels too when it's hidden in wxOSX

Derive wxSlider from wxCompositeWindow to ensure that Show() (and other
methods) affect the slider labels as well.

Closes #2388.
This commit is contained in:
Vadim Zeitlin
2015-10-25 18:46:06 +01:00
parent ce3dab46c1
commit 04a784dfd3
2 changed files with 12 additions and 1 deletions

View File

@@ -193,3 +193,4 @@ wxOSX/Cocoa:
- Implement strike-through support in wxFont (Igor Korot).
- Provide native implementation of wxStandardPaths (Tobias Taschner).
- Add wxTE_{RIGHT,CENTER} support for multiline wxTextCtrl (Andreas Falkenhahn).
- Don't leave wxSlider labels shown when the slider itself is hidden.

View File

@@ -11,10 +11,11 @@
#ifndef _WX_SLIDER_H_
#define _WX_SLIDER_H_
#include "wx/compositewin.h"
#include "wx/stattext.h"
// Slider
class WXDLLIMPEXP_CORE wxSlider: public wxSliderBase
class WXDLLIMPEXP_CORE wxSlider: public wxCompositeWindow<wxSliderBase>
{
wxDECLARE_DYNAMIC_CLASS(wxSlider);
@@ -100,6 +101,15 @@ protected:
int m_lineSize;
int m_tickFreq;
private :
virtual wxWindowList GetCompositeWindowParts() const wxOVERRIDE
{
wxWindowList parts;
parts.push_back(m_macMinimumStatic);
parts.push_back(m_macMaximumStatic);
parts.push_back(m_macValueStatic);
return parts;
}
wxDECLARE_EVENT_TABLE();
};