1
//--------------------------------------------------------------------------------------
2
// LenMus Phonascus: The teacher of music
3
// Copyright (c) 2002-2007 Cecilio Salmeron
5
// This file is derived from file src/generic/mdig.h from wxWidgets 2.7.1 project.
6
// Author: Hans Van Leemputten
7
// Copyright (c) Hans Van Leemputten
12
// This program is free software; you can redistribute it and/or modify it under the
13
// terms of the GNU General Public License as published by the Free Software Foundation;
14
// either version 2 of the License, or (at your option) any later version.
16
// This program is distributed in the hope that it will be useful, but WITHOUT ANY
17
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
18
// PARTICULAR PURPOSE. See the GNU General Public License for more details.
20
// You should have received a copy of the GNU General Public License along with this
21
// program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
22
// Fifth Floor, Boston, MA 02110-1301, USA.
24
// For any comment, suggestion or feature request, please contact the manager of
25
// the project at cecilios@users.sourceforge.net
27
//-------------------------------------------------------------------------------------
29
#ifndef __LM_CHILDFRAME_H__
30
#define __LM_CHILDFRAME_H__
32
#include "../app/global.h" //access to lmUSE_NOTEBOOK_MDI flag
34
#if lmUSE_NOTEBOOK_MDI
39
class lmMDIParentFrame;
40
class lmMDIClientWindow;
42
//-----------------------------------------------------------------------------
44
// It is a panel on the Notebook (MDIParentFrame)
45
//-----------------------------------------------------------------------------
47
class lmMDIChildFrame: public wxPanel
51
lmMDIChildFrame( lmMDIParentFrame *parent,
53
const wxString& title,
54
const wxPoint& pos = wxDefaultPosition,
55
const wxSize& size = wxDefaultSize,
56
long style = wxDEFAULT_FRAME_STYLE,
57
const wxString& name = wxFrameNameStr );
59
virtual ~lmMDIChildFrame();
60
bool Create( lmMDIParentFrame *parent,
62
const wxString& title,
63
const wxPoint& pos = wxDefaultPosition,
64
const wxSize& size = wxDefaultSize,
65
long style = wxDEFAULT_FRAME_STYLE,
66
const wxString& name = wxFrameNameStr );
68
virtual void SetTitle(const wxString& title);
69
virtual wxString GetTitle() const;
71
virtual void Activate();
75
void SetIcon( const wxIcon& icon );
76
void SetIcons( const wxIconBundle& WXUNUSED(icons) ) { }
79
virtual void Maximize( bool WXUNUSED(maximize) = true) { /* Has no effect */ }
80
virtual void Restore() { /* Has no effect */ }
81
virtual void Iconize(bool WXUNUSED(iconize) = true) { /* Has no effect */ }
82
virtual bool IsMaximized() const { return true; }
83
virtual bool IsIconized() const { return false; }
84
virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style)) { return false; }
85
virtual bool IsFullScreen() const { return false; }
87
virtual bool IsTopLevel() const { return false; }
90
// The next 2 are copied from top level...
91
void OnCloseWindow(wxCloseEvent& event);
92
void OnSize(wxSizeEvent& event);
94
void SetMDIParentFrame(lmMDIParentFrame* parentFrame);
95
lmMDIParentFrame* GetMDIParentFrame() const;
98
lmMDIParentFrame *m_pMDIParentFrame;
106
virtual void DoMoveWindow(int x, int y, int width, int height);
108
// This function needs to be called when a size change is confirmed,
109
// we needed this function to prevent any body from the outside
110
// changing the panel... it messes the UI layout when we would allow it.
111
void ApplyMDIChildFrameRect();
114
DECLARE_DYNAMIC_CLASS(lmMDIChildFrame)
115
DECLARE_EVENT_TABLE()
117
friend class lmMDIClientWindow;
121
#else // do not lmUSE_NOTEBOOK_MDI
123
//use standard wxWidgets classes
124
#define lmMDIChildFrame wxMDIChildFrame
127
#endif //lmUSE_NOTEBOOK_MDI
130
#endif // __LM_CHILDFRAME_H__