spinbutt.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/os2/spinbutt.h
  3. // Purpose: wxSpinButton class
  4. // Author: David Webster
  5. // Modified by:
  6. // Created: 10/15/99
  7. // Copyright: (c) David Webster
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_SPINBUTT_H_
  11. #define _WX_SPINBUTT_H_
  12. #include "wx/control.h"
  13. #include "wx/event.h"
  14. extern MRESULT EXPENTRY wxSpinCtrlWndProc(
  15. HWND hWnd
  16. , UINT uMessage
  17. , MPARAM wParam
  18. , MPARAM lParam
  19. );
  20. class WXDLLIMPEXP_CORE wxSpinButton: public wxSpinButtonBase
  21. {
  22. public:
  23. // Construction
  24. wxSpinButton() { }
  25. inline wxSpinButton( wxWindow* pParent
  26. ,wxWindowID vId = -1
  27. ,const wxPoint& rPos = wxDefaultPosition
  28. ,const wxSize& rSize = wxDefaultSize
  29. ,long lStyle = wxSP_VERTICAL
  30. ,const wxString& rsName = wxT("wxSpinButton")
  31. )
  32. {
  33. Create(pParent, vId, rPos, rSize, lStyle, rsName);
  34. }
  35. virtual ~wxSpinButton();
  36. bool Create( wxWindow* pParent
  37. ,wxWindowID vId = -1
  38. ,const wxPoint& rPos = wxDefaultPosition
  39. ,const wxSize& rSize = wxDefaultSize
  40. ,long lStyle = wxSP_VERTICAL
  41. ,const wxString& rsName = wxT("wxSpinButton")
  42. );
  43. // Accessors
  44. inline virtual int GetMax(void) const { return m_max; }
  45. inline virtual int GetMin(void) const { return m_min; }
  46. virtual int GetValue(void) const;
  47. inline bool IsVertical(void) const {return ((m_windowStyle & wxSP_VERTICAL) != 0); }
  48. virtual void SetValue(int nVal);
  49. virtual void SetRange( int nMinVal
  50. ,int nMaxVal
  51. );
  52. //
  53. // Implementation
  54. //
  55. virtual bool OS2Command( WXUINT wParam
  56. ,WXWORD wId
  57. );
  58. virtual bool OS2OnScroll( int nOrientation
  59. ,WXWORD wParam
  60. ,WXWORD wPos
  61. ,WXHWND hControl
  62. );
  63. inline virtual bool AcceptsFocus(void) const { return FALSE; }
  64. protected:
  65. virtual wxSize DoGetBestSize() const;
  66. private:
  67. DECLARE_DYNAMIC_CLASS(wxSpinButton)
  68. }; // end of CLASS wxSpinButton
  69. #endif // _WX_SPINBUTT_H_