X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FInterface_ManagerContour_NDimensions%2FwxInstantChooserPanel.cxx;h=cd697ef36fb8042a3c986eb656c90472cd48ba0d;hb=3a73ff10fa8904d7aad5df49b1481f58abf829e3;hp=3184c942ac9dbcbc994e441c860f94685f6d0ae2;hpb=89db06fc8f04c54d2cee1b07a5abe3ac7ee6cf65;p=creaContours.git diff --git a/lib/Interface_ManagerContour_NDimensions/wxInstantChooserPanel.cxx b/lib/Interface_ManagerContour_NDimensions/wxInstantChooserPanel.cxx index 3184c94..cd697ef 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxInstantChooserPanel.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxInstantChooserPanel.cxx @@ -4,6 +4,10 @@ #include "wxInstantChooserPanel.h" #include "wxContourMainFrame.h" +//Test JCP 13-10-08 +//#include "wxContourEventHandler.h" +//Test JCP 13-10-08 + //---------------------------------------------------------------------------------------------------------------- // Class implementation //---------------------------------------------------------------------------------------------------------------- @@ -52,7 +56,7 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHOOSER_CHANGE ) sizer->Add( _outSizer, 1, wxEXPAND| wxGROW ); sizer->Add( resolutionSizer, 1, wxEXPAND | wxGROW ); SetSizer( sizer ); - Connect( wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxInstantChooserPanel:: onChechBoxClicked ); + Connect( wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxInstantChooserPanel:: onCheckBoxClicked ); } @@ -75,7 +79,7 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHOOSER_CHANGE ) sizer->Add( _outSizer, 1, wxEXPAND| wxGROW ); sizer->Add( _resolutionSlider, 1, wxEXPAND | wxGROW ); SetSizer( sizer ); - Connect( wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxInstantChooserPanel:: onChechBoxClicked ); + Connect( wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxInstantChooserPanel:: onCheckBoxClicked ); } wxInstantChooserPanel :: ~wxInstantChooserPanel() @@ -157,9 +161,9 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHOOSER_CHANGE ) } //------------------------------------------------------------------------------------------------------------ - void wxInstantChooserPanel :: onChechBoxClicked( wxCommandEvent& event ) + void wxInstantChooserPanel :: onCheckBoxClicked( wxCommandEvent& event ) { - int groupID = (int)event.GetClientData(); + /*int groupID = (int)event.GetClientData(); wxConceptControl * eventConcept = (wxConceptControl *)event.GetEventObject(); if ( eventConcept->getIfChecked( groupID ) ) { @@ -182,6 +186,32 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHOOSER_CHANGE ) } } } + }*/ + + int groupID = (int)event.GetClientData(); + wxConceptControl * eventConcept = (wxConceptControl *)event.GetEventObject(); + if ( eventConcept->getIfChecked( groupID ) ) + { + int size = _concepts->size(); + wxConceptControl * aConcept = NULL; + int accum = 0; + + for(int i = 0; i < eventConcept->getNumCheckBox();i++){ + if(i!=groupID){ + eventConcept->clearCheckAt(i); + } + } + for(int i=0; igetIfChecked( groupID ) ) + { + aConcept->clearCheckAt( groupID ); + } + } + } } } @@ -196,8 +226,19 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHOOSER_CHANGE ) // Sending the event of wxINSTANT_CHOOSER_CHANGE //------------------------------------------------- wxCommandEvent newevent(wxINSTANT_CHOOSER_CHANGE,GetId()); - _eventHandler->ProcessEvent(newevent); + //this->onChangeInstant(newevent); + ConceptDataWrap * dataConcept = getLastConceptData(); + if(getIfConceptCheckedAt( dataConcept->getName(), 0 )){ + wxContourMainFrame::getInstance()->onChangeInstantInstantPanel(dataConcept->getName(), dataConcept->getActualValue(), dataConcept->getMinShowedValue(), dataConcept->getMaxShowedValue()); + } + //((wxContourEventHandler*)_eventHandler)->onChangeInstant(newevent); + //_eventHandler->ProcessEvent(newevent); } + + void wxInstantChooserPanel :: onChangeInstant( wxCommandEvent& event ){ + + } + //------------------------------------------------------------------------------------------------------------ // Methods for sending events //------------------------------------------------------------------------------------------------------------ @@ -445,3 +486,16 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHOOSER_CHANGE ) } + void wxInstantChooserPanel::addConcepts(std::vector conceptNameVect,std::vector conceptSizeVect){ + int i=0; + int max = conceptNameVect.size(); + for( ; i