1. wxInputHandler::Map() can return a sequence of actions, not only one
2. wxControl::PerformAction() takes a wxEvent parameter 3. wxGTK fix: send enter/leave events even when the mouse is captured 4. renamed "highlighted" state to "current" git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -39,6 +39,21 @@
|
||||
#include "wx/stattext.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// control ids
|
||||
enum
|
||||
{
|
||||
Univ_Button1,
|
||||
Univ_Button2
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// our classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Define a new application type, each program should derive a class from wxApp
|
||||
class MyUnivApp : public wxApp
|
||||
{
|
||||
@@ -61,6 +76,7 @@ public:
|
||||
|
||||
protected:
|
||||
// event handlers
|
||||
void OnButton(wxCommandEvent& event);
|
||||
void OnLeftUp(wxMouseEvent& event);
|
||||
|
||||
private:
|
||||
@@ -75,6 +91,8 @@ private:
|
||||
IMPLEMENT_APP(MyUnivApp)
|
||||
|
||||
BEGIN_EVENT_TABLE(MyUnivFrame, wxFrame)
|
||||
EVT_BUTTON(-1, MyUnivFrame::OnButton)
|
||||
|
||||
EVT_LEFT_UP(MyUnivFrame::OnLeftUp)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
@@ -152,7 +170,14 @@ MyUnivFrame::MyUnivFrame(const wxString& title)
|
||||
|
||||
#undef CREATE_STATIC_ALIGN_DEMO
|
||||
|
||||
new wxButton(this, -1, _T("&Press me"), wxPoint(10, 300));
|
||||
new wxButton(this, Univ_Button1, _T("&Press me"), wxPoint(10, 300));
|
||||
new wxButton(this, Univ_Button2, _T("&And me"), wxPoint(100, 300));
|
||||
}
|
||||
|
||||
void MyUnivFrame::OnButton(wxCommandEvent& event)
|
||||
{
|
||||
wxLogDebug(_T("Button %d pressed."),
|
||||
event.GetId() == Univ_Button1 ? 1 : 2);
|
||||
}
|
||||
|
||||
void MyUnivFrame::OnLeftUp(wxMouseEvent& event)
|
||||
|
Reference in New Issue
Block a user