const int ID_SAVE_AS_COMPLEXBOX = 1011;
const int ID_COPY_TO_COMPLEXDIAGRAM = 1012;
const int ID_BTNBOX = 1013;
+ const int ID_HELP_BBEDITOR = 1014;
const int wxID_NOTEBOOK = 1013;
// Create Help menu and its items
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About"));
+ helpMenu->Append(ID_HELP_BBEDITOR, _T("&Help..."), _T("Help"));
+ Connect(ID_HELP_BBEDITOR,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnHelpBBeditor));
// Append the created menu to the menu bar
wxMenuBar *menuBar = new wxMenuBar();
//=========================================================================
-
void wxGUIEditorGraphicBBS::OnOpenDiagram(wxCommandEvent& event)
{
wxFileDialog * openFileDialog = new wxFileDialog(this,wxT("Open diagram"),wxEmptyString,wxT(""),wxT("*.bbg"),wxOPEN|wxFILE_MUST_EXIST);
if (openFileDialog->ShowModal() == wxID_OK)
{
wxString fileName = openFileDialog->GetPath();
-
ifstream inputStream;
-
//EED inputStream.open(fileName.c_str());
inputStream.open( (const char*) (fileName.mb_str()) );
-
-
-
_tabsMgr->addNewTab();
_tabsMgr->loadDiagram(inputStream);
void wxGUIEditorGraphicBBS::OnClickBtnBox(wxCommandEvent& event)
{
-
- BlackBoxDescriptor *bbDes = _pkgBrowser->GetActualSelected();
+ BlackBoxDescriptor *bbDes = _pkgBrowser->GetActualSelected();
if (bbDes!=NULL)
{
std::string typeName = bbDes->GetTypeName();
_tabsMgr->copySelectedBBoxesToComplexDiagram();
}
+
+ void wxGUIEditorGraphicBBS::OnHelpBBeditor(wxCommandEvent& event)
+ {
+ printf("wxGUIEditorGraphicBBS::OnHelpBBeditor ......\n");
+ }
+
+
+
//=========================================================================
void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event)
{
Close(true);
}
+
+
//=========================================================================
void OnAddComplexBoxInput(wxCommandEvent& event);
void OnAddComplexBoxOutput(wxCommandEvent& event);
void OnExit(wxCommandEvent& event);
+ void OnHelpBBeditor(wxCommandEvent& event);
// Edit menu events
void OnCopySelectedToComplexDiagram(wxCommandEvent& event);
if(isOverPort==false)
{
- _worldState=NOTHING_HAPPENS;
- //int lastId = _controllers.size()-1;
-//EED2Oct2010 GConnectorController *connector = (GConnectorController*)_controllers[_controllers.size()-1];
- GConnectorController *connector = (GConnectorController*)_controllers[_idConnectionInCreation];
-
- connector->removeFromScene();
- unregisterController(connector);
- _controllers.erase(_controllers.size()-1);
-
- for(it = _controllers.begin(); it != _controllers.end(); ++it)
- {
- GObjectController *desc = it->second;
- desc->SetActive(true);
- desc->getView()->setState(NOTHING_HAPPENS);
- desc->getModel()->notifyObservers(_idManager);
- } // for
+ CancelConnection();
+ UnSelectBlackBoxes();
} // isOverPort
} else { //_worldState
}
//=========================================================================
-
- bool wxVtkSceneManager::OnRightButtonUp()
+ void wxVtkSceneManager::CancelConnection()
{
if(_worldState==INIT_CREATION_CONTOUR)
{
_worldState=NOTHING_HAPPENS;
//int lastId = _controllers.size()-1;
-
+
GConnectorController *connector = (GConnectorController*)_controllers[_idConnectionInCreation];
connector->removeFromScene();
unregisterController(connector);
_controllers.erase(_idConnectionInCreation);
-
+
std::map<int, GObjectController*>::iterator it;
for(it = _controllers.begin(); it != _controllers.end(); ++it)
{
desc->SetActive(true);
desc->getView()->setState(NOTHING_HAPPENS);
desc->getModel()->notifyObservers(_idManager);
- }
- }
-
+ } // for
+ }// if
+ }
+
+
+ //=========================================================================
- for (int i = 0; i < (int)_selectedObjects.size(); i++)
+ bool wxVtkSceneManager::OnRightButtonUp()
+ {
+ if(_worldState==INIT_CREATION_CONTOUR)
{
- int id = _selectedObjects[i];
- GObjectController* cont = _controllers[id];
- cont->SetActive(true);
- cont->getView()->setState(NOTHING_HAPPENS);
- cont->getModel()->notifyObservers(_idManager);
+ CancelConnection();
}
-
- _selectedObjects.clear();
-
+ UnSelectBlackBoxes();
return true;
}
int GetIndexInSelected(int idControler);
void UnSelectBlackBoxes();
GObjectController *GetGBlackBoxControlerPointedByMouse();
-
+ void CancelConnection();
protected: