]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp
#3474 Refresh optimization DrawAxisTree3D Box
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualPaint / wxManualPaintPanel.cpp
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 #include "wxManualPaintPanel.h"
27 #include <wx/radiobox.h>
28
29 wxManualPaintPanel::wxManualPaintPanel( wxWindow * parent )
30                 : wxPanel( parent, -1 )
31 {
32         wxSizer *sizer = new wxFlexGridSizer( 1 );
33         // Widget interface
34         wxStaticText *tittleText = new wxStaticText( this, -1,_T("             Manual Paint") );
35         //Title
36         sizer->Add( tittleText );
37         //giving some blank spaces
38         sizer->Add( new wxStaticText( this, -1, _T("          key A : Enable/Disable   ") ) );
39         this->ConfigureActiveCBButton( );
40         this->ConfigureBrushToolRadioButton( );
41         this->Configure2D3DRadioButton( );
42         this->ConfigureBrushFormRadioButton( );
43         this->ConfigureRangeBar( );
44         this->ConfigureGrayLevelSld( );
45         this->ConfigureBrushSizeSld( );
46         this->ConfigureDistanceFillSld( );
47         this->ConfigureTolFillSld( );
48         this->ConfigureEditButtons( );
49         //Buttons
50         wxStaticText *editButtonsText   = new wxStaticText( this, -1,_T("Edit Buttons") );
51         this->_buttonsSizer                     = new wxFlexGridSizer( 4 );
52         this->_buttonsSizer->Add( _btnUndo, 1, wxGROW );
53         this->_buttonsSizer->Add( _btnRedo, 1, wxGROW );
54         this->_buttonsSizer->Add( _btnCopy, 1, wxGROW );
55         this->_gConfigSizer = new wxFlexGridSizer( 1 );
56         //BrushTool Radio Button
57         //giving blank space
58         this->_gConfigSizer->Add(  new wxStaticText( this, -1, _T("             ") ) );
59         //end of blank space
60         this->_gConfigSizer->Add( _rbBrushTool, 1, wxGROW );
61         //2D/3D Radio Button
62         this->_gConfigSizer->Add( _rb2D3D, 1, wxGROW );
63         //RangeBar
64         this->_gConfigSizer->Add( new wxStaticText( this, -1, _T( "Select Range" ) ), 1, wxGROW );
65         this->_gConfigSizer->Add( _mBarSlices, 1, wxGROW );
66         //GrayLevel Slider
67         this->_gConfigSizer->Add( _txtGrayLevel );
68
69 //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
70 #if wxMAJOR_VERSION <= 2
71         wxFlexGridSizer *sizerGrayLevel = new wxFlexGridSizer( 2, wxHORIZONTAL );
72 #else
73         wxFlexGridSizer *sizerGrayLevel = new wxFlexGridSizer( 2 );
74 #endif
75
76         sizerGrayLevel->Add( _sldGrayLevel, 1, wxGROW );
77         sizerGrayLevel->Add( _graylevelCtrl, 1,
78                 wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
79         this->_gConfigSizer->Add( sizerGrayLevel, 1, wxGROW );
80
81         //Brush
82         this->_brushSizer = new wxFlexGridSizer( 1 );
83         //giving blank space
84         this->_brushSizer->Add( new wxStaticText( this, -1, _T("             ") ) );
85         //end of blank space
86         this->_brushSizer->Add( new wxStaticText( this, -1, _T("Brush Settings") ) );
87         //BrushSize Slider
88         this->_brushSizer->Add( _txtBrushSize );
89
90 //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
91 #if wxMAJOR_VERSION <= 2
92         wxFlexGridSizer *sizersdlBrushSize = new wxFlexGridSizer( 2, wxHORIZONTAL );
93 #else
94         wxFlexGridSizer *sizersdlBrushSize = new wxFlexGridSizer( 2 );
95 #endif
96
97         sizersdlBrushSize->Add( _sldBrushSize, 1, wxGROW );
98         sizersdlBrushSize->Add( _BrushSizeCtrl, 1,
99                 wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
100         this->_brushSizer->Add( sizersdlBrushSize );
101         //BrushForm RadioButton
102         this->_brushSizer->Add( _rbBrushForm, 1, wxGROW );
103         //Fill
104         this->_FillSizer = new wxFlexGridSizer( 1 );
105         //giving blank space
106         this->_FillSizer->Add( new wxStaticText( this, -1, _T("             ") ) );
107         //end of blank space
108         this->_FillSizer->Add( new wxStaticText( this, -1, _T("Fill Settings") ) );
109         //ToleranceFill
110         this->_FillSizer->Add( _txtToleranceFill );
111         wxFlexGridSizer *sizerTolerance = new wxFlexGridSizer( 2 );
112         sizerTolerance->Add( _sldToleranceFill, 1, wxGROW );
113         sizerTolerance->Add( _tolerancefillCtrl, 1, wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
114         this->_FillSizer->Add( sizerTolerance, 1, wxGROW );
115         //Distance Fill
116         this->_FillSizer->Add( _txtDistanceFill );
117         wxFlexGridSizer *sizerDistance = new wxFlexGridSizer( 2 );
118         sizerDistance->Add( _sldDistanceFill, 1, wxGROW );
119         sizerDistance->Add( _distancefillCtrl, 1, wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
120         this->_FillSizer->Add( sizerDistance );
121         sizer->Add( _activeCB );
122         sizer->Add( editButtonsText );
123         sizer->Add( _buttonsSizer );
124         sizer->Add( _gConfigSizer );
125         sizer->Add( _brushSizer );
126         sizer->Add( _FillSizer );
127         this->ConnectComponents( ); //DFCH
128         this->_FillSizer->Show( false );
129         this->SetSizer( sizer );
130         this->SetAutoLayout( true );
131         this->Layout( );
132 }
133
134 //---------------------------------------------------------------------------
135 wxManualPaintPanel::~wxManualPaintPanel( )
136 {
137 }
138
139 //--------------------------------------------------------------------------
140 void wxManualPaintPanel::ConfigureActiveCBButton( )
141 {
142    _activeCB = new wxCheckBox (this, -1, _T("Active") );
143    _activeCB->SetValue(true);
144    SetActive( _activeCB->GetValue() );
145 }
146
147
148 //Panel Config
149 //--------------------------------------------------------------------------
150 void wxManualPaintPanel::ConfigureBrushToolRadioButton( )
151 {
152         wxString lstBrushForm[ 2 ];
153         lstBrushForm[ 0 ] = _T("rectangle/cube");
154         lstBrushForm[ 1 ] = _T("circle/sphere");
155         _rbBrushForm = new wxRadioBox( this, -1, _T("Brush form"),
156                 wxDefaultPosition, wxSize( 270, 45 ), 2, lstBrushForm, 2,
157                 wxRA_SPECIFY_COLS );
158 }
159
160 //--------------------------------------------------------------------------
161 void wxManualPaintPanel::Configure2D3DRadioButton( )
162 {
163         wxString lst2D3D[ 2 ];
164         lst2D3D[ 0 ] = _T("2D");
165         lst2D3D[ 1 ] = _T("3D");
166         _rb2D3D = new wxRadioBox( this, -1, _T("2D / 3D"), wxDefaultPosition,
167                 wxSize( 270, 45 ), 2, lst2D3D, 2, wxRA_SPECIFY_COLS );
168         _rb2D3D->SetSelection( 1 );
169
170 }
171
172 //--------------------------------------------------------------------------
173 void wxManualPaintPanel::ConfigureBrushFormRadioButton( )
174 {
175         wxString lstBrushTool[ 2 ];
176         lstBrushTool[ 0 ] = _T("Brush");
177         lstBrushTool[ 1 ] = _T("Fill");
178         _rbBrushTool = new wxRadioBox( this, -1, _T("Brush tool"),
179                 wxDefaultPosition, wxSize( 270, 45 ), 2, lstBrushTool, 2,
180                 wxRA_SPECIFY_COLS );
181 }
182
183 //--------------------------------------------------------------------------
184 void wxManualPaintPanel::ConfigureRangeBar( )
185 {
186         //DFCH -- BarSlices
187         double range[ 2 ];
188         GetScalarRange( range );
189         int min = 0; //range[0];
190         int max = 6000; //range[1];
191         _mBarSlices = new mBarRange( this, 70, 65 );
192         _mBarSlices->SetMin( 0 );
193         _mBarSlices->SetStart( 0 );
194         _mBarSlices->SetOrientation( true );
195         _mBarSlices->setActiveStateTo( true );
196         _mBarSlices->setVisibleLabels( true );
197         _mBarSlices->setDeviceEndMargin( 10 );
198         _mBarSlices->setDeviceBlitStart( 10, 10 );
199         _mBarSlices->setIfWithActualDrawed( false );
200         _mBarSlices->setRepresentedValues( min, max );
201         _mBarSlices->SetStart( min );
202         _mBarSlices->SetEnd( max );
203         _mBarSlices->Update( );
204         SetRangeMin( min );
205         SetRangeMax( max );
206         //DFCH -- End BarSlices
207 }
208
209 //--------------------------------------------------------------------------
210 void wxManualPaintPanel::ConfigureGrayLevelSld( )
211 {
212         _txtGrayLevel = new wxStaticText( this, -1,
213         wxString( _T("  Gray Level  ") ) );
214         _sldGrayLevel = new wxSlider( this, -1, 0, 0, 255, wxDefaultPosition,
215         wxDefaultSize, wxSL_LABELS );
216         _sldGrayLevel->SetMinSize( wxSize( 200, -1 ) );
217         _sldGrayLevel->SetMaxSize( wxSize( 200, -1 ) );
218         _graylevelCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
219         wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 0 );
220 }
221
222 //--------------------------------------------------------------------------
223 void wxManualPaintPanel::ConfigureBrushSizeSld( )
224 {
225         _txtBrushSize = new wxStaticText( this, -1,
226         wxString( _T("  Brush size  ") ) );
227         _sldBrushSize = new wxSlider( this, -1, 5, 1, 50, wxDefaultPosition,
228         wxDefaultSize, wxSL_LABELS );
229         _BrushSizeCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
230         wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 0 );
231         _sldBrushSize->SetMinSize( wxSize( 200, -1 ) );
232         _sldBrushSize->SetMaxSize( wxSize( 200, -1 ) );
233 }
234
235 //--------------------------------------------------------------------------
236 void wxManualPaintPanel::ConfigureDistanceFillSld( )
237 {
238         _txtDistanceFill = new wxStaticText( this, -1,
239         wxString( _T("  Distance fill  ") ) );
240         _sldDistanceFill = new wxSlider( this, -1, 5, 1, 500, wxDefaultPosition,
241         wxDefaultSize, wxSL_LABELS );
242         _sldDistanceFill->SetMinSize( wxSize( 200, -1 ) );
243         _sldDistanceFill->SetMaxSize( wxSize( 200, -1 ) );
244         _distancefillCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
245         wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 500, 50 );
246         _txtDistanceFill->Disable( );
247         _sldDistanceFill->Disable( );
248         _distancefillCtrl->Disable( );
249 }
250
251 //--------------------------------------------------------------------------
252 void wxManualPaintPanel::ConfigureTolFillSld( )
253 {
254         _txtToleranceFill = new wxStaticText( this, -1,wxString( _T("  Tolerance fill  ") ) );
255         _sldToleranceFill = new wxSlider( this, -1, 125, 0, 255, wxDefaultPosition,wxDefaultSize, wxSL_LABELS );
256         _sldToleranceFill->SetMinSize( wxSize( 200, -1 ) );
257         _sldToleranceFill->SetMaxSize( wxSize( 200, -1 ) );
258         _tolerancefillCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, 50 );
259         _txtToleranceFill->Disable( );
260         _sldToleranceFill->Disable( );
261         _tolerancefillCtrl->Disable( );
262 }
263
264 //--------------------------------------------------------------------------
265 void wxManualPaintPanel::ConfigureEditButtons( )
266 {
267         _btnCopy = new wxButton( this, -1, _T("Copy") );
268         _btnCopy->Disable( );
269         _btnUndo = new wxButton( this, -1, _T("Undo") );
270         _btnRedo = new wxButton( this, -1, _T("Redo") );
271         //btnUndo->Disable();
272 }
273 //--------------------------------------------------------------------------
274
275 /*
276  * The following function allows the management of the events
277  */
278 void wxManualPaintPanel::ConnectComponents( ) //DFCH
279 {
280         this->Connect(_sldBrushSize->GetId( ),
281                 wxEVT_SCROLL_THUMBRELEASE,
282                 (wxObjectEventFunction) (void(wxPanel::*)(
283                 wxScrollEvent& )) (&wxManualPaintPanel::OnBrushSize) );this ->Connect (_sldGrayLevel->GetId(),
284                 wxEVT_SCROLL_THUMBRELEASE,
285                 (wxObjectEventFunction) (void(wxPanel::*)( wxScrollEvent&)) &wxManualPaintPanel::OnSldGrayLevel);
286
287                 this->Connect(  _graylevelCtrl->GetId(),
288                                 wxEVT_COMMAND_TEXT_UPDATED,
289                                 (wxObjectEventFunction) (void(wxPanel::*)(
290                                                                 wxCommandEvent&)) &wxManualPaintPanel::OnCtrTxtGrayLevel);
291
292                 this->Connect (
293                                 _sldToleranceFill->GetId(),
294                                 wxEVT_SCROLL_THUMBRELEASE,
295                                 (wxObjectEventFunction) (void(wxPanel::*)(
296                                                                 wxScrollEvent&)) &wxManualPaintPanel::OnSldToleranceFill);this->Connect
297                 (
298                                 _tolerancefillCtrl->GetId(),
299                                 wxEVT_COMMAND_TEXT_UPDATED,
300                                 (wxObjectEventFunction) (void(wxPanel::*)(
301                                                                 wxCommandEvent&)) &wxManualPaintPanel::OnCtrTxtToleranceFill);
302
303                 this->Connect (
304                                 _sldDistanceFill->GetId(),
305                                 wxEVT_SCROLL_THUMBRELEASE,
306                                 (wxObjectEventFunction) (void(wxPanel::*)(
307                                                                 wxScrollEvent&)) &wxManualPaintPanel::OnSldDistanceFill);this->Connect
308                 (
309                                 _distancefillCtrl->GetId(),
310                                 wxEVT_COMMAND_TEXT_UPDATED,
311                                 (wxObjectEventFunction) (void(wxPanel::*)(
312                                                                 wxCommandEvent&)) &wxManualPaintPanel::OnCtrTxtDistanceFill);
313
314                 this->Connect (
315                                 _rb2D3D->GetId(),
316                                 wxEVT_COMMAND_RADIOBOX_SELECTED,
317                                 (wxObjectEventFunction) (void(wxPanel::*)(
318                                                                 wxCommandEvent&)) &wxManualPaintPanel::On2D3D);this->Connect
319                 (
320                                 _rbBrushForm->GetId(),
321                                 wxEVT_COMMAND_RADIOBOX_SELECTED,
322                                 (wxObjectEventFunction) (void(wxPanel::*)(
323                                                                 wxCommandEvent&)) &wxManualPaintPanel::OnBrushForm);this->Connect
324                 (
325                                 _rbBrushTool->GetId(),
326                                 wxEVT_COMMAND_RADIOBOX_SELECTED,
327                                 (wxObjectEventFunction) (void(wxPanel::*)(
328                                                                 wxCommandEvent&)) &wxManualPaintPanel::OnTool);this->Connect
329                 (
330                                 _btnCopy->GetId(),
331                                 wxEVT_COMMAND_BUTTON_CLICKED,
332                                 (wxObjectEventFunction) (void(wxPanel::*)(
333                                                                 wxCommandEvent&)) &wxManualPaintPanel::OnCopy);
334
335                 this->Connect (
336                                 _btnUndo->GetId(),
337                                 wxEVT_COMMAND_BUTTON_CLICKED,
338                                 (wxObjectEventFunction) (void(wxPanel::*)(
339                                                                 wxCommandEvent&)) &wxManualPaintPanel::OnUndo);
340                 this->Connect(_btnRedo->GetId(),
341                                 wxEVT_COMMAND_BUTTON_CLICKED,
342                                 (wxObjectEventFunction) (void(wxPanel::*)(
343                                                                 wxCommandEvent&)) &wxManualPaintPanel::OnRedo); //DFCH
344
345                 this->Connect(
346                                 _mBarSlices->GetId(),
347                                 wxEVT_TSBAR,
348                                 (wxObjectEventFunction) (wxCommandEventFunction) &wxManualPaintPanel::onBarrange);
349                 //                      Connect(modBarRange->GetId(),98765,(wxObjectEventFunction) (wxCommandEventFunction)  &wxWidgetSliderMinMax::onActualChange_Bar );
350                 this->Connect(
351                                 _mBarSlices->GetId(),
352                                 wxEVT_TSBAR_ACTUAL,
353                                 (wxObjectEventFunction) (wxCommandEventFunction) &wxManualPaintPanel::onActualChange_Bar);
354                 this->Connect(
355                                 _mBarSlices->GetId(),
356                                 wxEVT_TSBAR_START,
357                                 (wxObjectEventFunction) (wxCommandEventFunction) &wxManualPaintPanel::onStartChange_Bar);
358                 this->Connect(
359                                 _mBarSlices->GetId(),
360                                 wxEVT_TSBAR_END,
361                                 (wxObjectEventFunction) (wxCommandEventFunction) &wxManualPaintPanel::onEndChange_Bar);
362                 this->Connect(
363                                 _mBarSlices->GetId(),
364                                 wxEVT_SELECTION_END,
365                                 (wxObjectEventFunction) (wxCommandEventFunction) &wxManualPaintPanel::onSelectionEnd);
366                 this->Connect(
367                                 _mBarSlices->GetId(),
368                                 wxEVT_TSBAR_MOVED,
369                                 (wxObjectEventFunction) (wxCommandEventFunction) &wxManualPaintPanel::onMovedBar);
370                 this->Connect
371                 (
372                                 _BrushSizeCtrl->GetId(),
373                                 wxEVT_COMMAND_TEXT_UPDATED,
374                                 (wxObjectEventFunction) (void(wxPanel::*)(
375                                                                 wxCommandEvent&)) &wxManualPaintPanel::OnCtrBrushSize);
376                 this->Connect
377                 (
378                         _activeCB->GetId(),
379                         wxEVT_COMMAND_CHECKBOX_CLICKED, 
380                         (wxObjectEventFunction) (void (wxPanel::*)(wxCommandEvent&))&wxManualPaintPanel::OnActive);
381         }
382
383
384   //-------------------------------------------------------------------------
385   void wxManualPaintPanel::OnActive(wxCommandEvent& event)
386   {
387         SetActive( _activeCB->GetValue() );
388   }
389
390
391 //---------------------------------------------------------------------------
392 void wxManualPaintPanel::OnBrushSize( wxScrollEvent& event )
393 {
394         SetBrushSize( this->_sldBrushSize->GetValue( ) );
395         wxString text;
396         text.Printf( wxT("%d"), this->_sldBrushSize->GetValue( ) );
397         _BrushSizeCtrl->SetValue( text );
398 }
399
400 //---------------------------------------------------------------------------
401 void wxManualPaintPanel::OnSldGrayLevel( wxScrollEvent& event )
402 {
403         SetGrayLevel( (double) ( _sldGrayLevel->GetValue( )) );
404         wxString text;
405         text.Printf( wxT("%d"), _sldGrayLevel->GetValue( ) );
406         _graylevelCtrl->SetValue( text );
407 }
408
409 //---------------------------------------------------------------------------
410 void wxManualPaintPanel::OnCtrTxtGrayLevel( wxCommandEvent &event )
411 {
412         int graylevel = this->_graylevelCtrl->GetValue( );
413         this->_sldGrayLevel->SetValue( graylevel );
414         SetGrayLevel( graylevel );
415 }
416
417 //---------------------------------------------------------------------------
418 void wxManualPaintPanel::OnSldDistanceFill( wxScrollEvent& event )
419 {
420         SetDistanceFill( (double) ( _sldDistanceFill->GetValue( )) );
421         wxString text;
422         text.Printf( wxT("%d"), _sldDistanceFill->GetValue( ) );
423         _distancefillCtrl->SetValue( text );
424 }
425
426 //---------------------------------------------------------------------------
427 void wxManualPaintPanel::OnCtrTxtDistanceFill( wxCommandEvent &event )
428 {
429         int distancefill = this->_distancefillCtrl->GetValue( );
430         this->_sldDistanceFill->SetValue( distancefill );
431         SetDistanceFill( distancefill );
432 }
433 //---------------------------------------------------------------------------
434 void wxManualPaintPanel::OnCtrBrushSize( wxCommandEvent &event )
435 {
436         int brushSize = _BrushSizeCtrl->GetValue( );
437         this->_sldBrushSize->SetValue( brushSize );
438         SetBrushSize( brushSize );
439 }
440
441 //---------------------------------------------------------------------------
442 void wxManualPaintPanel::OnSldToleranceFill( wxScrollEvent& event )
443 {
444         SetToleranceFill( (double) ( _sldToleranceFill->GetValue( )) );
445         wxString text;
446         text.Printf( wxT("%d"), _sldToleranceFill->GetValue( ) );
447         _tolerancefillCtrl->SetValue( text );
448 }
449
450 //---------------------------------------------------------------------------
451 void wxManualPaintPanel::OnCtrTxtToleranceFill( wxCommandEvent &event )
452 {
453         int tolerance = _tolerancefillCtrl->GetValue( );
454         this->_sldToleranceFill->SetValue( tolerance );
455         SetToleranceFill( tolerance );
456 }
457
458 //---------------------------------------------------------------------------
459 void wxManualPaintPanel::DisableControls( )
460 {
461         _txtBrushSize->Disable( );
462         _sldBrushSize->Disable( );
463         _rbBrushForm->Disable( );
464
465         _txtToleranceFill->Disable( );
466         _sldToleranceFill->Disable( );
467         _tolerancefillCtrl->Disable( );
468
469         _txtDistanceFill->Disable( );
470         _sldDistanceFill->Disable( );
471         _distancefillCtrl->Disable( );
472 }
473
474 //---------------------------------------------------------------------------
475 void wxManualPaintPanel::On2D3D( wxCommandEvent &event )
476 {
477         Set2D3D( _rb2D3D->GetSelection( ) );
478 }
479
480 //---------------------------------------------------------------------------
481 void wxManualPaintPanel::OnBrushForm( wxCommandEvent &event )
482 {
483         SetBrushForm( _rbBrushForm->GetSelection( ) );
484 }
485
486 //---------------------------------------------------------------------------
487 void wxManualPaintPanel::OnTool( wxCommandEvent &event )
488 {
489         DisableControls( );
490         SetTool( _rbBrushTool->GetSelection( ) );
491
492         if( _rbBrushTool->GetSelection( ) == 0 ) //Brush tool
493         {
494                 _txtBrushSize->Enable( );
495                 _sldBrushSize->Enable( );
496                 _rbBrushForm->Enable( );
497                 _brushSizer->Show( true );
498                 _FillSizer->Show( false );
499                 this->Layout( );
500         }
501
502         if( _rbBrushTool->GetSelection( ) == 1 ) //Fill tool
503         {
504                 _txtToleranceFill->Enable( );
505                 _sldToleranceFill->Enable( );
506                 _tolerancefillCtrl->Enable( );
507                 _txtDistanceFill->Enable( );
508                 _sldDistanceFill->Enable( );
509                 _distancefillCtrl->Enable( );
510                 _FillSizer->Show( true );
511                 _brushSizer->Show( false );
512                 this->Layout( );
513         }
514 }
515
516 //---------------------------------------------------------------------------
517 void wxManualPaintPanel::OnCopy( wxCommandEvent &event )
518 {
519 }
520
521 //---------------------------------------------------------------------------
522 void wxManualPaintPanel::OnUndo( wxCommandEvent &event )
523 {
524         this->_manualPaintControler->Undo( );
525 }
526
527 //---------------------------------------------------------------------------
528 void wxManualPaintPanel::OnRedo( wxCommandEvent &event )
529 {
530         this->_manualPaintControler->Redo( );
531 }
532
533 //--------------------------------------------------------------------------------------------------------------------------------
534 // Min-Max Barrange received events
535 //--------------------------------------------------------------------------------------------------------------------------------
536 void wxManualPaintPanel::onBarrange( wxCommandEvent& event )
537 {
538 }
539
540 void wxManualPaintPanel::onActualChange_Bar( wxCommandEvent& event )
541 {
542         /*mbbtkSliderMinMax->bbSetOutputOutActual(modBarRange->GetActual());
543          mbbtkSliderMinMax->bbSignalOutputModification(std::string("OutActual"));*/
544 }
545
546 void wxManualPaintPanel::onStartChange_Bar( wxCommandEvent& event )
547 {
548         SetRangeMin( _mBarSlices->GetStart( ) );
549 }
550
551 void wxManualPaintPanel::onEndChange_Bar( wxCommandEvent& event )
552 {
553         SetRangeMax( _mBarSlices->GetEnd( ) );
554 }
555
556 void wxManualPaintPanel::onSelectionEnd( wxCommandEvent& event )
557 {
558 }
559
560 void wxManualPaintPanel::onMovedBar( wxCommandEvent& event )
561 {
562 }
563 //-------------------------------------------------------------------------
564 //--------------------------------------------------------------------------
565 //--------------------------------------------------------------------------
566