X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FpPlotter%2FmBarRange.cxx;h=b92232faecc1a806ae48ab8e4fba8551abbfc1f9;hb=94a6229aed777e2270a361e3d1721a14daa50d25;hp=494d599f949c937a8290d1b086c4a7c30218ed71;hpb=0738bcbc9e571daa06e0249bc9d9b8c42b30cecf;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx index 494d599..b92232f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.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. +# ------------------------------------------------------------------------ */ + //---------------------------------------------------------------------------- #include "mBarRange.h" @@ -254,14 +279,15 @@ void mBarRange::SetHeight(int h) int mBarRange::filtreValue(int value) { if(value<_min) + { value = _min; - else if (value>_max) + } else if (value>_max) { value = _max; - + } return value; } - +//---------------------------------------------------------------------------- int mBarRange::GetStart() { return _start; @@ -272,11 +298,17 @@ int mBarRange::GetStart() void mBarRange::SetStart(int newstart) { _start = filtreValue(newstart); - if (_start>_end) { _start=_end; } + + if (_start>_end) + { + _start=_end; + } + if (_in_rangeProperty==true) { if (_start>_actual) { _start=_actual; } } + RefreshForce(); } //---------------------------------------------------------------------------- @@ -296,7 +328,10 @@ void mBarRange::SetEnd(int newend) if (_end<_start) { _end=_start; } if (_in_rangeProperty==true) { - if (_end<_actual) { _end=_actual; } + if (_end<_actual) + { + _end=_actual; + } // _end } RefreshForce(); } @@ -326,6 +361,7 @@ int mBarRange::GetTrianglesHalfWidth() { return trianglesHalfWidth; } + //---------------------------------------------------------------------------- void mBarRange::SetTrianglesHalfWidth(int nwTriHalfWidth) { @@ -338,9 +374,7 @@ void mBarRange::OnSize( wxSizeEvent &WXUNUSED(event) ) if(_orientation) { SetWidth( rectTotal.GetWidth() - deviceEndMargin ); - } - else - { + } else { SetWidth( rectTotal.GetHeight() - deviceEndMargin); } _selectionMoveId = -1; @@ -360,7 +394,8 @@ void mBarRange::Refresh(bool eraseBackground, const wxRect* rect) //---------------------------------------------------------------------------- void mBarRange::OnPaint( wxPaintEvent &WXUNUSED(event) ) { - if (_bitmap_bar!=NULL){ + if (_bitmap_bar!=NULL) + { //repaint rectangle if(_orientation) { @@ -392,9 +427,8 @@ void mBarRange::OnPaint( wxPaintEvent &WXUNUSED(event) ) // dc.Blit(0,_w, _h+deviceStart_y+200, _w+deviceStart_x+200-deviceEndMargin, &temp_dc, deviceStart_y,_w+deviceStart_x); // } - } - } + } // _bitmap_bar } @@ -1362,7 +1396,6 @@ void mBarRange :: setVisibleLabels ( bool setVisibleLB ) return guideLineColor; } - void mBarRange ::onLeftClicDown(wxMouseEvent& event ) { acceptedClick = true;