Commit Graph

3234 Commits

Author SHA1 Message Date
jean-pierre charras b636aaddf6 Eeschema: fix incorrect UI messages in dialogs due to using UTF8 strings instead of wxStrings (unicode) to build them.
(Added a explicit to build a Unicode string in UI messages to avoid mistakes)
2018-04-30 11:46:23 +02:00
Jeff Young 91cfecaa12 Don't allow wxDataViewCtrl updates during model update.
Also checks to make sure libraries are activated before adding
them to the component tree.

Fixes: lp:1765286
* https://bugs.launchpad.net/kicad/+bug/1765286
2018-04-28 10:45:32 +01:00
Jeff Young 942d4e7658 Check footprint history list for validity.
Fixes: lp:1767108
* https://bugs.launchpad.net/kicad/+bug/1767108
2018-04-27 15:26:00 +01:00
jean-pierre charras 319908b7f4 fix a compil issue. 2018-04-24 15:20:35 +02:00
Maciej Suminski 143d580596 Fixed relative coordinates reset when a tool forces the cursor position
Fixes: lp:1759044
* https://bugs.launchpad.net/kicad/+bug/1759044
2018-04-24 12:56:19 +02:00
Seth Hillbrand dbfa9093ab Adding seg-polyset collision support 2018-04-23 16:43:13 -07:00
Seth Hillbrand b618da1fac Fixing bounding box calc for arcs 2018-04-23 16:43:13 -07:00
Maciej Suminski cfa9916836 Prevent issuing a print command before the previous one is finished
Fixes: lp:1765965
* https://bugs.launchpad.net/kicad/+bug/1765965
2018-04-23 11:25:28 +02:00
Maciej Suminski c960d671cd Changed negative recursion level argument to positive
BEZIER_POLY::recursiveBezier() was called with negated 'level'
variable as an argument which is incorrect for an unsigned type.
2018-04-19 08:39:46 +02:00
Jeff Young 3be876c388 Cleanup of trace logs from Simon Richter. 2018-04-17 17:27:18 +01:00
Jeff Young 000457db7c Move Fields Editor to wxGrid.
Makes in-place editing much easier and fixes some other issues
(see bug reports).

Fixed sorting bugs in References and added better sorting for
Values.

Removed Description column as it wasn't editable and caused more
confusion than value.

Removed auto-column-width after initial render.

Re-implemented undo/redo.

Fixes: lp:1749287
* https://bugs.launchpad.net/kicad/+bug/1749287

Fixes: lp:1737361
* https://bugs.launchpad.net/kicad/+bug/1737361

Fixes: lp:1759756
* https://bugs.launchpad.net/kicad/+bug/1759756

Fixes: lp:1763223
* https://bugs.launchpad.net/kicad/+bug/1763223

Fixes: lp:1761378
* https://bugs.launchpad.net/kicad/+bug/1761378
2018-04-17 11:39:44 +01:00
Jeff Young 12ec56bc15 Prevent reentrancy in footprint loading.
Also removes parallel implementation in favour of using the
normal one (with a new wxGauge-backed PROGRESS_REPORTER).

Fixes: lp:1764196
* https://bugs.launchpad.net/kicad/+bug/1764196
2018-04-16 23:19:08 +01:00
Wayne Stambaugh 81843c37a4 Organize trace debugging code for ease of maintenance. 2018-04-13 09:59:01 -04:00
Maciej Suminski 3f734eb1b5 Improved validation of library and entry names
Symbol/footprint library and entry have the same set of forbidden
characters with a single exception, space character. To accommodate for
this difference, LIB_ID validation and fix methods have been extended to
specify the LIB_ID type that is checked (schematic/board).

LIB_ID::HasIllegalChars() and LIB_ID::FixIllegalChars() had two different
sets of characters treated as invalid in LIB_IDs. The set has been
factored out to another function to avoid duplication.
2018-04-13 14:24:57 +02:00
jean-pierre charras e57435c0fc Fix compil issue (created by commit "Added std::less specialization for wxPoint") with wxWidgets 3.1.1 2018-04-13 11:06:46 +02:00
Seth Hillbrand 0f3fc4b6eb Avoid doubling-up std namespace 2018-04-12 09:38:45 -07:00
Maciej Suminski b766dbc7a4 Added std::less specialization for wxPoint
Requried to use wxPoint as key type in maps
2018-04-12 18:09:18 +02:00
Jeff Young 84151990cd Don't set dirty bit when adding MARKERs.
They're not saved in the file, so they shouldn't dirty it.

Fixes: lp:1762497
* https://bugs.launchpad.net/kicad/+bug/1762497
2018-04-09 21:19:11 +01:00
Jeff Young d54a252eaa Check zone fills for being out-of-date during DRC. 2018-04-09 11:05:14 +01:00
Carsten Schoenert a11714b1a4 fix misspelled 'an other' -> 'another' 2018-04-08 13:24:37 -04:00
Carsten Schoenert 1f32f7c55b fix misspelled 'allows to' -> 'allows one to' 2018-04-08 13:24:18 -04:00
jean-pierre charras 7f6e26e55a DrawGraphicText: remove a static variable, and replace it (when needed) by a new parameter in argument list.
It make this function thread-safe (as far as wxString is thread-safe)
2018-04-07 19:57:26 +02:00
Kristoffer Ödmark fdb6bbab7b Footprint Wizard now also handles custom Env paths 2018-04-06 14:51:09 +01:00
Jeff Young df43f071e1 Keep track of open sockets and dispose of them in d'tor.
Fixes: lp:1760936
* https://bugs.launchpad.net/kicad/+bug/1760936
2018-04-04 12:02:40 +01:00
Jeff Young 5e36fe8df7 Move timestamp setting where it will alwasy get set.
Also update the rest of the symbol-chooser usage to current
specs, including examining the timestamp to see if the list
needs loading at all.

Partial fix to: lp:1760936
* https://bugs.launchpad.net/kicad/+bug/1760936
2018-04-04 12:02:40 +01:00
jean-pierre charras f8a3ec4974 Add a method to facilitate Tools handling in main frame toolbars.
Fix also a bug in gerbview_frame.cpp, about a broken toolbar accessor (fortunately not used in current code)
2018-04-03 13:00:20 +02:00
Wayne Stambaugh 53b1ec8146 Fix track posture hotkey bug on windows.
The change track posture hotkey '/' was getting interpreted as the show
hotkey list shortcut '?' on windows.  This fix is temporary hack to fix
the problem which much more involved than the simple #ifdef/#endif used
to fix this issue.

