+enum
+{
+ StaticEllipsize_Start,
+ StaticEllipsize_Middle,
+ StaticEllipsize_End
+};
+
+// ----------------------------------------------------------------------------
+// MyStaticText and MyStaticBox
+// ----------------------------------------------------------------------------
+
+// these 2 classes simply show that the static controls can get the mouse
+// clicks too -- this used to be broken under MSW but works now
+
+class MyStaticText : public wxStaticText
+{
+public:
+ MyStaticText(wxWindow* parent,
+ wxWindowID id,
+ const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0)
+ : wxStaticText(parent, id, label, pos, size, style)
+ {
+ }
+
+protected:
+ void OnMouseEvent(wxMouseEvent& WXUNUSED(event))
+ {
+ wxLogMessage(wxT("Clicked on static text"));
+ }
+
+ DECLARE_EVENT_TABLE()
+};
+
+class MyStaticBox : public wxStaticBox
+{
+public:
+ MyStaticBox(wxWindow* parent,
+ wxWindowID id,
+ const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0)
+ : wxStaticBox(parent, id, label, pos, size, style)
+ {
+ }
+
+protected:
+ void OnMouseEvent(wxMouseEvent& WXUNUSED(event))
+ {
+ wxLogMessage(wxT("Clicked on static box"));
+ }
+
+ DECLARE_EVENT_TABLE()
+};
+
+BEGIN_EVENT_TABLE(MyStaticText, wxStaticText)
+ EVT_LEFT_UP(MyStaticText::OnMouseEvent)
+END_EVENT_TABLE()
+
+BEGIN_EVENT_TABLE(MyStaticBox, wxStaticBox)
+ EVT_LEFT_UP(MyStaticBox::OnMouseEvent)
+END_EVENT_TABLE()
+