Doc tweaks

Added back mouse sensitivity to wxStaticText
Added code to widgets sample to test for sensitive wxStaticTexts


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15381 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-05-05 09:35:44 +00:00
parent 644231539d
commit a9d171bd00
6 changed files with 67 additions and 35 deletions

View File

@@ -73,6 +73,27 @@ enum
StaticVAlign_Max
};
class DerivedStaticText: public wxStaticText
{
public:
DerivedStaticText(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)
{
}
void OnMouseEvent(wxMouseEvent& event)
{
if (event.LeftDown())
wxMessageBox(wxT("Clicked on static text"));
}
DECLARE_EVENT_TABLE()
};
BEGIN_EVENT_TABLE(DerivedStaticText, wxStaticText)
EVT_MOUSE_EVENTS(DerivedStaticText::OnMouseEvent)
END_EVENT_TABLE()
// ----------------------------------------------------------------------------
// StaticWidgetsPage
// ----------------------------------------------------------------------------
@@ -324,7 +345,7 @@ void StaticWidgetsPage::CreateStatic()
m_sizerStatBox = new wxStaticBoxSizer(box, isVert ? wxHORIZONTAL
: wxVERTICAL);
m_statText = new wxStaticText(this, -1, m_textLabel->GetValue(),
m_statText = new DerivedStaticText(this, -1, m_textLabel->GetValue(),
wxDefaultPosition, wxDefaultSize,
flagsText);