- wxStaticText *tittleText = new wxStaticText(panel, -1,
- _T(" Manual Paint"));
- _txtBrushSize = new wxStaticText(panel, -1, wxString(_T(" Brush size ")));
- _sldBrushSize = new wxSlider(panel, -1, 1, 1, 20, wxDefaultPosition,
- wxDefaultSize, wxSL_LABELS);
- wxStaticText *txtGrayLevel = new wxStaticText(panel, -1,
- wxString(_T(" Gray Level ")));
- _sldGrayLevel = new wxSlider(panel, -1, 0, 0, 50, wxDefaultPosition,
- wxDefaultSize, wxSL_LABELS);
- _graylevelCtrl = new wxTextCtrl(panel, -1);
- _txtToleranceFill = new wxStaticText(panel, -1,
- wxString(_T(" Tolerance fill ")));
- _sldToleranceFill = new wxSlider(panel, -1, 50, 0, 50, wxDefaultPosition,
- wxDefaultSize, wxSL_LABELS);
- _tolerancefillCtrl = new wxTextCtrl(panel, -1, _T("50"));
- _txtDistanceFill = new wxStaticText(panel, -1,
- wxString(_T(" Distance fill ")));
- _sldDistanceFill = new wxSlider(panel, -1, 500, 1, 500, wxDefaultPosition,
- wxDefaultSize, wxSL_LABELS);
- _distancefillCtrl = new wxTextCtrl(panel, -1, _T("500"));
+ wxStaticText *tittleText = new wxStaticText( this, -1,
+ _T(" Manual Paint") );
+ //Title
+ sizer->Add( tittleText );
+ //giving some blank spaces
+ sizer->Add( new wxStaticText( this, -1, _T(" key A : Enable/Disable ") ) );
+
+ this->ConfigureActiveCBButton( );
+ this->ConfigureBrushToolRadioButton( );
+ this->Configure2D3DRadioButton( );
+ this->ConfigureBrushFormRadioButton( );
+ this->ConfigureRangeBar( );
+ this->ConfigureGrayLevelSld( );
+ this->ConfigureBrushSizeSld( );
+ this->ConfigureDistanceFillSld( );
+ this->ConfigureTolFillSld( );
+ this->ConfigureEditButtons( );
+
+ //Buttons
+ wxStaticText *editButtonsText = new wxStaticText( this, -1,
+ _T("Edit Buttons") );
+ this->_buttonsSizer = new wxFlexGridSizer( 4 );
+ this->_buttonsSizer->Add( _btnUndo, 1, wxGROW );
+ this->_buttonsSizer->Add( _btnRedo, 1, wxGROW );
+ this->_buttonsSizer->Add( _btnCopy, 1, wxGROW );
+
+ this->_gConfigSizer = new wxFlexGridSizer( 1 );
+ //BrushTool Radio Button
+ //giving blank space
+ this->_gConfigSizer->Add( new wxStaticText( this, -1, _T(" ") ) );
+ //end of blank space
+ this->_gConfigSizer->Add( _rbBrushTool, 1, wxGROW );
+ //2D/3D Radio Button
+ this->_gConfigSizer->Add( _rb2D3D, 1, wxGROW );
+ //RangeBar
+ this->_gConfigSizer->Add(
+ new wxStaticText( this, -1, _T( "Select Range" ) ), 1, wxGROW );
+ this->_gConfigSizer->Add( _mBarSlices, 1, wxGROW );
+ //GrayLevel Slider
+ this->_gConfigSizer->Add( _txtGrayLevel );
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ wxFlexGridSizer *sizerGrayLevel = new wxFlexGridSizer( 2, wxHORIZONTAL );
+#else
+ wxFlexGridSizer *sizerGrayLevel = new wxFlexGridSizer( 2 );
+#endif
+
+ sizerGrayLevel->Add( _sldGrayLevel, 1, wxGROW );
+ sizerGrayLevel->Add( _graylevelCtrl, 1,
+ wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
+ this->_gConfigSizer->Add( sizerGrayLevel, 1, wxGROW );
+
+ //Brush
+ this->_brushSizer = new wxFlexGridSizer( 1 );
+ //giving blank space
+ this->_brushSizer->Add( new wxStaticText( this, -1, _T(" ") ) );
+ //end of blank space
+ this->_brushSizer->Add(
+ new wxStaticText( this, -1, _T("Brush Settings") ) );
+ //BrushSize Slider
+ this->_brushSizer->Add( _txtBrushSize );
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ wxFlexGridSizer *sizersdlBrushSize = new wxFlexGridSizer( 2, wxHORIZONTAL );
+#else
+ wxFlexGridSizer *sizersdlBrushSize = new wxFlexGridSizer( 2 );
+#endif
+
+ sizersdlBrushSize->Add( _sldBrushSize, 1, wxGROW );
+ sizersdlBrushSize->Add( _BrushSizeCtrl, 1,
+ wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
+ this->_brushSizer->Add( sizersdlBrushSize );
+ //BrushForm RadioButton
+ this->_brushSizer->Add( _rbBrushForm, 1, wxGROW );
+ //Fill
+ this->_FillSizer = new wxFlexGridSizer( 1 );
+ //giving blank space
+ this->_FillSizer->Add( new wxStaticText( this, -1, _T(" ") ) );
+ //end of blank space
+ this->_FillSizer->Add( new wxStaticText( this, -1, _T("Fill Settings") ) );
+ //ToleranceFill
+ this->_FillSizer->Add( _txtToleranceFill );
+ wxFlexGridSizer *sizerTolerance = new wxFlexGridSizer( 2 );
+ sizerTolerance->Add( _sldToleranceFill, 1, wxGROW );
+ sizerTolerance->Add( _tolerancefillCtrl, 1,
+ wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
+ this->_FillSizer->Add( sizerTolerance, 1, wxGROW );
+ //Distance Fill
+ this->_FillSizer->Add( _txtDistanceFill );
+ wxFlexGridSizer *sizerDistance = new wxFlexGridSizer( 2 );
+ sizerDistance->Add( _sldDistanceFill, 1, wxGROW );
+ sizerDistance->Add( _distancefillCtrl, 1,
+ 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 );
+ sizer->Add( _FillSizer );
+
+ this->ConnectComponents( ); //DFCH
+ this->_FillSizer->Show( false );
+
+ this->SetSizer( sizer );
+ this->SetAutoLayout( true );
+ this->Layout( );
+
+}
+
+//---------------------------------------------------------------------------
+wxManualPaintPanel::~wxManualPaintPanel( )
+{
+}
+
+//--------------------------------------------------------------------------
+void wxManualPaintPanel::ConfigureActiveCBButton( )
+{
+ _activeCB = new wxCheckBox (this, -1, _T("Active") );
+ _activeCB->SetValue(true);
+ SetActive( _activeCB->GetValue() );
+}
+
+
+//Panel Config
+//--------------------------------------------------------------------------
+void wxManualPaintPanel::ConfigureBrushToolRadioButton( )
+{
+ wxString lstBrushForm[ 2 ];
+ lstBrushForm[ 0 ] = _T("rectangle/cube");
+ lstBrushForm[ 1 ] = _T("circle/sphere");
+ _rbBrushForm = new wxRadioBox( this, -1, _T("Brush form"),
+ wxDefaultPosition, wxSize( 270, 45 ), 2, lstBrushForm, 2,
+ wxRA_SPECIFY_COLS );
+}
+
+//--------------------------------------------------------------------------
+void wxManualPaintPanel::Configure2D3DRadioButton( )
+{
+ wxString lst2D3D[ 2 ];
+ lst2D3D[ 0 ] = _T("2D");
+ lst2D3D[ 1 ] = _T("3D");
+ _rb2D3D = new wxRadioBox( this, -1, _T("2D / 3D"), wxDefaultPosition,
+ wxSize( 270, 45 ), 2, lst2D3D, 2, wxRA_SPECIFY_COLS );
+ _rb2D3D->SetSelection( 1 );
+
+}
+
+//--------------------------------------------------------------------------
+void wxManualPaintPanel::ConfigureBrushFormRadioButton( )
+{
+ wxString lstBrushTool[ 2 ];
+ lstBrushTool[ 0 ] = _T("Brush");
+ lstBrushTool[ 1 ] = _T("Fill");
+ _rbBrushTool = new wxRadioBox( this, -1, _T("Brush tool"),
+ wxDefaultPosition, wxSize( 270, 45 ), 2, lstBrushTool, 2,
+ wxRA_SPECIFY_COLS );
+}
+
+//--------------------------------------------------------------------------
+void wxManualPaintPanel::ConfigureRangeBar( )
+{