Commit Graph

90 Commits

Author SHA1 Message Date
Wayne Stambaugh 0e27f45ffd Encapsulate EDA_APP class. 2011-12-16 15:12:49 -05:00
Wayne Stambaugh fac288cffa More encapsulation work and other minor improvements.
* EDA_DRAW_FRAME completely encapsulated except for DrawFrame member.
* Moved members specific to Pcbnew from EDA_DRAW_FRAME to PCB_BASE_FRAME
  or PCB_EDIT_FRAME as appropriate.
* Replace EDA_TOOLBAR with wxAuiToolBar as EDA_TOOL bar provided no
  additional functionality and made code less readable.
* Remove EDA_TOOLBAR class definition from wxstruct.h and delete file
  wineda_toolbar.cpp.
* Rename tool bar members to something more descriptive since the
  horizontal and vertical references wont mean anything once the
  tool bars are movable.
* Lots of dead code removal.
2011-12-16 08:32:23 -05:00
Guillaume Simard cc70c1a463 fix 2011-12-14 16:35:03 -06:00
Wayne Stambaugh 95891006cd More EDA_DRAW_FRAME encapsulation work. 2011-12-14 15:03:15 -05:00
Dick Hollenbeck b26580d5df ++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
    having a BOARD being edited by more than one editor, it was a bad design.
    And this meant removing m_PcbFrame from BOARD.
  * removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
  * Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
  * added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
  * a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
    such as dialog_mask_clearance, dialog_drc, etc.
  * Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
    with build_version.h's #define BOARD_FILE_VERSION, although there may be a
    better place for this constant.
  * Made the public functions in PARAM_CFG_ARRAY be type const.
    void SaveParam(..) const and void ReadParam(..) const
  * PARAM_CFG_BASE now has virtual destructor since we have various way of
    destroying the derived class and boost::ptr_vector must be told about this.
  * Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
    an automatic PARAM_CFG_ARRAY which is on the stack.\
  * PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
    since it has to access the current BOARD and the BOARD can change.
    Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
  * Made the m_BoundingBox member private, this was a brutally hard task,
    and indicative of the lack of commitment to accessors and object oriented
    design on the part of KiCad developers.  We must do better.
    Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
  * Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 00:15:33 -06:00
Wayne Stambaugh 393e020442 Fix cursor warping out of client when zooming bug.
* Modify algorithm to correctly calculate the virtual drawing size and
  offset required to place the drawing correctly under all conditions.
* Ignore default wxWidgets scroll keys on Windows in EDA_DRAW_PANEL key
  event handler.
2011-11-07 14:04:24 -05:00
Wayne Stambaugh 121b65bfb8 More auto save improvements.
* Factor test for auto save file into base frame class.
* Added auto save feature to Eeschema for saving schematics, addresses
  launchpad question 173631.
* Add auto save interval control to Eeschema options dialog.
* Fix problem with subsequent auto saves in last commit.
2011-10-15 09:25:57 -04:00
Wayne Stambaugh edd35b4e90 PCB common library header rationalization.
* All header files used to create the PCB common library now compile as
  stand alone code.  This prevents the need to define them in a specific
  order to make source code compile properly.  It should also now be
  possible to relocate the source code to build the common PCB library
  to a separate folder.
2011-09-23 09:57:12 -04:00
Wayne Stambaugh cb78c9452b Undo changes from my last commit that caused a trace drag bug. 2011-09-14 11:08:44 -04:00
Wayne Stambaugh efc93aa52b PCBNew locate code refactoring.
* Move various locate functions into the appropriate board item object.
* Unified best zoom for all frames derived from PCB_BASE_FRAME.
* Remove track.cpp as it is no longer needed.
* Dead code removal.
* Remove scary frame window pointer member from board item objects.
* Add draw bounding box to gerber draw item for debugging purposes.
2011-09-13 09:29:43 -04:00
Roman Bashkov c5e1c249bb pcbnew:
* Add hotkey fast switch to two grids: for place and trace
	Alt+"1" - switch grid for place module
	Alt+"2" - switch grid for trace
  This two grid set in dialog - menu Preferences->Dimensions->Grid.
* Add hotkey switch grid:
	"`" - switch to next grid
	Ctrl+"`" - switch to previous grid
* Add hotkey switch track width:
	"W" - switch to next track width
	Ctrl+"W" - switch to previous track width
