#include <docviewref.h>


Public Member Functions | |
| a2dDocumentFrame () | |
| Constructor for two step creation, call a2dDocumentFrame::Create later. | |
| a2dDocumentFrame (bool parentFrame, wxWindow *frame, a2dView *view=NULL, wxWindowID id=-1, const wxString &title=wxT("a2dDocumentFrame"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxT("frame")) | |
| constructor | |
| a2dDocumentFrame (wxWindow *frame, wxWindowID id=-1, const wxString &title=wxT("a2dDocumentFrame"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxT("frame")) | |
| wxFrame compatible constructor | |
| bool | Create (bool parentFrame, wxWindow *frame, a2dView *view=NULL, wxWindowID id=-1, const wxString &title=wxT("a2dDocumentFrame"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxT("frame")) |
| Constructor for two-step-creation (2nd step). | |
| ~a2dDocumentFrame () | |
| destructor | |
| void | SetDestroyOnCloseView (bool destroyOnCloseView) |
| void | SetView (a2dView *view) |
| set a pointer to a a2dView to sent view events to. | |
| a2dView * | GetView () |
| get the pointer to a a2dView to which view events are sent | |
| bool | ProcessEvent (wxEvent &event) |
| Modified event handler to also sent event to a2dView or wxDocviewCommonEvents. | |
| bool | GetIsParentFrame () |
| void | SetIsParentFrame (bool parentFrame) |
| virtual void | OnDraw (wxDC &dc) |
| Override this function to draw the graphic (or just process EVT_PAINT). | |
| void | AddCmdToToolbar (const a2dMenuIdItem &cmdId) |
| add items to toolbar using a predefined command ID. | |
| void | ConnectCmdId (const a2dMenuIdItem &cmdId) |
| void | AddCmdMenu (wxMenu *parentMenu, const a2dMenuIdItem &cmdId) |
| add a command menu to the parent menu, and connect it to the eventhandler of the frame | |
| void | AddCmdMenu (wxMenu *parentMenu, wxMenuItem *item) |
| void | RemoveCmdMenu (wxMenu *parentMenu, const a2dMenuIdItem &cmdId) |
| remove a command menu from the parent menu. | |
| void | OnExecuteCommand (wxCommandEvent &event) |
Protected Member Functions | |
| void | OnCmdMenuId (wxCommandEvent &event) |
| void | OnPaint (wxPaintEvent &event) |
| default handler for paint events, it calls OnDraw(). | |
| void | OnCloseView (a2dCloseViewEvent &event) |
| default for closing a view in this frame | |
| void | OnCloseWindow (wxCloseEvent &event) |
| default for closing this frame via close button. | |
| void | OnExit (wxCommandEvent &event) |
| called by API and only handled if this is the Parent Frame | |
| void | OnMRUFile (wxCommandEvent &event) |
| called by API and only handled if this is the Parent Frame | |
| void | OnChangeFilename (a2dViewEvent &event) |
| default handler for file changed event sent from a2dView | |
| void | OnActivateViewSentFromChild (a2dViewEvent &viewevent) |
| sets m_view to the current active view, generate by a2dView::Activate() | |
Protected Attributes | |
| a2dSmrtPtr< a2dView > | m_view |
| bool | m_isParentFrame |
| is this the docframe or not. | |
| bool | m_destroyOnCloseView |
| when closing the view the frame will be destroyed. | |
Can be parent or child frame.
In case of a wxEVT_CLOSE_WINDOW event, it is first redirected to the frame, and if not vetod askes the view to close. In a multi frame application the View should Destroy its windows/frame, including this one. The View may Veto the Close.
The view which belongs to this frame is either set directly when constructing, or it is set automatically by the view when a2dView::Activate() is sending the wxEVT_ACTIVATE_VIEW_SENT_FROM_CHILD event. Imagine that this frame would have 4 windows, each having a view on a 3D object. When clicking on one of those view, that views, its window will be activated, resulting in its view being activated, and that sents the wanted event. The frame will always know which view is active, and e.g. closing one view/window is via this chain.
If this frame is the parent all other child frames will close also, else only the child frame.
Definition at line 3510 of file docviewref.h.
| a2dDocumentFrame::a2dDocumentFrame | ( | bool | parentFrame, | |
| wxWindow * | frame, | |||
| a2dView * | view = NULL, |
|||
| wxWindowID | id = -1, |
|||
| const wxString & | title = wxT("a2dDocumentFrame"), |
|||
| const wxPoint & | pos = wxDefaultPosition, |
|||
| const wxSize & | size = wxDefaultSize, |
|||
| long | style = wxDEFAULT_FRAME_STYLE, |
|||
| const wxString & | name = wxT("frame") | |||
| ) |
constructor
| parentFrame | set true if this is to be the parent frame in the application. | |
| frame | the parent frame for this frame. If topwindow use NULL. | |
| view | The view for the document ( can be NULL ) | |
| id | The window identifier. It may take a value of -1 to indicate a default value. | |
| title | The caption to be displayed on the frame's title bar. | |
| pos | The window position. | |
| size | The window size. | |
| style | Window style, please look into wxWindows docs for an overview. | |
| name | The name of the window. |
Definition at line 2632 of file docviewref.cpp.
| bool a2dDocumentFrame::Create | ( | bool | parentFrame, | |
| wxWindow * | frame, | |||
| a2dView * | view = NULL, |
|||
| wxWindowID | id = -1, |
|||
| const wxString & | title = wxT("a2dDocumentFrame"), |
|||
| const wxPoint & | pos = wxDefaultPosition, |
|||
| const wxSize & | size = wxDefaultSize, |
|||
| long | style = wxDEFAULT_FRAME_STYLE, |
|||
| const wxString & | name = wxT("frame") | |||
| ) |
Constructor for two-step-creation (2nd step).
| parentFrame | set true if this is to be the parent frame in the application. | |
| frame | the parent frame for this frame. If topwindow use NULL. | |
| view | The view for the document ( can be NULL ) | |
| id | The window identifier. It may take a value of -1 to indicate a default value. | |
| title | The caption to be displayed on the frame's title bar. | |
| pos | The window position. | |
| size | The window size. | |
| style | Window style, please look into wxWindows docs for an overview. | |
| name | The name of the window. |
Definition at line 2671 of file docviewref.cpp.
| void a2dDocumentFrame::SetView | ( | a2dView * | view | ) |
set a pointer to a a2dView to sent view events to.
Normally set via OnActivateViewSentFromChild()
The m_view is used to redirect the frame event for closing the window, and the activate event for the frame, to the view. Only if the m_view->GetDisplayWindow() is the a2dDocumentFrame itself, it will also be used for drawing the view ( See OnDraw() )
Definition at line 2698 of file docviewref.cpp.
| bool a2dDocumentFrame::ProcessEvent | ( | wxEvent & | event | ) |
Modified event handler to also sent event to a2dView or wxDocviewCommonEvents.
Events handled how:
Definition at line 2741 of file docviewref.cpp.
| void a2dDocumentFrame::OnDraw | ( | wxDC & | dc | ) | [virtual] |
Override this function to draw the graphic (or just process EVT_PAINT).
The default handler for EVT_PAINT is OnPaint, and it calls OnDraw(). OnDraw its default implementation is calling the m_view its OnDraw().
If m_view its DisplayWindow, is the frame itself, the m_view->OnDraw() is called. If not the m_view, is only used for redirecting Close and activate events to the view which has the focus.
Definition at line 2936 of file docviewref.cpp.
| void a2dDocumentFrame::AddCmdMenu | ( | wxMenu * | parentMenu, | |
| const a2dMenuIdItem & | cmdId | |||
| ) |
add a command menu to the parent menu, and connect it to the eventhandler of the frame
Many commands which can be submitted to a commandprocessor in the following manner:
commandprocessor->Submit( new a2dCommand_SomeCommand() )
void a2dDocumentCommandProcessor::OnMenu( wxCommandEvent& event )
Definition at line 2979 of file docviewref.cpp.
| void a2dDocumentFrame::AddCmdMenu | ( | wxMenu * | parentMenu, | |
| wxMenuItem * | item | |||
| ) |
same as for a2dMenuIdItem, Id in wxMenuItem must be a valid id from one a2dMenuIdItem used in XRC files
Definition at line 2973 of file docviewref.cpp.
| void a2dDocumentFrame::RemoveCmdMenu | ( | wxMenu * | parentMenu, | |
| const a2dMenuIdItem & | cmdId | |||
| ) |
remove a command menu from the parent menu.
See AddCmdMenu()
Definition at line 2985 of file docviewref.cpp.
| void a2dDocumentFrame::OnExecuteCommand | ( | wxCommandEvent & | event | ) |
called for dynamic added menu's via AddCommandToMenu() command will be submitted to a2dDocviewGlobals->GetDocviewCommandProcessor()
Definition at line 2991 of file docviewref.cpp.
| void a2dDocumentFrame::OnCmdMenuId | ( | wxCommandEvent & | event | ) | [protected] |
used by AddCmdMenu() to dynamically connect menu to function. The function just Skipps the event, so it will be handled by a command processor in the end.
Definition at line 2950 of file docviewref.cpp.
| void a2dDocumentFrame::OnCloseView | ( | a2dCloseViewEvent & | event | ) | [protected] |
default for closing a view in this frame
Close the view, if set, and destroy the frame. The view is closed even if it is displayed in a nested subwindow. Since it Destroys the frame ( if m_destroyOnCloseView is set ), that will automatically destroy the nested windows too.
/remark m_view is set to the active view if there are more sub windows with views. So just closing the currently active view is not enough, if there are more.
Definition at line 2706 of file docviewref.cpp.
| void a2dDocumentFrame::OnCloseWindow | ( | wxCloseEvent & | event | ) | [protected] |
default for closing this frame via close button.
default handler for wxEVT_CLOSE event. Give the Frame the right to veto. The default tries to close the view. That is the right thing to do if the frame has just a single view.
If there are more views ( even in nested windows ), you need to handle that yourself.
/remark m_view is set to the active view if there are more sub windows with views. So just closing the currently active view is not enough, if there are more.
Reimplemented in a2dEditorFrame.
Definition at line 2862 of file docviewref.cpp.
| void a2dDocumentFrame::OnChangeFilename | ( | a2dViewEvent & | event | ) | [protected] |
default handler for file changed event sent from a2dView
Sents the event to the DisplayWindow, there or in its parent hiearchy it can be intercepted.
Definition at line 2729 of file docviewref.cpp.
a2dSmrtPtr<a2dView> a2dDocumentFrame::m_view [protected] |
used for redirecting close and activate events to the view which has the focus. See SetView()
Definition at line 3734 of file docviewref.h.