From: Eduardo DAVILA Date: Fri, 17 Mar 2017 09:39:01 +0000 (+0100) Subject: #3075 bbGEditor Bug New Normal - comboBox for message configuration X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=0ed874c749158f2f175664c45183fb05186d6c49;p=bbtkGEditor.git #3075 bbGEditor Bug New Normal - comboBox for message configuration --- diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxDiagramPropertiesEditionDialog.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxDiagramPropertiesEditionDialog.cxx index 13dacc0..8de199c 100755 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxDiagramPropertiesEditionDialog.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxDiagramPropertiesEditionDialog.cxx @@ -150,8 +150,8 @@ warning 1 Warning messages widget 0 Widgets related messages wx */ - _diagramMessageKind = new wxComboBox(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(100,-1) ); - _diagramMessageKind->Append (wxT(" ")); + _diagramMessageKind = new wxComboBox(panel, -1, wxT("-"), wxDefaultPosition, wxSize(100,-1) ); + _diagramMessageKind->Append (wxT("-")); _diagramMessageKind->Append (wxT("Interpreter")); _diagramMessageKind->Append (wxT("all")); _diagramMessageKind->Append (wxT("change")); @@ -176,8 +176,8 @@ wx _diagramMessageKind->Append (wxT("wx")); _diagramMessageKind->SetEditable(false); - _diagramMessageLevel = new wxComboBox(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(100,-1) ); - _diagramMessageLevel->Append (wxT(" ")); + _diagramMessageLevel = new wxComboBox(panel, -1, wxT("-"), wxDefaultPosition, wxSize(100,-1) ); + _diagramMessageLevel->Append (wxT("-")); _diagramMessageLevel->Append (wxT("0")); _diagramMessageLevel->Append (wxT("1")); _diagramMessageLevel->Append (wxT("2")); @@ -207,32 +207,44 @@ wx int currentType = (_parent->isCurrentDiagramComplexBox()==false)? 0 : 1; _diagramType->Select(currentType); std::string currentKindStr = _parent->getCurrentDiagramMessageKind(); - int currentKind; - if (currentKindStr =="Interpreter") { currentKind = 1;} - if (currentKindStr == "all") { currentKind = 2; } - if (currentKindStr == "change") { currentKind = 3; } - if (currentKindStr == "code") { currentKind = 4; } - if (currentKindStr == "config"){ currentKind = 5; } + int currentKind=0; // "-" + if (currentKindStr =="Interpreter") { currentKind = 1; } + if (currentKindStr == "all") { currentKind = 2; } + if (currentKindStr == "change") { currentKind = 3; } + if (currentKindStr == "code") { currentKind = 4; } + if (currentKindStr == "config") { currentKind = 5; } if (currentKindStr == "connection") { currentKind = 6; } - if (currentKindStr == "data") { currentKind = 7; } - if (currentKindStr == "debug") { currentKind = 8; } - if (currentKindStr == "echo") { currentKind = 9; } - if (currentKindStr == "error") { currentKind = 10; } - if (currentKindStr == "gui") { currentKind = 11; } - if (currentKindStr == "help") { currentKind = 12; } - if (currentKindStr == "kernel") { currentKind = 13; } - if (currentKindStr == "max"){ currentKind = 14; } - if (currentKindStr == "object") { currentKind = 15; } - if (currentKindStr == "output") { currentKind = 16; } - if (currentKindStr == "package") { currentKind = 17; } - if (currentKindStr == "process") { currentKind = 18; } - if (currentKindStr == "qt" ){ currentKind = 19; } - if (currentKindStr == "warning") { currentKind = 20; } - if (currentKindStr == "widget") { currentKind = 21; } - if (currentKindStr == "wx" ){ currentKind = 22; } + if (currentKindStr == "data") { currentKind = 7; } + if (currentKindStr == "debug") { currentKind = 8; } + if (currentKindStr == "echo") { currentKind = 9; } + if (currentKindStr == "error") { currentKind = 10; } + if (currentKindStr == "gui") { currentKind = 11; } + if (currentKindStr == "help") { currentKind = 12; } + if (currentKindStr == "kernel") { currentKind = 13; } + if (currentKindStr == "max") { currentKind = 14; } + if (currentKindStr == "object") { currentKind = 15; } + if (currentKindStr == "output") { currentKind = 16; } + if (currentKindStr == "package") { currentKind = 17; } + if (currentKindStr == "process") { currentKind = 18; } + if (currentKindStr == "qt" ) { currentKind = 19; } + if (currentKindStr == "warning") { currentKind = 20; } + if (currentKindStr == "widget") { currentKind = 21; } + if (currentKindStr == "wx" ) { currentKind = 22; } _diagramMessageKind->Select(currentKind); - int currentLevel = atoi(_parent->getCurrentDiagramMessageLevel().c_str()); - _diagramMessageLevel->Select(currentLevel+1); + + std::string currentLevelStr = _parent->getCurrentDiagramMessageLevel(); + int currentLevel = 0; + if (currentLevelStr == "0" ) { currentLevel = 1; } + if (currentLevelStr == "1" ) { currentLevel = 2; } + if (currentLevelStr == "2" ) { currentLevel = 3; } + if (currentLevelStr == "3" ) { currentLevel = 4; } + if (currentLevelStr == "4" ) { currentLevel = 5; } + if (currentLevelStr == "5" ) { currentLevel = 6; } + if (currentLevelStr == "6" ) { currentLevel = 7; } + if (currentLevelStr == "7" ) { currentLevel = 8; } + if (currentLevelStr == "8" ) { currentLevel = 9; } + if (currentLevelStr == "9" ) { currentLevel = 10;} + _diagramMessageLevel->Select(currentLevel); wxStaticText *type = new wxStaticText(panel, -1, wxT("Type")); wxStaticText *author = new wxStaticText(panel, -1, wxT("Author")); diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index af87221..002e589 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -73,25 +73,25 @@ namespace bbtk { wxVtkSceneManager::wxVtkSceneManager(wxGEditorTabPanel *parent, wxVtk3DBaseView *baseView, int idManager,Factory::Pointer bbtkfactory) { - _cbName = "ComplexBoxName"; - _cbPackageName = "PackageName"; - _Author = "Author ??"; - _Category = ""; - _Description = "Description ??"; - _MessageKind = " "; - _MessageLevel = " "; - - _bugTextActor_text = "void"; + _cbName = "ComplexBoxName"; + _cbPackageName = "PackageName"; + _Author = "Author ??"; + _Category = ""; + _Description = "Description ??"; + _MessageKind = "-"; + _MessageLevel = "-"; + + _bugTextActor_text = "void"; _bugTextActor_status = 0; - _parent = parent; - _numBoxes = 0; - _idManager = idManager; - _baseView = baseView; - _bbtkfactory = bbtkfactory; + _parent = parent; + _numBoxes = 0; + _idManager = idManager; + _baseView = baseView; + _bbtkfactory = bbtkfactory; - _startDragging = false; - _isComplexBox = false; + _startDragging = false; + _isComplexBox = false; if (_baseView != NULL) { //EED02JUIN2010 @@ -1540,7 +1540,7 @@ std::string wxVtkSceneManager::getDiagramBBS(bool wln) { script += "# Complex input ports\n"; script += complexInputs; - if((_MessageKind!=" ")&&(_MessageLevel!=" ")){ + if((_MessageKind!="-")&&(_MessageLevel!="-")){ script += LineNumber(wln, lnNmbr); script += "message "; script += _MessageKind; @@ -1736,13 +1736,17 @@ std::string wxVtkSceneManager::saveComplexBoxBBS() { script += "\n"; - script += "message "; - script += _MessageKind; - script += " "; - script += _MessageLevel; - script += "\n"; + if((_MessageKind!="-")&&(_MessageLevel!="-")) + { + script += "message "; + script += _MessageKind; + script += " "; + script += _MessageLevel; + script += "\n"; + } - for (i = 0; i < (int) execBoxes.size(); i++) { + for (i = 0; i < (int) execBoxes.size(); i++) + { script += "exec "; int id = execBoxes[i]; GObjectController *control = _controllers[id];