docmdi.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/docmdi.h
  3. // Purpose: Frame classes for MDI document/view applications
  4. // Author: Julian Smart
  5. // Created: 01/02/97
  6. // Copyright: (c) 1997 Julian Smart
  7. // (c) 2010 Vadim Zeitlin
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_DOCMDI_H_
  11. #define _WX_DOCMDI_H_
  12. #include "wx/defs.h"
  13. #if wxUSE_MDI_ARCHITECTURE
  14. #include "wx/docview.h"
  15. #include "wx/mdi.h"
  16. #ifdef __VISUALC6__
  17. // "non dll-interface class 'wxDocXXXFrameAny<>' used as base interface for
  18. // dll-interface class 'wxDocMDIXXXFrame'" -- this is bogus as the template
  19. // will be DLL-exported but only once it is used as base class here!
  20. #pragma warning (push)
  21. #pragma warning (disable:4275)
  22. #endif
  23. // Define MDI versions of the doc-view frame classes. Note that we need to
  24. // define them as classes for wxRTTI, otherwise we could simply define them as
  25. // typedefs.
  26. // ----------------------------------------------------------------------------
  27. // An MDI document parent frame
  28. // ----------------------------------------------------------------------------
  29. typedef
  30. wxDocParentFrameAny<wxMDIParentFrame> wxDocMDIParentFrameBase;
  31. class WXDLLIMPEXP_CORE wxDocMDIParentFrame : public wxDocMDIParentFrameBase
  32. {
  33. public:
  34. wxDocMDIParentFrame() : wxDocMDIParentFrameBase() { }
  35. wxDocMDIParentFrame(wxDocManager *manager,
  36. wxFrame *parent,
  37. wxWindowID id,
  38. const wxString& title,
  39. const wxPoint& pos = wxDefaultPosition,
  40. const wxSize& size = wxDefaultSize,
  41. long style = wxDEFAULT_FRAME_STYLE,
  42. const wxString& name = wxFrameNameStr)
  43. : wxDocMDIParentFrameBase(manager,
  44. parent, id, title, pos, size, style, name)
  45. {
  46. }
  47. private:
  48. DECLARE_CLASS(wxDocMDIParentFrame)
  49. wxDECLARE_NO_COPY_CLASS(wxDocMDIParentFrame);
  50. };
  51. // ----------------------------------------------------------------------------
  52. // An MDI document child frame
  53. // ----------------------------------------------------------------------------
  54. typedef
  55. wxDocChildFrameAny<wxMDIChildFrame, wxMDIParentFrame> wxDocMDIChildFrameBase;
  56. class WXDLLIMPEXP_CORE wxDocMDIChildFrame : public wxDocMDIChildFrameBase
  57. {
  58. public:
  59. wxDocMDIChildFrame() { }
  60. wxDocMDIChildFrame(wxDocument *doc,
  61. wxView *view,
  62. wxMDIParentFrame *parent,
  63. wxWindowID id,
  64. const wxString& title,
  65. const wxPoint& pos = wxDefaultPosition,
  66. const wxSize& size = wxDefaultSize,
  67. long style = wxDEFAULT_FRAME_STYLE,
  68. const wxString& name = wxFrameNameStr)
  69. : wxDocMDIChildFrameBase(doc, view,
  70. parent, id, title, pos, size, style, name)
  71. {
  72. }
  73. private:
  74. DECLARE_CLASS(wxDocMDIChildFrame)
  75. wxDECLARE_NO_COPY_CLASS(wxDocMDIChildFrame);
  76. };
  77. #ifdef __VISUALC6__
  78. #pragma warning (pop)
  79. #endif
  80. #endif // wxUSE_MDI_ARCHITECTURE
  81. #endif // _WX_DOCMDI_H_