button.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/os2/button.h
  3. // Purpose: wxButton class
  4. // Author: David Webster
  5. // Modified by:
  6. // Created: 10/13/99
  7. // Copyright: (c) David Webster
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_BUTTON_H_
  11. #define _WX_BUTTON_H_
  12. #include "wx/control.h"
  13. // Pushbutton
  14. class WXDLLIMPEXP_CORE wxButton: public wxButtonBase
  15. {
  16. public:
  17. inline wxButton() {}
  18. inline wxButton( wxWindow* pParent
  19. ,wxWindowID vId
  20. ,const wxString& rsLabel = wxEmptyString
  21. ,const wxPoint& rPos = wxDefaultPosition
  22. ,const wxSize& rSize = wxDefaultSize
  23. ,long lStyle = 0
  24. ,const wxValidator& rValidator = wxDefaultValidator
  25. ,const wxString& rsName = wxButtonNameStr
  26. )
  27. {
  28. Create( pParent
  29. ,vId
  30. ,rsLabel
  31. ,rPos
  32. ,rSize
  33. ,lStyle
  34. ,rValidator
  35. ,rsName
  36. );
  37. }
  38. bool Create( wxWindow* pParent
  39. ,wxWindowID vId
  40. ,const wxString& rsLabel = wxEmptyString
  41. ,const wxPoint& rPos = wxDefaultPosition
  42. ,const wxSize& rSize = wxDefaultSize
  43. ,long lStyle = 0
  44. ,const wxValidator& rValidator = wxDefaultValidator
  45. ,const wxString& rsName = wxButtonNameStr
  46. );
  47. virtual ~wxButton();
  48. virtual wxWindow *SetDefault();
  49. static wxSize GetDefaultSize(void);
  50. virtual void Command(wxCommandEvent& rEvent);
  51. virtual bool OS2Command( WXUINT uParam
  52. ,WXWORD vId
  53. );
  54. virtual WXHBRUSH OnCtlColor( WXHDC hDC
  55. ,WXHWND hWnd
  56. ,WXUINT uCtlColor
  57. ,WXUINT uMessage
  58. ,WXWPARAM wParam
  59. ,WXLPARAM lParam
  60. );
  61. void MakeOwnerDrawn(void);
  62. virtual MRESULT WindowProc( WXUINT uMsg
  63. ,WXWPARAM wParam
  64. ,WXLPARAM lParam
  65. );
  66. protected:
  67. bool SendClickEvent(void);
  68. void SetTmpDefault(void);
  69. void UnsetTmpDefault(void);
  70. static void SetDefaultStyle( wxButton* pButton
  71. ,bool bOn
  72. );
  73. virtual wxSize DoGetBestSize(void) const;
  74. virtual WXDWORD OS2GetStyle( long style
  75. ,WXDWORD* exstyle
  76. ) const;
  77. private:
  78. DECLARE_DYNAMIC_CLASS(wxButton)
  79. }; // end of CLASS wxButton
  80. #endif
  81. // _WX_BUTTON_H_