Add key code tracing to help analyze key codes for future development.
2018-04-02 18:05:37 -04:00
Jeff Young d391489596 Don't clear old footprint till after user has hit OK.
Fixes: lp:1759190
* https://bugs.launchpad.net/kicad/+bug/1759190
2018-04-02 22:32:09 +01:00
jean-pierre charras e750417fa0 Eeschema: fix many wxASSERT when trying to open menus from the main menubar.
This is due to the fact the same ID was used for menuitems in menubar,
and tools in toobars.
Especially, some items were not compatible due to different attributes.

Windows does not accept the same ID for 2 items inside the same frame.
It creates issues (items not shown, Asserts, ...)
2018-04-01 20:58:27 +02:00
Maciej Suminski 168112cf84 SEG: added Center() method 2018-03-29 12:11:35 +02:00
Seth Hillbrand 952aa7a1a6 Removing the last of time_t and fixing downcast corner bug in collector 2018-03-27 16:52:06 -07:00
Seth Hillbrand ced0fcee1e Updating Eagle Importer to take curved zones
Fixes: lp:1755879
* https://bugs.launchpad.net/kicad/+bug/1755879
2018-03-26 15:09:56 -07:00
Jeff Young f4ce8766e3 Implement shared FOOTPRINT_LIST.
While we already cache the loaded footprint files, parsing said files
into the list is also time-intensive.  Since the FOOTPRINT_LIST is
already hash-stamped against the current timestamps of the files that
make up the list, sharing a single copy of the list is quite
straight-forward.
2018-03-25 19:21:28 +01:00
Jeff Young b24b0d5dfe Dialog-ize CvPcb and implement proper Save.
Save now goes to disk (instead of just the in-memory schemaitc),
and the UI attempts to make this clear.
2018-03-25 19:21:27 +01:00
Jeff Young fbf10e941b Switch zone fillets to absolute-error algorithm.
And some general cleanup to related constants, etc.
2018-03-23 12:46:17 +00:00
Jeff Young a0364a1137 Don't make user click twice to toggle checkbox in wxGrid. 2018-03-23 12:46:17 +00:00
Jeff Young 99e659ff54 Coverity fixes. 2018-03-21 23:11:55 +00:00
Jon Evans 3103e3dc4c DRC: Center zoom on marker location, not DRC item start location
For some DRC checks, the location of the marker is not the location
of the first item in the resulting DRC_ITEM, so centering the screen
on PointA of the DRC_ITEM can be confusing.
2018-03-19 22:25:55 -04:00
Jeff Young aa0ae48dda Update status bar and toolbars on language change.
Fixes: lp:1392582
* https://bugs.launchpad.net/kicad/+bug/1392582

Fixes: lp:1748428
* https://bugs.launchpad.net/kicad/+bug/1748428
2018-03-18 22:17:27 +00:00
Jeff Young b8fd2f3c79 Revert "Don't be pedantic about the file format."
This reverts commit 1537cbc59c.
2018-03-16 18:11:36 +00:00
Jeff Young 1537cbc59c Don't be pedantic about the file format.
It's just another form of nagging.
2018-03-16 16:57:38 +00:00
jean-pierre charras e8df845b3f Minor fix in zones_by_polygon.cpp: When editing a non copper zone, some settings were not those of the edited zone.
trigo.h: Add a useful double NormalizeAngleDegrees( double Angle, double aMin, double aMax ).
2018-03-14 19:03:14 +01:00
Maciej Suminski 4055c435a5 Eagle PCB import: unified code for handling pad properties 2018-03-13 14:44:35 +01:00
Maciej Suminski 4c9be316dd Eagle import: minor ECOORD refactor
- changed EAGLE_UNIT enum names from EAGLE_* to EU_*
- renamed ToNanoMeters() to ConvertToNm() and added a comment
- added ToMils() and ToNanoMeters() method
2018-03-13 14:44:34 +01:00
Tomasz Wlostowski b1f613071d eeschema: workaround for 64kByte string length limit in wxString::Format() causing segfaults in netlist update under Windows
Fixes: lp:1754402
* https://bugs.launchpad.net/kicad/+bug/1754402
2018-03-12 18:26:25 +01:00
jean-pierre charras 2230abde1b page layout editor: fix a crash on block move.
This crash was due to a pointer initialized to a temporary reference.
Very minor coding style fixes
2018-03-10 10:25:07 +01:00
Seth Hillbrand ea4cee3393 Set Eagle import generated timestamps to KiCad std 2018-03-09 13:12:18 -08:00
Maciej Suminski 30a78f00bc Use 32-bit timestamps for imported Eagle files
Fixes: lp:1754610
* https://bugs.launchpad.net/kicad/+bug/1754610
2018-03-09 14:27:35 +01:00
jean-pierre charras 51fe063524 Circle to polygon conversion: a few enhancements:
* Remove duplicate code
* fix incorrect formulas is some places
* add comments
2018-03-09 13:28:47 +01:00
Jeff Young 308f28d2d4 Save ModEdit's footprint ID rather than source.
This primarily keeps us from overriding "truth" with data that
might not have even been saved when closing ModEdit.

Fixes: lp:1752543
* https://bugs.launchpad.net/kicad/+bug/1752543
2018-03-09 01:32:52 +00:00
Jeff Young 4693fd6200 Resolve env vars when looking up documentation files.
Fixes: lp:1729276
* https://bugs.launchpad.net/kicad/+bug/1729276
2018-03-08 23:51:10 +00:00
Seth Hillbrand 3cbf5f4942 Spelling indentifier -> identifier 2018-03-08 12:33:32 -08:00
Maciej Suminski 9ce768c29a Modified STROKE_FONT::ComputeStringBoundaryLimits() to process multiline strings
Removed a declaration of a not existing method (STROKE_FONT::ComputeTextLineSize()).

