+/*# ---------------------------------------------------------------------
+#
+# 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 "wxManualPaintPanel.h"
#include <wx/radiobox.h>
//Title
sizer->Add( tittleText );
//giving some blank spaces
- sizer->Add( new wxStaticText( this, -1, _T(" ") ) );
+ sizer->Add( new wxStaticText( this, -1, _T(" key A : Enable/Disable ") ) );
+ this->ConfigureActiveCBButton( );
this->ConfigureBrushToolRadioButton( );
this->Configure2D3DRadioButton( );
this->ConfigureBrushFormRadioButton( );
//Buttons
wxStaticText *editButtonsText = new wxStaticText( this, -1,
_T("Edit Buttons") );
- sizer->Add( editButtonsText );
this->_buttonsSizer = new wxFlexGridSizer( 4 );
this->_buttonsSizer->Add( _btnUndo, 1, wxGROW );
this->_buttonsSizer->Add( _btnRedo, 1, wxGROW );
this->_gConfigSizer = new wxFlexGridSizer( 1 );
//BrushTool Radio Button
//giving blank space
- this->_gConfigSizer->Add(
- new wxStaticText( this, -1, _T(" ") ) );
+ this->_gConfigSizer->Add( new wxStaticText( this, -1, _T(" ") ) );
//end of blank space
this->_gConfigSizer->Add( _rbBrushTool, 1, wxGROW );
//2D/3D Radio Button
wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
this->_FillSizer->Add( sizerDistance );
+ sizer->Add( _activeCB );
+ sizer->Add( editButtonsText );
sizer->Add( _buttonsSizer );
sizer->Add( _gConfigSizer );
sizer->Add( _brushSizer );
}
//--------------------------------------------------------------------------
+void wxManualPaintPanel::ConfigureActiveCBButton( )
+{
+ _activeCB = new wxCheckBox (this, -1, _T("Active") );
+ _activeCB->SetValue(true);
+ SetActive( _activeCB->GetValue() );
+}
+
//Panel Config
+//--------------------------------------------------------------------------
void wxManualPaintPanel::ConfigureBrushToolRadioButton( )
{
wxString lstBrushForm[ 2 ];
wxDefaultPosition, wxSize( 270, 45 ), 2, lstBrushForm, 2,
wxRA_SPECIFY_COLS );
}
+
//--------------------------------------------------------------------------
void wxManualPaintPanel::Configure2D3DRadioButton( )
{
_mBarSlices->SetStart( min );
_mBarSlices->SetEnd( max );
_mBarSlices->Update( );
+
+ SetRangeMin( min );
+ SetRangeMax( max );
+
//DFCH -- End BarSlices
}
//--------------------------------------------------------------------------
void wxManualPaintPanel::ConfigureGrayLevelSld( )
{
_txtGrayLevel = new wxStaticText( this, -1,
- wxString( _T(" Gray Level ") ) );
+ wxString( _T(" Gray Level ") ) );
_sldGrayLevel = new wxSlider( this, -1, 0, 0, 255, wxDefaultPosition,
- wxDefaultSize, wxSL_LABELS );
+ wxDefaultSize, wxSL_LABELS );
_sldGrayLevel->SetMinSize( wxSize( 200, -1 ) );
_sldGrayLevel->SetMaxSize( wxSize( 200, -1 ) );
_graylevelCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
- wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 0 );
+ wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 0 );
}
//--------------------------------------------------------------------------
void wxManualPaintPanel::ConfigureBrushSizeSld( )
{
_txtBrushSize = new wxStaticText( this, -1,
- wxString( _T(" Brush size ") ) );
+ wxString( _T(" Brush size ") ) );
_sldBrushSize = new wxSlider( this, -1, 1, 1, 50, wxDefaultPosition,
- wxDefaultSize, wxSL_LABELS );
+ wxDefaultSize, wxSL_LABELS );
_BrushSizeCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
- wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 0 );
+ wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 0 );
_sldBrushSize->SetMinSize( wxSize( 200, -1 ) );
_sldBrushSize->SetMaxSize( wxSize( 200, -1 ) );
}
void wxManualPaintPanel::ConfigureDistanceFillSld( )
{
_txtDistanceFill = new wxStaticText( this, -1,
- wxString( _T(" Distance fill ") ) );
+ wxString( _T(" Distance fill ") ) );
_sldDistanceFill = new wxSlider( this, -1, 50, 1, 500, wxDefaultPosition,
- wxDefaultSize, wxSL_LABELS );
+ wxDefaultSize, wxSL_LABELS );
_sldDistanceFill->SetMinSize( wxSize( 200, -1 ) );
_sldDistanceFill->SetMaxSize( wxSize( 200, -1 ) );
_distancefillCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
- wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 500, 50 );
+ wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 500, 50 );
_txtDistanceFill->Disable( );
_sldDistanceFill->Disable( );
_distancefillCtrl->Disable( );
*/
void wxManualPaintPanel::ConnectComponents( ) //DFCH
{
- this->Connect(
- _sldBrushSize->GetId( ),
+ this->Connect(_sldBrushSize->GetId( ),
wxEVT_SCROLL_THUMBRELEASE,
(wxObjectEventFunction) (void(wxPanel::*)(
- wxScrollEvent& )) (&wxManualPaintPanel::OnBrushSize) );this ->Connect (_sldGrayLevel->GetId(),
- wxEVT_SCROLL_THUMBRELEASE,
- (wxObjectEventFunction) (void(wxPanel::*)(
- wxScrollEvent&)) &wxManualPaintPanel::OnSldGrayLevel);
- this->Connect
- (
- _graylevelCtrl->GetId(),
+ wxScrollEvent& )) (&wxManualPaintPanel::OnBrushSize) );this ->Connect (_sldGrayLevel->GetId(),
+ wxEVT_SCROLL_THUMBRELEASE,
+ (wxObjectEventFunction) (void(wxPanel::*)( wxScrollEvent&)) &wxManualPaintPanel::OnSldGrayLevel);
+
+ this->Connect( _graylevelCtrl->GetId(),
wxEVT_COMMAND_TEXT_UPDATED,
(wxObjectEventFunction) (void(wxPanel::*)(
wxCommandEvent&)) &wxManualPaintPanel::OnCtrTxtGrayLevel);
wxEVT_COMMAND_TEXT_UPDATED,
(wxObjectEventFunction) (void(wxPanel::*)(
wxCommandEvent&)) &wxManualPaintPanel::OnCtrBrushSize);
+ this->Connect
+ (
+ _activeCB->GetId(),
+ wxEVT_COMMAND_CHECKBOX_CLICKED,
+ (wxObjectEventFunction) (void (wxPanel::*)(wxCommandEvent&))&wxManualPaintPanel::OnActive);
}
+
+ //-------------------------------------------------------------------------
+ void wxManualPaintPanel::OnActive(wxCommandEvent& event)
+ {
+ printf("EED wxManualPaintPanel::OnActive \n");
+ SetActive( _activeCB->GetValue() );
+ }
+
+
//---------------------------------------------------------------------------
void wxManualPaintPanel::OnBrushSize( wxScrollEvent& event )
{