From: <ma...@us...> - 2004-02-28 03:05:02
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10867 Modified Files: GUISettingsDlg.cpp GUISettingsDlg.h MainDlg.cpp MainDlg.h SearchWnd.cpp SearchWnd.h ServerWnd.cpp ServerWnd.h TransferWnd.cpp TransferWnd.h Log Message: wxWidgets 2.5.1 compatibility: Fixed events handling issues. Index: GUISettingsDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- GUISettingsDlg.cpp 22 Feb 2004 23:54:37 -0000 1.38 +++ GUISettingsDlg.cpp 28 Feb 2004 02:48:01 -0000 1.39 @@ -66,16 +66,18 @@ * Handles GUI Settings dialog Ok button event - Saves the settings and * closes the dialog. */ -void CGUISettingsDlg::OnOk(const wxCommandEvent &event) { +void CGUISettingsDlg::OnOk(wxCommandEvent &event) { SaveSettings(); EndModal(0); + event.Skip(); } /* * Handles GUI Settings dialog Cancel button event - closes the dialog. */ -void CGUISettingsDlg::OnCancel(const wxCommandEvent &event) { +void CGUISettingsDlg::OnCancel(wxCommandEvent &event) { EndModal(0); + event.Skip(); } /* @@ -277,12 +279,13 @@ * Handles checking/unchecking Remember Last checkbox - enables/disables * startpage selection combobox as neccesery. */ -void CGUISettingsDlg::OnCheckRememberLast(const wxCommandEvent &event) { +void CGUISettingsDlg::OnCheckRememberLast(wxCommandEvent &event) { if (GetRememberLast()->GetValue()) { GetStartPage()->Disable(); } else { GetStartPage()->Enable(); } + event.Skip(); } /** @@ -290,11 +293,12 @@ * is being disabled, make sure that toolbar is enabled, otherwise user * loses all ways to control the application. */ -void CGUISettingsDlg::OnCheckShowMenu(const wxCommandEvent &event) { +void CGUISettingsDlg::OnCheckShowMenu(wxCommandEvent &event) { if (!GetShowMenu()->GetValue() && !GetShowTool()->GetValue()) { GetShowTool()->SetValue(true); GetToolAlign()->Enable(); } + event.Skip(); } /** @@ -304,7 +308,7 @@ * Also, if toolbar displaying is disabled, also disable toolbar alignment * choice. */ -void CGUISettingsDlg::OnCheckShowTool(const wxCommandEvent &event) { +void CGUISettingsDlg::OnCheckShowTool(wxCommandEvent &event) { if (!GetShowTool()->GetValue()) { if (!GetShowMenu()->GetValue()) { GetShowMenu()->SetValue(true); @@ -313,12 +317,13 @@ } else { GetToolAlign()->Enable(); } + event.Skip(); } /** * Constructs a new dialog to collect new language data. */ -void CGUISettingsDlg::AddLang(const wxCommandEvent &event) { +void CGUISettingsDlg::AddLang(wxCommandEvent &event) { CAddLanguageDlg *addlangdlg = new CAddLanguageDlg( NULL, -1, _("Add new language") ); @@ -327,12 +332,13 @@ GetLang()->SetSelection(GetLang()->GetCount()-1); } delete addlangdlg; + event.Skip(); } /** * Removes a language from the languages list */ -void CGUISettingsDlg::RemoveLang(const wxCommandEvent &event) { +void CGUISettingsDlg::RemoveLang(wxCommandEvent &event) { wxString confirmtext; confirmtext.Format( @@ -347,12 +353,13 @@ GetLang()->Delete(GetLang()->GetSelection()); } GetLang()->SetSelection(0); + event.Skip(); } /** * Constructs a new dialog to collect new iconset data. */ -void CGUISettingsDlg::AddIconSet(const wxCommandEvent &event) { +void CGUISettingsDlg::AddIconSet(wxCommandEvent &event) { CAddIconSetDlg *addiconsetdlg = new CAddIconSetDlg( NULL, -1, _("Add new iconset") ); @@ -361,12 +368,13 @@ GetIconSet()->SetSelection(GetIconSet()->GetCount()-1); } delete addiconsetdlg; + event.Skip(); } /** * Removes current selected item from list of known iconsets. */ -void CGUISettingsDlg::RemoveIconSet(const wxCommandEvent &event) { +void CGUISettingsDlg::RemoveIconSet(wxCommandEvent &event) { wxString confirmtext; confirmtext.Format( @@ -382,6 +390,7 @@ GetIconSet()->Delete(GetIconSet()->GetSelection()); } GetIconSet()->SetSelection(0); + event.Skip(); } void CGUISettingsDlg::CreateControls() { @@ -662,7 +671,7 @@ * (and exists, for that matter), and if everything works as expected, * add the new language to language choice box. */ -void CAddLanguageDlg::AddLangOk(const wxCommandEvent &event) { +void CAddLanguageDlg::AddLangOk(wxCommandEvent &event) { wxString name; /* Get the name and ID from dialog. */ @@ -709,14 +718,16 @@ ); EndModal(true); + event.Skip(); } /** * Handles cancel button event in Language adding dialog. * Destroys the above-mentioed dialog, plain and simple. */ -void CAddLanguageDlg::AddLangCancel(const wxCommandEvent &event) { +void CAddLanguageDlg::AddLangCancel(wxCommandEvent &event) { EndModal(false); + event.Skip(); } /************** @@ -741,13 +752,15 @@ /** * Should we do some checking for the new iconset here? */ -void CAddIconSetDlg::BtnOk(const wxCommandEvent &event) { +void CAddIconSetDlg::BtnOk(wxCommandEvent &event) { EndModal(true); + event.Skip(); } /** * Cancel pressed - return false, causing us abort all changes. */ -void CAddIconSetDlg::BtnCancel(const wxCommandEvent &event) { +void CAddIconSetDlg::BtnCancel(wxCommandEvent &event) { EndModal(false); + event.Skip(); } Index: GUISettingsDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- GUISettingsDlg.h 22 Feb 2004 23:54:37 -0000 1.13 +++ GUISettingsDlg.h 28 Feb 2004 02:48:01 -0000 1.14 @@ -44,15 +44,15 @@ ); private: /* Event handler functions */ - void OnOk(const wxCommandEvent &event); - void OnCancel(const wxCommandEvent &event); - void OnCheckRememberLast(const wxCommandEvent &event); - void OnCheckShowTool(const wxCommandEvent &event); - void OnCheckShowMenu(const wxCommandEvent &event); - void AddLang(const wxCommandEvent &event); - void RemoveLang(const wxCommandEvent &event); - void AddIconSet(const wxCommandEvent &event); - void RemoveIconSet(const wxCommandEvent &event); + void OnOk(wxCommandEvent &event); + void OnCancel(wxCommandEvent &event); + void OnCheckRememberLast(wxCommandEvent &event); + void OnCheckShowTool(wxCommandEvent &event); + void OnCheckShowMenu(wxCommandEvent &event); + void AddLang(wxCommandEvent &event); + void RemoveLang(wxCommandEvent &event); + void AddIconSet(wxCommandEvent &event); + void RemoveIconSet(wxCommandEvent &event); /* Other functions */ void SaveSettings(); @@ -103,8 +103,8 @@ } private: DECLARE_EVENT_TABLE() - void AddLangOk(const wxCommandEvent &event); - void AddLangCancel(const wxCommandEvent &event); + void AddLangOk(wxCommandEvent &event); + void AddLangCancel(wxCommandEvent &event); }; /** @@ -124,8 +124,8 @@ wxTextCtrl* GetIconSet() { return (wxTextCtrl*) FindWindow(ID_ICONSET);} private: DECLARE_EVENT_TABLE() - void BtnOk(const wxCommandEvent &event); - void BtnCancel(const wxCommandEvent &event); + void BtnOk(wxCommandEvent &event); + void BtnCancel(wxCommandEvent &event); }; #endif Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- MainDlg.cpp 22 Feb 2004 23:54:37 -0000 1.64 +++ MainDlg.cpp 28 Feb 2004 02:48:01 -0000 1.65 @@ -64,17 +64,19 @@ /* This method is called from event table whenever user right-clicks on */ /* toolbar. We call CMainDlg::ShowToolPopupMenu() to handle the event. */ /******************************************************************************/ -void MyToolBar::RightClick(const wxMouseEvent &event) { +void MyToolBar::RightClick(wxMouseEvent &event) { mainframe->ShowToolPopupMenu(); + event.Skip(); } /* .... */ -void MyToolBar::MiddleDClick(const wxMouseEvent &event) { +void MyToolBar::MiddleDClick(wxMouseEvent &event) { if (event.ControlDown()) { CAboutDlg *dlg = new CAboutDlg(NULL, -1, wxT("About...")); dlg->ShowModal(); delete dlg; } + event.Skip(); } BEGIN_EVENT_TABLE(DetachedFrame, wxFrame) @@ -110,7 +112,7 @@ /******************************************************************** OnClose */ /* Frame close event - sends content back to main frame */ /******************************************************************************/ -void DetachedFrame::OnClose(wxCommandEvent &event) { +void DetachedFrame::OnClose(wxCloseEvent &event) { cnt->content->Hide(); Hide(); if (wxGetApp().mainframe_active) { @@ -126,7 +128,7 @@ EVT_CLOSE(CMainDlg::OnCloseWindow) /* Shutdown event */ EVT_TOOL(-1, CMainDlg::MenuOrToolEvent) /* Menu/Toolbar events */ EVT_BUTTON(ID_BTN_GUISETTINGS, CMainDlg::ShowGUISettingsDlg) - EVT_BUTTON(ID_QUIT, CMainDlg::OnCloseWindow) + EVT_BUTTON(ID_QUIT, CMainDlg::OnBtnQuit) END_EVENT_TABLE() #include <wx/listimpl.cpp> @@ -524,13 +526,14 @@ /********************************************************* ShowGUISettingsDlg */ /* Displays GUI settings dialog and delets it after its finished. */ /******************************************************************************/ -void CMainDlg::ShowGUISettingsDlg() { +void CMainDlg::ShowGUISettingsDlg(wxCommandEvent &event) { CGUISettingsDlg *guisettings = new CGUISettingsDlg( NULL, -1, _("Preferences"), wxDefaultPosition, wxDefaultSize ); guisettings->ShowModal(); delete guisettings; + event.Skip(); } /***************************************************** LoadAndShowDialogPages */ @@ -698,9 +701,11 @@ case ID_BTN_CONNECT: ConnectToAnyServer(); break; - case ID_BTN_GUISETTINGS: - ShowGUISettingsDlg(); + case ID_BTN_GUISETTINGS: { + wxCommandEvent evt; + ShowGUISettingsDlg(evt); break; + } default: break; } @@ -767,10 +772,12 @@ Close(); event.Skip(); break; - case ID_EDIT_GUI_SETTINGS: - ShowGUISettingsDlg(); + case ID_EDIT_GUI_SETTINGS: { + wxCommandEvent evt; + ShowGUISettingsDlg(evt); event.Skip(); break; + } case ID_VIEW_MENUBAR: if ( !(GetViewMenuBar()->IsChecked()) && @@ -1029,10 +1036,12 @@ DetachCurPage(); event.Skip(); break; - case ID_EDIT_GUI_SETTINGS: - ShowGUISettingsDlg(); + case ID_EDIT_GUI_SETTINGS: { + wxCommandEvent evt; + ShowGUISettingsDlg(evt); event.Skip(); break; + } case ID_FULLSCREEN: ShowFullScreen( !IsFullScreen(), @@ -1239,3 +1248,11 @@ _("Options"), wxT("btn_guisettings") ); } + +/** + * Handles events on ID_QUIT button -> Closes the main dialog frame. + */ +void CMainDlg::OnBtnQuit(wxCommandEvent &event) { + Close(); + event.Skip(); +} Index: MainDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- MainDlg.h 22 Feb 2004 23:54:37 -0000 1.22 +++ MainDlg.h 28 Feb 2004 02:48:01 -0000 1.23 @@ -73,8 +73,8 @@ ); /* Constructor */ private: DECLARE_EVENT_TABLE() /* Event table declaration */ - void RightClick(const wxMouseEvent &event); /* Mouse Rclick events */ - void MiddleDClick(const wxMouseEvent &event); /* ... */ + void RightClick(wxMouseEvent &event); /* Mouse Rclick events */ + void MiddleDClick(wxMouseEvent &event); /* ... */ }; /**************************** DetachedFrame class *****************************/ @@ -93,7 +93,7 @@ wxLocale &m_locale; /* Localization variable */ private: DECLARE_EVENT_TABLE() /* Event table declaration */ - void OnClose(wxCommandEvent &event); /* Window closing event */ + void OnClose(wxCloseEvent &event); /* Window closing event */ Page *cnt; /* Contents of the frame */ }; @@ -169,13 +169,14 @@ void ToolEvent(wxCommandEvent &event); /* Toolbar events */ void OnCloseWindow(wxCloseEvent &event); /* Window closing event */ void PopUpMenuEvents(wxCommandEvent &event);/* Tbar popup-menu events */ + void OnBtnQuit(wxCommandEvent &event); /* Quit button */ /* Member functions */ void CreateSysTray(); /* Creates system tray icon */ void LoadAndShowDialogPages(); /* Loads dialog pages */ void ConnectToAnyServer(); /* Sends "connect" command to core */ - bool SetActivePage(const wxString &to_show); /* Displays page */ - void ShowGUISettingsDlg(); /* Displays GUI settings dialog */ + bool SetActivePage(const wxString &to_show); /* Displays page */ + void ShowGUISettingsDlg(wxCommandEvent &event); /* Show settings dlg */ void UpdateToolBar(); /* Updates toolbar buttons */ void UpdateMenuBar(); /* Updates menubar objects */ void RemovePage( /* Removes page `to_remove` */ Index: SearchWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SearchWnd.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- SearchWnd.cpp 13 Jan 2004 23:10:26 -0000 1.18 +++ SearchWnd.cpp 28 Feb 2004 02:48:01 -0000 1.19 @@ -360,7 +360,7 @@ /* If its shown, remove it from mainsizer and hide it, otherwise, prepend it */ /* to mainsizer and show it. Refresh() to avoid wierd visual leftovers. */ /******************************************************************************/ -void CSearchWnd::ToggleSidebar(const wxCommandEvent &event) { +void CSearchWnd::ToggleSidebar(wxCommandEvent &event) { #ifdef __HAVE_REMOVE_GROWABLE_COL__ if (sidebar->IsShown()) { mainsizer->Remove(sidebar); @@ -385,6 +385,7 @@ } Layout(); Refresh(); + event.Skip(); #endif } @@ -393,14 +394,14 @@ /* place, rather than having separate method for each of them (hei, they'r */ /* not THAT important :P). Anyway, nothing of interest to see here - move on. */ /******************************************************************************/ -void CSearchWnd::HandleCheckEvents(const wxCommandEvent &event) { - switch (event.GetId()) { - case ID_FLT_ALL: - CreateFilterChecks( - GetCheckFilterAll()->GetParent(), - s_filters, - !GetCheckFilterAll()->GetValue() - ); +void CSearchWnd::HandleCheckEvents(wxCommandEvent &event) { + switch (event.GetId()) { + case ID_FLT_ALL: + CreateFilterChecks( + GetCheckFilterAll()->GetParent(), + s_filters, + !GetCheckFilterAll()->GetValue() + ); break; case ID_CHK_FLT_SIZE_L: GetTextFilterSizeL()->Enable( @@ -425,6 +426,7 @@ default: break; } + event.Skip(); } /********************************************************* CreateFiltersPanel */ Index: SearchWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SearchWnd.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- SearchWnd.h 22 Feb 2004 23:54:37 -0000 1.11 +++ SearchWnd.h 28 Feb 2004 02:48:01 -0000 1.12 @@ -68,9 +68,9 @@ void SaveSettings(); /* Save various settings, like check states etc */ /* Event handlers */ - void ToggleSidebar(const wxCommandEvent &event);/* Toggles sidebar :) */ + void ToggleSidebar(wxCommandEvent &event); /* Toggles sidebar :) */ void HandleCheckEvents( /* Handles checkbox on/off switching events */ - const wxCommandEvent &event + wxCommandEvent &event ); /* Getters */ Index: ServerWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- ServerWnd.cpp 22 Feb 2004 23:54:37 -0000 1.59 +++ ServerWnd.cpp 28 Feb 2004 02:48:01 -0000 1.60 @@ -100,14 +100,16 @@ /* * Add new server to servers list. */ -void CServerWnd::AddNewServer() { +void CServerWnd::AddNewServer(wxCommandEvent &event) { + event.Skip(); } /* * Downloads the server.met file from given URL and adds any new servers found * to server list. */ -void CServerWnd::UpdateFromURL() { +void CServerWnd::UpdateFromURL(wxCommandEvent &event) { + event.Skip(); } /* Creates server page controls */ Index: ServerWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.h,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- ServerWnd.h 22 Feb 2004 23:54:37 -0000 1.35 +++ ServerWnd.h 28 Feb 2004 02:48:01 -0000 1.36 @@ -64,8 +64,8 @@ void OnAddLogLine(wxCommandEvent &event); /* Member function declarations */ - void AddNewServer(); - void UpdateFromURL(); + void AddNewServer(wxCommandEvent &event); + void UpdateFromURL(wxCommandEvent &event); void CreateControls(); wxSizer* SettingsPanel( wxWindow *parent, bool call_fit = true, bool set_sizer = true Index: TransferWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/TransferWnd.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- TransferWnd.cpp 22 Feb 2004 23:54:37 -0000 1.28 +++ TransferWnd.cpp 28 Feb 2004 02:48:01 -0000 1.29 @@ -75,7 +75,7 @@ /* * Changes the content of lower splitterwindow frame from Upload to Queue. */ -void CTransferWnd::ChangeToQueue() { +void CTransferWnd::ChangeToQueue(wxCommandEvent &event) { queue = new wxPanel( splatter, -1, wxDefaultPosition, wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL @@ -83,12 +83,13 @@ QueuePanel(queue); splatter->ReplaceWindow(upload, queue); delete upload; + event.Skip(); } /* * Changes the content of lower splitterwindow frame from Upload to Known. */ -void CTransferWnd::ChangeToKnown() { +void CTransferWnd::ChangeToKnown(wxCommandEvent &event) { known = new wxPanel( splatter, -1, wxDefaultPosition, wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL @@ -96,12 +97,13 @@ KnownPanel(known); splatter->ReplaceWindow(queue, known); delete queue; + event.Skip(); } /* * Changes the content of lower splitterwindow frame from Known to Upload. */ -void CTransferWnd::ChangeToUpload() { +void CTransferWnd::ChangeToUpload(wxCommandEvent &event) { upload = new wxPanel( splatter, -1, wxDefaultPosition, wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL @@ -109,6 +111,7 @@ UploadPanel(upload); splatter->ReplaceWindow(known, upload); delete known; + event.Skip(); } /* Index: TransferWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/TransferWnd.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- TransferWnd.h 22 Feb 2004 23:54:37 -0000 1.13 +++ TransferWnd.h 28 Feb 2004 02:48:01 -0000 1.14 @@ -60,9 +60,9 @@ DECLARE_EVENT_TABLE() /* Member event handler functions */ - void ChangeToQueue(); - void ChangeToKnown(); - void ChangeToUpload(); + void ChangeToQueue(wxCommandEvent &event); + void ChangeToKnown(wxCommandEvent &event); + void ChangeToUpload(wxCommandEvent &event); /* Member layout generation functions */ void CreateControls(); |