From: davila <> Date: Mon, 4 Jun 2012 21:48:38 +0000 (+0000) Subject: v1.1.0 Feature 1407 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=bbtkGEditor.git;a=commitdiff_plain;h=1a1d60ee9a094a5adfbe674e5d81a8fa846c099f v1.1.0 Feature 1407 - Input Description in the Toggle InputDialogBox - Type of the box in the InputDialogBox --- diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx index 386663f..1ab4ad3 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx @@ -160,6 +160,20 @@ namespace bbtk _bbtkName = obname; } + //========================================================================= + + std::string GObjectModel::getBBTKDescription() + { + return _bbtkDescription; + } + + //========================================================================= + + void GObjectModel::setBBTKDescription(std::string obdescription) + { + _bbtkDescription = obdescription; + } + //========================================================================= std::string GObjectModel::getStatusText()//virtual diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h index a5efed1..9904c58 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h @@ -96,6 +96,11 @@ namespace bbtk { std::string getBBTKName( ); void setBBTKName( std::string obname ); + // The description in BBTK, for boxes + std::string getBBTKDescription( ); + void setBBTKDescription( std::string obdescription ); + + // Object ID int getObjectId( ); void setObjectId( int id ); @@ -132,6 +137,9 @@ namespace bbtk { // The name in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), abcd is the name std::string _bbtkName; + + // The description in BBTK, for boxes + std::string _bbtkDescription; //Protected methods diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx index 8ee617b..ab134cb 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx @@ -85,12 +85,22 @@ namespace bbtk wxScrolledWindow *scrollWin = new wxScrolledWindow( this, -1, wxDefaultPosition, wxSize(200,200), wxVSCROLL); + wxString boxtype( crea::std2wx( _model->getBBTKType() ) ); + wxStaticText *textBoxName = new wxStaticText(scrollWin, -1, wxT("Box Name")); + wxStaticText *textBoxType = new wxStaticText(scrollWin, -1, boxtype+wxT(": ") ); wxTextCtrl *valueBoxName = new wxTextCtrl(scrollWin, -1, _T(""), wxDefaultPosition,wxSize(300,25)); _initBoxName = _model->getBBTKName(); valueBoxName->SetValue(crea::std2wx(_initBoxName)); _boxName = valueBoxName ; + wxBoxSizer *boxnameSizer = new wxBoxSizer(wxHORIZONTAL); + boxnameSizer->Add(textBoxType,0,wxEXPAND,5); + boxnameSizer->Add(valueBoxName,0,wxEXPAND,5); + boxnameSizer->Add( new wxStaticText(scrollWin, -1, wxT(" ")) ,0,wxCENTRE|wxEXPAND,5); + + + wxStaticText *text = new wxStaticText(scrollWin, -1, wxT("Input Ports")); wxFont font(11, wxDEFAULT, wxNORMAL, wxBOLD); text->SetFont(font); @@ -106,12 +116,16 @@ namespace bbtk for(int i = 0;i<(int)lstInputs.size();i++) { sizer->AddGrowableRow(i); - GPortModel* port = lstInputs[i]; - std::string type = port->getBBTKType(); - wxStaticText *lblName = new wxStaticText(scrollWin, -1, std2wx(port->getBBTKName()),wxDefaultPosition,wxSize(100,25)); - wxStaticText *lblType = new wxStaticText(scrollWin, -1, std2wx(type),wxDefaultPosition,wxSize(250,25)); - wxTextCtrl *txtValue = new wxTextCtrl(scrollWin, -1, _T(""),wxDefaultPosition,wxSize(300,25)); - + GPortModel *port = lstInputs[i]; + std::string type = port->getBBTKType(); + wxStaticText *lblName = new wxStaticText(scrollWin, -1, std2wx(port->getBBTKName()),wxDefaultPosition,wxSize(100,25)); + wxStaticText *lblType = new wxStaticText(scrollWin, -1, std2wx(type),wxDefaultPosition,wxSize(250,25)); + wxTextCtrl *txtValue = new wxTextCtrl(scrollWin, -1, _T(""),wxDefaultPosition,wxSize(300,25)); + + lblName->SetToolTip( std2wx(port->getBBTKDescription()) ); + txtValue->SetToolTip( std2wx(port->getBBTKDescription()) ); + + if(port->getValue()!="") { std::string text = port->getValue(); @@ -159,7 +173,7 @@ namespace bbtk sizerDialog->AddSpacer(10); sizerDialog->Add(textBoxName,0,wxALIGN_TOP|wxALIGN_CENTER); sizerDialog->AddSpacer(10); - sizerDialog->Add(valueBoxName, wxSizerFlags(0).Align(0).Border(wxLEFT, 100)); + sizerDialog->Add(boxnameSizer, wxSizerFlags(0).Align(0).Border(wxLEFT, 100)); sizerDialog->AddSpacer(10); sizerDialog->Add(text,0,wxALIGN_TOP|wxALIGN_CENTER); sizerDialog->AddSpacer(15); diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index cd6e443..b88f527 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -366,7 +366,7 @@ int wxVtkSceneManager::createGComplexBoxInputPort(std::string inputName) { //create the output port GPortController* portController = createGPort(GOUTPUTPORT, inputName, - "ComplexInputPort", 0, model); + "ComplexOutputPortType","ComplexOutputPortDescriopton", 0, model); model->addOutputPort((GPortModel*) portController->getModel()); //Associates the view with the correspondent renderer and the model. @@ -424,7 +424,7 @@ int wxVtkSceneManager::createGComplexBoxOutputPort(std::string outputName) { //create the output port GPortController* portController = createGPort(GINPUTPORT, outputName, - "ComplexInputPort", 0, model); + "ComplexInputPort","ComplexInputPortDescription", 0, model); model->addInputPort((GPortModel*) portController->getModel()); //Associates the view with the correspondent renderer and the model. @@ -448,7 +448,7 @@ int wxVtkSceneManager::createGComplexBoxOutputPort(std::string outputName) { int wxVtkSceneManager::createGInputPort(int portType, int posinBox, GBoxModel *blackBox, BlackBoxInputDescriptor *desc) { GPortController* portController = createGPort(portType, desc->GetName(), - desc->GetTypeName(), posinBox, blackBox); + desc->GetTypeName(), desc->GetDescription(), posinBox, blackBox); blackBox->addInputPort((GPortModel*) portController->getModel()); return portController->getId(); } @@ -458,7 +458,7 @@ int wxVtkSceneManager::createGInputPort(int portType, int posinBox, int wxVtkSceneManager::createGOutputPort(int portType, int posinBox, GBoxModel *blackBox, BlackBoxOutputDescriptor *desc) { GPortController* portController = createGPort(portType, desc->GetName(), - desc->GetTypeName(), posinBox, blackBox); + desc->GetTypeName(),desc->GetDescription(), posinBox, blackBox); blackBox->addOutputPort((GPortModel*) portController->getModel()); return portController->getId(); } @@ -466,7 +466,7 @@ int wxVtkSceneManager::createGOutputPort(int portType, int posinBox, //========================================================================= GPortController* wxVtkSceneManager::createGPort(int portType, - std::string bbtkName, std::string bbtkType, int posInBox, + std::string bbtkName, std::string bbtkType, std::string bbtkDescription, int posInBox, GBoxModel *blackBox) { int type = GPORT; @@ -484,6 +484,7 @@ GPortController* wxVtkSceneManager::createGPort(int portType, model->setBBTKType(bbtkType); model->setBBTKName(bbtkName); + model->setBBTKDescription(bbtkDescription); model->addObserver(view); model->addObserver(this); diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h index be332f7..4171311 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h @@ -116,7 +116,7 @@ namespace bbtk int createGBlackBox(int x, int y, std::string packageName, std::string boxType ); int createGComplexBoxInputPort(std::string inputName); int createGComplexBoxOutputPort(std::string outputName); - GPortController* createGPort(int portType, std::string bbtkName, std::string bbtkType, int posinBox,GBoxModel *blackBox); + GPortController* createGPort(int portType, std::string bbtkName, std::string bbtkType, std::string bbtkDescription, int posinBox,GBoxModel *blackBox); int createGInputPort(int portType, int posinBox,GBoxModel *blackBox, BlackBoxInputDescriptor *desc); int createGOutputPort(int portType, int posinBox,GBoxModel *blackBox, BlackBoxOutputDescriptor *desc); int createGConnector(GPortModel* startPort);