Fixes: lp:1747967
* https://bugs.launchpad.net/kicad/+bug/1747967
2018-03-08 10:56:34 +01:00
Maciej Suminski dfc47464d7 Added ReplaceIllegalFileNameChars() for wxString& 2018-03-08 09:06:15 +01:00
Seth Hillbrand 414e6614f1 Check for toolbar before checking tool
Not all toolbars exist in all tools at all times.  Need to check before
dereferencing variable.

Fixes: lp:1754094
* https://bugs.launchpad.net/kicad/+bug/1754094
2018-03-07 09:55:58 -08:00
Maciej Suminski 0521b63503 Remove negation from PCB_BASE_FRAME::PlaceModule() parameter
Negated parameters make code confusing. Now the parameter
description is accurate.
2018-03-05 16:42:30 +01:00
Maciej Suminski 1f09990618 Remove not used ListNets() methods 2018-03-04 18:04:19 +01:00
Maciej Suminski f7158e834d Created STDOUT_REPORTER class for debugging 2018-03-04 16:45:42 +01:00
Maciej Suminski 1f078f533b Refactor Eagle project import to use Kiway::ExpressMail() 2018-03-04 16:45:42 +01:00
Russell Oliver 9016344bb3 Eagle Schematic Import: Fix netlist mapping for zones and vias. 2018-03-04 16:45:11 +01:00
Tomasz Włostowski af7064ef89 pcbnew: synchronize zone visibility view menu entries with the toolbar buttons 2018-03-03 17:38:28 +01:00
Maciej Suminski 3f1a3fe65b Derive DIALOG_MULTI_OPTIONS from wxMultiChoiceDialog 2018-03-02 18:09:27 +01:00
Maciej Suminski be13bb0013 Refactored SelectSingleOption() to take advantage of wxSingleChoiceDialog. 2018-03-02 17:43:59 +01:00
Maciej Suminski 18167f829a Derive KIDIALOG from wxRichMessageDialog
wxRichMessageDialog already offers a dialog with a checkbox, so
the custom dialog setup code is not necessary anymore.
2018-03-02 17:05:35 +01:00
Maciej Suminski 1d5df8e975 Renamed KI_DIALOG to KIDIALOG 2018-03-02 11:57:03 +01:00
Andrzej Wolski 1ac5ec1fc8 Restore some missing visibility items from board file
LAYER_TRACKS, LAYER_PADS_TH and LAYER_NON_PLATEDHOLES
now have their own visibility control, so do not force them on.
2018-03-02 11:12:53 +01:00
Maciej Suminski 52fcddf4f4 Allow drawing self-intersecting polygons, just display a warning
Fixes: lp:1751654
* https://bugs.launchpad.net/kicad/+bug/1751654
2018-03-02 10:58:43 +01:00
Maciej Suminski 9127e09815 Code formatting 2018-03-01 17:20:50 +01:00
Jon Evans cd14525839 GerbView: More accurate selection of arc shapes 2018-02-28 08:23:39 +01:00
Jon Evans 37beb726e3 GerbView: Implement in-place GAL layer reordering (for X2 sorting) 2018-02-27 20:59:07 +01:00
jean-pierre charras 5f578c884c Fix SetValue() method in TEXT_CTRL_EVAL
Normal SetValue() call would temporarily change the displayed
value, but as soon as the text widget receives focus again, the original
expression (not evaluated) is restored.

To avoid this, the original expression is cleared in the associated
NumericEvaluator object.
2018-02-27 12:47:43 +01:00
Maciej Suminski 5f2b8e0409 Change NumericEvaluator::clear() to optionally accept an object to clear 2018-02-27 12:47:32 +01:00
Jon Evans 4ec7a02ccd Add a method to conditionally update VIEW_ITEMs (GerbView performance) 2018-02-25 18:20:44 -05:00
Jon Evans d7bb83ddcb Add a REPAINT flag for faster redraw when bounding box hasn't changed 2018-02-25 18:20:34 -05:00
Jon Evans be8bb24390 Make all new hotkeys editable; label some GAL-only hotkeys
Fixes: lp:1751183
* https://bugs.launchpad.net/kicad/+bug/1751183
2018-02-25 17:57:36 -05:00
Jon Evans b90528a7ae Fix regression in GerbView display settings; some optimization too 2018-02-25 17:35:26 -05:00
Carsten Schoenert 6256feb9db fix misspelled 'occured' -> 'occurred' 2018-02-25 17:10:10 -05:00
Michael Geselbracht 21f46776c6 Fix decimal point bug, support for more units V2
If ',' is used as decimal separator by the current locale a '.' is also accepted.
Also add support for units "mi", "th" and "in" as described in the documentation of pcbnew.

Fixes: lp:1751315
* https://bugs.launchpad.net/kicad/+bug/1751315
2018-02-25 08:21:23 +01:00
Jeff Young 821a411ac0 Fix regression in user grid size.
Frame, dialog and config file couldn't agree on whether to use
internal units or not.

Frame now stores internal units, and they're now mapped on the
way in/out of the config file.  Dialog was already assuming they
were stored in internal units (though they were previuosly not).

Fixes: lp:1751435
* https://bugs.launchpad.net/kicad/+bug/1751435
2018-02-24 09:21:28 -05:00
Jeff Young 7bd2f14342 Go back to checking individual file timestamps.
Too many external applications fail to touch the parent directory.

Also removes FP_CACHE_ITEM lastMod times and dirty flags as we've
always loaded libraries atomically anyway.

Claws back some of the performance lost by being more efficient
with cache management for sequential calls to Enumerate and then
Load.

Fixes: lp:1750936
* https://bugs.launchpad.net/kicad/+bug/1750936
2018-02-23 10:56:12 -05:00
Jeff Young e552c2fbff Remove confusing active library interactions with save.
Add a library selector to the save dialog.  Initialize it to the
footprint's library.  This way a straigh-up save will do what's
expected.

However, the user can still select the active library (or any
other library) if they really did want to move the footprint.

