]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxDiagramPropertiesEditionDialog.cxx
#3257 wxwidgets 3.2 macOS
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / wxDiagramPropertiesEditionDialog.cxx
index 13dacc0797f2304002675f9dbeef70f36e5cea4e..800ab3c9df88fe581969056abca5383aba444cd1 100755 (executable)
@@ -66,7 +66,7 @@ namespace bbtk
 {
        //=========================================================================
 
-       wxDiagramPropertiesEditionDialog::wxDiagramPropertiesEditionDialog(wxGUIEditorGraphicBBS *parent, NodeTreeC tree):wxDialog(parent,wxID_ANY,_T("Diagram Properties"), wxDefaultPosition, wxSize(500, 650),wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
+       wxDiagramPropertiesEditionDialog::wxDiagramPropertiesEditionDialog(wxGUIEditorGraphicBBS *parent, NodeTreeC tree):wxDialog(parent,wxID_ANY,_T("Diagram Properties"), wxDefaultPosition, wxSize(600, 750),wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
        {
                _parent = parent;
                _tree = tree;
@@ -100,22 +100,22 @@ namespace bbtk
 
        void wxDiagramPropertiesEditionDialog::constructDiagramPropertiesEditionDialog()
        {
-               const int ID_COMBO = 1;
-               wxPanel *panel = new wxPanel(this, -1);
-               wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL);
-               wxFlexGridSizer *fgsizer = new wxFlexGridSizer(5, 2, 9, 25);
+               const int       ID_COMBO    = 1;
+               wxPanel         *panel      = new wxPanel(this, -1);
+               wxBoxSizer      *hbox       = new wxBoxSizer(wxHORIZONTAL);
+               wxFlexGridSizer *fgsizer    = new wxFlexGridSizer(8, 2, 9, 25);
 
-
-               //CFT           
-
-               wxStaticText *tree = new wxStaticText(panel, -1, wxT("Tree of Box"));
+               //CFT
+               wxStaticText *tree          = new wxStaticText(panel, -1, wxT("Tree of Box"));
                
-               string sp = _tree.data;
-               const char* cc = sp.c_str();
-               wxString p = wxString::FromUTF8 (cc);
-
-               _treeBox = new wxTreeCtrl (this, wxID_ANY, wxPoint(0,0), wxSize(320,300), wxTR_HAS_BUTTONS | wxTR_SINGLE );
-               wxTreeItemId itemId = _treeBox->AddRoot(p, -1,-1,NULL);
+               string      sp              = _tree.data;
+               const char* cc              = sp.c_str();
+               wxString    p               = wxString::FromUTF8 (cc);
+        
+//EED 2023-10-31
+//                  _treeBox        = new wxTreeCtrl (this, wxID_ANY, wxPoint(0,0), wxSize(320,300), wxTR_HAS_BUTTONS | wxTR_SINGLE );
+                    _treeBox        = new wxTreeCtrl (panel, wxID_ANY, wxPoint(0,0), wxSize(320,300), wxTR_HAS_BUTTONS | wxTR_SINGLE );
+               wxTreeItemId itemId         = _treeBox->AddRoot(p, -1,-1,NULL);
                
                constructBoxTree(_tree, itemId);
                _treeBox->ExpandAll();  
@@ -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,45 +207,57 @@ 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);
-
-               wxStaticText *type = new wxStaticText(panel, -1, wxT("Type"));
-               wxStaticText *author = new wxStaticText(panel, -1, wxT("Author"));
-               wxStaticText *category = new wxStaticText(panel, -1, wxT("Categories"));
-               wxStaticText *description = new wxStaticText(panel, -1, wxT("Description"));
-               wxStaticText *messageKind = new wxStaticText(panel, -1, wxT("Message kind"));
-               wxStaticText *messageLevel = new wxStaticText(panel, -1, wxT("Message level"));
-
-               _txtAuthor = new wxTextCtrl(panel, -1);
-               _txtCategory = new wxTextCtrl(panel, -1);
-               _txtDescription = new wxTextCtrl(panel, -1, wxT(""), wxPoint(-1, -1), wxSize(-1, -1), wxTE_MULTILINE);
-               wxButton *okButton      = new wxButton(panel, -1, _T("Ok"),wxDefaultPosition, wxSize(-1, -1));
-               wxButton *closeButton   = new wxButton(panel, -1, _T("Close"), wxDefaultPosition, wxSize(-1, -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"));
+               wxStaticText    *category       = new wxStaticText(panel, -1, wxT("Categories"));
+               wxStaticText    *description    = new wxStaticText(panel, -1, wxT("Description"));
+               wxStaticText    *messageKind    = new wxStaticText(panel, -1, wxT("Message kind"));
+               wxStaticText    *messageLevel   = new wxStaticText(panel, -1, wxT("Message level"));
+
+                        _txtAuthor      = new wxTextCtrl(panel, -1);
+                        _txtCategory    = new wxTextCtrl(panel, -1);
+                        _txtDescription = new wxTextCtrl(panel, -1, wxT(""), wxPoint(-1, -1), wxSize(-1, -1), wxTE_MULTILINE);
+               wxButton        *okButton       = new wxButton(panel, -1, _T("Ok"),wxDefaultPosition, wxSize(-1, -1));
+               wxButton        *closeButton    = new wxButton(panel, -1, _T("Close"), wxDefaultPosition, wxSize(-1, -1));
 
                // connect command event handlers
                Connect(okButton->GetId(),wxEVT_COMMAND_BUTTON_CLICKED,wxCommandEventHandler(wxDiagramPropertiesEditionDialog::onClickOk));
@@ -256,7 +268,6 @@ wx
                _txtCategory->SetValue(crea::std2wx(_parent->getCurrentDiagramCategory()));
                _txtDescription->SetValue(crea::std2wx(_parent->getCurrentDiagramDescription()));
 
-
                fgsizer->Add(type);
                fgsizer->Add(_diagramType, 1, wxEXPAND);
                fgsizer->Add(author);