Update of /cvsroot/sharedaemon/ui-wx/src
In directory sc8-pr-cvs1:/tmp/cvs-serv602
Modified Files:
MainDlg.cpp MainDlg.h
Log Message:
Update menubar view section on page changing.
Index: MainDlg.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- MainDlg.cpp 25 Nov 2003 04:19:47 -0000 1.12
+++ MainDlg.cpp 25 Nov 2003 04:21:14 -0000 1.13
@@ -130,6 +130,8 @@
* Destructor for MainDlg.
*/
CMainDlg::~CMainDlg() {
+ short startpage = 0;
+ int remember_last;
/**
* Don't save the settings if we are iconized, otherwise we save our
* size and position to nulls or smth, and it seriously screws us on
@@ -151,11 +153,9 @@
* serverwnd, 1 for transferwnd etc, thus matching the codes we use
* from CGUISettingsDlg class.
*/
- int remember_last;
m_config->SetPath(wxT("/General"));
m_config->Read(wxT("Remember last"), &remember_last, true);
if (remember_last) {
- short startpage;
if (GetCurPage() == serverwnd) startpage = 0;
if (GetCurPage() == searchwnd) startpage = 1;
if (GetCurPage() == transferwnd) startpage = 2;
@@ -549,6 +549,31 @@
}
/**
+ * Here we update menubar view menu radio buttons.
+ */
+void CMainDlg::UpdateMenuBar() {
+#ifdef wxHAS_RADIO_MENU_ITEMS
+ if (GetMenuBar() == NULL) {
+ return;
+ }
+
+ if (GetCurPage() == serverwnd) {
+ GetViewServerWnd()->Check();
+ } else if (GetCurPage() == searchwnd) {
+ GetViewSearchWnd()->Check();
+ } else if (GetCurPage() == transferwnd) {
+ GetViewTransferWnd()->Check();
+ } else if (GetCurPage() == sharedfileswnd) {
+ GetViewSharedWnd()->Check();
+ } else if (GetCurPage() == messageswnd) {
+ GetViewMessagesWnd()->Check();
+ } else if (GetCurPage() == statisticswnd) {
+ GetViewStatisticsWnd()->Check();
+ }
+#endif
+}
+
+/**
* We handle menubar events here.
*/
void CMainDlg::MenuEvent(wxCommandEvent &event) {
@@ -649,6 +674,7 @@
ToolEvent(event);
MenuEvent(event);
UpdateToolButtons();
+ UpdateMenuBar();
} else {
event.Skip();
}
Index: MainDlg.h
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- MainDlg.h 24 Nov 2003 16:06:31 -0000 1.6
+++ MainDlg.h 25 Nov 2003 04:21:14 -0000 1.7
@@ -106,15 +106,19 @@
bool ShowPage(wxWindow* dlg);
void ShowGUISettingsDlg();
void UpdateToolButtons();
+ void UpdateMenuBar();
wxWindow* GetCurPage() { return activewnd; }
/* Getters */
- wxMenuItem* GetViewMenuBar() {
- return GetMenuBar()->FindItem(ID_VIEW_MENUBAR);
- }
- wxMenuItem* GetViewToolBar() {
- return GetMenuBar()->FindItem(ID_VIEW_TOOLBAR);
- }
+ wxMenuItem* GetViewMenuBar() {return GetMenuBar()->FindItem(ID_VIEW_MENUBAR);}
+ wxMenuItem* GetViewToolBar() {return GetMenuBar()->FindItem(ID_VIEW_TOOLBAR);}
+ wxMenuItem* GetViewServerWnd() {return GetMenuBar()->FindItem(ID_VIEW_SERVERS);}
+ wxMenuItem* GetViewSearchWnd() {return GetMenuBar()->FindItem(ID_VIEW_SEARCH);}
+ wxMenuItem* GetViewTransferWnd() {return GetMenuBar()->FindItem(ID_VIEW_TRANSFER);}
+ wxMenuItem* GetViewSharedWnd() {return GetMenuBar()->FindItem(ID_VIEW_SHARED_FILES);}
+ wxMenuItem* GetViewMessagesWnd() {return GetMenuBar()->FindItem(ID_VIEW_MESSAGES);}
+ wxMenuItem* GetViewStatisticsWnd() {return GetMenuBar()->FindItem(ID_VIEW_STATISTICS);}
+
wxStaticBitmap* GetBmpStatusConnection() { return (wxStaticBitmap*) FindWindow( ID_BMP_STATUS_CONNECTION ); }
wxStaticBitmap* GetBmpStatusDload() { return (wxStaticBitmap*) FindWindow( ID_BMP_STATUS_DLOAD ); }
wxStaticBitmap* GetBmpStatusUpload() { return (wxStaticBitmap*) FindWindow( ID_BMP_STATUS_UPLOAD ); }
|