Fixes: lp:1750918
* https://bugs.launchpad.net/kicad/+bug/1750918
2018-02-22 18:19:02 -05:00
jean-pierre charras 43cb1b7bc7 Fix a compil issue with too old compilers 2018-02-22 21:06:48 +01:00
Jeff Young 4dda8a39fe Add inc/dec current layer alpha to menus.
Also adds indicators in layers palette for feedback.
Also generates sized images for all indicators instead of using
scaled bitmaps (which didn't look great).
Also fixes a completely unrelated typo in a UI string.
2018-02-22 17:48:14 +01:00
Maciej Suminski 918ac567e5 Fix constant naming conflict in KI_DIALOG 2018-02-22 17:15:22 +01:00
Maciej Suminski 01aca9d783 KI_DIALOG: flexible way of creating dialogs, including "do not show again" 2018-02-22 16:24:08 +01:00
Maciej Suminski 4da47f2c01 Forbid drawing self-intersecting polygons. 2018-02-22 16:24:08 +01:00
Maciej Suminski 7129dcef91 Added STATUS_TEXT_POPUP for simple popup text display 2018-02-22 15:18:52 +01:00
Maciej Suminski 9673ac4ecd WX_STATUS_POPUP refactor
- Rename WX_STATUS_POPUP -> STATUS_POPUP
- Added Expire() to show a popup temporarily
- Code formatting
2018-02-22 15:18:52 +01:00
Maciej Suminski 7775f59eec Converted zone drawing tools to store points in a SHAPE_LINE_CHAIN
Simplifies the code a bit, removes redundant conversions to/from
std::vector.
2018-02-22 15:18:52 +01:00
Jon Evans 0c9d11c180 Add progress reporting for GerbView file loading 2018-02-21 13:17:02 -05:00
Jeff Young cd81254262 Respect 45-degree mode when set from zone dialog.
Fixes: lp:1655073
* https://bugs.launchpad.net/kicad/+bug/1655073
2018-02-20 17:38:20 +01:00
Jon Evans 01ab8b0584 Use polygonal hit testing for module selection 2018-02-20 10:43:43 -05:00
Maciej Suminski 6c1a05a7d5 Coverity fixes
Uninitialized variables: CID #163188 and #174187
Unused variable: CID #168698
2018-02-20 09:14:51 +01:00
Jeff Young e9e3134dab Grid dialog changes to go along with menu changes.
Removes the units from the grid dialog.  They're now set via
the view menu.
2018-02-18 17:03:26 -05:00
Jeff Young b3884669cf Proper error reporting for Annotate dialog.
Also fixes:
- forcing the annotation scope to "full schematic" when run
  as a prerequisite to Generate Netlist.

- a long-standing bug where displaying extra items in a dialog
  would mess up the height of the HTML_REPORT_PANEL (becasue
  we were setting the html window's height rather than its
  parent flexgrid.

- initializing the annotation radio buttons to safe values
  (full schematic and keep existing)

Fixes: lp:1750062
* https://bugs.launchpad.net/kicad/+bug/1750062
2018-02-18 15:08:24 -05:00
jean-pierre charras cf5d93857f PnS router: add support for circles in board outline 2018-02-18 21:00:28 +01:00
Michael 3b085f0d03 Pcbnew new menubar structure 2018-02-18 11:27:52 -05:00
Tomasz Włostowski b05f95e7af RTREE: avoid uninitialized variables 2018-02-17 18:25:20 +01:00
Tomasz Włostowski 5fef750b49 SHAPE_ARC: use more Kicad-ish arc representation. Fixes board outline collisions issues in the P&S 2018-02-17 18:25:20 +01:00
Robbert Lagerweij ed0e226aab pcbnew: add and use new icons for align left, right, top & bottom
NEW: add new align icons based on the existing align_items.svg icon, just flipped and rotated
CHANGED: change the context menu to use the new align icons
2018-02-17 11:58:36 -05:00
Maciej Suminski 24fcdb00cc Eagle importer: convert special characters in net names
Convert '!' to '~' to reflect overbar toggling and change '~' to '~~'.
Now it matches the net names in schematics import plugin.
2018-02-17 00:03:28 +01:00
Maciej Suminski 9e80eff90a Eagle importer: two stage netlist update
After Eagle project import, schematic and board netlists are inconsistent:
footprints do not have sheetpaths assigned, schematics are unannotated.

One can update netlist either by references or timestamps, but timestamps
are empty in pcbnew, and updating by reference must by preceded by
annotation which may lead to broken links between board and schematics
(Eagle does not require references to end with a number, so KiCad annotater
will add numbers in such cases).

To fix the problem, there is a two step netlist update:
- update by reference without the annotation step, to assign
correct sheetpaths to footprints
- update by timestamp, after symbols are annotated, in order to
update references in the board

Fixes: lp:1748502
* https://bugs.launchpad.net/kicad/+bug/1748502
2018-02-16 19:37:23 +01:00
Robbert Lagerweij b356275e76 pcbnew: add align center and align middle tools and related icons
NEW: add placement tools that allow aligning the centers of items in a selection, both vertically and horizonally
2018-02-16 12:01:01 -05:00
Maciej Suminski c95340fbaf Eagle importer: replace invalid character with '_' to match PCB<->SCH 2018-02-16 16:52:14 +01:00
Michael d2e6f3a0e6 Improve edit menu and use common hotkeys 2018-02-15 16:46:17 +01:00
Michael Geselbracht 5d738dcb6d Coverity fix for libeval (CID #169327) 2018-02-15 15:43:12 +01:00
Maciej Suminski 570f4dd991 Coverity fixes
CIDs:
174166
174170
174171
2018-02-15 10:27:01 +01:00
jean-pierre charras 4012aa70da Fix a few minor Coverity warnings 2018-02-15 10:16:17 +01:00
Maciej Suminski 151021919e Tool Manager: yet another approach to handling tool view control settings
All calls to {save,apply}ViewControls() have been replaced with a new
method: setActiveState(). The advantage is that setActiveState() always
saves view controls settings to the tool that set them. As long
as setActiveState() is called every time there is a tool context
switch, the changes are kept up-to-date.

Fixes: lp:1748613
* https://bugs.launchpad.net/kicad/+bug/1748613
2018-02-14 15:34:05 +01:00
Jeff Young f68bf33cd3 Implement progress reporter for cvpcb footprint loading.
Fixes: lp:1676910
* https://bugs.launchpad.net/kicad/+bug/1676910
2018-02-13 20:21:38 -05:00
Jeff Young 4bae901dc8 Centralize zoom-to-fit code.
Fixes a bunch of errors:
- libedit and libbrowser would zoom to bounding box but centre on canvas
- libedit, libbrowser and gerbview didn’t take the scroll bars into account
- pcbnew didn’t take scroll bars into account or apply the 10% margin
- appending a board file would re-centre, but not re-zoom

Fixes: lp:1504302
* https://bugs.launchpad.net/kicad/+bug/1504302
2018-02-13 20:06:03 -05:00
Russell Oliver 34b52c91b7 Add empty eeschema page layout for Eagle schematic import.
Fixes: lp:1729722
* https://bugs.launchpad.net/kicad/+bug/1729722
2018-02-13 14:56:11 +01:00
Maciej Suminski 365ab99a6a GAL: update cursor position on panning and scrolling
Fixes: lp:1749082
* https://bugs.launchpad.net/kicad/+bug/1749082
2018-02-13 09:45:06 +01:00
Maciej Suminski 4f0c9b6b20 Fix double disambiguation menu when removing footprints
Second disambiguation menu was caused by another call to
SELECTION_TOOL::RequestSelection() meant to get the list of
connected tracks. When there were only footprints under the cursor,
it asked the user again to pick an item to remove.

Fixes: lp:1748521
* https://bugs.launchpad.net/kicad/+bug/1748521
2018-02-12 10:34:22 +01:00
Jeff Young 916f79d5a1 Performance fixes for the place footprint list all dialog.
Smartens the cache freshness checking, and adds checksums of
constituent-directory last-mod-dates to the footprint info
list.

Also inserts the dataPtrs into the list at the same time as
the text to keep wxWidgets from measuring the width of the
text twice (yes, really).  And converts the list to default-
column widths in case the wxWidgets patch is present to
greatly speed list creation (by not measuring all that text).

On my machine drops the first-load time from 4s to 2.5s and
the subsequent-load times from 2.5s to < 1s.  With the
wxWidgets patch subsequent-loads become near-instantaneous.
2018-02-11 11:51:48 -05:00
Maciej Suminski c39fd46c07 PROGRESS_REPORTER: code formatting 2018-02-09 14:20:25 +01:00
Tomasz Włostowski 271363f822 router: support for board outline 2018-02-06 09:43:56 +01:00
Tomasz Włostowski 2faf1a1ed3 Initial support for keepout zones in the P&S router. 2018-02-06 09:43:56 +01:00
jean-pierre charras 821668d96c rename class_collector.h to collector.h 2018-02-04 10:49:37 +01:00
jean-pierre charras 1858852f57 rename files 2018-02-02 21:57:12 +01:00
Maciej Suminski 95864780e2 Fix cursor freezes in GAL
Launching right click context menu overrides the cursor position, so all
actions executed by the tools will be performed in the right click
position. It created an issue, as the overridden cursor settings were
saved into wrong context if there was another tool activated in the
meantime.

Current implementation saves cursor settings for all tools and restores
them once the right click context menu disappears.

Fixes: lp:1745981
* https://bugs.launchpad.net/kicad/+bug/1745981

Fixes: lp:1746507
* https://bugs.launchpad.net/kicad/+bug/1746507
2018-02-02 19:08:05 +01:00
jean-pierre charras 39b4afecfa fix code after file renaming 2018-01-31 09:24:02 +01:00
jean-pierre charras 32aedc99b7 rename files 2018-01-31 09:24:00 +01:00
jean-pierre charras b43dc7954c fix code after renaming files 2018-01-30 15:34:09 +01:00
jean-pierre charras 5d72aebd22 Fix code after renaming files 2018-01-29 16:40:22 +01:00
jean-pierre charras bc76ec4d67 Rename files according to the name of classes they are defining 2018-01-29 16:40:20 +01:00
jean-pierre charras d0754acf00 Fix code after renaming files 2018-01-29 11:37:29 +01:00
jean-pierre charras 398f6d7b32 rename a few files 2018-01-29 09:50:58 +01:00
jean-pierre charras d44494beda Update code after file renaming 2018-01-29 09:39:49 +01:00
jean-pierre charras fa10e1b7fe rename a few files 2018-01-29 09:39:47 +01:00
jean-pierre charras 4c5bd01887 Rename a few files 2018-01-28 22:02:31 +01:00
jean-pierre charras 5868202c28 rename files, mainly files for plotter control 2018-01-28 18:13:27 +01:00
Martin Sivak d5cdd78062 eeschema: keystroke zoom should obey disabled centering
Keystroke zoom (F1/F2) always centered the screen, because it
was handled as ID_POPUP_ZOOM_IN event. Mousewheel scrolling
was ok, because it is handled using different event based
on the configuration.

This patch introduces special event ids for keystroke
zooming that are then properly translated to either
ID_POPUP_ZOOM_IN or ID_OFFCENTER_ZOOM_IN depending
on the configuration.

The same issue is fixed for legacy canvas pcbnew.

Fixes: lp:1742567
* https://bugs.launchpad.net/kicad/+bug/1742567

Signed-off-by: Martin Sivak <mars@montik.net>
2018-01-27 20:20:32 -05:00
Jeff Young 7a28f3d4cf Implement undo/redo for origins in legacy
PICKED_ITEMS_LIST knows the architecture of the undo commands so
that it can delete those ITEMs which it owns.  This represents poor
encapsulation so instead of adding yet another case, I added a
UR_TRANSIENT item flag which is set by callers whenever they create
new objects to “give to” the undo/redo stack.  This allowed some
cleanup of other code, but cleaning up UR_DELETE and UR_WIRE_IMAGE
will be a bigger task and have to wait for another day.

Fixes: lp:1542018
* https://bugs.launchpad.net/kicad/+bug/1542018
2018-01-27 19:51:44 -05:00
Jeff Young 4784ee7fe4 Implement undo/redo for drill and grid origins.
The undo/redo operations are essentially the same as for
UR_CHANGED: we store both the origin marker item and a copy
of it and flip back and forth between the two.  This also
required the implementation of clone() for the markers.

The ORIGIN_VIEWMARKER is moved from being a subclass of
EDA_ITEM to BOARD_ITEM to facilitate the use of a UR_CHANGE-
like implementation without having to know the internals
of the ORIGIN_VIEWMARKER.

In the command processors, the setting of the origins is
broken into two parts: one for UI-level access which includes
setting up undo, and one for low-level access which does not.
The undo/redo code itself of course uses the lower level.

Fixes: lp:1542018
* https://bugs.launchpad.net/kicad/+bug/1542018
2018-01-27 19:40:51 -05:00
Maciej Suminski b8ecc95d9c Forward context menu events to the tool that created the menu
It fixes the case when a tool sets up a menu and starts its event loop
waiting exclusively for menu events. If none arrived, the tool was stuck
in the loop forever.

Fixes: lp:1744915
* https://bugs.launchpad.net/kicad/+bug/1744915
2018-01-26 15:53:52 +01:00
Seth Hillbrand 7a2d9dff62 Sets additional conditions for when a wire is trimmed
This adds a set of conditions that will prevent a wire from being
automatically trimmed.  Wires that are currently being moved or are
newly created or are explicitly avoided will not be removed.  This also
adds a function to set a flag on items in a block.

Fixes: lp:1744632
* https://bugs.launchpad.net/kicad/+bug/1744632
2018-01-24 19:47:14 -05:00
jean-pierre charras 270a63daac DRAWSEGMENT, S_POLYGON shape: remove useless copies or conversion to std::vector<wxPoint> of SHPE_POLY_SET polygon shape.
Rename GetPolyPoint() to BuildPolyPointsList(), because GetPolyPoint() looks like an accessor, but it is not an accessor.
(Using it as accessor can creates a *very long calculation time* for very basic access to polygon vertices)

Fixes: lp:1745050
https://bugs.launchpad.net/kicad/+bug/1745050
2018-01-24 14:22:43 +01:00
Maciej Suminski 121e670508 TEXT_CTRL_EVAL: Close the parent dialog after pressing Enter
Fixes: lp:1744721
* https://bugs.launchpad.net/kicad/+bug/1744721
2018-01-23 11:49:39 +01:00
Maciej Suminski da305e7750 Move SwitchCanvas() implementation to EDA_DRAW_FRAME
Share more code between pcbnew and gerbview. Fix warnings regarding
shadowing EDA_DRAW_FRAME::SwitchCanvas().
2018-01-22 09:06:55 +01:00
jean-pierre charras 1db14d44b7 Better calculation of polygon clearance area of oval pads. Wip. 2018-01-20 19:34:50 +01:00
Jeff Young cba430deab Fix undo/redo and revert for libedit name changes and aliases
Three interrelated issues:
1) Implement an undo/redo type for renames so that we know to delete
the old lib entry and add a new lib entry
2) When doing so (for the undo/redo OR the original edit), we must
make a copy of the 'original' LIB_PART which is used for revert, and
hand it to the new lib entry
3) When comparing a modified component tree item with the current item
we must also check for aliases.

