wxArt2D
Public Member Functions | Protected Member Functions | List of all members
a2dDocumentMDIParentFrame Class Reference

Use wxDocMDIParentFrame instead of wxDocMDIParentFrame. More...

#include <docmdiref.h>

Inheritance diagram for a2dDocumentMDIParentFrame:
Inheritance graph
[legend]
Collaboration diagram for a2dDocumentMDIParentFrame:
Collaboration graph
[legend]

Public Member Functions

 a2dDocumentMDIParentFrame (wxFrame *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxT("frame"))
 Constructor. More...
 
bool Create (wxWindow *frame, wxWindowID id=-1, const wxString &title=wxT("frame"), 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). More...
 
virtual bool ProcessEvent (wxEvent &event)
 Extend event processing to search the document manager's event table.
 
void OnExit (wxCommandEvent &event)
 Does a call to Close()
 
void OnMRUFile (wxCommandEvent &event)
 Creates a new view for a file from file-history (a new MDI child will be created)
 
void OnCloseWindow (wxCloseEvent &event)
 Closes the this window, if not vetoed.
 
void AddCmdMenu (wxMenu *parentMenu, const a2dMenuIdItem &cmdId)
 add a command menu to the parent menu, and connect it to the eventhandler of the frame More...
 
void AddCmdMenu (wxMenu *parentMenu, wxMenuItem *item)
 
void RemoveCmdMenu (wxMenu *parentMenu, const a2dMenuIdItem &cmdId)
 remove a command menu from the parent menu. More...
 
void AddCmdToToolbar (const a2dMenuIdItem &cmdId)
 add items to toolbar using a predefined command ID.
 

Protected Member Functions

void OnCmdMenuId (wxCommandEvent &event)
 

Detailed Description

Use wxDocMDIParentFrame instead of wxDocMDIParentFrame.

This class is the replacement for the standard wxWindow wxDocMDIParentFrame

Definition at line 35 of file docmdiref.h.

Constructor & Destructor Documentation

a2dDocumentMDIParentFrame::a2dDocumentMDIParentFrame ( wxFrame *  parent,
wxWindowID  id,
const wxString &  title,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxDEFAULT_FRAME_STYLE,
const wxString &  name = wxT( "frame" ) 
)

Constructor.

Parameters
parentThe parent frame. This should be NULL
idThe window identifier. It may take a value of -1 to indicate a default value.
titleThe caption to be displayed on the frame's title bar.
posThe window position.
sizeThe window size.
styleWindow style, please look into wxWindows docs for an overview.
nameThe name of the window.

Definition at line 64 of file docmdiref.cpp.

Member Function Documentation

void a2dDocumentMDIParentFrame::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() )

Submitting the command makes it possible to undo the action. To issue such a command from a menu requires an Id. Therefore wxDocview defines many predefined menus items in the form of a2dMenuIdItem. They produce a unique Id to be handled in the commandprocessor. Like in:

void a2dDocumentCommandProcessor::OnMenu( wxCommandEvent& event )

Several modules in wxDocview extend, in the derived a2dDocumentCommandProcessor, the set of handled menu Id's. The OnMenu intercepts the menu event, and sets up a new a2dCommand to be submitted. Understand that a2dDocumentFrame and a2dDocumentMDIParentFrame already redirect non handled events to the commandprocessor of the application. An a2dMenuIdItem defined menu text and helpstring, therefore all you need to do to add a command to your application is AddCmdMenu(). Many commands have parameters, and a a2dMenuIdItem its Id, can only be coupled to one a2dCommand with some predefined set of parameters. If you need a different implementation of the same command you can extend in the same manner in your derived commandprocessor. But you can always use the standard way of wxWidgets to add a menu, and add a handler in the frame. In the handler setsup the a2dCommand and submits it. Exactly the same behaviour, only not predefined.

Remarks
a2dMenuIdItem uses Id my name ready to be used by XRC files.

Definition at line 154 of file docmdiref.cpp.

void a2dDocumentMDIParentFrame::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 148 of file docmdiref.cpp.

bool a2dDocumentMDIParentFrame::Create ( wxWindow *  frame,
wxWindowID  id = -1,
const wxString &  title = wxT( "frame" ),
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).

Parameters
frameThe parent frame. This should not be NULL
idThe window identifier. It may take a value of -1 to indicate a default value.
titleThe caption to be displayed on the frame's title bar.
posThe window position.
sizeThe window size.
styleWindow style, please look into wxWindows docs for an overview.
nameThe name of the window.

Definition at line 74 of file docmdiref.cpp.

void a2dDocumentMDIParentFrame::OnCmdMenuId ( wxCommandEvent &  event)
protected

used by AddCmdMenu() to dynamically connect menu to function. The function just Skippes the event, so it will be handled by a command processor in the end.

Definition at line 143 of file docmdiref.cpp.

void a2dDocumentMDIParentFrame::RemoveCmdMenu ( wxMenu *  parentMenu,
const a2dMenuIdItem cmdId 
)

remove a command menu from the parent menu.

See AddCmdMenu()

Definition at line 160 of file docmdiref.cpp.


The documentation for this class was generated from the following files:
a2dDocumentMDIParentFrame Class Reference -- Sun Oct 12 2014 17:04:35 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation