Loading CHANGELOG.txt +20 −0 Original line number Original line Diff line number Diff line Loading @@ -4,6 +4,26 @@ KiCad ChangeLog 2010 Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with email address. email address. 2010-Jan-23 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ ++pcbnew's PCB_LAYER_WIDGET Removed wxformbuilder dependency from LAYER_WIDGET, thus killing off layer_widget_base.* and panel_layer_select.fbp. Added aPointSize to LAYER_WIDGET constructor so it uses that font size. Removed layer_widget.h from wxPcbStruct.h for faster compiles with less dependencies, and this meant moving the class LYRS out of class WinEDA_PcbFrame. While doing that I renamed it to PCB_LAYER_WIDGET. Integration of PCB_LAYER_WIDGET into WinEDA_PcbFrame to fully support the layer change logic. Added syncLayerWidget(), * WinEDA_PcbFrame: Added syncLayerWidget(), syncLayerBox() (via a rename), setActiveLayer(), and getActiveLayer(). Use a font size in PCB_LAYER_WIDGET 80% of the system font size for systems with screen resolution height <= 900, or 100% if not. See WinEDA_PcbFrame constructor. * See TODO.txt for more things that need to be done. 2010-Jan-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2010-Jan-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> ================================================================================ ================================================================================ ++ Pcbnew: ++ Pcbnew: Loading TODO.txt +12 −7 Original line number Original line Diff line number Diff line Loading @@ -72,19 +72,24 @@ PCBNew * Need to add polygon aperture type. * Need to add polygon aperture type. Then example 2 in RS274xrevd_e.pdf will draw properly. Then example 2 in RS274xrevd_e.pdf will draw properly. Dick: * Get the nested quote support for DSNLEXER fixed up and committed. LAYER_WIDGET for PCBNEW LAYER_WIDGET for PCBNEW ----------------------- ----------------------- L2) Hook in bool WinEDA_PcbFrame::LYRS::OnLayerSelect( int aLayer ) L4) Move popup menu code from class LAYER_WIDGET into WinEDA_PcbFrame::LYRS so as to keep LAYER_WIDGET fully usage agnostic. Remove #include "pcbstruct.h" // IsValidCopperLayerIndex() from layer_widget.cpp. L5) Add to moved popu menu code the ability to save the current layer widget L5) Add to moved popu menu code the ability to save the current layer widget color and enable settings with an additional menu item. color and enable settings with an additional menu item. L6) Test, and fix up any remaining issues with the PCB_VISIBLE support, several L6) Test, and fix up any remaining issues with the PCB_VISIBLE support, several items which are stored on globals could and should be stored in items which are stored on globals could and should be stored in EDA_Settings.m_VisibleElements using enum PCB_VISIBLE. EDA_Settings.m_VisibleElements using enum PCB_VISIBLE. Initial Render checkbox settings are probably not correct, for example grid. L7) make the bitmapbutton a staticbitmap, and make its size dependent on the point size. L8) LAYER_WIDGET::GetBestSize() needs platform independence. Dick: L9) still thinking about background colors, easier now without wxformbuilder. include/wxPcbStruct.h +54 −52 Original line number Original line Diff line number Diff line Loading @@ -8,7 +8,6 @@ #include "wxstruct.h" #include "wxstruct.h" #include "base_struct.h" #include "base_struct.h" #include "layer_widget.h" #ifndef PCB_INTERNAL_UNIT #ifndef PCB_INTERNAL_UNIT #define PCB_INTERNAL_UNIT 10000 #define PCB_INTERNAL_UNIT 10000 Loading Loading @@ -36,6 +35,7 @@ class ZONE_CONTAINER; class DRAWSEGMENT; class DRAWSEGMENT; class GENERAL_COLLECTOR; class GENERAL_COLLECTOR; class GENERAL_COLLECTORS_GUIDE; class GENERAL_COLLECTORS_GUIDE; class PCB_LAYER_WIDGET; /** /** Loading @@ -49,34 +49,64 @@ class GENERAL_COLLECTORS_GUIDE; /*****************************************************/ /*****************************************************/ class WinEDA_PcbFrame : public WinEDA_BasePcbFrame class WinEDA_PcbFrame : public WinEDA_BasePcbFrame { { friend class PCB_LAYER_WIDGET; protected: protected: PCB_LAYER_WIDGET* m_Layers; DRC* m_drc; ///< the DRC controller, see drc.cpp // we'll use lower case function names for private member functions. void createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu ); void createPopUpMenuForFootprints( MODULE* aModule, wxMenu* aPopMenu ); void createPopUpMenuForFpTexts( TEXTE_MODULE* aText, wxMenu* aPopMenu ); void createPopUpMenuForFpPads( D_PAD* aPad, wxMenu* aPopMenu ); void createPopupMenuForTracks( TRACK* aTrack, wxMenu* aPopMenu ); void createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu ); void createPopUpBlockMenu( wxMenu* menu ); void createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu ); /** /** * Class LYRS * Function setActiveLayer * is here to implement the abtract functions of LAYER_WIDGET so they * will change the currently active layer to \a aLayer and also * may be tied into this frame's data. * update the PCB_LAYER_WIDGET. */ */ class LYRS : public LAYER_WIDGET void setActiveLayer( int aLayer, bool doLayerWidgetUpdate = true ) { { WinEDA_PcbFrame* myframe; ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = aLayer; public: if( doLayerWidgetUpdate ) LYRS( WinEDA_PcbFrame* aParent, wxWindow* aFocusOwner ) : syncLayerWidget(); LAYER_WIDGET( aParent, aFocusOwner ), } myframe( aParent ) /** * Function getActiveLayer * returns the active layer */ int getActiveLayer() { { return ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer; } } //-----<implement LAYER_WIDGET abstract callback functions>----------- /** void OnLayerColorChange( int aLayer, int aColor ); * Function syncLayerWidget bool OnLayerSelect( int aLayer ); * updates the currently "selected" layer within the PCB_LAYER_WIDGET. void OnLayerVisible( int aLayer, bool isVisible, bool isFinal ); * The currently active layer is defined by the return value of getActiveLayer(). void OnRenderColorChange( int aId, int aColor ); * <p> void OnRenderEnable( int aId, bool isEnabled ); * This function cannot be inline without including layer_widget.h in //-----</implement LAYER_WIDGET abstract callback functions>---------- * here and we do not want to do that. }; */ void syncLayerWidget(); /** * Function syncLayerBox * updates the currently "selected" layer within m_SelLayerBox * The currently active layer, as defined by the return value of * getActiveLayer(). And updates the colored icon in the toolbar. */ void syncLayerBox(); LYRS* m_Layers; // established in constructor public: public: WinEDAChoiceBox* m_SelLayerBox; // a combo box to display and WinEDAChoiceBox* m_SelLayerBox; // a combo box to display and Loading @@ -95,19 +125,6 @@ public: bool m_show_microwave_tools; bool m_show_microwave_tools; bool m_show_layer_manager_tools; bool m_show_layer_manager_tools; private: DRC* m_drc; ///< the DRC controller, see drc.cpp // we'll use lower case function names for private member functions. void createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu ); void createPopUpMenuForFootprints( MODULE* aModule, wxMenu* aPopMenu ); void createPopUpMenuForFpTexts( TEXTE_MODULE* aText, wxMenu* aPopMenu ); void createPopUpMenuForFpPads( D_PAD* aPad, wxMenu* aPopMenu ); void createPopupMenuForTracks( TRACK* aTrack, wxMenu* aPopMenu ); void createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu ); void createPopUpBlockMenu( wxMenu* menu ); void createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu ); public: public: WinEDA_PcbFrame( wxWindow* father, const wxString& title, WinEDA_PcbFrame( wxWindow* father, const wxString& title, Loading Loading @@ -183,13 +200,6 @@ public: /* toolbars update UI functions: */ /* toolbars update UI functions: */ /** * Function UpdateToolbarLayerInfo * updates the currently selected layer in the layer listbox and * the colored icon in the toolbar. */ void UpdateToolbarLayerInfo(); void PrepareLayerIndicator(); void PrepareLayerIndicator(); /** /** Loading @@ -206,14 +216,6 @@ public: */ */ void AuxiliaryToolBar_DesignRules_Update_UI(); void AuxiliaryToolBar_DesignRules_Update_UI(); /** Function SynchronizeLayersManager( ) * Must be called when info displayed in the layer manager Toolbar * as been changed in the main window ( by hotkey or a tool option. * Mainly when the active layer as changed. * @param aFlag = flag giving the type of data (layers, checkboxes...) */ void SynchronizeLayersManager( int aFlag ); /* mouse functions events: */ /* mouse functions events: */ void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); Loading pcbnew/CMakeLists.txt +0 −2 Original line number Original line Diff line number Diff line Loading @@ -111,7 +111,6 @@ set(PCBNEW_SRCS ioascii.cpp ioascii.cpp print_board_functions.cpp print_board_functions.cpp printout_controler.cpp printout_controler.cpp layer_panel_base.cpp layer_widget.cpp layer_widget.cpp librairi.cpp librairi.cpp loadcmp.cpp loadcmp.cpp Loading Loading @@ -243,7 +242,6 @@ endif(NOT MSVC) # This one gets made only when testing. # This one gets made only when testing. add_executable(layer_widget_test WIN32 EXCLUDE_FROM_ALL add_executable(layer_widget_test WIN32 EXCLUDE_FROM_ALL layer_panel_base.cpp layer_widget.cpp layer_widget.cpp ) ) target_link_libraries(layer_widget_test common ${wxWidgets_LIBRARIES}) target_link_libraries(layer_widget_test common ${wxWidgets_LIBRARIES}) pcbnew/deltrack.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -36,7 +36,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) { { if( g_CurrentTrackList.GetCount() > 0 ) if( g_CurrentTrackList.GetCount() > 0 ) { { int previous_layer = ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer; int previous_layer = getActiveLayer(); D( g_CurrentTrackList.VerifyListIntegrity(); ) D( g_CurrentTrackList.VerifyListIntegrity(); ) Loading Loading @@ -71,7 +71,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) // Correct active layer which could change if a via // Correct active layer which could change if a via // has been erased // has been erased ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = previous_layer; setActiveLayer( previous_layer ); UpdateStatusBar(); UpdateStatusBar(); if( g_TwoSegmentTrackBuild ) // We must have 2 segments or more, if( g_TwoSegmentTrackBuild ) // We must have 2 segments or more, Loading Loading
CHANGELOG.txt +20 −0 Original line number Original line Diff line number Diff line Loading @@ -4,6 +4,26 @@ KiCad ChangeLog 2010 Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with email address. email address. 2010-Jan-23 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ ++pcbnew's PCB_LAYER_WIDGET Removed wxformbuilder dependency from LAYER_WIDGET, thus killing off layer_widget_base.* and panel_layer_select.fbp. Added aPointSize to LAYER_WIDGET constructor so it uses that font size. Removed layer_widget.h from wxPcbStruct.h for faster compiles with less dependencies, and this meant moving the class LYRS out of class WinEDA_PcbFrame. While doing that I renamed it to PCB_LAYER_WIDGET. Integration of PCB_LAYER_WIDGET into WinEDA_PcbFrame to fully support the layer change logic. Added syncLayerWidget(), * WinEDA_PcbFrame: Added syncLayerWidget(), syncLayerBox() (via a rename), setActiveLayer(), and getActiveLayer(). Use a font size in PCB_LAYER_WIDGET 80% of the system font size for systems with screen resolution height <= 900, or 100% if not. See WinEDA_PcbFrame constructor. * See TODO.txt for more things that need to be done. 2010-Jan-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2010-Jan-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> ================================================================================ ================================================================================ ++ Pcbnew: ++ Pcbnew: Loading
TODO.txt +12 −7 Original line number Original line Diff line number Diff line Loading @@ -72,19 +72,24 @@ PCBNew * Need to add polygon aperture type. * Need to add polygon aperture type. Then example 2 in RS274xrevd_e.pdf will draw properly. Then example 2 in RS274xrevd_e.pdf will draw properly. Dick: * Get the nested quote support for DSNLEXER fixed up and committed. LAYER_WIDGET for PCBNEW LAYER_WIDGET for PCBNEW ----------------------- ----------------------- L2) Hook in bool WinEDA_PcbFrame::LYRS::OnLayerSelect( int aLayer ) L4) Move popup menu code from class LAYER_WIDGET into WinEDA_PcbFrame::LYRS so as to keep LAYER_WIDGET fully usage agnostic. Remove #include "pcbstruct.h" // IsValidCopperLayerIndex() from layer_widget.cpp. L5) Add to moved popu menu code the ability to save the current layer widget L5) Add to moved popu menu code the ability to save the current layer widget color and enable settings with an additional menu item. color and enable settings with an additional menu item. L6) Test, and fix up any remaining issues with the PCB_VISIBLE support, several L6) Test, and fix up any remaining issues with the PCB_VISIBLE support, several items which are stored on globals could and should be stored in items which are stored on globals could and should be stored in EDA_Settings.m_VisibleElements using enum PCB_VISIBLE. EDA_Settings.m_VisibleElements using enum PCB_VISIBLE. Initial Render checkbox settings are probably not correct, for example grid. L7) make the bitmapbutton a staticbitmap, and make its size dependent on the point size. L8) LAYER_WIDGET::GetBestSize() needs platform independence. Dick: L9) still thinking about background colors, easier now without wxformbuilder.
include/wxPcbStruct.h +54 −52 Original line number Original line Diff line number Diff line Loading @@ -8,7 +8,6 @@ #include "wxstruct.h" #include "wxstruct.h" #include "base_struct.h" #include "base_struct.h" #include "layer_widget.h" #ifndef PCB_INTERNAL_UNIT #ifndef PCB_INTERNAL_UNIT #define PCB_INTERNAL_UNIT 10000 #define PCB_INTERNAL_UNIT 10000 Loading Loading @@ -36,6 +35,7 @@ class ZONE_CONTAINER; class DRAWSEGMENT; class DRAWSEGMENT; class GENERAL_COLLECTOR; class GENERAL_COLLECTOR; class GENERAL_COLLECTORS_GUIDE; class GENERAL_COLLECTORS_GUIDE; class PCB_LAYER_WIDGET; /** /** Loading @@ -49,34 +49,64 @@ class GENERAL_COLLECTORS_GUIDE; /*****************************************************/ /*****************************************************/ class WinEDA_PcbFrame : public WinEDA_BasePcbFrame class WinEDA_PcbFrame : public WinEDA_BasePcbFrame { { friend class PCB_LAYER_WIDGET; protected: protected: PCB_LAYER_WIDGET* m_Layers; DRC* m_drc; ///< the DRC controller, see drc.cpp // we'll use lower case function names for private member functions. void createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu ); void createPopUpMenuForFootprints( MODULE* aModule, wxMenu* aPopMenu ); void createPopUpMenuForFpTexts( TEXTE_MODULE* aText, wxMenu* aPopMenu ); void createPopUpMenuForFpPads( D_PAD* aPad, wxMenu* aPopMenu ); void createPopupMenuForTracks( TRACK* aTrack, wxMenu* aPopMenu ); void createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu ); void createPopUpBlockMenu( wxMenu* menu ); void createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu ); /** /** * Class LYRS * Function setActiveLayer * is here to implement the abtract functions of LAYER_WIDGET so they * will change the currently active layer to \a aLayer and also * may be tied into this frame's data. * update the PCB_LAYER_WIDGET. */ */ class LYRS : public LAYER_WIDGET void setActiveLayer( int aLayer, bool doLayerWidgetUpdate = true ) { { WinEDA_PcbFrame* myframe; ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = aLayer; public: if( doLayerWidgetUpdate ) LYRS( WinEDA_PcbFrame* aParent, wxWindow* aFocusOwner ) : syncLayerWidget(); LAYER_WIDGET( aParent, aFocusOwner ), } myframe( aParent ) /** * Function getActiveLayer * returns the active layer */ int getActiveLayer() { { return ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer; } } //-----<implement LAYER_WIDGET abstract callback functions>----------- /** void OnLayerColorChange( int aLayer, int aColor ); * Function syncLayerWidget bool OnLayerSelect( int aLayer ); * updates the currently "selected" layer within the PCB_LAYER_WIDGET. void OnLayerVisible( int aLayer, bool isVisible, bool isFinal ); * The currently active layer is defined by the return value of getActiveLayer(). void OnRenderColorChange( int aId, int aColor ); * <p> void OnRenderEnable( int aId, bool isEnabled ); * This function cannot be inline without including layer_widget.h in //-----</implement LAYER_WIDGET abstract callback functions>---------- * here and we do not want to do that. }; */ void syncLayerWidget(); /** * Function syncLayerBox * updates the currently "selected" layer within m_SelLayerBox * The currently active layer, as defined by the return value of * getActiveLayer(). And updates the colored icon in the toolbar. */ void syncLayerBox(); LYRS* m_Layers; // established in constructor public: public: WinEDAChoiceBox* m_SelLayerBox; // a combo box to display and WinEDAChoiceBox* m_SelLayerBox; // a combo box to display and Loading @@ -95,19 +125,6 @@ public: bool m_show_microwave_tools; bool m_show_microwave_tools; bool m_show_layer_manager_tools; bool m_show_layer_manager_tools; private: DRC* m_drc; ///< the DRC controller, see drc.cpp // we'll use lower case function names for private member functions. void createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu ); void createPopUpMenuForFootprints( MODULE* aModule, wxMenu* aPopMenu ); void createPopUpMenuForFpTexts( TEXTE_MODULE* aText, wxMenu* aPopMenu ); void createPopUpMenuForFpPads( D_PAD* aPad, wxMenu* aPopMenu ); void createPopupMenuForTracks( TRACK* aTrack, wxMenu* aPopMenu ); void createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu ); void createPopUpBlockMenu( wxMenu* menu ); void createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu ); public: public: WinEDA_PcbFrame( wxWindow* father, const wxString& title, WinEDA_PcbFrame( wxWindow* father, const wxString& title, Loading Loading @@ -183,13 +200,6 @@ public: /* toolbars update UI functions: */ /* toolbars update UI functions: */ /** * Function UpdateToolbarLayerInfo * updates the currently selected layer in the layer listbox and * the colored icon in the toolbar. */ void UpdateToolbarLayerInfo(); void PrepareLayerIndicator(); void PrepareLayerIndicator(); /** /** Loading @@ -206,14 +216,6 @@ public: */ */ void AuxiliaryToolBar_DesignRules_Update_UI(); void AuxiliaryToolBar_DesignRules_Update_UI(); /** Function SynchronizeLayersManager( ) * Must be called when info displayed in the layer manager Toolbar * as been changed in the main window ( by hotkey or a tool option. * Mainly when the active layer as changed. * @param aFlag = flag giving the type of data (layers, checkboxes...) */ void SynchronizeLayersManager( int aFlag ); /* mouse functions events: */ /* mouse functions events: */ void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); Loading
pcbnew/CMakeLists.txt +0 −2 Original line number Original line Diff line number Diff line Loading @@ -111,7 +111,6 @@ set(PCBNEW_SRCS ioascii.cpp ioascii.cpp print_board_functions.cpp print_board_functions.cpp printout_controler.cpp printout_controler.cpp layer_panel_base.cpp layer_widget.cpp layer_widget.cpp librairi.cpp librairi.cpp loadcmp.cpp loadcmp.cpp Loading Loading @@ -243,7 +242,6 @@ endif(NOT MSVC) # This one gets made only when testing. # This one gets made only when testing. add_executable(layer_widget_test WIN32 EXCLUDE_FROM_ALL add_executable(layer_widget_test WIN32 EXCLUDE_FROM_ALL layer_panel_base.cpp layer_widget.cpp layer_widget.cpp ) ) target_link_libraries(layer_widget_test common ${wxWidgets_LIBRARIES}) target_link_libraries(layer_widget_test common ${wxWidgets_LIBRARIES})
pcbnew/deltrack.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -36,7 +36,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) { { if( g_CurrentTrackList.GetCount() > 0 ) if( g_CurrentTrackList.GetCount() > 0 ) { { int previous_layer = ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer; int previous_layer = getActiveLayer(); D( g_CurrentTrackList.VerifyListIntegrity(); ) D( g_CurrentTrackList.VerifyListIntegrity(); ) Loading Loading @@ -71,7 +71,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) // Correct active layer which could change if a via // Correct active layer which could change if a via // has been erased // has been erased ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = previous_layer; setActiveLayer( previous_layer ); UpdateStatusBar(); UpdateStatusBar(); if( g_TwoSegmentTrackBuild ) // We must have 2 segments or more, if( g_TwoSegmentTrackBuild ) // We must have 2 segments or more, Loading