X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/57c4d796c56bd48ce370240107f3e4c07e142985..75ded4d17344618afd302a0671f1277791ee17ed:/include/wx/os2/slider.h diff --git a/include/wx/os2/slider.h b/include/wx/os2/slider.h index 09ed090957..05fc54887e 100644 --- a/include/wx/os2/slider.h +++ b/include/wx/os2/slider.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: slider.h +// Name: wx/os2/slider.h // Purpose: wxSlider class // Author: David Webster // Modified by: @@ -14,108 +14,144 @@ #include "wx/control.h" -WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr; - // Slider -class WXDLLEXPORT wxSlider: public wxControl +class WXDLLIMPEXP_CORE wxSlider: public wxSliderBase { - DECLARE_DYNAMIC_CLASS(wxSlider) - public: wxSlider(); - - inline wxSlider(wxWindow *parent, wxWindowID id, - int value, int minValue, int maxValue, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSL_HORIZONTAL, -#if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else - const wxValidator& validator = wxDefaultValidator, -# endif -#endif - const wxString& name = wxSliderNameStr) - { - Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name); - } - - ~wxSlider(); - - bool Create(wxWindow *parent, wxWindowID id, - int value, int minValue, int maxValue, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSL_HORIZONTAL, -#if wxUSE_VALIDATORS -# if defined(__VISAGECPP__) - const wxValidator* validator = wxDefaultValidator, -# else - const wxValidator& validator = wxDefaultValidator, -# endif -#endif - const wxString& name = wxSliderNameStr); - - virtual int GetValue() const ; - virtual void SetValue(int); - - void GetSize(int *x, int *y) const ; - void GetPosition(int *x, int *y) const ; - - bool Show(bool show); - - void SetRange(int minValue, int maxValue); - - inline int GetMin() const { return m_rangeMin; } - inline int GetMax() const { return m_rangeMax; } - - void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - - - - // For trackbars only - void SetTickFreq(int n, int pos); - inline int GetTickFreq() const { return m_tickFreq; } - void SetPageSize(int pageSize); - int GetPageSize() const ; - void ClearSel() ; - void ClearTicks() ; - void SetLineSize(int lineSize); - int GetLineSize() const ; - int GetSelEnd() const ; - int GetSelStart() const ; - void SetSelection(int minPos, int maxPos); - void SetThumbLength(int len) ; - int GetThumbLength() const ; - void SetTick(int tickPos) ; - - // IMPLEMENTATION - WXHWND GetStaticMin() const { return m_staticMin; } - WXHWND GetStaticMax() const { return m_staticMax; } - WXHWND GetEditValue() const { return m_staticValue; } - virtual bool ContainsHWND(WXHWND hWnd) const; - - void Command(wxCommandEvent& event); - virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, WXWPARAM wParam, WXLPARAM lParam); - virtual bool OS2OnScroll(int orientation, WXWORD wParam, - WXWORD pos, WXHWND control); - - protected: - WXHWND m_staticMin; - WXHWND m_staticMax; - WXHWND m_staticValue; - int m_rangeMin; - int m_rangeMax; - int m_pageSize; - int m_lineSize; - int m_tickFreq; - - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO); -}; + inline wxSlider( wxWindow* pParent + ,wxWindowID vId + ,int nValue + ,int nMinValue + ,int nMaxValue + ,const wxPoint& rPos = wxDefaultPosition + ,const wxSize& rSize = wxDefaultSize + ,long lStyle = wxSL_HORIZONTAL + ,const wxValidator& rValidator = wxDefaultValidator + ,const wxString& rsName = wxSliderNameStr + ) + { + Create( pParent + ,vId + ,nValue + ,nMinValue + ,nMaxValue + ,rPos + ,rSize + ,lStyle + ,rValidator + ,rsName + ); + } + virtual ~wxSlider(); + + bool Create( wxWindow* pParent + ,wxWindowID vId + ,int nValue + ,int nMinValue + ,int nMaxValue + ,const wxPoint& rPos = wxDefaultPosition + ,const wxSize& rSize = wxDefaultSize + ,long lStyle = wxSL_HORIZONTAL + ,const wxValidator& rValidator = wxDefaultValidator + ,const wxString& rsName = wxSliderNameStr + ); + + virtual int GetValue(void) const ; + virtual void SetValue(int); + + void GetSize( int* pnX + ,int* pnY + ) const; + void GetPosition( int* pnX + ,int* pnY + ) const ; + bool Show(bool bShow = TRUE); + void SetRange( int nMinValue + ,int nMaxValue + ); + + inline int GetMin(void) const { return m_nRangeMin; } + inline int GetMax(void) const { return m_nRangeMax; } + + // + // For trackbars only + // + void ClearSel(void); + void ClearTicks(void); + + int GetLineSize(void) const; + int GetPageSize(void) const ; + int GetSelEnd(void) const; + int GetSelStart(void) const; + inline int GetTickFreq(void) const { return m_nTickFreq; } + int GetThumbLength(void) const ; + + void SetLineSize(int nLineSize); + void SetPageSize(int nPageSize); + void SetSelection( int nMinPos + ,int nMaxPos + ); + void SetThumbLength(int nLen) ; + void SetTick(int ntickPos) ; + + // + // IMPLEMENTATION + // + inline WXHWND GetStaticMin(void) const { return m_hStaticMin; } + inline WXHWND GetStaticMax(void) const { return m_hStaticMax; } + inline WXHWND GetEditValue(void) const { return m_hStaticValue; } + virtual bool ContainsHWND(WXHWND hWnd) const; + void AdjustSubControls( int nX + ,int nY + ,int nWidth + ,int nHeight + ,int nSizeFlags + ); + inline int GetSizeFlags(void) { return m_nSizeFlags; } + void Command(wxCommandEvent& rEvent); + virtual WXHBRUSH OnCtlColor( WXHDC hDC + ,WXHWND hWnd + ,WXUINT uCtlColor + ,WXUINT uMessage + ,WXWPARAM wParam + ,WXLPARAM lParam + ); + virtual bool OS2OnScroll( int nOrientation + ,WXWORD wParam + ,WXWORD wPos + ,WXHWND hControl + ); + +protected: + WXHWND m_hStaticMin; + WXHWND m_hStaticMax; + WXHWND m_hStaticValue; + int m_nRangeMin; + int m_nRangeMax; + int m_nPageSize; + int m_nLineSize; + int m_nTickFreq; + double m_dPixelToRange; + int m_nThumbLength; + int m_nSizeFlags; + + virtual void DoGetSize( int* pnWidth + ,int* pnHeight + ) const; + virtual void DoSetSize( int nX + ,int nY + ,int nWidth + ,int nHeight + ,int nSizeFlags = wxSIZE_AUTO + ); + + // Platform-specific implementation of SetTickFreq + virtual void DoSetTickFreq(int freq); + +private: + DECLARE_DYNAMIC_CLASS(wxSlider) +}; // end of CLASS wxSlider #endif // _WX_SLIDER_H_