#include <menuutils.h>
Inheritance diagram for wxMenuTreeWalker:
Public Member Functions | |
wxMenuTreeWalker () | |
virtual | ~wxMenuTreeWalker () |
void | FillTreeBranch (wxMenuBar *p, wxTreeCtrl *ctrl, wxTreeItemId branch) |
Attaches the tree structure of the menubar in the given tree control using the given tree item as root. | |
void | FillTreeCtrl (wxMenuBar *p, wxTreeCtrl *ctrl, const wxString &rootname=wxT("root")) |
Works like FillTreeBranch but this function also removes all the tree items (before starting) and then builds the root with the given label. | |
Protected Member Functions | |
void * | OnMenuWalk (wxMenuBar *p, wxMenu *, void *) |
Called when a wxMenu is found in the menu bar passed to Walk(), or when a submenu is found by WalkMenuItem(). | |
void * | OnMenuItemWalk (wxMenuBar *p, wxMenuItem *, void *) |
Called when a wxMenuItem is found inside a wxMenu. | |
void | DeleteData (void *data) |
Deletes the given 'data'. | |
Private Attributes | |
wxTreeCtrl * | m_pTreeCtrl |
wxTreeItemId | m_root |
Each node of the wxTreeCtrl is associated with a wxExTreeItemData object which contains the ID of the menuitem it represents (for items representing the top level menus, wxID_INVALID is contained).
wxMenuTreeWalker::wxMenuTreeWalker | ( | ) | [inline] |
virtual wxMenuTreeWalker::~wxMenuTreeWalker | ( | ) | [inline, virtual] |
void wxMenuTreeWalker::DeleteData | ( | void * | data | ) | [protected, virtual] |
Deletes the given 'data'.
The derived class should pass to the OnMenuWalk/OnMenuWalkItem functions always the same type of structure/class in 'data' and in this function it should just cast the given pointer to that type and delete it.
Implements wxMenuWalker.
void wxMenuTreeWalker::FillTreeBranch | ( | wxMenuBar * | p, | |
wxTreeCtrl * | ctrl, | |||
wxTreeItemId | branch | |||
) |
Attaches the tree structure of the menubar in the given tree control using the given tree item as root.
void wxMenuTreeWalker::FillTreeCtrl | ( | wxMenuBar * | p, | |
wxTreeCtrl * | ctrl, | |||
const wxString & | rootname = wxT("root") | |||
) | [inline] |
Works like FillTreeBranch but this function also removes all the tree items (before starting) and then builds the root with the given label.
void * wxMenuTreeWalker::OnMenuItemWalk | ( | wxMenuBar * | p, | |
wxMenuItem * | , | |||
void * | ||||
) | [protected, virtual] |
Called when a wxMenuItem is found inside a wxMenu.
This works like OnMenuWalk() but "data" is something which was given to the WalkMenuItem (which is always the caller of this function). If the current menu item contains a submenu, the returned value is passed to OnMenuWalk() or it's directly deleted...
Implements wxMenuWalker.
void * wxMenuTreeWalker::OnMenuWalk | ( | wxMenuBar * | p, | |
wxMenu * | , | |||
void * | ||||
) | [protected, virtual] |
Called when a wxMenu is found in the menu bar passed to Walk(), or when a submenu is found by WalkMenuItem().
Implements wxMenuWalker.
wxTreeCtrl* wxMenuTreeWalker::m_pTreeCtrl [private] |
wxTreeItemId wxMenuTreeWalker::m_root [private] |