Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/lintest/myrulib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKandrashin Denis <mail@lintest.ru>2012-10-11 16:06:41 +0400
committerKandrashin Denis <mail@lintest.ru>2012-10-11 18:02:20 +0400
commit07c38f2852f9f0b0c008c6e900b5eb482687e7df (patch)
treef82bedec8ee68d0a2bfffad67492137f87492b1f
parent93693386af989da85569de8dc298ffe6b7375f0c (diff)
Fix panel submenu
-rw-r--r--sources/MyRuLib/FbBookPanel.h4
-rw-r--r--sources/MyRuLib/FbMainFrame.cpp17
-rw-r--r--sources/MyRuLib/FbMainFrame.h3
-rw-r--r--sources/MyRuLib/frames/FbFrameBase.cpp6
4 files changed, 19 insertions, 11 deletions
diff --git a/sources/MyRuLib/FbBookPanel.h b/sources/MyRuLib/FbBookPanel.h
index b7297ca3..046473af 100644
--- a/sources/MyRuLib/FbBookPanel.h
+++ b/sources/MyRuLib/FbBookPanel.h
@@ -51,6 +51,10 @@ class FbBookPanel: public wxSplitterWindow
FbTreeViewCtrl & GetBookList() { return m_BookList; }
void DoFolderAdd(int folder);
public:
+ void DoEvent(wxEvent& event) {
+ GetEventHashTable().HandleEvent(event, this);
+ }
+ public:
void EmptyBooks(const int selected = 0);
void AppendAuthor(int id, const wxString title, wxTreeItemData * data = NULL);
void AppendSequence(int id, const wxString title, wxTreeItemData * data = NULL);
diff --git a/sources/MyRuLib/FbMainFrame.cpp b/sources/MyRuLib/FbMainFrame.cpp
index c2c74b8d..aa0167dc 100644
--- a/sources/MyRuLib/FbMainFrame.cpp
+++ b/sources/MyRuLib/FbMainFrame.cpp
@@ -45,6 +45,8 @@ IMPLEMENT_CLASS(FbMainFrame, wxFrame)
BEGIN_EVENT_TABLE(FbMainFrame, wxFrame)
+ EVT_MENU(wxID_ANY, FbMainFrame::OnClassMenu)
+
EVT_MENU(wxID_NEW, FbMainFrame::OnNewZip)
EVT_MENU(wxID_OPEN, FbMainFrame::OnFolder)
EVT_MENU(wxID_EXIT, FbMainFrame::OnExit)
@@ -178,16 +180,15 @@ FbMainFrame::~FbMainFrame()
wxDELETE(m_MenuBook);
}
-bool FbMainFrame::ProcessEvent(wxEvent& event)
+void FbMainFrame::OnClassMenu(wxCommandEvent& event)
{
- if (event.GetEventType() == wxEVT_COMMAND_MENU_SELECTED) {
- FbMenu::Type type; int code;
- if (FbMenuItem::Get(event.GetId(), type, code) && type == FbMenu::CLSS) {
- OpenClss(code);
- return true;
- }
+ int code;
+ FbMenu::Type type;
+ if (FbMenuItem::Get(event.GetId(), type, code) && type == FbMenu::CLSS) {
+ OpenClss(code);
+ return;
}
- return wxFrame::ProcessEvent(event);
+ event.Skip();
}
void FbMainFrame::OnSubmenu(wxCommandEvent& event)
diff --git a/sources/MyRuLib/FbMainFrame.h b/sources/MyRuLib/FbMainFrame.h
index 5b3a492c..1ed8666e 100644
--- a/sources/MyRuLib/FbMainFrame.h
+++ b/sources/MyRuLib/FbMainFrame.h
@@ -23,8 +23,6 @@ class FbMainFrame : public wxFrame
void Localize(int language);
wxAuiNotebook * GetNotebook() { return &m_FrameNotebook; }
void UpdateBook(int id);
- protected:
- virtual bool ProcessEvent(wxEvent& event);
private:
bool Create(wxWindow * parent, wxWindowID id, const wxString & title);
wxWindow * GetActiveChild();
@@ -81,6 +79,7 @@ class FbMainFrame : public wxFrame
void OnFullScreen(wxCommandEvent& event);
void OnFullScreenUpdate(wxUpdateUIEvent& event);
void OnInitFrame(wxCommandEvent& event);
+ void OnClassMenu(wxCommandEvent& event);
void OnMenuFrame(wxCommandEvent& event);
void OnMenuNothing(wxCommandEvent& event);
void OnMenuAuthor(wxCommandEvent& event);
diff --git a/sources/MyRuLib/frames/FbFrameBase.cpp b/sources/MyRuLib/frames/FbFrameBase.cpp
index df5e9950..82ad1d13 100644
--- a/sources/MyRuLib/frames/FbFrameBase.cpp
+++ b/sources/MyRuLib/frames/FbFrameBase.cpp
@@ -48,6 +48,10 @@ BEGIN_EVENT_TABLE(FbFrameBase, wxSplitterWindow)
EVT_TREE_SEL_CHANGED(ID_MASTER_LIST, FbFrameBase::OnMasterSelected)
EVT_MENU(wxID_ANY, FbFrameBase::OnHandleMenu)
EVT_MENU(wxID_SAVE, FbFrameBase::OnExportBooks)
+ EVT_MENU(ID_SPLIT_HORIZONTAL, FbFrameBase::OnSubmenu)
+ EVT_MENU(ID_SPLIT_VERTICAL, FbFrameBase::OnSubmenu)
+ EVT_MENU(ID_SPLIT_NOTHING, FbFrameBase::OnSubmenu)
+ EVT_MENU(ID_EDIT_COMMENTS, FbFrameBase::OnSubmenu)
EVT_MENU(ID_MODE_TREE, FbFrameBase::OnChangeMode)
EVT_MENU(ID_MODE_LIST, FbFrameBase::OnChangeMode)
EVT_MENU(ID_FILTER_SET, FbFrameBase::OnFilterSet)
@@ -156,7 +160,7 @@ void FbFrameBase::RefreshBooks()
void FbFrameBase::OnSubmenu(wxCommandEvent& event)
{
- wxPostEvent(m_BooksPanel, event);
+ m_BooksPanel->DoEvent(event);
}
void FbFrameBase::OnExportBooks(wxCommandEvent& event)