68 {
69#if wxUSE_ACCESSIBILITY
70 SetAccessible(
safenew ReadOnlyTextAx(
this));
71#endif
73
74 Bind(wxEVT_SET_FOCUS, [&](wxFocusEvent &event)
75 {
76 SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT));
77 SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT));
78 Refresh();
79 event.Skip();
80 });
81
82 Bind(wxEVT_KILL_FOCUS, [&](wxFocusEvent &event)
83 {
84 SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT));
85 SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
86 Refresh();
87 event.Skip();
88 });
89
90 Bind(wxEVT_PAINT, [&](wxPaintEvent & WXUNUSED(event))
91 {
92 wxPaintDC dc(this);
93
94 wxRect rect = GetClientRect();
95 if (!IsEnabled())
96 {
97
98 dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT));
99 wxRect rectShadow = rect;
100 rectShadow.Offset(1, 1);
101 dc.DrawLabel(GetLabel(), rectShadow, GetAlignment());
102 dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW));
103 }
104 dc.DrawLabel(GetLabel(), rect, GetAlignment());
105 });
106 };