commandlinkbutton.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/msw/commandlinkbutton.h
  3. // Purpose: wxCommandLinkButton class
  4. // Author: Rickard Westerlund
  5. // Created: 2010-06-11
  6. // Copyright: (c) 2010 wxWidgets team
  7. // Licence: wxWindows licence
  8. /////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_MSW_COMMANDLINKBUTTON_H_
  10. #define _WX_MSW_COMMANDLINKBUTTON_H_
  11. // ----------------------------------------------------------------------------
  12. // Command link button for wxMSW
  13. // ----------------------------------------------------------------------------
  14. // Derive from the generic version to be able to fall back to it during
  15. // run-time if the command link buttons are not supported by the system we're
  16. // running under.
  17. class WXDLLIMPEXP_ADV wxCommandLinkButton : public wxGenericCommandLinkButton
  18. {
  19. public:
  20. wxCommandLinkButton () : wxGenericCommandLinkButton() { }
  21. wxCommandLinkButton(wxWindow *parent,
  22. wxWindowID id,
  23. const wxString& mainLabel = wxEmptyString,
  24. const wxString& note = wxEmptyString,
  25. const wxPoint& pos = wxDefaultPosition,
  26. const wxSize& size = wxDefaultSize,
  27. long style = 0,
  28. const wxValidator& validator = wxDefaultValidator,
  29. const wxString& name = wxButtonNameStr)
  30. : wxGenericCommandLinkButton()
  31. {
  32. Create(parent, id, mainLabel, note, pos, size, style, validator, name);
  33. }
  34. bool Create(wxWindow *parent,
  35. wxWindowID id,
  36. const wxString& mainLabel = wxEmptyString,
  37. const wxString& note = wxEmptyString,
  38. const wxPoint& pos = wxDefaultPosition,
  39. const wxSize& size = wxDefaultSize,
  40. long style = 0,
  41. const wxValidator& validator = wxDefaultValidator,
  42. const wxString& name = wxButtonNameStr);
  43. // overridden base class methods
  44. // -----------------------------
  45. // do the same thing as in the generic case here
  46. virtual void SetLabel(const wxString& label)
  47. {
  48. SetMainLabelAndNote(label.BeforeFirst('\n'), label.AfterFirst('\n'));
  49. }
  50. virtual void SetMainLabelAndNote(const wxString& mainLabel,
  51. const wxString& note);
  52. virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
  53. protected:
  54. virtual wxSize DoGetBestSize() const;
  55. virtual bool HasNativeBitmap() const;
  56. private:
  57. wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxCommandLinkButton);
  58. };
  59. #endif // _WX_MSW_COMMANDLINKBUTTON_H_