]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/button.h
   1 ///////////////////////////////////////////////////////////////////////////// 
   2 // Name:        wx/msw/button.h 
   3 // Purpose:     wxButton class 
   4 // Author:      Julian Smart 
   8 // Copyright:   (c) Julian Smart 
   9 // Licence:     wxWindows licence 
  10 ///////////////////////////////////////////////////////////////////////////// 
  15 // ---------------------------------------------------------------------------- 
  17 // ---------------------------------------------------------------------------- 
  19 class WXDLLEXPORT wxButton 
: public wxButtonBase
 
  23     wxButton(wxWindow 
*parent
, 
  25              const wxString
& label 
= wxEmptyString
, 
  26              const wxPoint
& pos 
= wxDefaultPosition
, 
  27              const wxSize
& size 
= wxDefaultSize
, 
  29              const wxValidator
& validator 
= wxDefaultValidator
, 
  30              const wxString
& name 
= wxButtonNameStr
) 
  32         Create(parent
, id
, label
, pos
, size
, style
, validator
, name
); 
  35     bool Create(wxWindow 
*parent
, 
  37                 const wxString
& label 
= wxEmptyString
, 
  38                 const wxPoint
& pos 
= wxDefaultPosition
, 
  39                 const wxSize
& size 
= wxDefaultSize
, 
  41                 const wxValidator
& validator 
= wxDefaultValidator
, 
  42                 const wxString
& name 
= wxButtonNameStr
); 
  46     virtual void SetDefault(); 
  48     // implementation from now on 
  49     virtual void Command(wxCommandEvent
& event
); 
  50     virtual WXLRESULT 
MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
); 
  51     virtual bool MSWCommand(WXUINT param
, WXWORD id
); 
  53     // coloured buttons support 
  54     virtual bool SetBackgroundColour(const wxColour 
&colour
); 
  55     virtual bool SetForegroundColour(const wxColour 
&colour
); 
  57     virtual bool MSWOnDraw(WXDRAWITEMSTRUCT 
*item
); 
  58     virtual WXDWORD 
MSWGetStyle(long style
, WXDWORD 
*exstyle
) const; 
  61     void MakeOwnerDrawn(); 
  64     // send a notification event, return true if processed 
  65     bool SendClickEvent(); 
  67     // default button handling 
  69     void UnsetTmpDefault(); 
  71     // set or unset BS_DEFPUSHBUTTON style 
  72     static void SetDefaultStyle(wxButton 
*btn
, bool on
); 
  74     // usually overridden base class virtuals 
  75     virtual wxSize 
DoGetBestSize() const; 
  78     DECLARE_DYNAMIC_CLASS_NO_COPY(wxButton
)