49 #include "wx/string.h"
51 #include "wx/filename.h"
52 #include <wx/splitter.h>
53 #include "wx/notebook.h"
56 using namespace sigslot;
60 #if wxUSE_PRINTING_ARCHITECTURE
64 #include <wx/listimpl.cpp>
70 #endif //wxART2D_USE_CVGIO
72 #if (defined(__WXMSW__) )
73 #ifdef A2DDOCVIEWMAKINGDLL
74 #define A2DDOCVIEWDLLEXP WXEXPORT
75 #define A2DDOCVIEWDLLEXP_DATA(type) WXEXPORT type
76 #define A2DDOCVIEWDLLEXP_CTORFN
77 #elif defined(WXDOCVIEW_USINGDLL)
78 #define A2DDOCVIEWDLLEXP WXIMPORT
79 #define A2DDOCVIEWDLLEXP_DATA(type) WXIMPORT type
80 #define A2DDOCVIEWDLLEXP_CTORFN
81 #else // not making nor using DLL
82 #define A2DDOCVIEWDLLEXP
83 #define A2DDOCVIEWDLLEXP_DATA(type) type
84 #define A2DDOCVIEWDLLEXP_CTORFN
86 #else // (defined(__WXMSW__) )not making nor using DLL
87 #define A2DDOCVIEWDLLEXP
88 #define A2DDOCVIEWDLLEXP_DATA(type) type
89 #define A2DDOCVIEWDLLEXP_CTORFN
90 #endif //(defined(__WXMSW__) )
98 #if (defined(__WXMSW__) && defined(WXUSINGDLL) )
107 template class A2DDOCVIEWDLLEXP std::allocator<class a2dSmrtPtr<class a2dDocument> >;
108 template class A2DDOCVIEWDLLEXP std::allocator< std::_List_nod<class a2dSmrtPtr<class a2dDocument>, std::allocator<class a2dSmrtPtr<class a2dDocument> > >::_Node >;
109 template class A2DDOCVIEWDLLEXP std::allocator< std::_List_ptr<class a2dSmrtPtr<class a2dDocument>, std::allocator<class a2dSmrtPtr<class a2dDocument> > >::_Nodeptr >;
110 template class A2DDOCVIEWDLLEXP std::list<class a2dSmrtPtr<class a2dDocument> >;
114 template class A2DDOCVIEWDLLEXP std::allocator<class a2dSmrtPtr<class a2dView> >;
115 template class A2DDOCVIEWDLLEXP std::allocator< std::_List_nod<class a2dSmrtPtr<class a2dView>, std::allocator<class a2dSmrtPtr<class a2dView> > >::_Node >;
116 template class A2DDOCVIEWDLLEXP std::allocator< std::_List_ptr<class a2dSmrtPtr<class a2dView>, std::allocator<class a2dSmrtPtr<class a2dView> > >::_Nodeptr >;
117 template class A2DDOCVIEWDLLEXP std::list<class a2dSmrtPtr<class a2dView> >;
121 template class A2DDOCVIEWDLLEXP std::allocator<class a2dSmrtPtr<class a2dDocumentTemplate> >;
122 template class A2DDOCVIEWDLLEXP std::allocator< std::_List_nod<class a2dSmrtPtr<class a2dDocumentTemplate>, std::allocator<class a2dSmrtPtr<class a2dDocumentTemplate> > >::_Node >;
123 template class A2DDOCVIEWDLLEXP std::allocator< std::_List_ptr<class a2dSmrtPtr<class a2dDocumentTemplate>, std::allocator<class a2dSmrtPtr<class a2dDocumentTemplate> > >::_Nodeptr >;
124 template class A2DDOCVIEWDLLEXP std::list<class a2dSmrtPtr<class a2dDocumentTemplate> >;
128 template class A2DDOCVIEWDLLEXP std::allocator<class a2dSmrtPtr<class a2dViewTemplate> >;
129 template class A2DDOCVIEWDLLEXP std::allocator< std::_List_nod<class a2dSmrtPtr<class a2dViewTemplate>, std::allocator<class a2dSmrtPtr<class a2dViewTemplate> > >::_Node >;
130 template class A2DDOCVIEWDLLEXP std::allocator< std::_List_ptr<class a2dSmrtPtr<class a2dViewTemplate>, std::allocator<class a2dSmrtPtr<class a2dViewTemplate> > >::_Nodeptr >;
131 template class A2DDOCVIEWDLLEXP std::list<class a2dSmrtPtr<class a2dViewTemplate> >;
166 #if wxUSE_STD_IOSTREAM
167 #include "wx/ioswrap.h"
174 #include "wx/wfstream.h"
257 #include <wx/listimpl.cpp>
262 BEGIN_DECLARE_EVENT_TYPES()
263 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_SIGNAL, 1 )
266 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_SAVE_DOCUMENT, 1 )
268 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_SAVEAS_DOCUMENT, 1 )
270 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_IMPORT_DOCUMENT, 1 )
272 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_EXPORT_DOCUMENT, 1 )
274 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_CLOSE_DOCUMENT, 1 )
276 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_OPEN_DOCUMENT, 1 )
278 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_NEW_DOCUMENT, 1 )
280 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_CREATE_DOCUMENT, 1 )
282 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_ADD_VIEW, 1 )
284 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_REMOVE_VIEW, 1 )
286 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_DISCONNECT_ALLVIEWS, 1 )
288 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_UPDATE_VIEWS, 1 )
290 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_ENABLE_VIEWS, 1 )
292 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_REPORT_VIEWS, 1 )
294 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_CHANGEDFILENAME_DOCUMENT, 1 )
296 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_CHANGEDTITLE_DOCUMENT, 1 )
298 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_CHANGEDMODIFY_DOCUMENT, 1 )
300 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_POST_LOAD_DOCUMENT, 1 )
303 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_ACTIVATE_VIEW, 1 )
305 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_ACTIVATE_VIEW_SENT_FROM_CHILD, 1 )
307 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_CLOSE_VIEW, 1 )
309 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_CREATE_VIEW, 1 )
311 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_SET_DOCUMENT, 1 )
313 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_ENABLE_VIEW, 1 )
315 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_CHANGEDFILENAME_VIEW, 1 )
318 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_PRE_ADD_DOCUMENT, 1 )
320 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_POST_CREATE_DOCUMENT, 1 )
322 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_POST_CREATE_VIEW, 1 )
324 DECLARE_EXPORTED_EVENT_TYPE( A2DDOCVIEWDLLEXP, wxEVT_DISCONNECT_VIEW, 1 )
326 END_DECLARE_EVENT_TYPES()
364 : a2dEvent( id, wxEVT_CLOSE_VIEW ),
368 m_isCommandEvent =
true;
374 m_veto( event.m_veto ),
375 m_canVeto( event.m_canVeto )
386 wxCHECK_RET( m_canVeto,
387 wxT(
"call to Veto() ignored (can't veto this event)" ) );
399 bool GetVeto()
const {
return m_canVeto && m_veto; }
445 m_isCommandEvent =
true;
477 m_isCommandEvent =
true;
481 if ( type == wxEVT_ACTIVATE_VIEW || type == wxEVT_ACTIVATE_VIEW_SENT_FROM_CHILD )
485 else if ( type == wxEVT_ENABLE_VIEW )
495 m_bAllow = event.m_bAllow;
496 m_flags = event.m_flags;
497 m_activate = event.m_activate;
498 m_enable = event.m_enable;
502 void Veto() { m_bAllow =
false; }
564 : wxCloseEvent( wxEVT_CLOSE_DOCUMENT, id )
570 : wxCloseEvent( event )
636 m_filename = filename;
639 m_doctemplate = NULL;
642 m_reportViews = NULL;
673 m_filename = filename;
676 m_doctemplate = doctemplate;
679 m_reportViews = NULL;
694 m_filename = wxFileName( wxT(
"" ) );
697 m_doctemplate = NULL;
700 m_reportViews = reportlist;
725 m_filename = wxFileName( wxT(
"" ) );
727 m_doctemplate = NULL;
730 m_reportViews = NULL;
738 m_bAllow = event.m_bAllow;
739 m_error = event.m_error;
740 m_filename = event.m_filename;
741 m_flags = event.m_flags;
742 m_view = event.m_view;
743 m_doctemplate = event.m_doctemplate;
744 m_updateHint = event.m_updateHint;
745 m_objectHint = event.m_objectHint;
746 m_reportViews = event.m_reportViews;
747 m_enable = event.m_enable;
751 void Veto() { m_bAllow =
false; }
760 void SetFileName(
const wxFileName& filename ) { m_filename = filename; }
782 void SetUpdateHint(
unsigned int updateHint ) { m_updateHint = updateHint; }
784 unsigned int GetUpdateHint() {
return m_updateHint; }
786 void SetUpdateObject( wxObject* objectHint ) { m_objectHint = objectHint; }
788 wxObject* GetUpdateObject() {
return m_objectHint; }
790 a2dViewList* GetReportList() {
return m_reportViews; }
819 wxFileName m_filename;
827 unsigned int m_updateHint;
829 wxObject* m_objectHint;
898 m_flags = event.m_flags;
899 m_mask = event.m_mask;
905 void SetDocument(
a2dDocument* doc ) { m_doc = doc; }
941 typedef void ( wxEvtHandler::*a2dDocumentEventFunction )(
a2dDocumentEvent& );
943 typedef void ( wxEvtHandler::*a2dViewEventFunction )(
a2dViewEvent& );
944 typedef void ( wxEvtHandler::*a2dTemplateEventFunction )(
a2dTemplateEvent& );
947 #define a2dDocumentCloseEventHandler(func) \
948 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(a2dDocumentCloseEventFunction, &func)
949 #define a2dDocumentEventHandler(func) \
950 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(a2dDocumentEventFunction, &func)
951 #define a2dViewCloseEventHandler(func) \
952 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(a2dViewCloseEventFunction, &func)
953 #define a2dViewEventHandler(func) \
954 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(a2dViewEventFunction, &func)
955 #define a2dTemplateEventHandler(func) \
956 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(a2dTemplateEventFunction, &func)
959 #define EVT_DISCONNECT_ALLVIEWS(func) wx__DECLARE_EVT0( wxEVT_DISCONNECT_ALLVIEWS, a2dDocumentEventHandler( func ))
961 #define EVT_CLOSE_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_CLOSE_DOCUMENT, a2dDocumentCloseEventHandler( func ))
963 #define EVT_OPEN_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_OPEN_DOCUMENT, a2dDocumentEventHandler( func ))
965 #define EVT_NEW_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_NEW_DOCUMENT, a2dDocumentEventHandler( func ))
967 #define EVT_CREATE_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_CREATE_DOCUMENT, a2dDocumentEventHandler( func ))
969 #define EVT_SAVE_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_SAVE_DOCUMENT, a2dDocumentEventHandler( func ))
971 #define EVT_SAVEAS_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_SAVEAS_DOCUMENT, a2dDocumentEventHandler( func ))
973 #define EVT_SAVE_MODIFIED_DIALOG_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_SAVE_MODIFIED_DIALOG_DOCUMENT, a2dDocumentEventHandler( func ))
975 #define EVT_EXPORT_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_EXPORT_DOCUMENT, a2dDocumentEventHandler( func ))
977 #define EVT_IMPORT_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_IMPORT_DOCUMENT, a2dDocumentEventHandler( func ))
979 #define EVT_UPDATE_VIEWS(func) wx__DECLARE_EVT0( wxEVT_UPDATE_VIEWS, a2dDocumentEventHandler( func ))
981 #define EVT_ENABLE_VIEWS(func) wx__DECLARE_EVT0( wxEVT_ENABLE_VIEWS, a2dDocumentEventHandler( func ))
983 #define EVT_REPORT_VIEWS(func) wx__DECLARE_EVT0( wxEVT_REPORT_VIEWS, a2dDocumentEventHandler( func ))
985 #define EVT_CHANGEDFILENAME_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_CHANGEDFILENAME_DOCUMENT, a2dDocumentEventHandler( func ))
987 #define EVT_CHANGEDTITLE_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_CHANGEDTITLE_DOCUMENT, a2dDocumentEventHandler( func ))
989 #define EVT_CHANGEDMODIFY_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_CHANGEDMODIFY_DOCUMENT, a2dDocumentEventHandler( func ))
991 #define EVT_POST_LOAD_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_POST_LOAD_DOCUMENT, a2dDocumentEventHandler( func ))
993 #define EVT_CLOSE_VIEW(func) wx__DECLARE_EVT0( wxEVT_CLOSE_VIEW, a2dViewCloseEventHandler( func))
995 #define EVT_CREATE_VIEW(func) wx__DECLARE_EVT0( wxEVT_CREATE_VIEW, a2dViewEventHandler( func ))
997 #define EVT_SET_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_SET_DOCUMENT, a2dViewEventHandler( func ))
999 #define EVT_ACTIVATE_VIEW(func) wx__DECLARE_EVT0( wxEVT_ACTIVATE_VIEW, a2dViewEventHandler( func ))
1001 #define EVT_ACTIVATE_VIEW_SENT_FROM_CHILD(func) wx__DECLARE_EVT0( wxEVT_ACTIVATE_VIEW_SENT_FROM_CHILD, a2dViewEventHandler( func ))
1003 #define EVT_ENABLE_VIEW(func) wx__DECLARE_EVT0( wxEVT_ENABLE_VIEW, a2dViewEventHandler( func ))
1005 #define EVT_ADD_VIEW(func) wx__DECLARE_EVT0( wxEVT_ADD_VIEW, a2dDocumentEventHandler( func ))
1007 #define EVT_REMOVE_VIEW(func) wx__DECLARE_EVT0( wxEVT_REMOVE_VIEW, a2dDocumentEventHandler( func ))
1009 #define EVT_PRE_ADD_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_PRE_ADD_DOCUMENT, a2dTemplateEventHandler( func ))
1011 #define EVT_POST_CREATE_DOCUMENT(func) wx__DECLARE_EVT0( wxEVT_POST_CREATE_DOCUMENT, a2dTemplateEventHandler( func ))
1013 #define EVT_POST_CREATE_VIEW(func) wx__DECLARE_EVT0( wxEVT_POST_CREATE_VIEW, a2dTemplateEventHandler( func ))
1015 #define EVT_DISCONNECT_VIEW(func) wx__DECLARE_EVT0( wxEVT_DISCONNECT_VIEW, a2dTemplateEventHandler( func ))
1017 #define EVT_CHANGEDFILENAME_VIEW(func) wx__DECLARE_EVT0( wxEVT_CHANGEDFILENAME_VIEW, a2dViewEventHandler( func ))
1019 #define EVT_CHANGEDTITLE_VIEW(func) wx__DECLARE_EVT0( wxEVT_CHANGEDTITLE_VIEW, a2dViewEventHandler( func ))
1070 DECLARE_EVENT_TABLE()
1100 void SetFilename(
const wxFileName& filename,
bool notifyViews =
false );
1115 void SetTitle(
const wxString& title,
bool notifyViews =
false );
1165 bool Close(
bool force );
1212 virtual bool Revert();
1250 #if wxART2D_USE_CVGIO
1271 #endif //wxART2D_USE_CVGIO
1282 virtual int SaveModifiedDialog(
bool canCancel =
true );
1291 virtual void CreateCommandProcessor();
1310 virtual void DeleteContents();
1318 virtual bool Draw( wxDC& context );
1330 void Modify(
bool mod );
1369 void EnableAllViews(
bool enable,
a2dView* sender = (
a2dView* ) NULL );
1386 void DisConnectAllViews();
1395 wxString GetPrintableName()
const;
1398 virtual wxWindow* GetAssociatedWindow()
const;
1667 virtual bool SmrtPtrRelease();
1674 #if (defined(__WXMSW__) && defined(WXUSINGDLL) )
1806 DECLARE_ABSTRACT_CLASS(
a2dView )
1808 DECLARE_EVENT_TABLE()
1849 bool Enable(
bool enable );
1872 virtual void SetDisplayWindow( wxWindow* display );
1927 virtual void Update(
unsigned int hint = 0, wxObject* hintObject = NULL );
2025 virtual bool Close(
bool force =
false );
2042 virtual bool ProcessEvent( wxEvent& event );
2060 void Activate(
bool activate );
2091 virtual void OnDraw( wxDC* dc ) = 0;
2093 #if wxUSE_PRINTING_ARCHITECTURE
2108 virtual wxPrintout* OnCreatePrintout(
a2dPrintWhat typeOfPrint,
const wxPageSetupDialogData& pageSetupData );
2115 virtual void OnPrint( wxDC* dc, wxObject* info );
2213 void OnSetFocus( wxFocusEvent& event );
2219 void OnKillFocus( wxFocusEvent& event );
2258 virtual bool SmrtPtrRelease();
2340 const wxString& descr,
2341 const wxString& filter,
2342 const wxString& dir,
2343 const wxString& ext,
2344 const wxString& docTypeName,
2345 wxClassInfo* docClassInfo = ( wxClassInfo* ) NULL,
2460 virtual bool FileMatchesTemplate(
const wxString& path );
2487 #if wxUSE_PRINTING_ARCHITECTURE
2488 wxPageSetupDialogData* GetPageSetupData(
void )
const {
return m_pageSetupData; }
2489 void SetPageSetupData(
const wxPageSetupDialogData& pageSetupData ) { *m_pageSetupData = pageSetupData; }
2490 void SetPageSetupData( wxPageSetupDialogData* pageSetupData );
2493 wxClassInfo* GetDocumentClassInfo()
const {
return m_docClassInfo; }
2512 #if wxART2D_USE_CVGIO
2514 virtual void DoLoad( wxObject* parent,
a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
2515 #endif //wxART2D_USE_CVGIO
2550 #if wxUSE_PRINTING_ARCHITECTURE
2558 virtual bool SmrtPtrRelease();
2584 const wxString& descr,
2585 const wxString& filter,
2586 const wxString& dir,
2587 const wxString& ext,
2588 const wxString& docTypeName,
2589 wxClassInfo* docClassInfo = ( wxClassInfo* ) NULL,
2642 #if wxART2D_USE_CVGIO
2644 virtual void DoLoad( wxObject* parent,
a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
2645 #endif //wxART2D_USE_CVGIO
2680 const wxString& descr,
2681 const wxString& docTypeName,
2682 const wxString& viewTypeName,
2683 wxClassInfo* viewClassInfo = ( wxClassInfo* ) NULL,
2686 const wxSize& size = wxSize( 0, 0 ) );
2748 #if wxUSE_PRINTING_ARCHITECTURE
2749 wxPageSetupDialogData* GetPageSetupData(
void )
const {
return m_pageSetupData; }
2750 void SetPageSetupData(
const wxPageSetupDialogData& pageSetupData ) { *m_pageSetupData = pageSetupData; }
2751 void SetPageSetupData( wxPageSetupDialogData* pageSetupData );
2779 #if wxUSE_PRINTING_ARCHITECTURE
2787 virtual bool SmrtPtrRelease();
2861 DECLARE_EVENT_TABLE()
2906 void DisassociateViewTemplates();
2915 virtual a2dView* CreateView(
a2dDocument* doc,
const wxString& viewTypeName = wxT(
"" ),
2965 wxFAIL_MSG( wxT(
"cannot clone a2dIOHandler" ) );
3028 void Init( wxFrame* docframe,
bool createChildframe =
true );
3038 void SetFrame( wxFrame* docframe ) { m_docframe = docframe; }
3040 void SetCreateChild(
bool createChildframe ) { m_createChildframe = createChildframe; }
3042 bool GetCreateChild() {
return m_createChildframe; }
3053 bool m_createChildframe;
3070 template<
class Twindow>
3073 DECLARE_EVENT_TABLE()
3076 typedef Twindow TType;
3103 template<class Twindow>
3109 template<
class Twindow>
3118 m_display->SetView( view );
3155 template<
class Twindow>
3166 void Init( wxSplitterWindow* splitter, Twindow* connecto );
3168 wxSplitterWindow* GetSplitter() {
return m_splitter; }
3172 wxSplitterWindow* m_splitter;
3175 template<
class Twindow>
3178 m_splitter = ( wxSplitterWindow* ) NULL;
3181 template<
class Twindow>
3186 template<
class Twindow>
3189 m_splitter = splitter;
3190 wxASSERT_MSG( connecto == m_splitter->GetWindow1() || connecto == m_splitter->GetWindow2(), wxT(
"wxDrawingConnector::OnCloseView Not a valid window in splitter" ) );
3191 this->SetDisplayWindow( connecto );
3202 template <
class NoteBook,
class Twindow,
class Tview = a2dView >
3208 DECLARE_EVENT_TABLE()
3226 void Init( NoteBook* notebook );
3240 #define wxBEGIN_EVENT_TABLE_TEMPLATE3(theClass, baseClass, T1, T2, T3) \
3241 template<typename T1, typename T2, typename T3> \
3242 const wxEventTable theClass<T1, T2, T3>::sm_eventTable = \
3243 { &baseClass::sm_eventTable, &theClass<T1, T2, T3>::sm_eventTableEntries[0] }; \
3244 template<typename T1, typename T2, typename T3> \
3245 const wxEventTable *theClass<T1, T2, T3>::GetEventTable() const \
3246 { return &theClass<T1, T2, T3>::sm_eventTable; } \
3247 template<typename T1, typename T2, typename T3> \
3248 wxEventHashTable theClass<T1, T2, T3>::sm_eventHashTable(theClass<T1, T2, T3>::sm_eventTable); \
3249 template<typename T1, typename T2, typename T3> \
3250 wxEventHashTable &theClass<T1, T2, T3>::GetEventHashTable() const \
3251 { return theClass<T1, T2, T3>::sm_eventHashTable; } \
3252 template<typename T1, typename T2, typename T3> \
3253 const wxEventTableEntry theClass<T1, T2, T3>::sm_eventTableEntries[] = { \
3260 template<class NoteBook, class Twindow, class Tview>
3263 m_notebook = ( NoteBook* ) NULL;
3266 template<
class NoteBook,
class Twindow,
class Tview>
3271 template<
class NoteBook,
class Twindow,
class Tview>
3274 m_notebook = notebook;
3277 template<
class NoteBook,
class Twindow,
class Tview>
3284 template<
class NoteBook,
class Twindow,
class Tview>
3290 Twindow* outputwindow;
3291 outputwindow =
new Twindow( view, m_notebook, -1, wxDefaultPosition, wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE );
3292 m_notebook->AddPage( outputwindow, view->GetDocument()->GetPrintableName(), true );
3294 outputwindow->SetCursor( wxCURSOR_PENCIL );
3295 outputwindow->SetScrollbars( 20, 20, 50, 50 );
3296 outputwindow->SetBackgroundColour( wxColour( 0, 235, 235 ) );
3297 outputwindow->ClearBackground();
3306 #if wxUSE_PRINTING_ARCHITECTURE
3317 bool OnPrintPage(
int page );
3318 bool HasPage(
int page );
3319 bool OnBeginDocument(
int startPage,
int endPage );
3320 void GetPageInfo(
int* minPage,
int* maxPage,
int* selPageFrom,
int* selPageTo );
3322 virtual a2dView* GetView() {
return m_printoutView; }
3327 #endif // wxUSE_PRINTING_ARCHITECTURE
3384 const wxString& title = wxT(
"a2dDocumentFrame" ),
3385 const wxPoint& pos = wxDefaultPosition,
3386 const wxSize& size = wxDefaultSize,
3387 long style = wxDEFAULT_FRAME_STYLE,
3388 const wxString& name = wxT(
"frame" ) );
3395 const wxString& title = wxT(
"a2dDocumentFrame" ),
3396 const wxPoint& pos = wxDefaultPosition,
3397 const wxSize& size = wxDefaultSize,
3398 long style = wxDEFAULT_FRAME_STYLE,
3399 const wxString& name = wxT(
"frame" ) );
3420 const wxString& title = wxT(
"a2dDocumentFrame" ),
3421 const wxPoint& pos = wxDefaultPosition,
3422 const wxSize& size = wxDefaultSize,
3423 long style = wxDEFAULT_FRAME_STYLE,
3424 const wxString& name = wxT(
"frame" ) );
3429 void SetDestroyOnCloseView(
bool destroyOnCloseView ) { m_destroyOnCloseView = destroyOnCloseView; }
3440 void SetView(
a2dView* view );
3462 bool ProcessEvent( wxEvent& event );
3464 bool ProcessConnectedEvent( wxEvent& event );
3465 void ConnectEvent( wxEventType type, wxEvtHandler* evtObject );
3466 bool DisconnectEvent( wxEventType type, wxEvtHandler* evtObject );
3468 bool GetIsParentFrame() {
return m_isParentFrame; }
3470 void SetIsParentFrame(
bool parentFrame ) { m_isParentFrame = parentFrame; }
3481 virtual void OnDraw( wxDC& dc );
3523 void AddCmdMenu( wxMenu* parentMenu,
const a2dMenuIdItem& cmdId );
3527 void AddCmdMenu( wxMenu* parentMenu, wxMenuItem* item );
3533 void RemoveCmdMenu( wxMenu* parentMenu,
const a2dMenuIdItem& cmdId );
3537 void OnExecuteCommand( wxCommandEvent& event );
3541 void OnCmdMenuId( wxCommandEvent& event );
3547 void OnPaint( wxPaintEvent& event );
3575 void OnCloseWindow( wxCloseEvent& event );
3578 void OnExit( wxCommandEvent& event );
3581 void OnMRUFile( wxCommandEvent& event );
3590 void OnActivateViewSentFromChild(
a2dViewEvent& viewevent );
3602 DECLARE_EVENT_TABLE()
3629 template<
class Twindow>
3649 const wxPoint& pos = wxDefaultPosition,
3650 const wxSize& size = wxDefaultSize,
3651 long style = wxHSCROLL | wxVSCROLL,
3652 const wxString& name = wxT(
"a2dViewWindow" ) );
3666 const wxPoint& pos = wxDefaultPosition,
3667 const wxSize& size = wxDefaultSize,
3668 long style = wxHSCROLL | wxVSCROLL,
3669 const wxString& name = wxT(
"a2dViewWindow" ) );
3680 virtual void SetView(
a2dView* view );
3698 virtual bool ProcessEvent( wxEvent& event );
3701 virtual void OnDraw( wxDC& dc );
3707 void OnPaint( wxPaintEvent& event );
3719 template<
class Twindow>
3721 Twindow( parent, id, pos, size, style, name )
3723 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
3737 template<
class Twindow>
3739 Twindow( parent, id, pos, size, style, name )
3741 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
3748 template<
class Twindow>
3753 m_view->SetDisplayWindow( NULL );
3758 template<
class Twindow>
3763 m_view->SetDisplayWindow( NULL );
3772 m_view->Activate(
true );
3776 template<
class Twindow>
3779 wxPaintDC dc(
this );
3780 Twindow::PrepareDC( dc );
3786 template<
class Twindow>
3790 m_view->OnDraw( & dc );
3793 template<
class Twindow>
3796 wxASSERT_MSG( m_view == event.GetEventObject(), wxT(
"view in a2dCloseViewEvent not equal to m_view" ) );
3810 template<
class Twindow>
3818 if ( event.GetEventType() == wxEVT_ACTIVATE_VIEW_SENT_FROM_CHILD )
3820 return wxEvtHandler::ProcessEvent( event );
3825 if ( m_view && !m_view->IsClosed() &&
3826 m_view->ProcessEvent( event ) )
3829 return wxEvtHandler::ProcessEvent( event );
3858 DECLARE_EVENT_TABLE()
3875 const wxPoint& pos = wxDefaultPosition,
3876 const wxSize& size = wxDefaultSize,
3877 long style = wxHSCROLL | wxVSCROLL,
3878 const wxString& name = wxT(
"a2dDocumentViewScrolledWindow" ) );
3892 const wxPoint& pos = wxDefaultPosition,
3893 const wxSize& size = wxDefaultSize,
3894 long style = wxHSCROLL | wxVSCROLL,
3895 const wxString& name = wxT(
"a2dDocumentViewScrolledWindow" ) );
3929 DECLARE_EVENT_TABLE()
3946 const wxPoint& pos = wxDefaultPosition,
3947 const wxSize& size = wxDefaultSize,
3948 long style = wxHSCROLL | wxVSCROLL,
3949 const wxString& name = wxT(
"a2dDocumentViewWindow" ) );
3964 const wxPoint& pos = wxDefaultPosition,
3965 const wxSize& size = wxDefaultSize,
3966 long style = wxHSCROLL | wxVSCROLL,
3967 const wxString& name = wxT(
"a2dDocumentViewWindow" ) );
Automatic template, which searches a suitable handler for the document.
a2dSmrtPtr< a2dCommandProcessor > m_commandProcessor
A pointer to the command processor associated with this document.
void Allow()
allow the operation if it was disabled by default
virtual void SetDocumentIOHandlerStrIn(a2dIOHandlerStrIn *handler)
Set Inputhandler used to load the document using this template.
const a2dTemplateFlag & GetFlags() const
Returns the flags, as passed to the document template constructor.
a2dError m_lastError
error code used when LoadObject is returning.
wxString GetDocumentTypeName() const
Returns the document type name, as passed to the document template constructor.
#define wxDynamicCast(obj, className)
Define wxDynamicCast so that it will give a compiler error for unrelated types.
a2dDocument * m_documentParent
parant document if set.
a2dViewTemplateList::iterator a2dViewTemplateListIter
iterator for list of ...
a2dCloseDocumentEvent(const a2dCloseDocumentEvent &event)
constructor
bool IsModified() const
Has the document been modified.
void Init(NoteBook *notebook)
initialize with/to this notebook
a2dViewEvent(const a2dViewEvent &event)
constructor
static const a2dTemplateFlagMask LOAD_IMPORT
wxString m_documentTypeName
The document type name given to the a2dDocumentTemplate constructor,.
a2dCloseViewEvent(int id=0)
Constructor for view event of type ::wxEVT_CLOSE_VIEW.
class to map references to objects stored in XML, in order to make the connection later on...
extend a2dViewConnector to have a a2dDocumentViewScrolledWindow for each view.
a2dSmrtPtrList< a2dDocumentTemplate > a2dDocumentTemplateList
list of document templates
wxClassInfo * m_viewClassInfo
For dynamic creation of appropriate instances.
NoteBook * m_notebook
the notebook to hook views into.
a2dTemplateEvent(const a2dTemplateEvent &event)
constructor
virtual wxEvent * Clone() const
clone the event
The a2dViewTemplate class is used to model the relationship between a document class and a view class...
a2dSmrtPtr< a2dView > a2dViewPtr
view smart pointer
a2dView * GetView()
Gives the a2dView in case of event types concerning a view.
a2dSmrtPtrList< a2dDocument > a2dDocumentList
list of documents
wxString GetDocumentTypeName() const
Gets the document type name of this document. See the comment for documentTypeName.
void SetDirectory(const wxString &dir)
Sets the default directory.
a2dDocumentEvent(wxEventType type, a2dView *view=NULL, bool enable=true, int id=0)
for event types
void SetFlags(a2dTemplateFlag flags)
Sets the internal document template flags (see the constructor description for more details)...
static const a2dTemplateFlagMask SAVE
wxString GetDirectory() const
Returns the default directory, as passed to the document template constructor.
const a2dPrintWhat a2dPRINT_Preview
general print preview
bool m_isClosed
set true when document is closed or when busy closing document.
a2dDocumentTemplate * GetDocumentTemplate() const
Gets a2dDocumentTemplate pointer which was used to create the a2dView.
wxNotebook * GetNotebook()
return pointer to notebook type used
wxPageSetupDialogData * m_pageSetupData
this is the printer page setup data for all views with this template
a2dDocumentFlag
Document manager flags.
virtual void SetDisplayWindow(wxWindow *display)
Set the display window.
static const a2dTemplateFlagMask DEFAULT
const a2dError a2dError_NoError
a2dDocumentEvent(const a2dDocumentEvent &event)
constructor
wxWindow * GetDisplayWindow()
Get the display window.
wxString m_directory
The default directory for files of this type.
wxOutputStream a2dDocumentOutputStream
output stream based wxStreams
bool IsMarked() const
Returns true if the document template is marked , false otherwise.
bool GetEnabled()
return true if the view is enabled. See Enable()
void SetError(a2dError error)
in case of errors when sending an event, this can be set to tell the reason of failure ...
The a2dDocumentTemplate class is used to model the relationship between a document class and files...
static const a2dTemplateFlagMask SAVE_EXPORT
a2dCommandProcessor * GetCommandProcessor() const
Returns a pointer to the command processor associated with this document.
void SetDefaultExtension(const wxString &ext)
Sets the default file extension.
Input and output handler for the XmlSer format.
wxString GetDescription() const
Returns the text description of this template, as passed to the document template constructor...
void OnPostCreateView(a2dTemplateEvent &event)
what to do after view creation
a2dDocumentPtr m_documentCreate
if set this will be used instead of m_docClassInfo to initiate new documents
bool GetEnable()
when ::wxEVT_ENABLE_VIEW get enable value of the event
a2dSmrtPtr< a2dView > m_view
the view that uses this window to display itself
A trivial base class for a2dSmrtPtr. Non-template class, so that it can.
a2dView * GetView()
Get the view created.
using a file stream for input, stream the file into a a2dDocument or other object ...
wxSize m_initialSize
size for new view
a2dSmrtPtr< a2dIOHandlerStrOut > m_ioHandlerStrOut
used for writing the document to streams.
a2dSmrtPtr< a2dViewTemplate > a2dViewTemplatePtr
a2dViewTemplate smart pointer
bool CheckMask(a2dTemplateFlagMask mask)
does template mask match
unsigned int a2dTemplateFlagMask
mask of flags for a2dTemplateFlag
a2dView event, to report events in the a2dView class
void SetFlags(a2dTemplateFlagMask flags)
Sets the internal document template flags (see the constructor description for more details)...
bool m_askSaveWhenOwned
Set when Owners become zero and document will be deleted. May also be overruled by user...
This class is used to connect newly created a2dView's to a wxFrame and/or wxWindow.
wxPoint & GetInitialPosition()
Get position used for new created views or frames or windows.
specialized wxWindow to handle a2dView events
void SetMarked(bool value)
Returns true if the document template is marked , false otherwise.
a2dSmrtPtr< a2dView > m_keepalive
const a2dTemplateFlag & GetFlags() const
Returns the flags, as passed to the document template constructor.
void Allow()
allow the operation if it was disabled by default
a2dSmrtPtr< a2dDocument > m_viewDocument
the document to which this view belongs.
bool GetActive()
when ::wxEVT_ACTIVATE_VIEW get activation value of the event
bool m_viewEnabled
Is the view enabled?
void AskSaveWhenOwned(bool askSaveWhenOwned)
Ask to save when document is modified and last view is closed?
void SetDescription(const wxString &descr)
Sets the template description.
a2dSmrtPtrList< a2dViewTemplate > a2dViewTemplateList
list of view templates
a2dCloseViewEvent(const a2dCloseViewEvent &event)
constructor
a2dWindowConnector< a2dDocumentViewWindow > a2dWindowConnectorFora2dDocumentViewWindow
lua wrap
virtual void Update(unsigned int hint=0, wxObject *hintObject=NULL)
force a2dDocumentEvent ::wxEVT_UPDATE_VIEWS event
~wxNotebookConnector()
destructor
a2dDocumentEvent(wxEventType type, a2dDocumentTemplate *doctemplate, const wxFileName &filename=wxFileName(wxT("")), a2dDocumentFlagMask flags=a2dREFDOC_NON, int id=0)
for event types
bool IsClosed()
A closed flag is set when a view is closed.
void SetCanVeto(bool canVeto)
If the event can not be vetod this is set to false.
a2dSmrtPtr< a2dViewConnector > m_connector
class used to connect new views with Frames and windows.
Holds a view on a a2dDocument.
XML I/O classes which is Pull parser based for reading XML files.
bool IsVisible() const
Returns true if the document template can be shown in user dialogs, false otherwise.
wxString m_docTypeName
The named type of the document associated with this template.
event sent to a2dViewConnector
a2dView * GetView()
get the pointer to a a2dView to which view events are sent
a2dViewEvent(wxEventType type, a2dDocumentFlagMask flags, int id)
for event types
void SetInitialPosition(const wxPoint &position)
set position to use for new created views or frames or windows
wxDateTime m_modificationtime
last modification time when this document was stored.
a2dDocument * GetDocument()
the document created.
The document class can be used to model an application's file-based data.
bool IsDocumentSaved() const
Alias for a2dDocument::GetDocumentSaved.
a2dDocumentEvent(wxEventType type, const wxFileName &filename, a2dDocumentFlagMask flags=a2dREFDOC_NON, int id=0)
for event types
static const a2dTemplateFlagMask NON
wxSize m_initialSize
size for new frames
void SetDocumentTemplate(a2dDocumentTemplate *temp)
Set a2dDocumentTemplate pointer.
void SetDescription(const wxString &descr)
Sets the template description.
wxString m_documentTitle
Document title.
virtual wxEvent * Clone() const
clone the event.
void Veto()
veto the operation (usually it's allowed by default)
wxUint16 a2dPrintWhat
defines what to print
Twindow * GetDisplayWindow()
window used by view to display itself.
const a2dPrintWhat a2dPRINT_PreviewDocument
preview print a2dDocument
long m_documentModified
modified flag
a2dSmrtPtr< a2dDocumentTemplate > a2dDocumentTemplatePtr
a2dDocumentTemplate smart pointer
bool IsAllowed() const
for implementation code only: is the operation allowed?
void Veto()
veto the operation (usually it's allowed by default)
The a2dDocumentFrame class provides a default frame for displaying documents.
bool m_isClosed
close flag, to indicate that the view is being closed are is closed.
void SetModificationTime(const wxDateTime &datatime)
Sets a time of last modification.
virtual wxEvent * Clone() const
clone the event
a2dError GetError()
in case of errors when sending an event, this is to know the reason of failure
#define EVT_POST_CREATE_VIEW(func)
sent from a view template after it created a view
virtual void OnDraw(wxDC &dc)
Override this function to draw the graphic (or just process EVT_PAINT)
virtual void SetDocumentIOHandlerStrOut(a2dIOHandlerStrOut *handler)
Set output handler used to save the document using this template.
a connector which holds one pointer to a wxWindow derived class being the template parameter...
wxString GetFileFilter() const
Returns the file filter, as passed to the document template constructor.
a2dSplitterConnector()
Constructor.
#define EVT_POST_CREATE_DOCUMENT(func)
sent from a doc template after it created a document
void Veto(bool veto=true)
use to veto event when the closing of the view needs to be refused in a handler.
wxUint32 m_id
This identifies the view in event processing.
a2dSmrtPtr< a2dViewConnector > m_connector
class used to connect new views with Frames and windows.
void SetCommandProcessor(a2dCommandProcessor *proc)
Sets the command processor to be used for this document.
static const a2dTemplateFlagMask EXPORTING
Input and output handler for the XmlSer format.
bool GetVeto() const
If the event can be vetod this return true.
a2dDocumentList::iterator a2dDocumentListIter
iterator for list of ...
a2dDocumentFlagMask GetFlags()
for following event types, get document flags of the event.
wxClassInfo * m_docClassInfo
Run-time class information that allows document instances to be constructed dynamically.
void SetVisible(bool value)
Returns true if the document template can be shown in user dialogs, false otherwise.
void SetInitialStyle(long style)
set style to use for new created frames or windows
bool IsAllowed() const
for implementation code only, testing result of handler: is the operation allowed?
void SetOnlyDisconnect(bool OnlyDisconnect)
uses a wxFrame to hold new views or to create child wxFrame's to hold new views.
void SetFlags(a2dTemplateFlag flags)
Sets the internal document template flags (see the constructor description for more details)...
virtual wxEvent * Clone() const
clone the event
void SetFileName(const wxFileName &filename)
set filename of file to open, before sending the event.
bool CheckMask(a2dTemplateFlagMask mask)
does template mask match
wxFrame * m_docframe
the frame which receives events and often redirect those to the document manager. ...
void SetMarked(bool value)
Returns true if the document template is marked , false otherwise.
static const a2dTemplateFlagMask IMPORTING
a2dViewUpdateFlags
mask flags for a2dDocument::UpdateAllViews()
wxDateTime & GetModificationTime()
Returns the time of last modification when the document was saved.
virtual void SetView(a2dView *view)
to switch the view in this window to another view
const a2dPrintWhat a2dPRINT_Print
general print
a2dDocumentTemplate * GetDocumentTemplate()
Get the template choosen to import / export.
~a2dViewWindow()
Destructor.
wxFileName GetFilename() const
Get the file name in use for this document.
a2dDocumentTemplateList::iterator a2dDocumentTemplateListIter
iterator for list of ...
wxString m_description
A short description of this template.
wxString GetViewTypeName() const
Returns the view type name, as passed to the document template constructor.
a2dViewTemplatePtr m_viewTemplate
view was created from this view template or if not used NULL
using a file stream for output, stream a a2dDocument or other wxObject into a stream.
a2dViewConnector * GetViewConnector()
return the a2dViewConnector that is used for sending the ::wxEVT_POST_CREATE_DOCUMENT too...
long m_initialStyle
style for new frames
a2dDocumentFlagMask GetFlags()
gives the a2dDocumentFlagMask in case of event types concerning a document.
bool m_savedYet
saved flag
bool GetDocumentSaved() const
Returns if the document was saved after a modification.
virtual ~a2dFrameViewConnector()
destructor
a2dDocumentFlagMask GetFlags()
the document flags as set by a2dDocumentTemplate::CreateDocument()
void SetDisplayWindow(Twindow *window)
get window used by view to display itself.
void OnPostCreateDocument(a2dTemplateEvent &event)
what to do after document creation
void SetDocumentCreate(a2dDocument *documentCreate)
if set this will be used instead of m_docClassInfo to initiate new documents
a2dViewTemplate * GetViewTemplate() const
get the a2dViewTemplate with which this view was created
void SetLastError(a2dError lastError)
can be set by a2dIOHandler's by e.g LoadObject().
bool IsMarked() const
Returns true if the document template is marked , false otherwise.
a2dViewList::iterator a2dViewListIter
iterator for list of ...
void OnCloseView(a2dCloseViewEvent &event)
resets view to NULL when view was closed and skips the event for the parent window/frame.
wxInputStream a2dDocumentInputStream
input stream based wxStreams
wxString m_description
A short description of this template.
static const a2dTemplateFlagMask MARK
wxPoint m_initialPos
position for new frames
void SetInitialSize(const wxSize &size)
set size to use for new created views
a2dDocument * GetDocument() const
get the document of the view
general modules header files all together.
virtual a2dIOHandlerStrOut * GetDocumentIOHandlerStrOut()
Get output handler used to save the document using this template.
virtual bool ProcessEvent(wxEvent &event)
Extend event processing to search the view's event table.
wxFileName m_documentFile
Filename associated with this document ("" if none).
void SetFileFilter(const wxString &filter)
Sets the file filter.
long GetInitialStyle()
Get style used for new created a2dDocumentFrame.
wxUint32 GetId()
Get the id of the view (used for identification in event processing.
wxPageSetupDialogData * m_pageSetupData
this is the printer page setup data for all documents with this template
bool m_isParentFrame
is this the docframe or not.
a2dTemplateFlag m_flags
The flags passed to the constructor.
a2dTemplateEvent(a2dDocument *doc, wxEventType type, a2dDocumentFlagMask flags=a2dREFDOC_NON, int id=0)
constructor
wxFileName & GetFileName()
get filename of file to open
a2dViewTemplateList m_viewTemplates
templates for views
wxString m_docTypeName
The named type of the document associated with this template.
void SetViewTypeName(const wxString &name)
set type name of the view.
void SetInitialSize(const wxSize &size)
set size to use for new created views or frames or windows
bool IsVisible() const
Returns true if the document template can be shown in user dialogs, false otherwise.
sent to document before closing
a2dWindowConnector< a2dDocumentViewScrolledWindow > a2dWindowConnectorFora2dDocumentViewScrolledWindow
lua wrap
a2dViewEvent(wxEventType type, bool value, int id)
for event types
const a2dPrintWhat a2dPRINT_PrintDocument
print a2dDocument
bool IsClosed()
returns true when document is closed or busy closing.
bool GetActive()
return if the view is active/
a2dCloseDocumentEvent(int id=0)
constructor
void SetFlags(a2dTemplateFlagMask flags)
Sets the internal document template flags (see the constructor description for more details)...
wxString m_defaultExt
The default extension for files of this type.
wxUint32 m_id
This identifies the document in event processing.
void SetFrame(wxFrame *docframe)
set the frame
void SetDocumentSaved(bool saved=true)
Sets the document saved flag.
wxSize & GetInitialSize()
Get size used for new created views.
extend a2dWindowConnector to connect views into a wxNotebook window
bool m_active
true if this view is activated ( its display window has the focus and recieves mouse events ) ...
a2dSmrtPtrList< a2dView > a2dViewList
list of views
used to report a2dDocument events
static const a2dTemplateFlagMask LOAD
void SetTitle(const wxString &title, bool notifyViews=false)
Sets the title for this document.
wxString m_fileFilter
The file filter (such as *.txt) to be used in file selector dialogs.
wxSize & GetInitialSize()
GGet size used for new created views or frames or windows.
bool GetOnlyDisconnect()
When true, a2dView::OnDisConnectView() only disconnects view from document, and does not close it...
void SetVisible(bool value)
Returns true if the document template can be shown in user dialogs, false otherwise.
wxString m_viewTypeName
The named type of the view associated with this template.
a2dDocument * GetDocumentCreate()
if set this will be used instead of m_docClassInfo to initiate new documents
a2dError GetLastError()
is set by a2dIOHandler's and is tested by LoadObject().
wxString GetDocumentTypeName() const
Returns the document type name, as passed to the document template constructor.
void SetDocumentTypeName(const wxString &name)
Sets the document type name for this document. See the comment for documentTypeName.
void OnPaint(wxPaintEvent &event)
calls OnDraw(dc);
const a2dPrintWhat a2dPRINT_PreviewView
preview print a2dView
a2dViewWindow(a2dView *view, wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxHSCROLL|wxVSCROLL, const wxString &name=wxT("a2dViewWindow"))
Constructor for creation with view.
a2dTemplateFlag m_flags
The flags passed to the constructor.
a2dSmrtPtr< a2dIOHandlerStrIn > m_ioHandlerStrIn
used for reading the document from streams.
static const a2dTemplateFlagMask VISIBLE
specialized wxWindow derived template class to handle a2dView events
wxString GetDescription() const
Returns the text description of this template, as passed to the document template constructor...
const a2dPrintWhat a2dPRINT_PrintView
print a2dView
wxWindow * m_display
In case of using a window for displaying the view, this holds the window.
wxString GetDefaultExtension() const
Returns the default file extension for the document data, as passed to the document template construc...
extend wxSameFrameViewConnector to connect view into a splitter window
a2dView * GetView()
get the current view
bool m_destroyOnCloseView
when closing the view the frame will be destroyed.
virtual a2dIOHandlerStrIn * GetDocumentIOHandlerStrIn()
Get Input handler used to store the document using this template.
wxString m_viewTypeName
set via the a2dViewTemplate on generation of this view.
wxString GetTitle() const
Returns the title for this document.
a2dDocumentTemplatePtr m_documentTemplate
A pointer to the template from which this document was created.
CloneOptions
options for cloning
a2dSmrtPtr< a2dView > m_view
a2dSmrtPtr< a2dDocument > a2dDocumentPtr
document smart pointer
void SetView(a2dView *view)
Set the view created.
bool CanVeto() const
If the event can be vetod this is set.
static const a2dTemplateFlagMask ALL
bool GetEnable()
when ::wxEVT_ENABLE_VIEWS get enable value of the event
a2dTemplateEvent(wxEventType type, a2dView *view, a2dDocumentFlagMask flags=a2dREFDOC_NON, int id=0)
constructor
bool m_OnlyDisconnect
see SetOnlyDisconnect()
wxFrame * GetFrame()
get the frame
void SetViewTemplate(a2dViewTemplate *viewtemplate)
to set the view template from which this view was created.
unsigned int a2dDocumentFlagMask
mask of flags for a2dDocumentFlag
wxString GetViewTypeName() const
get type name of the view.