diff --git a/xvaga/xvaga.cpp b/xvaga/xvaga.cpp index f3b7e4a08..e633e1e1d 100755 --- a/xvaga/xvaga.cpp +++ b/xvaga/xvaga.cpp @@ -60,7 +60,6 @@ class TMessageBox : public wxDialog { protected: void OnButton(wxCommandEvent& evt); - void OnMouseCaptureLost(wxMouseCaptureLostEvent& evt); void AddButton(wxSizer* sz, int id, int ico); DECLARE_EVENT_TABLE() @@ -70,7 +69,6 @@ public: BEGIN_EVENT_TABLE(TMessageBox, wxDialog) EVT_BUTTON(wxID_ANY, TMessageBox::OnButton) - EVT_MOUSE_CAPTURE_LOST(TMessageBox::OnMouseCaptureLost) END_EVENT_TABLE() void TMessageBox::OnButton(wxCommandEvent& evt) @@ -86,13 +84,6 @@ void TMessageBox::OnButton(wxCommandEvent& evt) EndModal(ec); } -void TMessageBox::OnMouseCaptureLost(wxMouseCaptureLostEvent& e) -{ - e.Skip(); - - // Segnaposto inutile nella realta' ... ma indispensabile per qualche genio di wxWidgets -} - void TMessageBox::AddButton(wxSizer* sz, int id, int WXUNUSED(ico)) { sz->Add(new wxButton(this, id, wxEmptyString, wxDefaultPosition, @@ -158,9 +149,9 @@ int _MessageBox(const wxString& msg, int nStyle) { xvt_dm_post_speech(msg, 1, TRUE); - int ret = ::wxMessageBox(msg, _GetAppTitle(), nStyle); -/* TMessageBox dlg(msg, nStyle); - const int ret = dlg.ShowModal(); */ +//int ret = ::wxMessageBox(msg, _GetAppTitle(), nStyle); + TMessageBox dlg(msg, nStyle); + const int ret = dlg.ShowModal(); switch(ret) { diff --git a/xvaga/xvtctl.cpp b/xvaga/xvtctl.cpp index e51e957d5..368c85657 100755 --- a/xvaga/xvtctl.cpp +++ b/xvaga/xvtctl.cpp @@ -168,6 +168,7 @@ protected: public: int Add(short nIconId, const wxString strText, int nFlags); TwxOutlookBar(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style); + ~TwxOutlookBar(); }; WINDOW xvt_ctl_create_def(WIN_DEF *win_def_p, WINDOW parent_win, long app_data) @@ -1205,6 +1206,13 @@ TwxOutlookBar::TwxOutlookBar(wxWindow *parent, wxWindowID id, SetItemCount(0); } +TwxOutlookBar::~TwxOutlookBar() +{ + if (HasCapture()) + ReleaseMouse(); +} + + int xvt_list_add_item(WINDOW win, short icon, const char* text, int flags) { int n = -1; diff --git a/xvaga/xvtwin.cpp b/xvaga/xvtwin.cpp index 2c5688bd6..b391cbf5b 100755 --- a/xvaga/xvtwin.cpp +++ b/xvaga/xvtwin.cpp @@ -931,6 +931,8 @@ TwxWindow::TwxWindow(wxWindow *parent, wxWindowID id, const wxString& title, TwxWindow::~TwxWindow() { + if (HasCapture()) + ReleaseMouse(); EVENT e; memset(&e, 0, sizeof(EVENT)); e.type = E_DESTROY; DoXvtEvent(e);