From d73e1324551a9bd5e9bcaf5b0f4dfbf0e340ab67 Mon Sep 17 00:00:00 2001 From: charras Date: Fri, 6 Feb 2009 11:45:35 +0000 Subject: [PATCH] See changelog --- CHANGELOG.txt | 18 ++++++++++ common/about_kicad.cpp | 1 + common/base_screen.cpp | 7 +++- common/makefile.include | 70 +++++++++++++++++++++++++++++++++++++-- cvpcb/makefile.include | 47 +------------------------- eeschema/class_screen.cpp | 7 ++-- gerbview/makefile.include | 50 +--------------------------- include/build_version.h | 4 +-- include/id.h | 3 +- include/wxPcbStruct.h | 1 + pcbnew/classpcb.cpp | 64 ++++++++++++++++++++--------------- pcbnew/makefile.include | 29 ++-------------- pcbnew/moduleframe.cpp | 32 +++++++++++++++++- pcbnew/pcbcfg.h | 10 ------ pcbnew/pcbframe.cpp | 4 +++ pcbnew/set_grid.cpp | 8 +++-- pcbnew/tool_modedit.cpp | 12 +++++-- pcbnew/tool_pcb.cpp | 2 -- 18 files changed, 194 insertions(+), 175 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d86fc35198..9484d950e4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,24 @@ Please add newer entries at the top, list the date and your name with email address. +2009-Feb-6 Jean-Pierre Charras +================================================================================ + Added a forgotten contributor (Tim Hanson) to kicad contributor list. + +++pcbnew: + Zoom factors in 1.5 progression, and limited to 18 values + (near to to Wayne Stambaugh's changes: 15 values are not enought for pcbnew) + removed minor problems in zoom box selection (removed blank line). + Added user grid selection in modedit and refinements when user grid is selected. + TODO: + more refinements in user grid mode. + new grid implementation does not used floats when user grid is selected to calculate coordinates. + so it is unable to handle a metric grid. Todo: see what happened. + + +++eeschema: + Zoom factors in 1.5 progression, and limited to 15 values according to Wayne Stambaugh's changes. + 2009-Feb-05 UPDATE Wayne Stambaugh ================================================================================ ++All diff --git a/common/about_kicad.cpp b/common/about_kicad.cpp index 719d1e9d34..5f4e739bfd 100644 --- a/common/about_kicad.cpp +++ b/common/about_kicad.cpp @@ -113,6 +113,7 @@ void InitKiCadAbout( wxAboutDialogInfo& info ) info.AddDeveloper( SetMsg( wxT( "Jonas Diemer " ) ) ); info.AddDeveloper( SetMsg( wxT( "KBool Library " ) ) ); info.AddDeveloper( SetMsg( wxT( "Rok Markovic " ) ) ); + info.AddDeveloper( SetMsg( wxT( "Tim Hanson " ) ) ); info.AddDeveloper( SetMsg( wxT( "Vesa Solonen " ) ) ); info.AddDeveloper( SetMsg( wxT( "Wayne Stambaugh " ) ) ); diff --git a/common/base_screen.cpp b/common/base_screen.cpp index f3342b9ab5..9f95cccbe2 100644 --- a/common/base_screen.cpp +++ b/common/base_screen.cpp @@ -310,6 +310,7 @@ void BASE_SCREEN::SetGrid( const wxSize& size ) size_t i; + wxSize nearest_grid = m_GridList[0].m_Size; for( i = 0; i < m_GridList.GetCount(); i++ ) { if( m_GridList[i].m_Size == size ) @@ -317,9 +318,13 @@ void BASE_SCREEN::SetGrid( const wxSize& size ) m_Grid = m_GridList[i].m_Size; return; } + + // keep trace of the nearest grill size, if the exact size is not found + if ( size.x < m_GridList[i].m_Size.x ) + nearest_grid = m_GridList[i].m_Size; } - m_Grid = m_GridList[0].m_Size; + m_Grid = nearest_grid; wxLogWarning( _( "Grid size( %d, %d ) not in grid list, falling back to " \ "grid size( %d, %d )." ), diff --git a/common/makefile.include b/common/makefile.include index df0f09b461..64ccf591b9 100644 --- a/common/makefile.include +++ b/common/makefile.include @@ -2,7 +2,7 @@ EXTRACPPFLAGS += -I$(SYSINCLUDE) -I./ -Ibitmaps -I../include COMMON = ../include/colors.h - +PCBINCL = -I../pcbnew -I../polygon OBJECTS= \ about_kicad.o\ @@ -39,13 +39,79 @@ OBJECTS= \ worksheet.o\ base_screen.o\ dcsvg.o\ - zoom.o + zoom.o\ + basepcbframe.o\ + class_board.o\ + class_board_connected_item.o\ + class_cotation.o\ + class_drc_item.o\ + class_marker.o\ + class_mire.o\ + class_pad.o\ + class_pad_draw_functions.o\ + class_pcb_text.o\ + class_zone.o\ + class_zone_setting.o\ + classpcb.o\ + collectors.o\ + sel_layer.o\ + dialog_print_using_printer_base.o + ifdef KICAD_PYTHON OBJECTS += pyhandler.o pyhandler.o: pyhandler.cpp $(COMMON) ../include/pyhandler.h endif + +basepcbframe.o: ../pcbnew/basepcbframe.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +class_board.o: ../pcbnew/class_board.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +class_board_connected_item.o: ../pcbnew/class_board_connected_item.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +class_cotation.o: ../pcbnew/class_cotation.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +class_drc_item.o: ../pcbnew/class_drc_item.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +class_marker.o: ../pcbnew/class_marker.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +class_mire.o: ../pcbnew/class_mire.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +class_pad.o: ../pcbnew/class_pad.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +class_pad_draw_functions.o: ../pcbnew/class_pad_draw_functions.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +class_pcb_text.o: ../pcbnew/class_pcb_text.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +class_zone.o: ../pcbnew/class_zone.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +class_zone_setting.o: ../pcbnew/class_zone_setting.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +classpcb.o: ../pcbnew/classpcb.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +collectors.o: ../pcbnew/collectors.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +sel_layer.o: ../pcbnew/sel_layer.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + +dialog_print_using_printer_base.o: ../pcbnew/dialog_print_using_printer_base.cpp + $(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp + gr_basic.o: gr_basic.cpp ../include/gr_basic.h $(DEPEND) confirm.o: confirm.cpp $(COMMON) diff --git a/cvpcb/makefile.include b/cvpcb/makefile.include index 49e5323a74..b5d68b6273 100644 --- a/cvpcb/makefile.include +++ b/cvpcb/makefile.include @@ -13,16 +13,10 @@ LIBVIEWER3D = ../3d-viewer/3d-viewer.a OBJECTS = $(TARGET).o \ class_cvpcb.o\ - class_zone.o\ - class_zone_setting.o\ - class_board_connected_item.o\ class_board_item.o\ memoire.o \ cvframe.o\ listboxes.o\ - class_pcb_text.o\ - class_cotation.o\ - class_mire.o\ displayframe.o\ init.o\ readschematicnetlist.o\ @@ -39,18 +33,12 @@ OBJECTS = $(TARGET).o \ setvisu.o\ dialog_display_options.o\ tracemod.o \ - classpcb.o \ class_drawsegment.o \ - class_board.o \ class_module.o \ - class_pad.o \ - class_pad_draw_functions.o\ class_text_mod.o \ class_edge_mod.o \ class_equipot.o \ - class_track.o\ - basepcbframe.o\ - collectors.o + class_track.o cvpcb.o: cvpcb.cpp cvpcb.h @@ -67,30 +55,9 @@ memoire.o: memoire.cpp rdpcad.o: rdpcad.cpp -classpcb.o: ../pcbnew/classpcb.cpp - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -class_mire.o: ../pcbnew/class_mire.cpp ../pcbnew/class_mire.h $(COMMON) - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -class_board_connected_item.o: ../pcbnew/class_board_connected_item.cpp - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - class_board_item.o: ../pcbnew/class_board_item.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp -class_zone.o: ../pcbnew/class_zone.cpp ../pcbnew/class_zone.h $(COMMON) - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -class_zone_setting.o: ../pcbnew/class_zone_setting.cpp ../pcbnew/class_zone_setting.h $(COMMON) - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -class_cotation.o: ../pcbnew/class_cotation.cpp ../pcbnew/class_cotation.h $(COMMON) - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -class_pcb_text.o: ../pcbnew/class_pcb_text.cpp ../pcbnew/class_pcb_text.h $(COMMON) - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - class_board.o: ../pcbnew/class_board.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp @@ -100,12 +67,6 @@ class_drawsegment.o: ../pcbnew/class_drawsegment.cpp ../pcbnew/class_drawsegment class_track.o: ../pcbnew/class_track.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp -class_pad.o: ../pcbnew/class_pad.cpp - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -class_pad_draw_functions.o: ../pcbnew/class_pad_draw_functions.cpp - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - class_module.o: ../pcbnew/class_module.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp @@ -118,12 +79,6 @@ class_edge_mod.o: ../pcbnew/class_edge_mod.cpp class_equipot.o: ../pcbnew/class_equipot.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp -basepcbframe.o: ../pcbnew/basepcbframe.cpp - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -collectors.o: ../pcbnew/collectors.cpp $(COMMON) - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - readschematicnetlist.o: readschematicnetlist.cpp viewlogi.o: viewlogi.cpp diff --git a/eeschema/class_screen.cpp b/eeschema/class_screen.cpp index 8b47894aa5..eff74a3fc7 100644 --- a/eeschema/class_screen.cpp +++ b/eeschema/class_screen.cpp @@ -79,8 +79,11 @@ void SCH_ITEM::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) /* Class SCH_SCREEN: classe de gestion d'un affichage pour schematique */ /***********************************************************************/ -/* Default EESchema zoom values. 3th root of 2 series up to 32 */ -static int SchematicZoomList[] = { 10, 13, 16, 20, 25, 32, 40, 50, 63, 80, 101, 127, 160, 202, 254, 320, 640, 1280 }; +/* Default EESchema zoom values. Limited to 15 values to keep a decent size to menus */ +static int SchematicZoomList[] = +{ + 10, 15, 20, 30, 40, 60, 80, 120, 160, 230, 320, 480, 640, 800, 1280 +}; #define SCHEMATIC_ZOOM_LIST_CNT ( sizeof( SchematicZoomList ) / \ sizeof( int ) ) diff --git a/gerbview/makefile.include b/gerbview/makefile.include index e347bdb6bf..ea58ede992 100644 --- a/gerbview/makefile.include +++ b/gerbview/makefile.include @@ -9,30 +9,20 @@ EXTRACPPFLAGS= -DGERBVIEW -DPCBNEW -fno-strict-aliasing\ OBJECTS= \ $(TARGET).o\ - classpcb.o\ - class_zone.o\ - class_zone_setting.o\ select_layers_to_pcb.o\ - sel_layer.o\ lay2plot.o\ - dialog_print_using_printer_base.o \ dialog_print_using_printer.o \ edit.o \ setpage.o \ tool_gerber.o \ gerberframe.o\ onrightclick.o\ - class_board.o\ class_board_item.o\ class_drawsegment.o\ class_track.o \ - class_drc_item.o \ - class_board_connected_item.o\ set_color.o \ gerbview_config.o \ - class_marker.o \ tracepcb.o \ - class_pcb_text.o\ trpiste.o \ reglage.o \ options.o \ @@ -49,9 +39,7 @@ OBJECTS= \ files.o\ block.o\ controle.o\ - basepcbframe.o\ - export_to_pcbnew.o\ - collectors.o + export_to_pcbnew.o setpage.o: ../share/setpage.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp @@ -59,51 +47,15 @@ setpage.o: ../share/setpage.cpp drawframe.o: ../share/drawframe.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp -class_board_connected_item.o: ../pcbnew/class_board_connected_item.cpp - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - class_board_item.o: ../pcbnew/class_board_item.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp -class_marker.o: ../pcbnew/class_marker.cpp ../pcbnew/class_marker.h - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -class_zone.o: ../pcbnew/class_zone.cpp ../pcbnew/class_zone.h - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -class_zone_setting.o: ../pcbnew/class_zone_setting.cpp ../pcbnew/class_zone_setting.h - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - class_drawsegment.o: ../pcbnew/class_drawsegment.cpp ../pcbnew/class_drawsegment.h $(DEPEND) $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp -class_drc_item.o: ../pcbnew/class_drc_item.cpp - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -sel_layer.o: ../pcbnew/sel_layer.cpp - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -dialog_print_using_printer_base.o: ../pcbnew/dialog_print_using_printer_base.cpp ../pcbnew/dialog_print_using_printer_base.h - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - dialog_print_using_printer.o: ../pcbnew/dialog_print_using_printer.cpp ../pcbnew/dialog_print_using_printer_base.h $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp -classpcb.o: ../pcbnew/classpcb.cpp - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -class_pcb_text.o: ../pcbnew/class_pcb_text.cpp ../pcbnew/class_pcb_text.h - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -class_board.o: ../pcbnew/class_board.cpp $(DEPEND) - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -basepcbframe.o: ../pcbnew/basepcbframe.cpp - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - -collectors.o: ../pcbnew/collectors.cpp - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - class_track.o: ../pcbnew/class_track.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp diff --git a/include/build_version.h b/include/build_version.h index b3bbfd747e..818145df87 100644 --- a/include/build_version.h +++ b/include/build_version.h @@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion # include "config.h" (wxT(KICAD_SVN_VERSION)) # else - (wxT("(20090201-unstable)")) /* main program version */ + (wxT("(20090206-unstable)")) /* main program version */ # endif #endif ; @@ -20,7 +20,7 @@ COMMON_GLOBL wxString g_BuildAboutVersion # include "config.h" (wxT(KICAD_ABOUT_VERSION)) # else - (wxT("(20090201-unstable)")) /* svn date & rev (normally overridden) */ + (wxT("(20090206-unstable)")) /* svn date & rev (normally overridden) */ # endif #endif ; diff --git a/include/id.h b/include/id.h index 64f4d13e1c..ae4ada1a4d 100644 --- a/include/id.h +++ b/include/id.h @@ -218,9 +218,10 @@ enum main_id { * than 15 entries in a context submenu may get too large to display * cleanly. Add any additional popup zoom IDs above here or the * zoom event handler will not work properly. + * currently set to 18. This is a compromise for pcbnew. For schematic 15 is enought */ ID_POPUP_ZOOM_LEVEL_START, - ID_POPUP_ZOOM_LEVEL_END = ID_POPUP_ZOOM_LEVEL_START + 15, + ID_POPUP_ZOOM_LEVEL_END = ID_POPUP_ZOOM_LEVEL_START + 18, ID_POPUP_ZOOM_END_RANGE, // last zoom id ID_POPUP_GRID_PLUS, diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index 8691e5b4fb..89b387574f 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -916,6 +916,7 @@ public: void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ); void Show3D_Frame( wxCommandEvent& event ); void GeneralControle( wxDC* DC, wxPoint Mouse ); + virtual void OnSelectGrid( wxCommandEvent& event ); /* handlers for block commands */ int ReturnBlockCommand( int key ); diff --git a/pcbnew/classpcb.cpp b/pcbnew/classpcb.cpp index 8589c3af33..ffbf26218a 100644 --- a/pcbnew/classpcb.cpp +++ b/pcbnew/classpcb.cpp @@ -12,8 +12,16 @@ #include "id.h" -// mostly 1.5 factor, seems to work well. -static const int PcbZoomList[] = { 5, 8, 12, 18, 27, 40, 60, 90, 140, 200, 300, 450, 700, 1000, 1500, 2250, 4500, 9000, 20480 }; +/* Default pcbnew zoom values. + * Limited to 18 values to keep a decent size to menus + * 15 it better but does not allow a sufficient number of values + * roughtly a 1.5 progression. + * The last 2 values is handy when somebody uses a library import of a module + * (or foreign data) which has a bad coordinate + * Also useful in Gerbview for this reason. + */ +static const int PcbZoomList[] = { 10, 15, 22, 30, 45, 70, 100, 150, 220, 350, 500, 800, 1200, + 2000, 3500, 5000, 10000, 20000 }; #define PCB_ZOOM_LIST_CNT ( sizeof( PcbZoomList ) / sizeof( int ) ) @@ -21,27 +29,26 @@ static const int PcbZoomList[] = { 5, 8, 12, 18, 27, 40, 60, 90, 140, 200, 300, /* Default grid sizes for PCB editor screens. */ static GRID_TYPE PcbGridList[] = { { ID_POPUP_GRID_LEVEL_1000, wxSize( 1000, 1000 ) }, - { ID_POPUP_GRID_LEVEL_500, wxSize( 500, 500 ) }, - { ID_POPUP_GRID_LEVEL_250, wxSize( 250, 250 ) }, - { ID_POPUP_GRID_LEVEL_200, wxSize( 200, 200 ) }, - { ID_POPUP_GRID_LEVEL_100, wxSize( 100, 100 ) }, - { ID_POPUP_GRID_LEVEL_50, wxSize( 50, 50 ) }, - { ID_POPUP_GRID_LEVEL_25, wxSize( 25, 25 ) }, - { ID_POPUP_GRID_LEVEL_20, wxSize( 20, 20 ) }, - { ID_POPUP_GRID_LEVEL_10, wxSize( 10, 10 ) }, - { ID_POPUP_GRID_LEVEL_5, wxSize( 5, 5 ) }, - { ID_POPUP_GRID_LEVEL_2, wxSize( 2, 2 ) }, - { ID_POPUP_GRID_LEVEL_1, wxSize( 1, 1 ) } + { ID_POPUP_GRID_LEVEL_500, wxSize( 500, 500 ) }, + { ID_POPUP_GRID_LEVEL_250, wxSize( 250, 250 ) }, + { ID_POPUP_GRID_LEVEL_200, wxSize( 200, 200 ) }, + { ID_POPUP_GRID_LEVEL_100, wxSize( 100, 100 ) }, + { ID_POPUP_GRID_LEVEL_50, wxSize( 50, 50 ) }, + { ID_POPUP_GRID_LEVEL_25, wxSize( 25, 25 ) }, + { ID_POPUP_GRID_LEVEL_20, wxSize( 20, 20 ) }, + { ID_POPUP_GRID_LEVEL_10, wxSize( 10, 10 ) }, + { ID_POPUP_GRID_LEVEL_5, wxSize( 5, 5 ) }, + { ID_POPUP_GRID_LEVEL_2, wxSize( 2, 2 ) }, + { ID_POPUP_GRID_LEVEL_1, wxSize( 1, 1 ) } }; #define PCB_GRID_LIST_CNT ( sizeof( PcbGridList ) / sizeof( GRID_TYPE ) ) -/**************************************************/ -/* Class SCREEN: classe de gestion d'un affichage */ -/***************************************************/ -/* Constructeur de SCREEN */ -PCB_SCREEN::PCB_SCREEN( ) : BASE_SCREEN( TYPE_SCREEN ) +/*******************************************************************/ +/* Class PCB_SCREEN: class to handle parametres to display a board */ +/********************************************************************/ +PCB_SCREEN::PCB_SCREEN() : BASE_SCREEN( TYPE_SCREEN ) { size_t i; @@ -51,7 +58,7 @@ PCB_SCREEN::PCB_SCREEN( ) : BASE_SCREEN( TYPE_SCREEN ) for( i = 0; i < PCB_GRID_LIST_CNT; i++ ) AddGrid( PcbGridList[i] ); - SetGrid( wxSize( 500, 500 ) ); /* pas de la grille en 1/10000 "*/ + SetGrid( wxSize( 500, 500 ) ); /* Set the working grid size to a reasonnable value (in 1/10000 inch) */ Init(); } @@ -62,22 +69,25 @@ PCB_SCREEN::~PCB_SCREEN() { } + /*************************/ void PCB_SCREEN::Init() /*************************/ { InitDatas(); - m_Active_Layer = COPPER_LAYER_N; /* ref couche active 0.. 31 */ - m_Route_Layer_TOP = CMP_N; /* ref couches par defaut pour vias (Cu.. Cmp) */ + m_Active_Layer = COPPER_LAYER_N; /* default active layer = bottom layer */ + m_Route_Layer_TOP = CMP_N; /* default layers pair for vias (bottom to top) */ m_Route_Layer_BOTTOM = COPPER_LAYER_N; - m_Zoom = 128; /* valeur */ + m_Zoom = 150; /* a default value for zoom */ } + int PCB_SCREEN::GetInternalUnits( void ) { return PCB_INTERNAL_UNIT; } + /* Return true if a microvia can be put on board * A microvia ia a small via restricted to 2 near neighbour layers * because its is hole is made by laser which can penetrate only one layer @@ -164,10 +174,10 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings() m_CopperLayerCount = 2; // Default design is a double sided board m_ViaDrill = 250; // defualt via drill (for the entire board) m_ViaDrillCustomValue = 250; // via drill for vias which must have a defined drill value - m_CurrentViaSize = 450; // Current via size - m_CurrentViaType = VIA_THROUGH; // via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA) - m_CurrentTrackWidth = 170; // current track width - m_UseConnectedTrackWidth = false; // if true, when creating a new track starting on an existing track, use this track width + m_CurrentViaSize = 450; // Current via size + m_CurrentViaType = VIA_THROUGH; // via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA) + m_CurrentTrackWidth = 170; // current track width + m_UseConnectedTrackWidth = false; // if true, when creating a new track starting on an existing track, use this track width m_MicroViaDrill = 50; // micro via drill (for the entire board) m_CurrentMicroViaSize = 150; // Current micro via size m_MicroViasAllowed = false; // true to allow micro vias @@ -196,7 +206,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings() m_ViaColor[VIA_BLIND_BURIED] = BROWN; m_ViaColor[VIA_THROUGH] = WHITE; - m_ModuleTextCMPColor = LIGHTGRAY; // Text module color for modules on the COMPONENT layer + m_ModuleTextCMPColor = LIGHTGRAY; // Text module color for modules on the COMPONENT layer m_ModuleTextCUColor = MAGENTA; // Text module color for modules on the COPPER layer m_ModuleTextNOVColor = DARKGRAY; // Text module color for "invisible" texts (must be BLACK if really not displayed) m_AnchorColor = BLUE; // Anchor color for modules and texts diff --git a/pcbnew/makefile.include b/pcbnew/makefile.include index 23413752d4..ab7aa7a062 100644 --- a/pcbnew/makefile.include +++ b/pcbnew/makefile.include @@ -21,7 +21,7 @@ ZONE_FILES = zones_by_polygon.o zones_test_and_combine_areas.o\ SPECCTRA_TOOLS = specctra.o specctra_export.o dsn.o specctra_import.o -OBJECTS= $(TARGET).o classpcb.o\ +OBJECTS= $(TARGET).o\ $(ZONE_FILES)\ $(SPECCTRA_TOOLS)\ print_board_functions.o\ @@ -36,13 +36,11 @@ OBJECTS= $(TARGET).o classpcb.o\ dialog_SVG_print.o\ dialog_SVG_print_base.o\ dialog_print_using_printer.o\ - dialog_print_using_printer_base.o\ onrightclick.o\ onleftclick.o\ modedit_onclick.o\ cross-probing.o\ via_edit.o\ - class_marker.o\ menubarpcb.o \ menubarmodedit.o \ tool_onrightclick.o\ @@ -52,21 +50,12 @@ OBJECTS= $(TARGET).o classpcb.o\ pcbframe.o \ class_drawsegment.o \ class_track.o \ - class_mire.o\ class_cotation.o\ - class_pad.o \ - class_pad_draw_functions.o\ class_equipot.o \ class_module.o \ class_edge_mod.o \ class_text_mod.o\ - class_pcb_text.o\ class_board_item.o\ - class_board_connected_item.o\ - class_drc_item.o\ - class_board.o\ - class_zone.o\ - class_zone_setting.o\ track.o \ set_color.o \ set_grid.o \ @@ -111,7 +100,6 @@ OBJECTS= $(TARGET).o classpcb.o\ gendrill.o\ gen_holes_and_tools_lists_for_drill.o\ gen_drill_report_files.o\ - sel_layer.o \ cotation.o\ automove.o\ tr_modif.o \ @@ -131,14 +119,12 @@ OBJECTS= $(TARGET).o classpcb.o\ tool_modedit.o\ moduleframe.o\ find.o\ - basepcbframe.o\ modeditoptions.o\ gen_modules_placefile.o\ modedit.o\ export_gencad.o\ hotkeys.o \ - collectors.o\ - gpcb_exchange.o + gpcb_exchange.o setpage.o: ../share/setpage.cpp @@ -165,16 +151,8 @@ export_gencad.o: export_gencad.cpp print_board_functions.o: print_board_functions.cpp -classpcb.o: classpcb.cpp - class_track.o: class_track.cpp class_track.h -class_mire.o: class_mire.cpp class_mire.h - -class_cotation.o: class_cotation.cpp class_cotation.h - -class_pad.o: class_pad.cpp - class_equipot.o: class_equipot.cpp class_module.o: class_module.cpp @@ -183,8 +161,6 @@ class_edge_mod.o: class_edge_mod.cpp class_text_mod.o: class_text_mod.cpp -class_pcb_text.o: class_pcb_text.cpp class_pcb_text.h - pcbnew.o: pcbnew.cpp pcbnew.h pcbplot.h drag.h \ autorout.h ../include/eda_dde.h @@ -315,4 +291,3 @@ dragsegm.o: dragsegm.cpp drag.h router.o: router.cpp -collectors.o: collectors.cpp collectors.h diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index 82fbc5c2b3..057edaa7f5 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -195,7 +195,11 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father, GridSize.x = SizeX; GridSize.y = SizeY; } + } + + GetScreen()->AddGrid( g_UserGrid, g_UserGrid_Unit, ID_POPUP_GRID_USER ); + GetScreen()->SetGrid( GridSize ); SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); @@ -353,14 +357,18 @@ void WinEDA_ModuleEditFrame::SetToolbars() unsigned jj; if( m_SelZoomBox ) { - for( jj = 0; jj < (int)GetScreen()->m_ZoomList.GetCount(); jj++ ) + bool not_found = true; + for( jj = 0; jj < GetScreen()->m_ZoomList.GetCount(); jj++ ) { if( GetScreen()->GetZoom() == GetScreen()->m_ZoomList[jj] ) { m_SelZoomBox->SetSelection( jj + 1 ); + not_found = false; break; } } + if ( not_found ) + m_SelZoomBox->SetSelection( -1 ); } if( m_SelGridBox && GetScreen() ) @@ -493,3 +501,25 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) SetToolbars(); Affiche_Status_Box(); /* Affichage des coord curseur */ } + + +/*****************************************************************/ +void WinEDA_ModuleEditFrame::OnSelectGrid( wxCommandEvent& event ) +/******************************************************************/ +// Virtual function +{ + if( m_SelGridBox == NULL ) + return; // Should not occurs + + GetScreen()->AddGrid( g_UserGrid, g_UserGrid_Unit, ID_POPUP_GRID_USER ); + + WinEDA_DrawFrame::OnSelectGrid( event ); + + // If the user grid is the current selection , ensure grid size value = new user grid value + int ii = m_SelGridBox->GetSelection(); + if ( ii == (int)(m_SelGridBox->GetCount() - 1) ) + { + GetScreen()->SetGrid( ID_POPUP_GRID_USER ); + DrawPanel->Refresh(); + } +} diff --git a/pcbnew/pcbcfg.h b/pcbnew/pcbcfg.h index 318e77524f..cc6663dfe6 100644 --- a/pcbnew/pcbcfg.h +++ b/pcbnew/pcbcfg.h @@ -13,8 +13,6 @@ #define INSETUP TRUE -static int Pcbdiv_grille; /* memorisation temporaire */ - /* Liste des parametres */ static PARAM_CFG_WXSTRING UserLibDirBufCfg @@ -745,13 +743,6 @@ static PARAM_CFG_INT UserGrilleUnitCfg 0, 1 /* Min and max values*/ ); -static PARAM_CFG_INT DivGrillePcbCfg -( - wxT( "DivGrPc" ), /* Keyword */ - &Pcbdiv_grille, /* Parameter address */ - 1, /* Default value */ - 1, 10 /* Min and max values*/ -); static PARAM_CFG_INT TimeOutCfg //Duree entre Sauvegardes auto en secondes ( @@ -905,7 +896,6 @@ PARAM_CFG_BASE* ParamCfgList[] = &UserGrilleXCfg, &UserGrilleYCfg, &UserGrilleUnitCfg, - &DivGrillePcbCfg, &TimeOutCfg, &DisplPolairCfg, &CursorShapeCfg, diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 9eb296a2a2..98affccfff 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -543,14 +543,18 @@ void WinEDA_PcbFrame::SetToolbars() if( m_SelZoomBox ) { + bool not_found = true; for( jj = 0; jj < (int)GetScreen()->m_ZoomList.GetCount(); jj++ ) { if( GetScreen()->GetZoom() == GetScreen()->m_ZoomList[jj] ) { m_SelZoomBox->SetSelection( jj + 1 ); + not_found = false; break; } } + if ( not_found ) + m_SelZoomBox->SetSelection( -1 ); } if( m_SelGridBox && GetScreen() ) diff --git a/pcbnew/set_grid.cpp b/pcbnew/set_grid.cpp index 6bfa793293..230bafefb0 100644 --- a/pcbnew/set_grid.cpp +++ b/pcbnew/set_grid.cpp @@ -31,10 +31,14 @@ void WinEDA_PcbGridFrame::AcceptPcbOptions(wxCommandEvent& event) m_OptGridSizeY->GetValue().ToDouble( &dtmp ); g_UserGrid.y = dtmp; - m_Parent->GetScreen()->AddGrid( g_UserGrid, g_UserGrid_Unit, - ID_POPUP_GRID_USER ); + m_Parent->GetScreen()->AddGrid( g_UserGrid, g_UserGrid_Unit, ID_POPUP_GRID_USER ); EndModal(1); + + // If the user grid is the current selection , ensure grid size value = new user grid value + int ii = m_Parent->m_SelGridBox->GetSelection(); + if ( ii == m_Parent->m_SelGridBox->GetCount() - 1 ) + m_Parent->GetScreen()->SetGrid( ID_POPUP_GRID_USER ); m_Parent->DrawPanel->Refresh( TRUE ); } diff --git a/pcbnew/tool_modedit.cpp b/pcbnew/tool_modedit.cpp index 9a2e938b12..1df73f5990 100644 --- a/pcbnew/tool_modedit.cpp +++ b/pcbnew/tool_modedit.cpp @@ -286,12 +286,18 @@ void WinEDA_ModuleEditFrame::ReCreateAuxiliaryToolbar() m_SelZoomBox->Append( msg ); for( int i = 0; i < (int)GetScreen()->m_ZoomList.GetCount(); i++ ) { - msg.Printf( _( "Zoom %d" ), GetScreen()->m_ZoomList[i] ); + msg = _( "Zoom " ); + if ( (GetScreen()->m_ZoomList[i] % GetScreen()->m_ZoomScalar) == 0 ) + msg << GetScreen()->m_ZoomList[i] / GetScreen()->m_ZoomScalar; + else + { + wxString value; + value.Printf(wxT("%.1f"),(float)GetScreen()->m_ZoomList[i] / GetScreen()->m_ZoomScalar ); + msg += value; + } m_SelZoomBox->Append( msg ); } - m_SelZoomBox->Append( wxT( "" ) ); - m_AuxiliaryToolBar->AddControl( m_SelZoomBox ); // after adding the buttons to the toolbar, must call Realize() to reflect diff --git a/pcbnew/tool_pcb.cpp b/pcbnew/tool_pcb.cpp index 822c4fa8be..b73d03eae5 100644 --- a/pcbnew/tool_pcb.cpp +++ b/pcbnew/tool_pcb.cpp @@ -603,8 +603,6 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar() m_SelZoomBox->Append( msg ); } - m_SelZoomBox->Append( wxT( "" ) ); - m_AuxiliaryToolBar->AddControl( m_SelZoomBox ); // after adding the buttons to the toolbar, must call Realize()