cmakemodules:
* Add GOST to KICAD_BUILD_VERSION if define KICAD_GOST.
2011-09-09 15:02:03 +04:00
Wayne Stambaugh 0c44335795 Lots and lots of PCBNew code cleaning and fix build bug introduced in r3108.
* Changed <wx-2.8/xml/xml.h> to "xnode.h" in pcbnew_config.cpp to fix bug
  when building against wxWidgets 2.9 and above.
* Convert broken wxXmlNode code to use XNODE.
* Overloaded XNODE constructor for creating child nodes.
* Translate French naming conventions.
* Translate French comments.
* Remove tabs from several source files.
* Coding style policy and Doxygen comment fixes.
2011-09-07 15:41:04 -04:00
Wayne Stambaugh 750f84c19a Coding style policy fixes and dead code removal. 2011-09-06 15:42:46 -04:00
Wayne Stambaugh ebc7259a91 Rename WinEDA_App class to EDA_APP and remove redundant includes. 2011-09-06 10:09:40 -04:00
jean-pierre charras f00696e835 Pcbnew: fix bug 804780.
All: use double instead of int to store zoom values.
2011-07-05 14:46:14 +02:00
jean-pierre charras 16e9ddc27a * Gerbview, Pcbnew: add SetLocaleTo_Default() after reading double in config to fix issues with decimal separator (when the separator is not a point).
(WxWidgets 2.9.1 seems call setlocale( LC_NUMERIC, "" ) when wxConfig read doubles stored in config, but forget to back to current locale.)
Note: perhaps there are some dialogs that need this call to  SetLocaleTo_Default() ).
* Minor  code cleanup in pcbnew/netlist.cpp
2011-04-02 18:14:07 +02:00
Wayne Stambaugh 283cfa67ff Set default button on all dialogs. Fixes lp:665703
* Set default button on all dialogs that do not already have a defined
  default button.  The only exception is the EESchema net list dialog
  which needs converted over to wxFormBuilder and due to it's design makes
  setting the default button in any tab other than the default tab
  problematic.
* Fix escape key dialog handling bug in EESchema print post script
  dialog.
2011-03-14 11:17:18 -04:00
Wayne Stambaugh 1010601a78 PCBNew control update bug fixes, fixes lp:725963.
* Fix grid select box update bug on context menu.
* Fix via size and track width select box update bugs.
* Fix layer pair indicator button update bug.
* Fix auto track width tool bar control enable bug.
* Fix via size and track width select status bug in context menu.
* Fix layer select box and layer control widget select bug when current
  layer is removed.
* Add virtual function to notify objects derived from EDA_DRAW_FRAME that
  the units setting has changed.
* Coding policy class naming fixes.
2011-03-01 14:26:17 -05:00
Marco Mattila 97003fefae Change board bounding box calculation to include all board items by default in pcbnew. Add a parameter to look for board edges only. 2011-02-25 18:23:24 +02:00
Wayne Stambaugh cb647737ee Improve handling of tool bar command IDs.
* Make EDA_DRAW_FRAME current tool ID member variable private.
* Added global no tool selected ID to replace application specific no
  tool selected IDs.
* Change SetToolID to prevent setting the tool ID to anything less than
  the new global no tool selected ID and assert on debug builds.
* Change command and update user interface command event handlers to use
  new global no tool selected ID.
* Fixed schematic library editor add pin hot key handler.
2011-02-24 15:22:12 -05:00
Wayne Stambaugh c02d90e9a7 Use wxUpdateUIEvent in CVPcb and other minor changes.
* CVPcb now uses wxUpdateUIEvent instead of set toolbars.
* Removed duplicate event handlers in CVPcb that were factored into
  EDA_DRAW_FRAME.
* Fix definition of GeneralControle() in CVPcb that prevented it from being
  called.
* Remove rarely used and scary refresh code GeneralControle() method in all
  main frame windows.
* Factor zoom menu and tool bar command IDs down to EDA_DRAW_FRAME.
2011-02-21 16:07:00 -05:00
Wayne Stambaugh bdca3c5efb All control state handling is now performed in wxUpdateUIEvent handlers.
* Old control state handling code completely removed in all applications.
* Factor common control state handlers into EDA_DRAW_FRAME.
* Replaced EDA_ITEM test for newness with IsNew() method.
* Factor vertical right toolbar command handlers out of giant edit command
  switch statement in EESchema and PCBNew.
2011-02-21 08:54:29 -05:00
jean-pierre charras 640a06850f Fix some issues. 2011-02-17 19:34:27 +01:00
Wayne Stambaugh 7b8b51b240 Draw panel object refactoring and other minor code cleaning.
* Rename all member variables and methods that reference the cross hair
  code in draw panel object from cursor to cross hair to eliminate confusion
  between the two concepts.
