diff --git a/common/draw_frame.cpp b/common/draw_frame.cpp index fb0b6ce8de..99d683993f 100644 --- a/common/draw_frame.cpp +++ b/common/draw_frame.cpp @@ -66,8 +66,6 @@ static const wxString traceScrollSettings( wxT( "KicadScrollSettings" ) ); ///@{ /// \ingroup config -/// Nonzero iff fullscreen cursor is to be used (suffix) -static const wxString CursorShapeEntryKeyword( wxT( "CursorShape" ) ); /// Nonzero to show grid (suffix) static const wxString ShowGridEntryKeyword( wxT( "ShowGrid" ) ); /// Grid color ID (suffix) @@ -154,7 +152,6 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, m_showBorderAndTitleBlock = false; // true to display reference sheet. m_showGridAxis = false; // true to draw the grid axis m_showOriginAxis = false; // true to draw the grid origin - m_cursorShape = 0; m_LastGridSizeId = 0; m_drawGrid = true; // hide/Show grid. default = show m_gridColor = COLOR4D( DARKGRAY ); // Default grid color @@ -318,7 +315,11 @@ void EDA_DRAW_FRAME::OnToggleCrossHairStyle( wxCommandEvent& aEvent ) { INSTALL_UNBUFFERED_DC( dc, m_canvas ); m_canvas->CrossHairOff( &dc ); - SetCursorShape( !GetCursorShape() ); + + auto& galOpts = GetGalDisplayOptions(); + galOpts.m_fullscreenCursor = !galOpts.m_fullscreenCursor; + galOpts.NotifyChanged(); + m_canvas->CrossHairOn( &dc ); } @@ -360,7 +361,7 @@ void EDA_DRAW_FRAME::OnUpdateGrid( wxUpdateUIEvent& aEvent ) void EDA_DRAW_FRAME::OnUpdateCrossHairStyle( wxUpdateUIEvent& aEvent ) { - aEvent.Check( m_cursorShape ); + aEvent.Check( GetGalDisplayOptions().m_fullscreenCursor ); } @@ -692,13 +693,6 @@ void EDA_DRAW_FRAME::LoadSettings( wxConfigBase* aCfg ) wxString baseCfgName = ConfigBaseName(); - // Cursor shape is problematic on OS X, lock to 0 -#ifdef __APPLE__ - m_cursorShape = 0; -#else - aCfg->Read( baseCfgName + CursorShapeEntryKeyword, &m_cursorShape, ( long )0 ); -#endif // __APPLE__ - bool btmp; if( aCfg->Read( baseCfgName + ShowGridEntryKeyword, &btmp ) ) SetGridVisibility( btmp ); @@ -726,7 +720,6 @@ void EDA_DRAW_FRAME::SaveSettings( wxConfigBase* aCfg ) wxString baseCfgName = ConfigBaseName(); - aCfg->Write( baseCfgName + CursorShapeEntryKeyword, m_cursorShape ); aCfg->Write( baseCfgName + ShowGridEntryKeyword, IsGridVisible() ); aCfg->Write( baseCfgName + GridColorEntryKeyword, GetGridColor().ToColour().GetAsString( wxC2S_CSS_SYNTAX ) ); @@ -1129,7 +1122,6 @@ void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable ) // Transfer EDA_DRAW_PANEL settings GetGalCanvas()->GetViewControls()->EnableCursorWarping( !m_canvas->GetEnableZoomNoCenter() ); GetGalCanvas()->GetViewControls()->EnableMousewheelPan( m_canvas->GetEnableMousewheelPan() ); - GetToolManager()->RunAction( "pcbnew.Control.switchCursor" ); } else if( m_galCanvasActive ) { diff --git a/common/draw_panel.cpp b/common/draw_panel.cpp index 5b9bca320f..d5445e2bde 100644 --- a/common/draw_panel.cpp +++ b/common/draw_panel.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -221,7 +222,7 @@ void EDA_DRAW_PANEL::DrawCrossHair( wxDC* aDC, COLOR4D aColor ) GRSetDrawMode( aDC, GR_XOR ); - if( GetParent()->m_cursorShape != 0 ) // Draws full screen crosshair. + if( GetParent()->GetGalDisplayOptions().m_fullscreenCursor ) { wxSize clientSize = GetClientSize(); diff --git a/common/gal/cairo/cairo_gal.cpp b/common/gal/cairo/cairo_gal.cpp index 948cdcbbc3..62078ae791 100644 --- a/common/gal/cairo/cairo_gal.cpp +++ b/common/gal/cairo/cairo_gal.cpp @@ -112,6 +112,7 @@ bool CAIRO_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) if( super::updatedGalDisplayOptions( aOptions ) ) { + initCursor(); Refresh(); refresh = true; } @@ -850,13 +851,6 @@ void CAIRO_GAL::ClearTarget( RENDER_TARGET aTarget ) } -void CAIRO_GAL::SetCursorSize( unsigned int aCursorSize ) -{ - GAL::SetCursorSize( aCursorSize ); - initCursor(); -} - - void CAIRO_GAL::DrawCursor( const VECTOR2D& aCursorPosition ) { cursorPosition = aCursorPosition; @@ -964,6 +958,8 @@ void CAIRO_GAL::initCursor() if( cursorPixelsSaved ) delete cursorPixelsSaved; + const int cursorSize = fullscreenCursor ? 8000 : 80; + cursorPixels = new wxBitmap( cursorSize, cursorSize ); cursorPixelsSaved = new wxBitmap( cursorSize, cursorSize ); @@ -991,6 +987,7 @@ void CAIRO_GAL::blitCursor( wxMemoryDC& clientDC ) auto p = ToScreen( cursorPosition ); const auto cColor = getCursorColor(); + const int cursorSize = fullscreenCursor ? 8000 : 80; wxColour color( cColor.r * cColor.a * 255, cColor.g * cColor.a * 255, cColor.b * cColor.a * 255, 255 ); diff --git a/common/gal/gal_display_options.cpp b/common/gal/gal_display_options.cpp index f09cd19d1a..92d46dedfc 100644 --- a/common/gal/gal_display_options.cpp +++ b/common/gal/gal_display_options.cpp @@ -36,6 +36,7 @@ static const wxString GalGridStyleConfig( "GridStyle" ); static const wxString GalGridLineWidthConfig( "GridLineWidth" ); static const wxString GalGridMaxDensityConfig( "GridMaxDensity" ); static const wxString GalGridAxesEnabledConfig( "GridAxesEnabled" ); +static const wxString GalFullscreenCursorConfig( "CursorFullscreen" ); static const wxString GalForceDisplayCursorConfig( "ForceDisplayCursor" ); @@ -63,6 +64,7 @@ GAL_DISPLAY_OPTIONS::GAL_DISPLAY_OPTIONS() m_gridLineWidth( 0.5 ), m_gridMinSpacing( 10.0 ), m_axesEnabled( false ), + m_fullscreenCursor( false ), m_forceDisplayCursor( false ) {} @@ -88,6 +90,9 @@ void GAL_DISPLAY_OPTIONS::ReadConfig( wxConfigBase* aCfg, wxString aBaseName ) aCfg->Read( aBaseName + GalGridAxesEnabledConfig, &m_axesEnabled, false ); + aCfg->Read( aBaseName + GalFullscreenCursorConfig, + &m_fullscreenCursor, false ); + aCfg->Read( aBaseName + GalForceDisplayCursorConfig, &m_forceDisplayCursor, false ); @@ -112,6 +117,9 @@ void GAL_DISPLAY_OPTIONS::WriteConfig( wxConfigBase* aCfg, wxString aBaseName ) aCfg->Write( aBaseName + GalGridAxesEnabledConfig, m_axesEnabled ); + aCfg->Write( aBaseName + GalFullscreenCursorConfig, + m_fullscreenCursor ); + aCfg->Write( aBaseName + GalForceDisplayCursorConfig, m_forceDisplayCursor ); } diff --git a/common/gal/graphics_abstraction_layer.cpp b/common/gal/graphics_abstraction_layer.cpp index d2902b67b9..cf9ae16f60 100644 --- a/common/gal/graphics_abstraction_layer.cpp +++ b/common/gal/graphics_abstraction_layer.cpp @@ -65,9 +65,9 @@ GAL::GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions ) : // Initialize the cursor shape SetCursorColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) ); - SetCursorSize( 80 ); - SetCursorEnabled( false ); + fullscreenCursor = false; forceDisplayCursor = false; + SetCursorEnabled( false ); strokeFont.LoadNewStrokeFont( newstroke_font, newstroke_font_bufsize ); @@ -124,6 +124,12 @@ bool GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) refresh = true; } + if( options.m_fullscreenCursor != fullscreenCursor ) + { + fullscreenCursor = options.m_fullscreenCursor; + refresh = true; + } + // tell the derived class if the base class needs an update or not return refresh; } diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 9f596142c9..5759aff17a 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -1662,6 +1662,8 @@ void OPENGL_GAL::blitCursor() compositor->SetBuffer( OPENGL_COMPOSITOR::DIRECT_RENDERING ); + const int cursorSize = fullscreenCursor ? 8000 : 80; + VECTOR2D cursorBegin = cursorPosition - cursorSize / ( 2 * worldScale ); VECTOR2D cursorEnd = cursorPosition + cursorSize / ( 2 * worldScale ); VECTOR2D cursorCenter = ( cursorBegin + cursorEnd ) / 2; diff --git a/common/widgets/gal_options_panel.cpp b/common/widgets/gal_options_panel.cpp index 8f9e8f4c73..833591b9a0 100644 --- a/common/widgets/gal_options_panel.cpp +++ b/common/widgets/gal_options_panel.cpp @@ -71,6 +71,9 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI wxBoxSizer* sLeftSizer = new wxBoxSizer( wxVERTICAL ); m_mainSizer->Add( sLeftSizer, 1, wxALL | wxEXPAND, 0 ); + // @todo LEGACY: not required when legacy is gone + const wxString galOnlySuffix = _( " (OpenGL && Cairo)" ); + /* * Anti-aliasing subpanel */ @@ -101,7 +104,7 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI { wxStaticBoxSizer* sGridSettings; sGridSettings = new wxStaticBoxSizer( new wxStaticBox( this, - wxID_ANY, _("Grid Display (OpenGL && Cairo)") ), wxVERTICAL ); + wxID_ANY, _( "Grid Display" ) + galOnlySuffix ), wxVERTICAL ); wxString m_gridStyleChoices[] = { _( "Dots" ), @@ -110,7 +113,7 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI }; int m_gridStyleNChoices = sizeof( m_gridStyleChoices ) / sizeof( wxString ); m_gridStyle = new wxRadioBox( sGridSettings->GetStaticBox(), - wxID_ANY, _("Grid Style"), + wxID_ANY, _( "Grid Style" ), wxDefaultPosition, wxDefaultSize, m_gridStyleNChoices, m_gridStyleChoices, 1, wxRA_SPECIFY_COLS ); sGridSettings->Add( m_gridStyle, 0, wxALL|wxEXPAND, 5 ); @@ -177,11 +180,35 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI { auto sCursorSettings = new wxStaticBoxSizer( new wxStaticBox( this, - wxID_ANY, _( "Cursor Display (OpenGL && Cairo)" ) ), wxVERTICAL ); + wxID_ANY, _( "Cursor Display" ) ), wxVERTICAL ); sLeftSizer->Add( sCursorSettings, 1, wxALL | wxEXPAND, 5 ); - m_forceCursorDisplay = new wxCheckBox( this, wxID_ANY, _( "Always display cursor" ) ); + wxString m_CursorShapeChoices[] = { + _( "Small cross" ), + _( "Full screen cursor" ) + }; + + wxString cursorShapeTitle = _( "Cursor Shape" ); + + // cursor is not shown in legacy on OSX, so this setting won't + // do anything there + // @todo LEGACY remove this +#ifdef __APPLE__ + cursorShapeTitle += galOnlySuffix; +#endif + + int m_CursorShapeNChoices = sizeof( m_CursorShapeChoices ) / sizeof( wxString ); + m_cursorShape = new wxRadioBox( this, wxID_ANY, + cursorShapeTitle, wxDefaultPosition, wxDefaultSize, + m_CursorShapeNChoices, m_CursorShapeChoices, 1, wxRA_SPECIFY_COLS ); + + m_cursorShape->SetSelection( 0 ); + m_cursorShape->SetToolTip( _( "Main cursor shape selection (small cross or large cursor)" ) ); + + sCursorSettings->Add( m_cursorShape, 0, wxALL | wxEXPAND, 5 ); + + m_forceCursorDisplay = new wxCheckBox( this, wxID_ANY, _( "Always display cursor" ) + galOnlySuffix ); sCursorSettings->Add( m_forceCursorDisplay, 0, wxALL | wxEXPAND, 5 ); } @@ -200,6 +227,8 @@ bool GAL_OPTIONS_PANEL::TransferDataToWindow() m_gridMinSpacingIncrementer->SetValue( m_galOptions.m_gridMinSpacing ); + m_cursorShape->SetSelection( m_galOptions.m_fullscreenCursor ); + m_forceCursorDisplay->SetValue( m_galOptions.m_forceDisplayCursor ); return true; @@ -218,6 +247,8 @@ bool GAL_OPTIONS_PANEL::TransferDataFromWindow() m_galOptions.m_gridMinSpacing = m_gridMinSpacingIncrementer->GetValue(); + m_galOptions.m_fullscreenCursor = m_cursorShape->GetSelection(); + m_galOptions.m_forceDisplayCursor = m_forceCursorDisplay->GetValue(); m_galOptions.NotifyChanged(); diff --git a/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp b/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp index 41ace4a1f1..18eb815991 100644 --- a/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp +++ b/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp @@ -93,11 +93,18 @@ void DIALOG_DISPLAY_OPTIONS::initOptDialog( ) m_PolarDisplay->SetSelection( m_Parent->m_DisplayOptions.m_DisplayPolarCood ? 1 : 0 ); m_BoxUnits->SetSelection( g_UserUnit ? 1 : 0 ); + // @todo: LEGACY: Cursor shape can be set using the GAL options + // widget, when that is added to gerbview. For now, access the + // setting via the frame's GAL options object directly + // Cursor shape cannot be implemented on OS X #ifdef __APPLE__ m_CursorShape->Hide(); #else - m_CursorShape->SetSelection( m_Parent->GetCursorShape() ? 1 : 0 ); + { + auto& galOpts = m_Parent->GetGalDisplayOptions(); + m_CursorShape->SetSelection( galOpts.m_fullscreenCursor ? 1 : 0 ); + } #endif // __APPLE__ // Show Option Draw Lines. We use DisplayPcbTrackFill as Lines draw option @@ -137,8 +144,12 @@ void DIALOG_DISPLAY_OPTIONS::OnOKBUttonClick( wxCommandEvent& event ) (m_PolarDisplay->GetSelection() == 0) ? false : true; g_UserUnit = (m_BoxUnits->GetSelection() == 0) ? INCHES : MILLIMETRES; + // @todo LEGACY: as above, this should be via the GAL display widget #ifndef __APPLE__ - m_Parent->SetCursorShape( m_CursorShape->GetSelection() ); + { + auto& galOpts = m_Parent->GetGalDisplayOptions(); + galOpts.m_fullscreenCursor = m_CursorShape->GetSelection(); + } #endif // !__APPLE__ if( m_OptDisplayLines->GetSelection() == 1 ) diff --git a/include/draw_frame.h b/include/draw_frame.h index 51eae83515..90d517eb07 100644 --- a/include/draw_frame.h +++ b/include/draw_frame.h @@ -98,11 +98,6 @@ protected: /// Tool ID of previously active draw tool bar button. int m_lastDrawToolId; - /// The shape of the KiCad cursor. The default value (0) is the normal cross - /// hair cursor. Set to non-zero value to draw the full screen cursor. - /// @note This is not the system mouse cursor. - int m_cursorShape; - /// True shows the X and Y axis indicators. bool m_showAxis; @@ -295,10 +290,6 @@ public: */ virtual void SetDrawBgColor( COLOR4D aColor) { m_drawBgColor= aColor ; } - int GetCursorShape() const { return m_cursorShape; } - - virtual void SetCursorShape( int aCursorShape ) { m_cursorShape = aCursorShape; } - bool GetShowBorderAndTitleBlock() const { return m_showBorderAndTitleBlock; } void SetShowBorderAndTitleBlock( bool aShow ) { m_showBorderAndTitleBlock = aShow; } diff --git a/include/gal/cairo/cairo_gal.h b/include/gal/cairo/cairo_gal.h index 63740ad5d3..121c223972 100644 --- a/include/gal/cairo/cairo_gal.h +++ b/include/gal/cairo/cairo_gal.h @@ -244,9 +244,6 @@ public: // Cursor // ------- - /// @copydoc GAL::SetCursorSize() - virtual void SetCursorSize( unsigned int aCursorSize ) override; - /// @copydoc GAL::DrawCursor() virtual void DrawCursor( const VECTOR2D& aCursorPosition ) override; diff --git a/include/gal/gal_display_options.h b/include/gal/gal_display_options.h index d9e684b73d..a281eb489e 100644 --- a/include/gal/gal_display_options.h +++ b/include/gal/gal_display_options.h @@ -85,6 +85,9 @@ namespace KIGFX ///> Whether or not to draw the coordinate system axes bool m_axesEnabled; + ///> Fullscreen crosshair or small cross + bool m_fullscreenCursor; + ///> Force cursor display bool m_forceDisplayCursor; }; diff --git a/include/gal/graphics_abstraction_layer.h b/include/gal/graphics_abstraction_layer.h index 24c84dda51..9dced85aa2 100644 --- a/include/gal/graphics_abstraction_layer.h +++ b/include/gal/graphics_abstraction_layer.h @@ -917,26 +917,6 @@ public: cursorColor = aCursorColor; } - /** - * @brief Returns the cursor size. - * - * @return The current cursor size (in pixels). - */ - inline unsigned int GetCursorSize() const - { - return cursorSize; - } - - /** - * @brief Set the cursor size. - * - * @param aCursorSize is the size of the cursor expressed in pixels. - */ - virtual inline void SetCursorSize( unsigned int aCursorSize ) - { - cursorSize = aCursorSize; - } - /** * @brief Draw the cursor. * @@ -1021,7 +1001,7 @@ protected: bool isCursorEnabled; ///< Is the cursor enabled? bool forceDisplayCursor; ///< Always show cursor COLOR4D cursorColor; ///< Cursor color - unsigned int cursorSize; ///< Size of the cursor in pixels + bool fullscreenCursor; ///< Shape of the cursor (fullscreen or small cross) VECTOR2D cursorPosition; ///< Current cursor position (world coordinates) /// Instance of object that stores information about how to draw texts diff --git a/include/widgets/gal_options_panel.h b/include/widgets/gal_options_panel.h index 8bbfbc51cb..d94c5753c5 100644 --- a/include/widgets/gal_options_panel.h +++ b/include/widgets/gal_options_panel.h @@ -65,6 +65,7 @@ private: wxSpinButton* m_gridMinSpacingSpinBtn; wxStaticText* l_gridMinSpacingUnits; + wxRadioBox* m_cursorShape; wxCheckBox* m_forceCursorDisplay; ///> The GAL options to read/write diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index b6c0766ccd..5919f969c6 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -371,9 +371,6 @@ public: */ virtual void SetGridColor( COLOR4D aColor ) override; - ///> @copydoc EDA_DRAW_FRAME::SetCursorShape() - virtual void SetCursorShape( int aCursorShape ) override; - // Configurations: void Process_Config( wxCommandEvent& event ); diff --git a/pcbnew/dialogs/dialog_general_options.cpp b/pcbnew/dialogs/dialog_general_options.cpp index 8f2b0fb880..6e204ee24b 100644 --- a/pcbnew/dialogs/dialog_general_options.cpp +++ b/pcbnew/dialogs/dialog_general_options.cpp @@ -65,14 +65,6 @@ void DIALOG_GENERALOPTIONS::init() m_PolarDisplay->SetSelection( displ_opts->m_DisplayPolarCood ? 1 : 0 ); m_UnitsSelection->SetSelection( g_UserUnit ? 1 : 0 ); - // Cursor shape cannot be implemented on OS X -#ifdef __APPLE__ - m_CursorShape->Hide(); -#else - m_CursorShape->SetSelection( GetParent()->GetCursorShape() ? 1 : 0 ); -#endif // __APPLE__ - - wxString rotationAngle; rotationAngle = AngleToStringDegrees( (double)GetParent()->GetRotationAngle() ); m_RotationAngle->SetValue( rotationAngle ); @@ -114,9 +106,6 @@ void DIALOG_GENERALOPTIONS::OnOkClick( wxCommandEvent& event ) if( ii != g_UserUnit ) GetParent()->ReCreateAuxiliaryToolbar(); -#ifndef __APPLE__ - GetParent()->SetCursorShape( m_CursorShape->GetSelection() ); -#endif // !__APPLE__ GetParent()->SetAutoSaveInterval( m_SaveTime->GetValue() * 60 ); GetParent()->SetRotationAngle( wxRound( 10.0 * wxAtof( m_RotationAngle->GetValue() ) ) ); diff --git a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp index c205332fa0..6edbf2c1ad 100644 --- a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp +++ b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2016) +// C++ code generated with wxFormBuilder (version Jan 9 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -38,14 +38,6 @@ DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE( bLeftSizer->Add( m_UnitsSelection, 0, wxALL|wxEXPAND, 5 ); - wxString m_CursorShapeChoices[] = { _("Small cross"), _("Full screen cursor") }; - int m_CursorShapeNChoices = sizeof( m_CursorShapeChoices ) / sizeof( wxString ); - m_CursorShape = new wxRadioBox( this, wxID_CURSOR_SHAPE, _("Cursor"), wxDefaultPosition, wxDefaultSize, m_CursorShapeNChoices, m_CursorShapeChoices, 1, wxRA_SPECIFY_COLS ); - m_CursorShape->SetSelection( 0 ); - m_CursorShape->SetToolTip( _("Main cursor shape selection (small cross or large cursor)") ); - - bLeftSizer->Add( m_CursorShape, 0, wxALL|wxEXPAND, 5 ); - bSizerUpper->Add( bLeftSizer, 2, wxALL|wxEXPAND, 5 ); diff --git a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp index c76acda56f..8a444b9ceb 100644 --- a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp +++ b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp @@ -291,96 +291,6 @@ - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Small cross" "Full screen cursor" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CURSOR_SHAPE - Cursor - 1 - - 0 - - - 0 - - 1 - m_CursorShape - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Main cursor shape selection (small cross or large cursor) - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.h b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.h index 3ca62be9d1..85ac74375b 100644 --- a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.h +++ b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2016) +// C++ code generated with wxFormBuilder (version Jan 9 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -44,7 +44,6 @@ class DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE : public DIALOG_SHIM { wxID_POLAR_CTRL = 1000, wxID_UNITS, - wxID_CURSOR_SHAPE, wxID_DRC_ONOFF, wxID_GENERAL_RATSNEST, wxID_TRACK_AUTODEL, @@ -56,7 +55,6 @@ class DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE : public DIALOG_SHIM wxRadioBox* m_PolarDisplay; wxRadioBox* m_UnitsSelection; - wxRadioBox* m_CursorShape; wxStaticText* m_staticTextmaxlinks; wxSpinCtrl* m_MaxShowLinks; wxStaticText* m_staticTextautosave; diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 4927fdc160..77a5b62c44 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -869,19 +869,6 @@ void PCB_EDIT_FRAME::SetGridColor( COLOR4D aColor ) } -void PCB_EDIT_FRAME::SetCursorShape( int aCursorShape ) -{ - const unsigned int BIG_CURSOR = 8000; - const unsigned int SMALL_CURSOR = 80; - - EDA_DRAW_FRAME::SetCursorShape( aCursorShape ); - KIGFX::GAL* gal = GetGalCanvas()->GetGAL(); - - if( gal ) - gal->SetCursorSize( aCursorShape ? BIG_CURSOR : SMALL_CURSOR ); -} - - bool PCB_EDIT_FRAME::IsMicroViaAcceptable() { int copperlayercnt = GetBoard()->GetCopperLayerCount( ); diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index c7cb553e67..d143d9640c 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -709,12 +709,10 @@ int PCBNEW_CONTROL::ResetCoords( const TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::SwitchCursor( const TOOL_EVENT& aEvent ) { - const unsigned int BIG_CURSOR = 8000; - const unsigned int SMALL_CURSOR = 80; + auto& galOpts = m_frame->GetGalDisplayOptions(); - PCB_BASE_FRAME* frame = getEditFrame(); - KIGFX::GAL* gal = frame->GetGalCanvas()->GetGAL(); - gal->SetCursorSize( frame->GetCursorShape() ? BIG_CURSOR : SMALL_CURSOR ); + galOpts.m_fullscreenCursor = !galOpts.m_fullscreenCursor; + galOpts.NotifyChanged(); return 0; }