X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FInterface_ManagerContour_NDimensions%2FwxConceptControl.cxx;h=ceb3f8a0643ff344f3fe46f9d3e9028ca4dadb07;hb=refs%2Fheads%2Fvtk7itk4;hp=47c1c7e923de0f70e13e86560e10e79a104e036c;hpb=c7aa7286e02028ade712c1284fea9439d0d3c61c;p=creaContours.git diff --git a/lib/Interface_ManagerContour_NDimensions/wxConceptControl.cxx b/lib/Interface_ManagerContour_NDimensions/wxConceptControl.cxx index 47c1c7e..ceb3f8a 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxConceptControl.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxConceptControl.cxx @@ -1,3 +1,28 @@ +/*# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ */ + //---------------------------------------------------------------------------------------------------------------- // Class definition include @@ -26,6 +51,7 @@ DEFINE_EVENT_TYPE( wxEVT_CONCEPT_RELEASE ) minValue = minV; maxValue = maxV; + _numCheckBox = 0; showLabels = true; @@ -217,7 +243,12 @@ DEFINE_EVENT_TYPE( wxEVT_CONCEPT_RELEASE ) char a = *elements; if( a == 67 || a == 99 )// Including C:67 or c:99 as a checkBox (ASCII) { - createCheckBoxAndAddToSizer( checkSizer, "", -1, ckecks); + /*if(ckecks==0){ + createCheckBoxAndAddToSizer( checkSizer, "X", -1, ckecks); + }else{ + createCheckBoxAndAddToSizer( checkSizer, "Y", -1, ckecks); + }*/ + createCheckBoxAndAddToSizer( checkSizer, "X", -1, ckecks); ckecks++; } else if ( a == 84 || a==116 )// Including T:84 or t t:116 as textCtrl (ASCII) @@ -226,9 +257,14 @@ DEFINE_EVENT_TYPE( wxEVT_CONCEPT_RELEASE ) } i++; } + _numCheckBox = ckecks; sizer->Add(checkSizer, 0, wxGROW |wxALL ); } + int wxConceptControl :: getNumCheckBox(){ + return _numCheckBox; + } + //------------------------------------------------------------------------------------------------------------ wxCheckBox * wxConceptControl :: createCheckBoxAndAddToSizer(wxSizer *sizer, std::string label, wxWindowID id,int groupID) { @@ -236,10 +272,16 @@ DEFINE_EVENT_TYPE( wxEVT_CONCEPT_RELEASE ) //itoa( groupID, buffer, 10); std::string buffer; - for(int k = groupID; k == 0; k++){ - char temp = k % 10 + 48; - k = k / 10; - buffer = temp + buffer; + + if(groupID == 0){ + buffer = "0"; + }else{ + int k=groupID; + while (k > 0){ + char temp = k % 10 + 48; + k = k / 10; + buffer = temp + buffer; + } } //wxCheckBox *checkbox = new wxCheckBox( this, -1, wxString( label.c_str(), wxConvUTF8), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, wxString( buffer, wxConvUTF8) );