* Rename cursor capture call backs in draw panel object to improve code
  readability.
* Create helper class for turning off the cross hair while drawing.
* Remove redundant block clear code.
* Remove redundant mouse capture call back reset code when end capture
  call back is called.
* Remove unused function definitions in base draw frame object.
* Lots of minor coding policy and doxygen comment fixes.
2011-02-11 15:48:13 -05:00
Wayne Stambaugh 0d8cb9b53c EESchema improvements and other minor fixes.
* Remove base screen methods from draw frame object and correct current
  screen methods in derived objects.
* Move restore old wires function code into schematic screen object.
* Make add junction method use current screen position instead of store
  position.
* Move poly line ghosting function into the delete current segment method
  as that was the only place is was being used.
* Add method to base schematic object of testing if object has a label
  that can be incremented.
* Simplified the schematic hierarchy traversing code.
* PCBNew Doxygen warning fixes.
2011-02-04 21:21:11 -05:00
Wayne Stambaugh d657b43052 Use wxDC for all coordinate manipulations.
* Remove all occurrences if #ifdef USE_WX_ZOOM and all associated code within
  the #else/#endif block ( old zoom code ).
* Removed the build option for USE_WX_ZOOM from CMakeList.txt and config.h.in.
* Removed all scaling code in base screen object.
* Fixed buffered paint and buffered client DC on Windows.  Buffering works
  properly on Linux and Windows.
* Modified kicad_device_context.h to automatically uses buffering on platforms
  where double buffering is supported natively.
* Remove all of the scaled versions of the drawing functions in gr_basic.cpp
  and any support code.
* Removed all traces of ActiveScreen global variable from eeschema and
  gerbview.
* Renamed Recadre_Trace to RedrawScreen in draw frame object.
* Renamed PostDirtyRect to RefreshDrawingRect in draw panel object.
* Lots of code cleaning an Doxygen comment improvements.
2011-01-30 17:22:38 -05:00
Wayne Stambaugh 73e38ce98c EESchema code refactoring and coding policy naming fixes.
* Move schematic wire and bus break code into schematic screen object.
* Move schematic test for dangling ends into schematic screen object.
* Remove left over debugging output in schematic screen object.
* Remove unused file eeschema/cleanup.cpp.
* Fix bug in schematic line object hit test algorithm.
* Fix a string concatenation compile error added in r2752.
* Rename class WinEDA_BasicFrame to EDA_BASE_FRAME.
* Rename class WinEDA_DrawFrame to EDA_DRAW_FRAME.
* Rename class WinEDA_DrawPanel to EDA_DRAW_PANEL.
2011-01-21 14:30:59 -05:00
jean-pierre charras e095b07cc3 code cleaning 2010-11-18 22:16:28 +01:00
Dick Hollenbeck 6c9244e8c3 fix function comments, this time ones in *.cpp files until they
can be deleted later if they exist in the headers, or moved to 
headers if they should exist in the headers.
2010-11-12 10:59:16 -06:00
Dick Hollenbeck 636b2d301e function comments, fix ones in *.cpp files until they can be deleted if they exist in the headers 2010-11-12 10:36:43 -06:00
jean-pierre charras 60c1cbe843 fixed issues with wxWidgets 2.9.1 2010-07-27 18:49:38 +02:00
Dick Hollenbeck bc14e66d78 A little useful feature: even if the default unit can be changed between
inches and mm, the industry is crazy enough to force us with mixed
design. For example I routinely use imperial units for track size and
clearance, but drilling is strictly a metric issue...

So I added a little parser to recognize a suffix specification in the
unit text boxes... so you can put in things like:
1in (1 inch)
1" (idem)
25th (25 thou)
25mi (25 mils, the same)
6mm (6 mm, obviously)

The rules are: spaces between the number and the unit are accepted, only
the first two letters are significant.

