2014-02-20 45 views
0

我有一個父窗口頂部有一個子窗口,如何處理從子窗口到父窗口的鼠標事件。如何在wxwidgets中處理父窗口的鼠標事件

這裏是我的代碼:

//parent class 
    IMPLEMENT_DYNAMIC_CLASS(MWParent, wxPanel) 
    BEGIN_EVENT_TABLE(MWParent, wxPanel) 
    EVT_LEFT_DCLICK(MWParent::OnMouseLeftDClick) 
    EVT_RIGHT_DOWN(MWParent::OnMouseRightclick) 
    END_EVENT_TABLE() 

    MWParent::MWParent() 
    { 
    } 
    MWParent::~MWParent() 
    { 

    } 
    MWParent::MWParent(wxWindow *win , long id):wxPanel(win , id){ 
      MWChild *obj = new MWChild(this); 
    } 

    //child class 

    IMPLEMENT_DYNAMIC_CLASS(MWChild, wxPanel) 
    BEGIN_EVENT_TABLE(MWChild, wxPanel) 
    END_EVENT_TABLE() 

    MWChild::MWChild() 
    { 
    } 
    MWChild::~MWChild() 
    { 

    } 
    MWChild::MWChild(wxWindow *win , long id):wxPanel(win , id){ 


} 

回答