Fixes: lp:1743857
* https://bugs.launchpad.net/kicad/+bug/1743857

Fixes: lp:1744371
* https://bugs.launchpad.net/kicad/+bug/1744371

Fixes: lp:1744373
* https://bugs.launchpad.net/kicad/+bug/1744373
2018-01-20 11:20:22 +01:00
jean-pierre charras 2e83103c3d WIDGET_NET_SELECTOR: speedup the net list creation.
Add comments and better names for variables.
2018-01-19 11:01:42 +01:00
Maciej Suminski d87a7ae58e Fallback to Cairo when OpenGL is not supported
Fixes: lp:1741787
* https://bugs.launchpad.net/kicad/+bug/1741787
2018-01-18 10:17:06 +01:00
Jon Evans b21f301097 Defer canvas type setting save until destruction of EDA_DRAW_FRAME
Fixes: lp:1741787
* https://bugs.launchpad.net/kicad/+bug/1741787
2018-01-18 10:17:06 +01:00
jean-pierre charras 47d392d83e Fix incorrect name (typo) of a method. 2018-01-18 10:11:45 +01:00
jean-pierre charras 6014307d06 Pcbnew, DRC dialog: Fix a few issues:
Gal mode: graphic cross-air cursor moved on items when clicking on & DRC error, like in legacy mode.
Make popup menu shown when right clicking on a DRC error item working.
2018-01-17 15:36:04 +01:00
Maciej Suminski d85cf732b6 TEXT_CTRL_EVAL: Evaluate expressions when Enter key is pressed
Fixes: lp:1741320
* https://bugs.launchpad.net/kicad/+bug/1741320
2018-01-16 14:53:13 +01:00
jean-pierre charras 433b2bff40 Add comments in progress_reporter.h; Remove unused parameter in Fill_All_Zones and remove empty file. 2018-01-16 10:22:25 +01:00
Jon Evans 6eb5733a0b LSET::UIOrder and LSET::Technicals now match layer widget order
Fixes: lp:1673792
* https://bugs.launchpad.net/kicad/+bug/1673792
2018-01-15 10:08:30 +01:00
Oliver 195b85b0c5 Cleanup of KiCad Icons
Major cleanup of many icons (started as a simple effort to tweak libedit and modedit icons)
Ref: https://lists.launchpad.net/kicad-developers/msg32860.html
* Each application icon has been updated
* Consolidated icon "modifiers" across many icons
* Replaced confusing arrows with "load" and "save" icons
* Slight code updates to reference correct icons
* Consolidate multiple representations of single icon type(s)
2018-01-12 14:06:45 -05:00
jean-pierre charras 79a9f401a3 Fix a minor issue in pad editor dialog: in GAL mode, the pad was sometimes shown in outline mode, sometimes in filled mode
Fixes: lp:1740668
https://bugs.launchpad.net/kicad/+bug/1740668
2018-01-12 19:58:32 +01:00
Jon Evans 5fd1236d7a Use worksheet bounding box when the board is empty
Fixes: lp:1742140
* https://bugs.launchpad.net/kicad/+bug/1742140
2018-01-11 11:28:19 +01:00
jean-pierre charras 47dfabc6c8 Add size control to HTML_MESSAGE_BOX. Fix incorrect default size of a few dialogs.
Clean code: remove useless code and not used parameters.
2018-01-11 10:48:52 +01:00
Chris Pavlina 7e6a6540c8 Implement primitive icon scaling for high DPI
This is meant as a stopgap for 5.0, with plans to add proper scaled
icons in the 6.0 cycle. A function KiScaledBitmap() is added, which
works like KiBitmap() except it scales the bitmap according to the
calling window's font size. Controls have been added to all the main
applications to let the user select scaling manually (these were omitted
from smaller apps that didn't already have a place to put them).

In addition, in eeschema only, the pixel height of the system font is
shown in the options dialog for diagnostics. This is only for collecting
feedback before 5.0 release from users with different displays and will
be removed.
2018-01-10 21:26:06 -07:00
Maciej Suminski 7f9202842d Fix an initialization order warning in coroutine.h 2018-01-10 08:52:17 +01:00
Camille 9ff66a5274 Fix unnecessary value parameter detected by clang-tidy. - Replace value parameter by const reference parameter or move-assignement in some cases 2018-01-09 18:55:51 -05:00
Chris Pavlina 6cee19d37d eeschema: neatly wrap placeholder text in symbol chooser 2018-01-07 19:30:56 -07:00
Chris Pavlina 445fc0000f COLOR_SWATCH, INDICATOR_ICON: DPI-independent scaling 2018-01-07 09:28:47 -07:00
Chris Pavlina 13bc706518 Fix several dialogs with bad default sizing
- Add helper methods for DPI-independent sizes
- Make splitter sashes visible on macOS
- Remove SetSizeInChars() - wx has a built-in way that I missed
- DIALOG_CHOOSE_COMPONENT: DPI-indep splitter sizes
- DIALOG_RESCUE_EACH: DPI-indep default size and sensible HTML window
  size
- COMPONENT_TREE: DPI-indep sizing
- DIALOG_FP_LIB_TABLE, DIALOG_SYMBOL_LIB_TABLE
2018-01-06 14:39:17 -07:00
Jeff Young 38227161bf Fix drawing of transparent layer swatches.
Also fixes a related bug to redraw holes when changing the
pcb background colour.

Fixes: lp:1741049
* https://bugs.launchpad.net/kicad/+bug/1741049

Fixes: lp:1741101
* https://bugs.launchpad.net/kicad/+bug/1741101
2018-01-06 12:12:39 -05:00
Mark Roszko b98cc0b937 Some coverity fixes 2018-01-05 22:51:03 -07:00
Chris Pavlina 57fe3739ca Symbol chooser: base default size on font for DPI flexibility 2018-01-05 22:02:05 -07:00
Jeff Young 658d181ec7 Don't capture cursor if zone or polygon cancelled.
If the client tool indicates it isn't happy for us to continue
(because, for instance, the user has cancelled the Zone Properties
dialog), then make sure we don't capture the mouse.

Fixes: lp: 1740780
* https://bugs.launchpad.net/kicad/+bug/1740780
2018-01-04 13:10:37 -05:00
Jon Evans 2dec95b4e6 Add a first-run dialog to encourage user to switch to OpenGL 2018-01-04 10:14:40 -05:00
jean-pierre charras 6bb349e933 Better management of KIWAY_PLAYER frame when called in modal mode, and having the wxFLOAT_ON_PARENT style option.
(previously, did not use the actual parent)
2018-01-01 10:41:43 +01:00
Jeff Young 88f23f17c1 Fix dialog OK button event issues on OSX.
Move the OSX dialog fix ups later so they come after some wxWindow
deferred processing.

Also provides a facility for doing a selectAll in each text field
so that tabbing between text fields behaves correctly.

Fixes: lp:1599157
* https://bugs.launchpad.net/kicad/+bug/1599157
2017-12-29 08:14:41 -05:00
Jeff Young 8a21641639 Eeschema: fix block copy and cut command event handlers.
Popup menu IDs must be between START_RANGE and END_RANGE to get bound to
the right event handler.

Fixes: lp:1667730
* https://bugs.launchpad.net/kicad/+bug/1667730
2017-12-28 16:12:33 -05:00
jean-pierre charras 992820f722 shape_line_chain ans shape_poly_det: add Rotate() geometric transform, useful for DRAWSEGMENT transforms 2017-12-22 10:54:47 +01:00
Oliver Walters 900ddca0b4 Changed default text size to 50mils
- Text size is now always written to file
- Unspecified text sizes are read as 60mils

Fixes lp:1737878

https://bugs.launchpad.net/kicad/+bug/1737878
2017-12-21 12:16:57 -05:00
Oliver Walters 5c6c60def4 Remove custom font from lib_table_grid
Fixes: lp:1738617
* https://bugs.launchpad.net/kicad/+bug/1738617
2017-12-21 09:35:52 +01:00
jean-pierre charras 3183fcb4bc Fix minor compil warnings (some are for old compilers). 2017-12-18 19:52:44 +01:00
Tomasz Włostowski a4528988ca pcbnew: fix graphical polygon movement, rotation, flipping and edit points synchronization.
Fixes: lp:1738449
* https://bugs.launchpad.net/kicad/+bug/1738449

Fixes: lp:1738032
* https://bugs.launchpad.net/kicad/+bug/1738032
2017-12-18 18:25:45 +01:00
Maciej Suminski f039e0bb6d Eagle parser: declare Convert() specialization for wxString in eagle_parser.h 2017-12-18 17:45:40 +01:00
Bernhard Stegmaier 02d1b2611e Remove wx-3.1 only constructor from HIDPI_GL_CANVAS wrapper. 2017-12-18 16:26:01 +01:00
Bernhard Stegmaier 19d7112fa2 Merge HIDPI_GL_CANVAS wrapper with OPENGL_GAL implementation. 2017-12-18 16:26:01 +01:00
Bernhard Stegmaier 909d95b5be Create HIDPI_GL_CANVAS wrapper for transparent wxGLCanvas HiDPI/Retina support. Enable HiDPI/Retina for 3d-viewer. 2017-12-18 16:26:01 +01:00
jean-pierre charras 1f78de409f Define "template<> struct hash<wxString>" in Kicad only if wxWidgets version < 3.1.0, because it is already defined in 3.1.0 2017-12-18 09:53:14 +01:00
Maciej Suminski 2e00169ae7 Explicitly cast wxString to std::string when throwing std::exception 2017-12-17 20:17:02 +01:00
Maciej Suminski 378846c2e3 Eagle Schematics Importer: support for UTF-8
Fixes: lp:1736083
* https://bugs.launchpad.net/kicad/+bug/1736083
2017-12-17 19:54:21 +01:00
Maciej Suminski 812b8b081d Implemented std::hash<wxString> specialization
Thanks to that wxString objects can be stored in certain
STL containers, e.g. unordered_map.
2017-12-17 18:45:40 +01:00
Maciej Suminski a13c89c83d Removed old debug output 2017-12-17 18:43:43 +01:00
Seth Hillbrand 6f3e55d344 wx: Add double-click handling in disambiguation cases
Fixes: lp:1154020
* https://bugs.launchpad.net/kicad/+bug/1154020
2017-12-15 16:32:19 -05:00
Tomasz Włostowski 75b21d010b pcbnew: more thread (and nested wx event loop) safety for the zone filling/connectivity algo 2017-12-14 23:49:46 +01:00
jean-pierre charras a287748921 Cosmetic enhancement: Add icons to track length tuner menu. 2017-12-14 14:33:20 +01:00
Tomasz Włostowski eed924fe45 Fixed zone filling crash & thermal stubs inconsistency
Fixes: lp:1737557
* https://bugs.launchpad.net/kicad/+bug/1737557
Fixes: lp:1737542
* https://bugs.launchpad.net/kicad/+bug/1737542
Fixes: lp:1737541
* https://bugs.launchpad.net/kicad/+bug/1737541
2017-12-14 01:29:08 +01:00
Tomasz Włostowski 2831268b60 PROGRESS_REPORTER: KeepRefreshing shouldn't block on non-OpenMP systems
Fixes: lp:1737277
* https://bugs.launchpad.net/kicad/+bug/1737277
2017-12-14 01:26:41 +01:00
Andreas Buhr 084eea6781 Bugfix: EDA_RECT to BOX2I generated wrong boxes
The "operator BOX2I() const" of EDA_RECT produced
wrong boxes, usually much to big. It passed its
end-position as second argument to the constructor
of BOX2I. However, BOX2I expects its size as second
argument.

This caused a dramatic performance penalty in some
cases.
2017-12-11 09:48:13 +01:00
Jon Evans 6ee26fdd8c Remove LAYER_WORKSHEET from forced visibility since it now has a control
Fixes: lp:1737315
* https://bugs.launchpad.net/kicad/+bug/1737315
2017-12-10 17:41:00 -05:00
jean-pierre charras 4c4b11b45f change UTF8& operator+=( wchar_t ch ) to UTF8& operator+=( unsigned ch ), because swig does not like wchar_t.
(on Linux, wchar_t is a unsigned int, on Windows a unsigned short, so always using a unsigned int do not create issues)
2017-12-08 17:57:53 +01:00
Andreas Buhr b33bf2eafe fix double free and memory leak in SHAPE_POLY_SET
There were two problems in the triangulation caching
of SHAPE_POLY_SET:
First there was a double free:
While SHAPE_POLY_SET implements the copy constructor,
it did not implement the operator=, which resulted
in the default operator= being generated by the
compiler. The default operator= copied the member
m_triangulatedPolys, which is a std::vector of pointers.
So after operator= execution, there are two SHAPE_POLY_SET
having pointers to the same TRIANGULATED_POLYGONs, each
of them deleting them in their destructors. This led
to segfaults, because calling
TransformShapeWithClearanceToPolygon on a Zone
uses operator= to copy the contained SHAPE_POLY_SET.
The new SHAPE_POLY_SET then went out of scope and
deleted the cached triangulation within the Zone.

This first problem is fixed by implementing operator=
for SHAPE_POLY_SET.

Second, there was a memory leak: Calling
"CacheTriangulation" on a SHAPE_POLY_SET,
then changing the polygon and then calling
"CacheTriangulation" again led to
leaking the
triangulations generated in the first call.

This second problem is fixed by holding
the cached triangulations in a unique_ptr.
2017-12-08 14:55:46 +01:00
jean-pierre charras d958ab9460 Fix operator+= for UTF8 class
Added operator+=(wchar_t), as operator+=(char) was not sufficient to
handle multibyte characters present in UTF8.

Fixes: lp:1737143
* https://bugs.launchpad.net/kicad/+bug/1737143
2017-12-08 14:37:55 +01:00
Maciej Suminski 9da8398cf3 Added files missing in 602ecf75 2017-12-07 18:14:19 +01:00
Maciej Suminski 602ecf7502 Fix overbar display in OpenGL canvas
Moved the code handling text overbars to a single function
(ProcessOverbars()) to replace similar pieces of code trying to do the
same thing.

Fixes: lp:1735906
* https://bugs.launchpad.net/kicad/+bug/1735906
2017-12-07 17:58:54 +01:00
jean-pierre charras bfc3804115 Minor fixes related to timestamp_t. Move timestamp_t definition to base_struct.h 2017-12-07 13:33:59 +01:00
Henner Zeller 3f57fa5d24 Change time_t in the functions that deal with timestamps to a new typedef timestamp_t (defined as a long).
that makes sure the c++ side and swigged Python side agree on the type, because time_t create problems in Python scripts.
2017-12-07 13:16:33 +01:00
Simon Richter 227afe77c0 Avoid C-style array member init (illegal in C++)
This is not part of the C++ language, and only supported in some compilers.
2017-12-06 19:28:17 -05:00
Simon Richter eaa31dc11b Avoid initialization from non-constexpr
In-class initializers for "static const" class members must be constexpr,
however std::string is only "static const" itself and cannot be used
without compiler extensions.
2017-12-06 19:27:53 -05:00
Tomasz Włostowski 7ad436c7aa pcbnew: now PROGRESS_REPORTER should work in multi-threaded context under Windows... 2017-12-05 14:54:57 +01:00
Tomasz Włostowski 4bf90f9717 WX_PROGRESS_REPORTER: fixed windows build error 2017-12-05 14:54:57 +01:00