As a bonus, it also recognize the period (.) as a decimal point
substituting it with the correct locale character (there was a wishlist
for it, IIRC). Most useful for number pad fans :D
2010-07-12 09:07:09 -05:00
jean-pierre charras e14311997d Auto update 3D display after footprint or board edition. 2010-05-01 14:46:33 +02:00
charras a70a580596 committed newfont patch. Pcbnew: board date automatically updated at each change. 2010-02-19 13:23:58 +00:00
charras 0bf4b5ae9a Pcbnew: fixed pad selection by right click according to pad visibility. 2010-02-05 10:56:23 +00:00
charras a46cd46d9d pcbnew: More about work on color selection and items visibility:
removed global variables and a lot of redundancies
2010-01-31 20:01:46 +00:00
charras 28f3b1988d Pcbnew: Code cleaning about visibility variables in draw functions.
Removed old color and visiblity dialog
work in progress.
See also TODO, P0)
2010-01-27 20:07:50 +00:00
dickelbeck 920186ddb4 more layer widget incorporation 2010-01-21 20:53:01 +00:00
charras 37309e1aac Ugly but necessary fix to display toolbars in latest Linux version (tested with Ubuntu 9.10 updated) 2010-01-14 20:20:59 +00:00
dickelbeck 860fbb16d7 ++pcbnew & gerbview
* Moved ReturnLayerName() to static BOARD::GetDefaultLayerName() and migrated
    to a Specctra DSN compatible default layer naming scheme:
        Component becomes Front, Copper becomes Back.
  * set_color.h: Cmp becomes Front, Cu becomes Back.
  * D_PAD::DisplayInfo() changed to use actual copper layer names.
  * more layer setup dialog work, moved all programmatic wxControl instantiation
    into the wxFormbuilder environment, but this is fraught with danger:
    wxFlexGridSizer used the tallest control to establish the row heights, so
    be careful about changing control borders in the scroll panel. The vertical
    size can explode since just a couple of pixels times the number of rows
    is substantial.  Currently I am setting a 5 pixel border only left, top, and right
    but not bottom.
  * Set copper layer count is back in place as a hack until I can get the enabled
    layer bit map fully operational.
2009-12-07 03:46:13 +00:00
stambaughw 4611bfd58c Comment translations.
* Completed translation of all kicad source.
* Translated source files A through C in pcbnew.
2009-11-12 15:43:38 +00:00
charras 4b61440eb1 fix some problems (not all) when using wxAUI.
others minor bugs fix.
2009-11-07 14:36:54 +00:00
charras e027e65971 code and files cleanup 2009-10-28 11:48:47 +00:00
stambaughw 92064f1dbf Fix save last grid size and other minor updates.
* Create single event handler for grid size events.
* Fix all frame windows to use new grid size event handler.
* Use offset relative to ID instead of ComboBox index to save last grid size.
* Move last grid size load/save setting into WinEDA_DrawFrame.
* Add equality and assignment operators the GRID_TYPE.
* Add current grid helper methods to BASE_SCREEN.
* Add GetPins helper to LIB_COMPONENT to replace GetNextPin where applicable.
* Add AppendMsgPanel helper to WinEDA_DrawFrame.
* Improve rounding for display of coordinates when millimeter units are selected.
2009-10-14 19:43:31 +00:00
charras 89535a1366 some enhancements and cleanup. Fixed problem when deleting Netclasses in Design rules dialog window 2009-10-14 18:14:58 +00:00
dickelbeck b4fe26a31f Isaac's next color/layer work step 2009-10-10 01:25:53 +00:00
dickelbeck 7e93bb19df Isaac's via patch 2009-09-29 04:44:35 +00:00
stambaughw 43d6c685b5 Command ID refactoring and other minor improvements.
* Split out application specific command IDs to prevent unnecessary rebuilding.
* Eliminate duplicate menu and tool bar command IDs.
* Split component library editor and viewer definitions to separate header files.
* More component library and document file merge code.
* A bunch of minor string readability and consistency fixes.
2009-09-22 12:27:57 +00:00
charras d535a0fc97 pcbnew: Starting work on undo/redo in pcbnew. Only some delete item commands are stored in undo/redo stack 2009-07-29 13:10:36 +00:00
stambaughw aa51c05dc6 CVPcb code refactoring, global variable elimination, and UI updates.
* Add methods to read and write project file parameters using dynamically defined list.
* Remove all global variables defined in CVPcb code.
* Dynamically define project file settings so class member variables can be used.
* Separate reading and writing application settings from project file settings.
* Make application UI objects and dialogs respect system UI font.
* Remove non-standard widget colors from CVPcb dialogs.
* Changed CVPcb object link list implementation to use wxList.
* Changed project library and path dialog to make OK button save project file instead of confusing "Save Cfg" button.
* Eliminate some duplicate file wildcard and extension definitions.
* The usual code reformatting, commenting, and spelling fixes.
2009-04-23 15:02:18 +00:00