]>
git.saurik.com Git - wxWidgets.git/blob - src/generic/commandlinkbuttong.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/generic/commandlinkbuttong.cpp
3 // Purpose: wxGenericCommandLinkButton
4 // Author: Rickard Westerlund
6 // Copyright: (c) 2010 wxWidgets team
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // ----------------------------------------------------------------------------
12 // ----------------------------------------------------------------------------
14 // For compilers that support precompilation, includes "wx.h".
15 #include "wx/wxprec.h"
21 #if wxUSE_COMMANDLINKBUTTON
23 #include "wx/commandlinkbutton.h"
24 #include "wx/artprov.h"
26 wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxCommandLinkButton
, wxButton
, "wx/commandlinkbutton.h")
28 wxDEFINE_FLAGS( wxCommandLinkButtonStyle
)
29 wxBEGIN_FLAGS( wxCommandLinkButtonStyle
)
30 // new style border flags, we put them first to
31 // use them for streaming out
32 wxFLAGS_MEMBER(wxBORDER_SIMPLE
)
33 wxFLAGS_MEMBER(wxBORDER_SUNKEN
)
34 wxFLAGS_MEMBER(wxBORDER_DOUBLE
)
35 wxFLAGS_MEMBER(wxBORDER_RAISED
)
36 wxFLAGS_MEMBER(wxBORDER_STATIC
)
37 wxFLAGS_MEMBER(wxBORDER_NONE
)
39 // old style border flags
40 wxFLAGS_MEMBER(wxSIMPLE_BORDER
)
41 wxFLAGS_MEMBER(wxSUNKEN_BORDER
)
42 wxFLAGS_MEMBER(wxDOUBLE_BORDER
)
43 wxFLAGS_MEMBER(wxRAISED_BORDER
)
44 wxFLAGS_MEMBER(wxSTATIC_BORDER
)
45 wxFLAGS_MEMBER(wxBORDER
)
47 // standard window styles
48 wxFLAGS_MEMBER(wxTAB_TRAVERSAL
)
49 wxFLAGS_MEMBER(wxCLIP_CHILDREN
)
50 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
51 wxFLAGS_MEMBER(wxWANTS_CHARS
)
52 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE
)
53 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB
)
54 wxFLAGS_MEMBER(wxVSCROLL
)
55 wxFLAGS_MEMBER(wxHSCROLL
)
57 wxFLAGS_MEMBER(wxBU_AUTODRAW
)
58 wxFLAGS_MEMBER(wxBU_LEFT
)
59 wxFLAGS_MEMBER(wxBU_RIGHT
)
60 wxFLAGS_MEMBER(wxBU_TOP
)
61 wxFLAGS_MEMBER(wxBU_BOTTOM
)
62 wxEND_FLAGS( wxCommandLinkButtonStyle
)
64 wxBEGIN_PROPERTIES_TABLE(wxCommandLinkButton
)
65 wxPROPERTY( MainLabel
, wxString
, SetMainLabel
, GetMainLabel
, wxString(), \
66 0 /*flags*/, wxT("The main label"), wxT("group") )
68 wxPROPERTY( Note
, wxString
, SetNote
, GetNote
, wxString(), \
69 0 /*flags*/, wxT("The link URL"), wxT("group") )
70 wxPROPERTY_FLAGS( WindowStyle
, wxCommandLinkButtonStyle
, long, SetWindowStyleFlag
, \
71 GetWindowStyleFlag
, wxEMPTY_PARAMETER_VALUE
, 0 /*flags*/, \
72 wxT("The link style"), wxT("group")) // style
73 wxEND_PROPERTIES_TABLE()
75 wxEMPTY_HANDLERS_TABLE(wxCommandLinkButton
)
77 wxCONSTRUCTOR_7( wxCommandLinkButton
, wxWindow
*, Parent
, wxWindowID
, Id
, wxString
, \
78 MainLabel
, wxString
, Note
, wxPoint
, Position
, wxSize
, Size
, long, WindowStyle
)
80 // ----------------------------------------------------------------------------
81 // Generic command link button
82 // ----------------------------------------------------------------------------
84 bool wxGenericCommandLinkButton::Create(wxWindow
*parent
,
86 const wxString
& mainLabel
,
91 const wxValidator
& validator
,
94 if ( !wxButton::Create(parent
,
96 mainLabel
+ '\n' + note
,
104 if ( !HasNativeBitmap() )
111 void wxGenericCommandLinkButton::SetDefaultBitmap()
113 SetBitmap(wxArtProvider::GetBitmap(wxART_GO_FORWARD
, wxART_BUTTON
));
116 #endif // wxUSE_COMMANDLINKBUTTON