]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxDiagramPropertiesEditionDialog.cxx
#3259 Export Format Python and JavaScript
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / wxDiagramPropertiesEditionDialog.cxx
index 800ab3c9df88fe581969056abca5383aba444cd1..04b47f74b28371bb1857b724129f1af8bff13cbd 100755 (executable)
@@ -103,7 +103,7 @@ namespace bbtk
                const int       ID_COMBO    = 1;
                wxPanel         *panel      = new wxPanel(this, -1);
                wxBoxSizer      *hbox       = new wxBoxSizer(wxHORIZONTAL);
-               wxFlexGridSizer *fgsizer    = new wxFlexGridSizer(8, 2, 9, 25);
+               wxFlexGridSizer *fgsizer    = new wxFlexGridSizer(9, 2, 9, 25);
 
                //CFT
                wxStaticText *tree          = new wxStaticText(panel, -1, wxT("Tree of Box"));
@@ -190,6 +190,16 @@ wx
                _diagramMessageLevel->Append (wxT("9"));
                _diagramMessageLevel->SetEditable(false);
 
+        
+        _exportFormatCB = new wxComboBox(panel, -1, wxT("bbs"), wxDefaultPosition, wxSize(100,-1) );
+        _exportFormatCB->Append (wxT("bbs"));
+        _exportFormatCB->Append (wxT("All (bbs Pyyhon JavaScript)"));
+        _exportFormatCB->Append (wxT("bbs Python"));
+        _exportFormatCB->Append (wxT("bbs JavaScript"));
+        _exportFormatCB->SetEditable(false);
+        _exportFormatCB->Select( _parent->getCurrentDiagramExportFormat() );
+
+        
 //CFT END
 
                // SELECTION CONSTANTS
@@ -247,6 +257,7 @@ wx
                _diagramMessageLevel->Select(currentLevel);
 
                wxStaticText    *type           = new wxStaticText(panel, -1, wxT("Type"));
+        wxStaticText    *exportFormat   = new wxStaticText(panel, -1, wxT("Export Format"));
                wxStaticText    *author         = new wxStaticText(panel, -1, wxT("Author"));
                wxStaticText    *category       = new wxStaticText(panel, -1, wxT("Categories"));
                wxStaticText    *description    = new wxStaticText(panel, -1, wxT("Description"));
@@ -269,9 +280,11 @@ wx
                _txtDescription->SetValue(crea::std2wx(_parent->getCurrentDiagramDescription()));
 
                fgsizer->Add(type);
-               fgsizer->Add(_diagramType, 1, wxEXPAND);
+               fgsizer->Add(_diagramType       , 1, wxEXPAND);
                fgsizer->Add(author);
-               fgsizer->Add(_txtAuthor, 1, wxEXPAND);
+               fgsizer->Add(_txtAuthor         , 1, wxEXPAND);
+        fgsizer->Add(exportFormat);
+        fgsizer->Add(_exportFormatCB    , 1, wxEXPAND);
                fgsizer->Add(category);
                fgsizer->Add(_txtCategory, 1, wxEXPAND);
                fgsizer->Add(description, 1, wxEXPAND);
@@ -307,10 +320,9 @@ wx
 
        void wxDiagramPropertiesEditionDialog::onClickOk(wxCommandEvent& event)
        {
-               printf("RaC wxDiagramPropertiesEditionDialog::onClickOk\n");
-               std::string txtAuthor = wx2std(_txtAuthor->GetValue());
-               std::string txtCategory = wx2std(_txtCategory->GetValue());
-               std::string txtDescription = wx2std(_txtDescription->GetValue());
+               std::string txtAuthor       = wx2std(_txtAuthor->GetValue());
+               std::string txtCategory     = wx2std(_txtCategory->GetValue());
+               std::string txtDescription  = wx2std(_txtDescription->GetValue());
                _parent->setCurrentDiagramAuthor(txtAuthor);
                _parent->setCurrentDiagramCategory(txtCategory);
                _parent->setCurrentDiagramDescription(txtDescription);
@@ -319,12 +331,24 @@ wx
                // 0 - Application
                // 1 - Complex box
                int selection = _diagramType->GetSelection();
-               if(selection == 0)
-                       _parent->disableComplexBox();
-               else if (selection == 1)
-                       _parent->enableComplexBox();
-
-
+        if(selection == 0)
+        {
+            _parent->disableComplexBox();
+        }else {
+            if (selection == 1)
+            {
+                _parent->enableComplexBox();
+            } // if selection 1
+        } // if selection 0
+
+        // Export Formats constants
+        // 0 - bbs
+        // 1 - ALL - bbs & py & js
+        // 2 - bbs & py
+        // 3 - bbs & js
+        _parent->setCurrentDiagramExportFormat( _exportFormatCB->GetSelection() );
+        
+        
                //Message
                std::string kindSelected = wx2std(_diagramMessageKind->GetStringSelection());
                std::string levelSelected = wx2std(_diagramMessageLevel->GetStringSelection());