X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0e320a79f187558effb04d92020b470372bbe456..8e77fd8bca165aab9709649d79a7cbc6a172d4e1:/include/wx/os2/slider.h?ds=sidebyside diff --git a/include/wx/os2/slider.h b/include/wx/os2/slider.h index 4df175c6a5..05fc54887e 100644 --- a/include/wx/os2/slider.h +++ b/include/wx/os2/slider.h @@ -1,93 +1,157 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: slider.h +// Name: wx/os2/slider.h // Purpose: wxSlider class -// Author: AUTHOR +// Author: David Webster // Modified by: -// Created: ??/??/98 +// Created: 10/15/99 // RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence +// Copyright: (c) David Webster +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SLIDER_H_ #define _WX_SLIDER_H_ -#ifdef __GNUG__ -#pragma interface "slider.h" -#endif - #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* 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); - inline wxSlider(wxWindow *parent, wxWindowID id, - int value, int minValue, int maxValue, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSL_HORIZONTAL, - const wxValidator& validator = wxDefaultValidator, - 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, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxSliderNameStr); - - virtual int GetValue() const ; - virtual void SetValue(int); - void GetSize(int *x, int *y) const ; - void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - 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; } - - // 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) ; - - void Command(wxCommandEvent& event); - protected: - int m_rangeMin; - int m_rangeMax; - int m_pageSize; - int m_lineSize; - int m_tickFreq; -DECLARE_EVENT_TABLE() private: - void SetSize(int width, int height) {wxWindow::SetSize(width, height);} -}; + DECLARE_DYNAMIC_CLASS(wxSlider) +}; // end of CLASS wxSlider #endif // _WX_SLIDER_H_