1
//---------------------------------------------------------------------------------------
2
// LenMus Phonascus: The teacher of music
3
// Copyright (c) 2002-2011 LenMus project
5
// This program is free software; you can redistribute it and/or modify it under the
6
// terms of the GNU General Public License as published by the Free Software Foundation,
7
// either version 3 of the License, or (at your option) any later version.
9
// This program is distributed in the hope that it will be useful, but WITHOUT ANY
10
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
// PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
// You should have received a copy of the GNU General Public License along with this
14
// program. If not, see <http://www.gnu.org/licenses/>.
16
// For any comment, suggestion or feature request, please contact the manager of
17
// the project at cecilios@users.sourceforge.net
19
//---------------------------------------------------------------------------------------
21
#ifndef __LENMUS_CANVAS_H__
22
#define __LENMUS_CANVAS_H__
25
#include <wx/aui/aui.h>
31
//forward declarations
36
//---------------------------------------------------------------------------------------
37
// ContentFrame: a wxFrame for placing the ContentWindow and the Canvas objects
38
class ContentFrame : public wxFrame
41
ContentWindow* m_pContentWindow;
42
Canvas* m_pActiveCanvas;
43
// wxMenuBar* m_pMyMenuBar;
46
ContentFrame(wxWindow* parent,
48
const wxString& title,
49
const wxPoint& pos = wxDefaultPosition,
50
const wxSize& size = wxDefaultSize,
51
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
52
const wxString& name = wxFrameNameStr);
54
virtual ~ContentFrame();
56
// virtual void SetMenuBar(wxMenuBar* pMenuBar);
57
// virtual bool ProcessEvent(wxEvent& event);
59
Canvas* get_active_canvas();
60
//void set_active_canvas(Canvas* pCanvas);
61
inline ContentWindow* get_content_window() const { return m_pContentWindow; }
63
// virtual void ActivateNext();
64
// virtual void ActivatePrevious();
65
// virtual bool CloseAll();
66
// virtual void CloseActive();
68
virtual void add_canvas(Canvas* pCanvas, const wxString& title);
69
// virtual void remove_canvas(Canvas* pCanvas);
70
// void OnSize(wxSizeEvent& event);
73
// virtual void DoGetClientSize(int* width, int* height) const;
78
// DECLARE_DYNAMIC_CLASS(ContentFrame)
79
// DECLARE_EVENT_TABLE()
82
//---------------------------------------------------------------------------------------
83
// ContentWindow: a place to display all Canvas objects
84
class ContentWindow : public wxAuiNotebook
88
ContentWindow(ContentFrame* parent, long style = 0 );
89
virtual ~ContentWindow();
91
Canvas* get_active_canvas();
92
void add_canvas(Canvas* pCanvas, const wxString& title);
93
// int SetSelection(size_t nPage);
94
// void OnSize(wxSizeEvent& event);
95
// void OnChildClose(wxAuiNotebookEvent& evt);
99
// void OnPageChanged(wxAuiNotebookEvent& event);
102
// DECLARE_DYNAMIC_CLASS(ContentWindow)
103
// DECLARE_EVENT_TABLE()
106
//---------------------------------------------------------------------------------------
107
// Canvas: a panel on the ContentWindow
108
class Canvas: public wxPanel
111
ContentFrame* m_pContentFrame;
115
Canvas(ContentFrame* parent, wxWindowID winid, const wxString& title,
116
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
117
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr);
120
// virtual void SetTitle(const wxString& title);
121
// virtual wxString GetTitle() const;
123
// virtual void Activate();
125
inline void set_content_frame(ContentFrame* parentFrame) {
126
m_pContentFrame = parentFrame;
128
inline ContentFrame* get_content_frame() const { return m_pContentFrame; }
130
// //New mthods not in wxMDIChildFrame --------------------------
132
// // methods to deal with zooming
133
// virtual double GetActiveViewScale() { return 1.0; }
134
// virtual bool SetActiveViewScale(double rScale) { return false; }
136
// // call back from ContentWindow::PageChanged
137
// virtual void OnChildFrameActivated() {}
138
// virtual void OnChildFrameDeactivated() {}
141
//DECLARE_DYNAMIC_CLASS(Canvas)
142
//DECLARE_EVENT_TABLE()
148
#endif // __LENMUS_CANVAS_H__