Go to the documentation of this file.
33 #include <boost/format.hpp>
72 wxTreeCtrl(parent,
OSEdConstants::CMD_TREE_ITEM), infoView_(infoView) {
92 vector<string> results;
97 wxTreeItemId root = AddRoot(_T(
"root"));
100 for (
size_t i = 0; i < paths.size(); i++) {
102 string pathName = paths[i];
118 for (
int j = 0; j < modules; j++) {
121 wxTreeItemId module =
124 modules_.insert(std::pair<std::string, wxTreeItemId>(mod.
name(), module));
141 results.push_back(
"\n");
144 for (
int k = 0; k < operations; k++) {
153 SortChildren(module);
175 wxTreeItemId
id =
event.GetItem();
178 string path = MapTools::keyForValue<string>(
paths_,
id);
184 string moduleName = MapTools::keyForValue<string>(
modules_,
id);
192 string opName = MapTools::keyForValue<string>(
operations_,
id);
203 mainFrame->
statusBar()->SetStatusText(_T(
""));
207 wxGetApp().mainFrame()->updateMenuBar();
221 wxTreeItemId
id =
event.GetItem();
248 wxPoint pos =
event.GetPosition();
249 int flags = wxTREE_HITTEST_ONITEMLABEL;
250 wxTreeItemId
id = HitTest(pos, flags);
265 PopupMenu(menu, pos);
272 PopupMenu(menu, pos);
280 PopupMenu(menu, pos);
282 mainFrame->
statusBar()->SetStatusText(_T(
"Cannot open"));
333 string pathName =
"";
337 if (IsSelected((*it).second)) {
338 opName = (*it).first;
339 wxTreeItemId opId = (*it).second;
341 wxTreeItemId moduleId = GetItemParent(opId);
342 wxTreeItemId pathId = GetItemParent(moduleId);
383 if (IsSelected((*it).second)) {
392 if ((*it).first == name) {
408 wxTreeItemId modId = GetItemParent(
id);
409 string moduleName = MapTools::keyForValue<string>(
modules_, modId);
421 return GetItemParent(
id);
432 wxTreeItemId pathId = GetItemParent(
id);
433 std::string path = MapTools::keyForValue<string>(
paths_, pathId);
445 return GetItemParent(
id);
461 while (it !=
paths_.end()) {
462 if (IsSelected((*it).second)) {
484 while (it !=
paths_.end()) {
485 if (IsSelected((*it).second)) {
495 wxTreeItemId
id =
paths_[path];
519 if (IsSelected((*it).second)) {
539 return GetSelection();
545 if (IsSelected((*it).second)) {
556 wxTreeItemId
id = it->second;
576 modules_.insert(std::pair<std::string, wxTreeItemId>(item,
id));
578 operations_.insert(std::pair<std::string, wxTreeItemId>(item,
id));
595 string key = MapTools::keyForValue<string>(
operations_,
id);
598 operations_.insert(std::pair<std::string, wxTreeItemId>(text,
id));
601 string key = MapTools::keyForValue<string>(
modules_,
id);
604 modules_.insert(std::pair<std::string, wxTreeItemId>(text,
id));
606 string key = MapTools::keyForValue<string>(
paths_,
id);
624 wxTreeItemId parent = GetItemParent(
id);
632 string key = MapTools::keyForValue<string>(
operations_,
id);
636 string key = MapTools::keyForValue<string>(
modules_,
id);
641 if (GetItemParent((*ot).second) ==
id) {
673 while (it !=
paths_.end()) {
674 if (IsSelected((*it).second)) {
683 if (IsSelected((*itm).second)) {
684 wxTreeItemId pathId = GetItemParent((*itm).second);
694 if (IsSelected((*it).second)) {
695 wxTreeItemId modId = GetItemParent((*it).second);
696 wxTreeItemId pathId = GetItemParent(modId);
void setParentWindow(wxWindow *view)
void operationView(const std::string &path, const std::string &mod)
std::string selectedPath()
std::string selectedModule()
wxTreeItemId selectedModuleId()
static wxString toWxString(const std::string &source)
void removeItem(wxTreeItemId id)
std::string pathOfModule(wxTreeItemId id)
bool isPath(wxTreeItemId id) const
static OperationSerializer & operationSerializer()
wxTreeItemId moduleIdOfOperation(wxTreeItemId id)
void addItem(wxTreeItemId parent, std::string item)
wxTreeItemId selectedPathId()
std::string selectedModule()
@ TXT_STATUS_MODULE_SELECTED
Status bar text when module is selected.
@ CMD_PROPERTIES
Operation properties command id.
OSEdInfoView * infoView() const
virtual boost::format text(int textId)
GUICommand * createCommand(const int id)
void moduleView(const std::string &name)
std::string selectedOperation()
#define assert(condition)
virtual std::string propertiesModule() const
void onDropDownMenu(wxMouseEvent &event)
OSEdInfoView * infoView_
An info window controlled by tree view.
void onItemSelected(wxTreeEvent &event)
std::string selectedPath()
virtual ObjectState * readState()
std::string moduleOfOperation(wxTreeItemId id)
bool isOperationSelected() const
bool isPathSelected() const
wxTreeItemId pathIdOfModule(wxTreeItemId id)
void changeText(wxTreeItemId id, const std::string &text)
virtual void loadState(const ObjectState *state)
bool isModule(wxTreeItemId id) const
bool isModuleSelected() const
ObjectState * child(int index) const
Operation * selectedOperation()
std::multimap< std::string, wxTreeItemId >::iterator IterM
void setSourceFile(const std::string &filename)
CommandRegistry * registry() const
void operationPropertyView(const std::string &opName, const std::string &modName, const std::string &pathName)
static std::vector< std::string > osalPaths()
std::string errorMessage() const
@ CMD_TREE_ITEM
Id for tree events.
void onItemClicked(wxTreeEvent &event)
static NullOperationBehavior & instance()
static bool fileExists(const std::string fileName)
std::multimap< std::string, wxTreeItemId > operations_
Operations of operation data base.
static OSEdTextGenerator & instance()
wxTreeItemId selectedOperationId()
@ TXT_STATUS_PATH_SELECTED
Status bar text when path is selected.
std::map< std::string, wxTreeItemId >::iterator Iter
Iterators for the maps.
std::vector< std::string > constructTree()
static Operation * operation(const std::string &path, const std::string &module, const std::string &oper)
std::map< std::string, wxTreeItemId > paths_
Paths of the operation data base.
virtual std::string name() const
int operationCount(const OperationModule &om)
static std::string toString(const wxString &source)
wxStatusBar * statusBar() const
std::multimap< std::string, wxTreeItemId > modules_
Modules of the operation data base.
static OperationIndex & operationIndex()
OperationModule & module(int i)
std::string operationName(int i, const OperationModule &om)
END_EVENT_TABLE() using namespace IDF
bool isOperation(wxTreeItemId id) const
@ TXT_STATUS_OPERATION_SELECTED
Status bar text when operation is selected.