Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / wxButton onclick event no respond?

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. wxButton onclick event no respond?
#2635
Posted by: mooncake 2003-09-17 19:44:19
Hi, when i click the button, but, still no respond... could somebody help me?  Thanks...

class frmLogin: public wxMDIChildFrame {
public:

    frmLogin(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
    ~frmLogin();
   
private:
    void Login(wxCommandEvent &event);   
    DECLARE_EVENT_TABLE()
};

wxList appLogin_children;
enum{
    frmLogin_Login=1000
};

frmLogin::frmLogin(wxMDIParentFrame *parent, const wxString& title,
                 const wxPoint& pos, const wxSize& size,
                 const long style)
       : wxMDIChildFrame(parent, -1, title, pos, size,
                         style | wxNO_FULL_REPAINT_ON_RESIZE){
    appLogin_children.Append(this);
    SetSizeHints(100, 100);
   
    wxBoxSizer *dialogSizer = new wxBoxSizer(wxVERTICAL);

    wxFlexGridSizer *controlSizer = new wxFlexGridSizer(2, 2, 10, 10);

    controlSizer->Add(new wxStaticText(this, -1, "Username : "), 0, wxALIGN_CENTRE_VERTICAL);
    controlSizer->Add(new wxTextCtrl(this, -1), 0, wxALIGN_CENTRE_VERTICAL);
    controlSizer->Add(new wxStaticText(this, -1, "Password  : "), 0, wxALIGN_CENTRE_VERTICAL);
    controlSizer->Add(new wxTextCtrl(this, -1), 0, wxALIGN_CENTRE_VERTICAL);

    wxBoxSizer *buttonSizer = new wxBoxSizer(wxVERTICAL);
    buttonSizer->Add(new wxButton(this, frmLogin_Login, "&Login"));

    dialogSizer->Add(controlSizer);
    dialogSizer->Add(20, 20);
    dialogSizer->Add(buttonSizer, 0, wxALIGN_CENTRE);

    SetSizer(dialogSizer);
    SetAutoLayout(TRUE);
    Layout();

}

frmLogin::~frmLogin(){
    appLogin_children.DeleteObject(this);
}

void frmLogin::Login(wxCommandEvent &event){
    (void)wxMessageBox(_T("Testing only..."), _T("About Testing"));
}

BEGIN_EVENT_TABLE(frmLogin, wxMDIChildFrame)
    EVT_BUTTON(frmLogin_Login, frmLogin::Login)
END_EVENT_TABLE()



Post Edited (09-17-03 20:05)
Meow~
Message2. Re: wxButton onclick event no respond?
#2636
Posted by: mooncake 2003-09-17 20:14:32
sorry, problem has been solved

Meow~
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-12-14  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0