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:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user