wxArt2D
|
Use wxDocMDIParentFrame instead of wxDocMDIParentFrame. More...
#include <docmdiref.h>
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) |
Use wxDocMDIParentFrame instead of wxDocMDIParentFrame.
This class is the replacement for the standard wxWindow wxDocMDIParentFrame
Definition at line 35 of file docmdiref.h.
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.
parent | The parent frame. This should 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 64 of file docmdiref.cpp.
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:
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:
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.
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).
frame | The parent frame. This should not 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 74 of file docmdiref.cpp.
|
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.