]> git.saurik.com Git - wxWidgets.git/blob - src/generic/commandlinkbuttong.cpp
Reflect changes in stc.cpp in stc.cpp.in from which it's generated.
[wxWidgets.git] / src / generic / commandlinkbuttong.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/generic/commandlinkbuttong.cpp
3 // Purpose: wxGenericCommandLinkButton
4 // Author: Rickard Westerlund
5 // Created: 2010-06-23
6 // Copyright: (c) 2010 wxWidgets team
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 // ----------------------------------------------------------------------------
11 // headers
12 // ----------------------------------------------------------------------------
13
14 // For compilers that support precompilation, includes "wx.h".
15 #include "wx/wxprec.h"
16
17 #ifdef __BORLANDC__
18 #pragma hdrstop
19 #endif
20
21 #if wxUSE_COMMANDLINKBUTTON
22
23 #include "wx/commandlinkbutton.h"
24 #include "wx/artprov.h"
25
26 wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxCommandLinkButton, wxButton, "wx/commandlinkbutton.h")
27
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)
38
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)
46
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)
56
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 )
63
64 wxBEGIN_PROPERTIES_TABLE(wxCommandLinkButton)
65 wxPROPERTY( MainLabel, wxString, SetMainLabel, GetMainLabel, wxString(), \
66 0 /*flags*/, wxT("The main label"), wxT("group") )
67
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()
74
75 wxEMPTY_HANDLERS_TABLE(wxCommandLinkButton)
76
77 wxCONSTRUCTOR_7( wxCommandLinkButton, wxWindow*, Parent, wxWindowID, Id, wxString, \
78 MainLabel, wxString, Note, wxPoint, Position, wxSize, Size, long, WindowStyle )
79
80 // ----------------------------------------------------------------------------
81 // Generic command link button
82 // ----------------------------------------------------------------------------
83
84 bool wxGenericCommandLinkButton::Create(wxWindow *parent,
85 wxWindowID id,
86 const wxString& mainLabel,
87 const wxString& note,
88 const wxPoint& pos,
89 const wxSize& size,
90 long style,
91 const wxValidator& validator,
92 const wxString& name)
93 {
94 if ( !wxButton::Create(parent,
95 id,
96 mainLabel + '\n' + note,
97 pos,
98 size,
99 style,
100 validator,
101 name) )
102 return false;
103
104 if ( !HasNativeBitmap() )
105 SetDefaultBitmap();
106
107 return true;
108
109 }
110
111 void wxGenericCommandLinkButton::SetDefaultBitmap()
112 {
113 SetBitmap(wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_BUTTON));
114 }
115
116 #endif // wxUSE_COMMANDLINKBUTTON