Commit Graph

2009 Commits

Author SHA1 Message Date
Seth Hillbrand a4808e0420 pcbnew: Copy hatch zone settings when duplicate
Also wrap orientation instead of verifying it.  This allows valid angles
that are larger/smaller than the ±180 limit.

Fixes: lp:1842654
* https://bugs.launchpad.net/kicad/+bug/1842654
2019-09-05 09:42:24 -07:00
Seth Hillbrand c8a6878eb8 pcbnew: Allow tuning length to be longer than INT_MAX
The INT_MAX limit for most elements makes sense only for single-segment,
straight line elements.  For elements that accumulate lengths, we should
utilize the long long int (64 bits) to allow for greater lengths.

Fixes: lp:1842367
* https://bugs.launchpad.net/kicad/+bug/1842367
2019-09-03 16:41:09 -07:00
Jeff Young a675b8e3b2 Add specificty for text labels in Dimension Properties dialog.
While we're re-using the Text Properties dialog, it really covers all
properties for a Dimension, so it needs to be more clear what's text
and what's not.  This changelist uses the Tooltips to store the more
explicit labels so they can still be edited in FormBuilder.
2019-09-02 11:07:05 +01:00
jean-pierre charras 762dabd754 Pcbnew, DIALOG_TEXT_PROPERTIES: make lines thickness editable when editing a dimension.
Fixes: lp:1841797
https://bugs.launchpad.net/kicad/+bug/1841797
2019-09-02 09:48:17 +02:00
jean-pierre charras 9dac8534c1 Pcbnew: seriously speedup calculation time when plotting large filled areas. 2019-08-27 13:32:00 +02:00
Seth Hillbrand 48d68f55d7 pcbnew: Two layer boards need both masks
Adds the missing default layer to the default board setups for two
layers with parts on single side (either top or bottom)

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

(cherry picked from commit 8b3a2984bf)
2019-08-26 17:14:35 -07:00
Jeff Young bc0e67579c Change OK/Cancel to MSW order and move some other dialogs to new system.
(There's no point in following the OSX OK/Cancel order as you can't
tab to buttons on OSX anyway.)
2019-08-26 18:36:35 +01:00
Jeff Young 6b6e9eddee Return control of Symbol and Footprint chooser col widths to user.
The auto-calculation wasn't working out and even with it some users
wanted control.

Fixes: lp:1796774
* https://bugs.launchpad.net/kicad/+bug/1796774
2019-08-26 18:27:49 +01:00
Jeff Young 67db6c49b5 Buttons which bring up dialogs for more info need a "...".
Fixes: lp:1795385
* https://bugs.launchpad.net/kicad/+bug/1795385
2019-08-26 18:27:49 +01:00
Jeff Young b109aba663 Add a file browser to the Sheet Properties dialog.
Fixes: lp:1840459
* https://bugs.launchpad.net/kicad/+bug/1840459
2019-08-26 00:45:34 +01:00
Jeff Young 19b463ec78 Add option to keep 3DModel info when exchanging footprints.
Fixes: lp:1841303
* https://bugs.launchpad.net/kicad/+bug/1841303
2019-08-25 22:49:36 +01:00
Jeff Young 03da721030 Move events to wxFormBuilder and fix the missing hookup.
Fixes: lp:1841361
* https://bugs.launchpad.net/kicad/+bug/1841361
2019-08-25 20:48:47 +01:00
Jeff Young 7c85dc6cd7 Clearance should be in mils, not inches.
Fixes: lp:1841360
* https://bugs.launchpad.net/kicad/+bug/1841360
2019-08-25 20:48:46 +01:00
Seth Hillbrand 7c37641d83 pcbnew: Partial board stats cleanup
Fixes ordering issue and int/double conversion in board area

Moves via casting to internal dyn_cast
2019-08-25 08:48:09 -07:00
Seth Hillbrand 2518a2cc81 pcbnew:Initialize board statistics
Uninitialized values can cause odd output values.  Also adjust absolute
calc to utilize floating point returns.

Fixes: lp:1838325
* https://bugs.launchpad.net/kicad/+bug/1838325
2019-08-24 08:21:08 -07:00
Jeff Young d1b2a6ea70 More descriptive labelling and hints for solder paste margins.
Fixes: lp:1837220
* https://bugs.launchpad.net/kicad/+bug/1837220
2019-08-21 15:35:03 +01:00
Jeff Young a25368cc6b Improve spelling.
The groundwork here is thanks to kunda1.

Fixes: lp:1831510
* https://bugs.launchpad.net/kicad/+bug/1831510
2019-08-20 19:14:05 +01:00
Jeff Young fb21077d3a Fix some alignment issues in dialog and formatting issues in code.
Fixes: lp:1840775
* https://bugs.launchpad.net/kicad/+bug/1840775
2019-08-20 16:39:40 +01:00
Jeff Young 054a24c26e Prevent size events from firing during initialization.
Fixes: lp:1840690
* https://bugs.launchpad.net/kicad/+bug/1840690
2019-08-20 16:39:40 +01:00
Jeff Young 195fbbaf23 Reduce confusion by putting all dialog pages as leaf nodes. 2019-08-19 17:46:25 +01:00
jean-pierre charras d50dc4ff65 PANEL_SETUP_LAYERS: minor cosmetic change: Fix for commit e2be49a2.
The commit e2be49a2 was sent too early.
2019-08-15 10:26:08 +02:00
jean-pierre charras e2be49a2f6 PANEL_SETUP_LAYERS: minor cosmetic change. 2019-08-15 09:44:55 +02:00
Jeff Young ccf18ceb0e Fix accidental change in default radio button of Update PCB from Schematic. 2019-08-12 22:21:09 +01:00
Jeff Young f3f0a6899f Invoke move by ACTION; the EDIT_TOOL does lots of other stuff too.
Fixes: lp:1839877
* https://bugs.launchpad.net/kicad/+bug/1839877
2019-08-12 22:21:09 +01:00
Jeff Young cc0bd9a171 Even out PCB_EDITOR_CONTROL and PCB_INSPECTION_TOOL. 2019-08-12 22:21:09 +01:00
Jeff Young bc07c7da11 Use wxChoice instead of wxComboBox so we get menu highlighting. 2019-08-09 16:01:45 +01:00
Jeff Young 17d015ed5d Strip illegal chars from 3D filepath and change rotation increment to 90deg.
Fixes: lp:1823559
* https://bugs.launchpad.net/kicad/+bug/1823559
2019-08-08 23:02:37 +01:00
Jeff Young 4d53ff9811 Grid dropdown doesn't always live in the same toolbar.
Also fixes typo in grid properties dialog.

Fixes: lp:1839224
* https://bugs.launchpad.net/kicad/+bug/1839224
2019-08-08 13:51:23 +01:00
Jeff Young edc05b5d54 Pad properties dialog needs to edit the local value, not the resultant value.
Fixes: lp:1838618
* https://bugs.launchpad.net/kicad/+bug/1838618
2019-08-05 21:38:28 -06:00
Jeff Young 6c0a3b4534 Disable inappropriate values for aperture pads.
Fixes: lp:1809010
* https://bugs.launchpad.net/kicad/+bug/1809010
2019-08-05 16:48:18 -06:00
Wayne Stambaugh bf5ce3a1ba Pcbnew: fix minor layout issues in options panel. 2019-08-05 11:29:16 -04:00
Jeff Young 95bfb733ee Add defensive coding for <enter> processing in Edit Footprint Text dialog.
Fixes: lp:1806124
* https://bugs.launchpad.net/kicad/+bug/1806124
2019-08-04 16:25:36 -06:00
Jeff Young 373ba5a904 Better tooltip for Match Mode radio buttons.
Fixes: lp:1838551
* https://bugs.launchpad.net/kicad/+bug/1838551
2019-08-03 17:20:54 -06:00
jean-pierre charras 7bfbcef942 Make some strings more easily translatable
DIALOG_BOARD_STATISTICS: fix some minor issues.
2019-08-03 09:32:10 +02:00
Jeff Young 01e78b04c6 Save last-used-paths in export dialogs.
Also fixes the export GenCAD dialog so that browse correctly updates
the textbox.

Fixes: lp:1793761
* https://bugs.launchpad.net/kicad/+bug/1793761
2019-08-02 21:03:48 -06:00
Jeff Young 5c85dbaec4 Another attempt to improve tooltips for Update PCB from Schematic dialog. 2019-08-02 14:32:49 -06:00
Jeff Young 1ea9ad05bc More explicit text for Update PCB dialog.
Fixes: lp:1838551
* https://bugs.launchpad.net/kicad/+bug/1838551
2019-08-01 20:36:59 -06:00
Jeff Young 5c80019541 Update comment. 2019-07-31 21:56:53 -06:00
jean-pierre charras 10fcd8eaef DIALOG_BOARD_STATISTICS_BASE: fix minor wxWidgets alerts. 2019-07-28 18:24:59 +02:00
Alexander a6b2a44fd6 DIALOG_BOARD_STATISTICS modifications and fixes - added vias information to dialog - added "save txt report" feature - some code cleanup and readability fixes - fixed issue with dialog moving when checkbox clicked - now dialog saves checkboxes state 2019-07-28 16:17:09 +02:00
jean-pierre charras dc69cac298 Try to fix UI issues in select layer pair dialog and slect layer dialog.
Fixes: lp:1838173
https://bugs.launchpad.net/kicad/+bug/1838173
2019-07-28 12:54:59 +02:00
Jeff Young d0344aecea Minor cleanup in dialog layout. 2019-07-27 23:27:21 -06:00
Jeff Young 4e40534d21 Update find history in combobox when history item is selected. 2019-07-26 23:50:51 -06:00
Jeff Young 3904d7ccfc Push some search stuff down into EDA_DRAW_FRAME so it can be shared.
Also rewrites the PCBNew Find dialog to make use of the above, including:
1) searching in user-defined footprint fields
2) searching in pcb text
3) a history list in the search popup
4) case sensitive searching
5) word sensitive searching
6) the ability to turn wildcard searching on/off
7) better placement of the result when the dialog obscures part of the
window

Fixes: lp:1838006
* https://bugs.launchpad.net/kicad/+bug/1838006
2019-07-26 17:53:32 -06:00
Jeff Young 460b03372d Implement preference for immediate actions.
Also pushes prefer-selection-to-dragging to common.
2019-07-25 20:41:22 -06:00
Jeff Young 2ca379b281 Copy ratsnest flags when exchanging modules.
Fixes: lp:1834214
* https://bugs.launchpad.net/kicad/+bug/1834214
2019-07-21 19:49:13 -06:00
jean-pierre charras 346495ae31 Fix errors in DIALOG_BOARD_STATISTICS.
(some values were not in the right column or row)
2019-07-21 16:45:37 +02:00
jean-pierre charras 88801f46d9 Fix issues in DIALOG_BOARD_STATISTICS:
- make it wxWidgets 3.1 compatible.
- internationalize.
- fix minor wxwidgets alert.
- remove settings for fg/bg color: the result is unpredictable:
was black texts on black background on my computer.
2019-07-21 12:01:36 +02:00
Jeff Young ab7cf4a2b0 A bit of visual cleanup for the new Board Statistics dialog. 2019-07-20 14:39:08 -06:00
Alexander bb290abe91 added board statistics dialog, which shows info for production and assembly 2019-07-20 14:39:08 -06:00
Jeff Young b5e01ea163 Initialize plot with aux origin checkbox.
Fixes: lp:1836923
* https://bugs.launchpad.net/kicad/+bug/1836923
2019-07-20 07:54:40 -06:00
Jeff Young 4a1edf581e Update DXF units drop-down.
Fixes: lp:1836927
* https://bugs.launchpad.net/kicad/+bug/1836927
2019-07-20 07:48:16 -06:00
Jeff Young 37af3adffb Add preference for flip axis.
Fixes: lp:1836267
* https://bugs.launchpad.net/kicad/+bug/1836267
2019-07-14 10:36:48 +01:00
Jeff Young a3855cb4f2 Allow thermal spokes to be same width as minimum width.
Also some changes for readability and clarity, both in the code
and in the Feature Constraints panel.

Fixes: lp:1835674
* https://bugs.launchpad.net/kicad/+bug/1835674
2019-07-14 10:36:48 +01:00
jean-pierre charras be5f3717c7 Fix minor wxWidgets alerts. 2019-07-13 18:32:18 +02:00
Ian McInerney 39954b20fe pcbnew: Make the netlist class panel usable with a lot of classes
Fixes: lp:1826154
* https://bugs.launchpad.net/kicad/+bug/1826154
2019-07-12 10:22:59 -07:00
Jeff Young 6c9e34e799 Don't let visibility bit get nuked when updating effects.
Fixes: lp:1836183
* https://bugs.launchpad.net/kicad/+bug/1836183
2019-07-11 18:19:29 +01:00
Jeff Young 807b8d4cf1 Lower x (or y) value always defines "Start Point".
"End Point" is the other.  (The user doesn't care what the variable
names in the code are.)

Also re-lays-out the dialog for better comprehension.

Fixes: lp:1694964
* https://bugs.launchpad.net/kicad/+bug/1694964
2019-07-11 17:36:32 +01:00
Ian McInerney ff9d899ae0 pcbnew: Clean up warnings with unit handling in the DXF export 2019-07-10 12:21:01 -04:00
Jeff Young 183687c69e Cleanup and a big hack to prevent keyboard focus loss.
Fixes: lp:1810993
* https://bugs.launchpad.net/kicad/+bug/1810993
2019-07-08 20:45:42 +01:00
Seth Hillbrand 3d8d852990 Fix board setup issue with reloading
Previous fix for the non-updated netclass pointers caused issues with
display of overlay view items and was bigger than needed to be.  Just
resetting the tools gets the pointers released.

Fixes: lp:1835533
* https://bugs.launchpad.net/kicad/+bug/1835533
2019-07-06 06:43:43 -07:00
Seth Hillbrand 09100100c9 pcbnew: Reload board after changing board paramters
The old board pointer maintains shared pointers to netclasses (among
other things) that do not get released by the
SynchronizeNetsAndClasses() call.  We reload the board to fully release
the pointers.

Fixes: lp:1835533
* https://bugs.launchpad.net/kicad/+bug/1835533
2019-07-05 13:50:29 -07:00
Jeff Young 1c30f3d9a9 Give up on KillFocus validation.
wxWidgets sends the KillFocus event before the Cancel button event,
and it sets the receiving-focus window pointer to NULL (so you can't
even check for it being the Cancel button.  Last time around (with
the UNIT_BINDER) I also tried a bunch of hacks for whether the window
pointer is NULL, etc., but they aren't discriminatory either.

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

Fixes: lp:1834966
* https://bugs.launchpad.net/kicad/+bug/1834966
2019-07-02 17:04:08 +01:00
Jeff Young da71a51029 Cleanup. 2019-07-02 00:48:05 +01:00
Jeff Young 29db6152b3 Only warn once in KillFocus for each error value in footprint name.
More than that just gets annoying, and there is at least one edge case
which throws us into an infinite loop if we don't have something to
break us out.

Fixes: lp:1834966
* https://bugs.launchpad.net/kicad/+bug/1834966
2019-07-02 00:47:52 +01:00
jean-pierre charras 978c4fd7d3 Pcbnew, export_footprints_placefile.cpp: code refactor.
Make the data generation code separate from the dialog code.
The dialog itself does not include anymore the data generation code.

Non SMD footprints forced in list are now displayed in the dialog.
The attribute MOD_CMS is no longer silently modified (without undo command) by the dialog.
2019-06-30 18:27:12 +02:00
Seth Hillbrand d650cca088 Enforcing rational limits on length tuner
The length tuning dialog needed validators on close to prevent negative
and percentages >100%

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

(cherry picked from commit 3974c6fd89)
2019-06-29 09:38:27 -07:00
Jeff Young 3135334c0c Hook up zone-connection controls in Edit Footprint dialog.
Fixes: lp:1834629
* https://bugs.launchpad.net/kicad/+bug/1834629
2019-06-28 12:24:15 +01:00
Jeff Young e785c140b9 Eradicate globals for PCB_GENERAL_SETTINGS.
Fixes: lp:1832896
* https://bugs.launchpad.net/kicad/+bug/1832896
2019-06-26 21:54:03 +01:00
Wayne Stambaugh 288982b15d Symbol and footprint library table editor fix.
Prevent the symbol and footprint library table editors from substituting
the current project path (${KIPRJMOD}) when adding libraries to the global
library table.  This will almost assuredly fail when opening a different
project.  We still allow users to manually use ${KIPRJMOD} in global table
paths under the assumption that if they are typing this in then they most
likely understand environment variable substitution.

Fixes lp:1830694

https://bugs.launchpad.net/kicad/+bug/1830694
2019-06-25 08:36:32 -04:00
Jeff Young 79cd457ba7 Implement thermal spokes for custom pad shapes.
The thermal spokes are anchored at the pad anchor.  They may or may
not make sense, depending on the pad shape.  It's up to the author
to move the anchor around as necessary or to not use thermals.
2019-06-25 11:34:28 +01:00
Seth Hillbrand 0bce0f37e4 pcbnew: Avoid wxassert in message
wxstring::Printf() needs size_t cast to acceptable type or it gives an
assertion in debug mode.

(cherry picked from commit e8ce0ba6ef)
2019-06-24 09:42:40 -07:00
Seth Hillbrand 3bd2b7762a Fixup previous move commit
The previous commit missed a case where the number was so large that it
overflowed the integer invalidating the comparison.  This protects
against that case by using floating point comparison.

(cherry picked from commit f25ae373bb)
2019-06-20 06:48:10 -07:00
Seth Hillbrand 4a18f9db3a pcbnew: Enforce maximum movement in Move Exact
This checks the movement against a maximum value that would place the
selection outside of the valid area for the footprint or board.

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

(cherry picked from commit 845833e8fd)
2019-06-20 06:40:33 -07:00
Seth Hillbrand 77cefe0c16 Normalize line endings
A few files snuck in with CRLF for the line endings.  These make it hard
to look at diffs as every line appears to have changed.  This commit
makes only line ending changes, so can be ignored
2019-06-19 15:18:30 -07:00
Jeff Young eb95202708 Fix grid update when edited from menubar.
Fixes: lp:1833399
* https://bugs.launchpad.net/kicad/+bug/1833399
2019-06-19 18:35:17 +01:00
jean-pierre charras a076f5092c I18n: fix a few useless leading spaces in messages. 2019-06-16 20:29:11 +02:00
Wayne Stambaugh 77bf575742 CvPcb: fix save changes dialog layout issue.
DIALOG_EXIT was not being laid out correctly after setting the dialog
message.  Rather than fix our custom DIALOG_EXIT, wxMessageDialog and
wxRichMessageDialog were substituted as direct replacements for all
of the variants of DIALOG_EXIT.  This make message dialogs appear more
consistent because wxMessageDialog uses the default platform message
dialog and wxRichMessageDialog uses the default platform rich message
dialog on windows.

Remove DIALOG_EXIT_BASE as it is no longer required.

Fixes lp:1832899

https://bugs.launchpad.net/kicad/+bug/1832899
2019-06-16 12:10:24 -04:00
jean-pierre charras 18ffb405b4 better message in dialog 2019-06-16 09:13:17 +02:00
Ian McInerney d5f680ecd2 Allow DXF to be exported in either inches or millimeters
Fixes: lp:1832188
* https://bugs.launchpad.net/kicad/+bug/1832188
2019-06-13 15:18:20 -07:00
Ian McInerney b2c848579a pcbnew: Update plot dialog to contain a unit selector for DXF 2019-06-13 15:18:07 -07:00
Jeff Young 8f84c3ec4f Grid rid of GetCanvas/GetGalCanvas distinction now that there's only gal. 2019-06-13 19:58:37 +01:00
Jeff Young ce1f35a1be Cleanup some left-over vestiages of the legacy canvas architecture. 2019-06-13 15:51:32 +01:00
Seth Hillbrand daad58e511 pcbnew: Add option to show ratsnest while moving
Re-works ratsnest display options in the configuration parameters rather
than the board file.  Moves ratsnest options to central preferences
location.

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

Fixes: lp:1821183
* https://bugs.launchpad.net/kicad/+bug/1821183
2019-06-12 17:36:02 -07:00
Jeff Young bb96255a03 Fix dangerous static_cast-ing to wrong type. 2019-06-10 23:46:01 +01:00
Jeff Young 5e49517781 Move hotkeys to ACTION architecture. 2019-06-10 23:46:00 +01:00
Jeff Young 6025256e07 Push KIWAY_HOLDER down a level so we can move a bunch of stuff that doesn't belong there out. 2019-06-10 23:46:00 +01:00
jean-pierre charras 929b1a1275 Better message for translation. 2019-06-09 17:53:03 +02:00
Jeff Young 1222f3cc72 ACTION-ize fab outputs. 2019-06-04 22:31:42 +01:00
Jeff Young 4e11dcfa31 Better error reporting for board edge collisions. 2019-06-04 13:56:54 +01:00
Jeff Young fbfbb64387 A bit of cleanup of stale DRC code. 2019-06-04 13:56:54 +01:00
jean-pierre charras 34ccd0f004 Pcbnew: prepare the new zone filling algo (filled polygons with no thickness). Work in progress. 2019-06-04 09:39:17 +02:00
Jeff Young 3912c7407f Move global commands to ACTIONs.
Also fixes a crash bug opening Edit Tracks and Vias dialog.
2019-06-03 21:08:30 +01:00
Jeff Young d7574db805 Fix regression in dialog-avoidance when focusing on a location. 2019-06-03 21:08:30 +01:00
Jeff Young 568c8c336b Move DRC control to a tool; move assorted commands to ACTIONS. 2019-06-03 21:08:30 +01:00
Jeff Young 6ac273264d Move Show3DViewer to common action. 2019-06-02 16:21:44 +01:00
jean-pierre charras 072fc4f8cb DIALOG_COPPER_ZONE: minor cosmetic change. 2019-06-02 11:50:46 +02:00
Seth Hillbrand 6a45446496 pcbnew: Remove the last dlist from modules/pcbnew 2019-06-01 20:55:32 -07:00
Seth Hillbrand 9163ac543a pcbnew: Move pads to std::deque 2019-06-01 16:23:54 -07:00
Seth Hillbrand 3fb8963536 pcbnew: Cleanup tracks and vias rework
Fixes a few commit issues based on the std:: rework.  Add an option to
delete tracks fully in pads and makes merge tracks smarter

Fixes: lp:1787190
* https://bugs.launchpad.net/kicad/+bug/1787190
2019-06-01 09:53:23 -07:00
Seth Hillbrand 888c01d11b pcbnew: Move tracks to std::deque 2019-06-01 09:53:23 -07:00
Seth Hillbrand d1877d7c1b Moving modules from DLIST to std::deque 2019-06-01 09:53:23 -07:00
Jeff Young 296ec66796 Cosmetic cleanup in preference panels. 2019-06-01 16:29:12 +01:00
Jeff Young c1298570cb Remove legacy routing options. 2019-06-01 16:29:12 +01:00
Jeff Young 7553cc2651 Clean up some dangling legacy odds and ends. 2019-06-01 01:17:46 +01:00
Jeff Young ed9153a786 Fix assert launching PCBNew. 2019-06-01 00:06:25 +01:00
Jeff Young c2662b0e11 Retire EDA_DRAW_PANEL and legacy_wx/EDA_DRAW_FRAME. 2019-05-31 21:55:30 +01:00
Jeff Young d6e9bdf07b Convert remaining legacy drawing code to print code. 2019-05-31 21:54:22 +01:00
Jeff Young 03bab2f4a9 Remove some more legacy drawing stuff. 2019-05-31 21:54:22 +01:00
Jeff Young d2daab808c Remove some legacy cursor handling stuff. 2019-05-31 21:54:22 +01:00
Jeff Young edc8438ef0 Start the process of removing the legacy draw panel. 2019-05-31 21:54:21 +01:00
Seth Hillbrand 218bea9ace pcbnew: Fix crash in find dialog
Tool manager is not exposed to the dialogs, we need to reference it
through the parent frame.

Fixes: lp:1830942
* https://bugs.launchpad.net/kicad/+bug/1830942
2019-05-29 15:05:38 -07:00
Jeff Young 1e9da7f57b Remove CurItem() architecture and legacy routers and drawing code. 2019-05-29 00:26:30 +01:00
Michael Kavanagh 27d097a78c Stop PNS router settings from being overwritten when switching modes
Fixes: lp:1824967
* https://bugs.launchpad.net/kicad/+bug/1824967
2019-05-27 16:10:00 -07:00
Jeff Young 9d9745b555 Remove more legacy editing code. 2019-05-27 18:47:20 +01:00
Jeff Young 6936effaa7 Implement undo for Page Settings in PlEditor, Eeschema and PCBNew.
Fixes: lp:1820059
* https://bugs.launchpad.net/kicad/+bug/1820059
2019-05-27 11:58:55 +01:00
jean-pierre charras 568d4e2b19 Avoid including id.h in a lot of files that do not use it. 2019-05-26 08:14:25 +02:00
Seth Hillbrand 6bcf1839b7 pcbnew: Add arc approximation setting to board
This places the arc approximation setting in the kicad_pcb file and uses
it for all parts of the board rendering where arcs are converted to
segments.  This allows the user to customize their speed vs. accuracy
tradeoff.  The default setting of maximum error of 0.005mm is acceptable
for small boards on moderate systems.
2019-05-24 21:21:06 -07:00
Ian McInerney 0daf14f9c3 pcbnew: Fixed listing of 3D libraries in the github wizard
Fixes: lp:1830137
* https://bugs.launchpad.net/kicad/+bug/1830137
2019-05-23 09:50:05 -07:00
jean-pierre charras 459a972116 Remove unused vars. 2019-05-22 08:27:48 +02:00
Jeff Young 1a3d0492f5 Push polar coords down into COMMON_TOOLS. 2019-05-18 00:21:49 +01:00
Seth Hillbrand f32c95229e pcbnew: Check for valid data before deleting
We need to check for valid rows and iterators before removing a 3d model

Fixes: lp:1829337
* https://bugs.launchpad.net/kicad/+bug/1829337
2019-05-17 09:34:27 -07:00
Jeff Young fbb807f3bb Move some more menu & toolbar items to modern toolset. 2019-05-16 19:57:06 +01:00
John Beard 0eb8f92c69 Pcbnew: add a step field to the array tool
This is useful, for example, when arraying only one side
of a connector.

Fixes: lp:1809580
* https://bugs.launchpad.net/kicad/+bug/1809580
2019-05-16 11:20:52 +01:00
John Beard eb1e67583f Pcbnew: tidy up array options access/allocation
Use unique_ptrs for ownership transfer.

Pass the target object to the constructor rather than
creating an internal verison.
2019-05-16 11:20:52 +01:00
John Beard 6ade8c25e1 Pcbnew: allow alphabetic numbering in n circular grids
Add controls to the dialog and wire up to the axis numbering
scheme, same as the grid axes.

Fixes: lp:1814923
* https://bugs.launchpad.net/kicad/+bug/1814923
2019-05-16 11:20:52 +01:00
John Beard f47e2b54f8 Decouple the array tool list box from the numbering enum
This prevents the dialog being sensitive to the exact ordering
of the enum, and instead defines an explicit mapping between
the axis numbering type, the label string and the position in the
list box control.
2019-05-16 11:20:52 +01:00
John Beard 2c1b970027 Arrays: isolate axis code in a new class
Remove the axis numbering code from ARRAY_OPTIONS
and place in a new class, ARRAY_AXIS. This keeps
the logic for the array item numbering separate from
the logic for the array item geometry.

This simplifies the logic in the ARRAY_OPTIONS class, which
no longer has to deal with the numbering of each axis.
2019-05-16 11:20:52 +01:00
Seth Hillbrand b3b5ffe799 pcbnew: fixup small type issue 2019-05-15 09:53:42 -07:00
Wayne Stambaugh a32bb4e9a5 Pcbnew: fix crash when deleting DRC errors from DRC dialog.
Fixes lp:1828726

https://bugs.launchpad.net/kicad/+bug/1828726
2019-05-14 18:07:34 -04:00
Wayne Stambaugh 6f27ef7f66 Fix library table editor dialog environment variable grid column names.
Fixes lp:1825977

https://bugs.launchpad.net/kicad/+bug/1828459
2019-05-14 07:57:58 -04:00
Seth Hillbrand f7c042a357 pcbnew: Allow curves in custom pads
Updates custom pad functions to permit adding arbitrary curves to the
primitives
2019-05-08 15:54:26 -07:00
Seth Hillbrand b56ca3f09c Staging wxFormBuilder change for next commit 2019-05-08 15:54:26 -07:00
jean-pierre charras 4e5a94efb7 Pcbnew, non copper zones: fix 2 issues.
1 - For debug purposes, the code to fill non copper zones was disabled and the copper zone code was uses instead.
It creates issues with pad clearance areas, because a non copper zone has no clearance areas.
2 - The non copper zone dialog had no option to set the outline smoothing option.
Unfortunately, this parameter was inherited from the last edited copper zone.
And therefore the non copper zone can have a non wanted outline smoothing option.
This option is now added to the dialog.

Fixes: lp:1826952
https://bugs.launchpad.net/kicad/+bug/1826952
2019-04-30 13:16:29 +02:00
Michael Kavanagh df228a3c10 Pcbnew: Fix missing UI elements for curved ratsnest function
Fixes: lp:1826446
* https://bugs.launchpad.net/kicad/+bug/1826446
2019-04-27 15:11:41 +02:00
Jeff Young 69cdb4a76c Make Import Settings button label more specific.
Fixes: lp:1826477
* https://bugs.launchpad.net/kicad/+bug/1826477
2019-04-26 15:02:17 +01:00
Jeff Young a461eae8b9 Fix 100s of usages of GetFlags() which conflated != 0 with being edited.
While this was true long ago, many flags have been added since which
have nothing to do with editing (HIGHLIGHTED, BEGIN_ONPAD, etc.)
2019-04-22 09:58:06 +01:00
Simon Richter 2b3b26b502 Remove two extraneous spaces from a tooltip 2019-04-20 22:04:22 +01:00
Jon Evans 105825c058 Refactor Import Netlist to use the same codepath as Update PCB 2019-04-17 22:57:19 -04:00
jean-pierre charras a07caac85a Pcbnew, Netlist inspector: fixes and enhancements. 2019-04-15 10:10:51 +02:00
Jeff Young ef3f773f84 Code formatting cleanup. 2019-04-14 23:13:46 +01:00
Jeff Young d5f136cd7e Polish export-related changes to List Nets Dialog. 2019-04-14 22:29:52 +01:00
Andrey Fedorushkov dacab4abe0 pcbnew: add tracks length and export netlist to file in netlist inspector 2019-04-14 20:39:29 +01:00
Jon Evans dec5d80180 Veto mouse warping from DRC dialog
Fixes: lp:1824630
* https://bugs.launchpad.net/kicad/+bug/1824630
2019-04-13 11:23:57 -04:00
Jeff Young dae41b7460 Remove legacy segment-based zones.
Give the user the option of cancelling a file open if there are
segment zones; otherwise they're converted to polygon fills.

Fixes: lp:1823087
* https://bugs.launchpad.net/kicad/+bug/1823087
2019-04-12 20:19:23 +01:00
Jon Evans 3d9b5daf9c Improve selection behavior of DRC markers in DRC dialog list
Fixes: lp:1813373
* https://bugs.launchpad.net/kicad/+bug/1813373
2019-04-12 11:01:38 -04:00
Jeff Young 0021ecf51e Don't double-escape netnames.
Netnames in wxChoice or wxListBox are already in internal format
and don't need escaping again.

Fixes: lp:1823863
* https://bugs.launchpad.net/kicad/+bug/1823863
2019-04-12 00:28:58 +01:00
Jeff Young 8ae0579436 Reorder global edit dialogs for better comprehension.
Fixes: lp:1818087
* https://bugs.launchpad.net/kicad/+bug/1818087
2019-04-12 00:28:58 +01:00
Jeff Young 2144c6c97d Save a bit of space in the copper zone dialog. 2019-04-10 18:12:14 +01:00
Seth Hillbrand 7cf394e34f pcbnew: Handle missing footprint wizards
When we do not have any footprint wizards to display, we cannot select
the grid rows.

Fixes: lp:1823608
* https://bugs.launchpad.net/kicad/+bug/1823608
2019-04-09 11:54:01 -07:00
jean-pierre charras 0b33df8831 Pcbnew,DIALOG_SELECT_NET_FROM_LIST: fix a crash and the not working net selection.
It was due to changes in code, and related to escaping the '/' in net labels.
2019-04-08 15:36:55 +02:00
Jeff Young d361e68d0e Condense the DRC dialog a bit.
The messages title doesn't really provide useful info anyway.
2019-04-08 13:26:26 +01:00
Jeff Young a1c162e59f Reimplement footprint checking on top of DRC architecture.
This allows Import Netlist and Update PCB from Schematic to
share the same checking code, and expose it through the DRC
dialog.

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

Fixes: lp:1809293
* https://bugs.launchpad.net/kicad/+bug/1809293
2019-04-08 13:26:17 +01:00
Tomasz Włostowski e5753b79d4 pcbnew: Hyperlynx Exporter - initial version 2019-04-08 02:56:02 +02:00
Seth Hillbrand a300ae105d pcbnew: Freeze the netclasses dialog on init
Prevents the size events from firing on Mac when we set up the netclass
panel

Fixes: lp:1819426
* https://bugs.launchpad.net/kicad/+bug/1819426
2019-04-07 07:07:55 -07:00
Jeff Young 684bb62fd8 Escape slashes in labels and netnames.
Also re-allows spaces, as they can already come in through sheet
names.

Fixes: lp:1798621
* https://bugs.launchpad.net/kicad/+bug/1798621
2019-04-07 00:24:10 +01:00
Jeff Young 1ae47b6069 Implement a copper-to-edge-clearance setting.
For legacy boards, the setting is picked up from the board outline
thickness.  If the board outline has mixed thicknesses, then the
max is used and a warning is displayed.

Fixes: lp:1797787
* https://bugs.launchpad.net/kicad/+bug/1797787
2019-04-05 22:18:44 +01:00
Wayne Stambaugh b6a0bf1142 Minor drill file dialog improvements. 2019-04-05 16:49:08 -04:00
Wayne Stambaugh dfee7bddd3 Minor footprint position dialog improvements. 2019-04-05 16:15:16 -04:00
Jeff Young 87f303319c Implement a dry run for Cleanup Tracks and Vias.
Uses the DRC architecture to support inspection of the changes to
be made (right click on items, hover over them in the menu to
highlight them on the board).

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

Fixes: lp:1809474
* https://bugs.launchpad.net/kicad/+bug/1809474
2019-04-05 18:52:51 +01:00
Jeff Young ea43866563 Move legacy netlist read/write to import/export.
Fixes: lp:1610529
* https://bugs.launchpad.net/kicad/+bug/1610529
2019-04-05 16:11:15 +01:00
jean-pierre charras 0aa8458d04 DIALOG_PAD_PROPERTIES: Fix incorrect calculation of Round Rect Radius Ratio, when inches are selected.
Fixes: lp:1822720
https://bugs.launchpad.net/kicad/+bug/1822720
2019-04-04 15:40:29 +02:00
Jeff Young d8cc2f8280 More cleanup from non-reference return from GetText(). 2019-04-03 19:35:25 +01:00
Jeff Young a8b8c73ab8 Set initial focus to track width / via size.
Fixes: lp:1822177
* https://bugs.launchpad.net/kicad/+bug/1822177
2019-04-01 13:23:37 +01:00
Jeff Young 3da5396c8d Fixes for importing board setup properties.
Save/restore default netclass.
Read layers back in with correct syntax ('.' between keyword and layer name).
Write layers to project file.
Read/write layer enablement bits.
Don't set solder paste margin min to 0 (most of them are negative).

Fixes: lp:1811990
* https://bugs.launchpad.net/kicad/+bug/1811990
2019-04-01 13:23:37 +01:00
jean-pierre charras 7170720f3c Allow hatch pattern in filled zones
the filled areas can use a hatch pattern (crossing lines) using square holes.
The zone filler removes too small holes (truncated holes) from hatch pattern.
It avoid to create small holes when a hole pattern is truncated by the filled area base shape.
2019-03-31 08:21:40 +02:00
John Beard d6b8e9e037 Pcbnew: Improve tab traversal in text properties dialog
Tab through the grid vertically, then horizontally, as the fields
are laid out with "related" fields (like the co-ords) vertically.

Also neaten headers.

Fixes: lp:1821887
* https://bugs.launchpad.net/kicad/+bug/1821887
2019-03-27 13:56:03 +00:00
John Beard b7017167f0 Pcbnew: Align right margins in text properties dialog 2019-03-27 13:56:03 +00:00
John Beard dd3252445d Pcbnew: update text properties dialog wxFB version
No actual changes, but this keeps the diffs clean(er).
2019-03-27 13:56:03 +00:00
jean-pierre charras 7c04b3dbeb Drc dialog: make track to copper zones test optional, because it can be really very time consuming 2019-03-19 18:18:20 +01:00
jean-pierre charras d259459a14 Pcbnew: add a new primitive pad shape: chamfered round rect pad.
Allows 0 to 4 chamfered corners, not only one.

A custom shape allow this kind of shape. However because it is a primitive,
it is easier to edit and it support thermal reliefs.
2019-03-11 10:26:15 +01:00
John Beard b6916c490c Pcbnew: allow tab traversal of footprint orientation text control
Disable the text update event for the orientation cutom value field before
updating it when the radio buttons are selected. This allows to use the
conventional EVT_TEXT handler, rather than KEYDOWN, which has two effects:

* Tabbing though the dialog no longer sets custom orientation
* Click-driven clipboard actions trigger the update correctly.

Introduce a helper function in validators.h to assist in updating
validated fields without triggering further events.

Fixes: lp:1819006
* https://bugs.launchpad.net/kicad/+bug/1819006
2019-03-07 20:27:04 +00:00
John Beard 4574349539 UI: Automatic wxFB changes in pcbnew edit footprint dialog
Commit automatic changes to keep diffs clean when real changes are made.
2019-03-07 20:27:04 +00:00
Wayne Stambaugh 4612175da2 Pcbnew: better fix for dialog default button handler issues.
Use DIALOG_SHIM::SetInitialFocus() to fix default button handler issue
on all platforms.  Commit cabc33b4 only fixed the problem on windows.
2019-03-04 15:30:32 -05:00
Wayne Stambaugh cabc33b4cd Pcbnew: fix dialog default button handler issues.
Set the focus to some control in the copper zone, non-copper zone, and
keep out zone dialogs required for the default button action to work
properly.  This only seem to affect windows dialogs.

Fixes lp:1818397

https://bugs.launchpad.net/kicad/+bug/1818397
2019-03-04 11:34:04 -05:00
Jeff Young cedef13bb1 Enable default OK button.
Fixes: lp:1818397
* https://bugs.launchpad.net/kicad/+bug/1818397
2019-03-04 12:06:40 +00:00
Jeff Young 69f003ba4a Remove previous cell selection fixes in favour of slow-click hack.
wxWidgets has several bugs that result in cell editors being closed
right after they're opened.  There are two wxWidgets hacks to
partially address this: the SetInSetFocus() hack, and a slow-click
hack.  We used to try and work-around these bugs ourselves for
single-click access, but this changelist moves those over to
wxWidget's slow-click hack.

Fixes: lp:1817965
* https://bugs.launchpad.net/kicad/+bug/1817965
2019-03-04 11:09:33 +00:00
jean-pierre charras 1ba1c6dbf3 DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE: fix minor wxWidgets alerts. 2019-02-28 18:56:48 +01:00
Jeff Young e25970592c Tighten up spacing a bit for 1024x768 monitors.
Fixes: lp:1817974
* https://bugs.launchpad.net/kicad/+bug/1817974
2019-02-28 11:36:09 +00:00
jean-pierre charras 16cbd25ed2 DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE: fix a minor wxWidgets alert. 2019-02-28 09:14:11 +01:00
jean-pierre charras 4d08906288 Pcbnew: fix 2 minor issues
* fp editor: ensure axis are drawn after switching the backend
* DIALOG_PNS_SETTINGS: ensure violate DRC option is correctly enabled/disable when opening the dialog.
2019-02-25 11:34:32 +01:00
Seth Hillbrand d36fbba1f3 pcbnew: Violate DRC only enabled in Highlight mode
Violating the DRC cannot happen in shove or walk around mode as we use
the DRC to calculate these actions.  The tooltip explains this as well
but we need to explicitly disable the checkbox to prevent users from
thinking that they can complete DRC violating tracks in other modes.
2019-02-23 08:19:50 -08:00
John Beard 82734e7116 Adjust tab ordering in some dialogs
Introduce a shortcut method to set tab ordering and use it in
the dialogs that override the tab traversal orders:

* Eeschema sheet properties
* Pcbnew Move exact
* Pcbnew Move relative

Also set some initial focus fields in the same dialogs.

Tidy a few includes.

Fixes: lp:1816009
* https://bugs.launchpad.net/kicad/+bug/1816009
2019-02-23 14:49:38 +00:00
John Beard 498a566ca3 Pcbnew: fix spacing in move exact dialog
The middle text ctrl has borders on both top and bottom, should be just
one for even spacing.
2019-02-23 14:49:38 +00:00
jean-pierre charras 0421335ac1 Minor fix in DIALOG_PAD_PROPERTIES: set show grid to false. 2019-02-23 12:31:00 +01:00
Jeff Young f14cf5cbc7 More uniform handling of state saving in global edit dialogs.
Includes Edit Text and Graphics Properties and Edit Track and Via
Properties.  It's also no longer board-specific as it turns out the
board timestamp is always 0 anyway.
2019-02-21 15:11:16 -07:00
jean-pierre charras 9ff0868813 pcbnew: fix incorrect sizing of net list display in DIALOG_SELECT_NET_FROM_LIST 2019-02-19 20:07:38 +01:00
Seth Hillbrand 525b9bd550 pcbnew: Correctly set the radio buttons in fpeditor
Radio buttons always have one set, so we need a single path to setting
the correct button.
2019-02-18 15:16:00 -08:00
jean-pierre charras 2dd653a327 WX_GRID: revert GetVisibleWidth() and add EnsureColLabelsVisible() to fix column label height of our wxGrid, for multiline column labels 2019-02-18 20:34:44 +01:00
jean-pierre charras e798cbe6c7 Fix a minor wxWidgets assert in DIALOG_SELECT_NET_FROM_LIST_BASE. 2019-02-18 11:33:53 +01:00
jean-pierre charras d62163cc7c Netclass panel: fix incorrect column sizes, that happens in a few languages.
The best size was calculated from a default size.
This default size (calculated by wxWidgets) was fully broken with some texts in a few languages.
So now this best size does not use this default size.

Fixes: lp:1816315
https://bugs.launchpad.net/kicad/+bug/1816315
2019-02-18 10:09:22 +01:00
Jeff Young dc5ae574e2 Restore ability to hide grid columns.
wxGrids stupidly does this by setting the width to zero, so you
have to be careful when adjusting minimum widths.
2019-02-17 14:09:35 +00:00
Jeff Young 076f07c683 Be more forgiving of large fonts in grids. 2019-02-17 10:38:06 +00:00
Jeff Young d751fecd8a Tooltip and error message improvements. 2019-02-17 10:20:29 +00:00
Jeff Young f1fb61202a Spelling fixes. 2019-02-17 10:18:42 +00:00
Jeff Young f5369c9d2c Clean up some extraneous TEXT_CRTL_EVAL references.
(UnitBinder gives you evaluation for "free".)
2019-02-17 10:16:09 +00:00
jean-pierre charras 303b7ac7f8 Pcbnew: fix delete dangling tracks only removes the last segment of tracks.
Fixes: lp:1816234
https://bugs.launchpad.net/kicad/+bug/1816234
2019-02-16 16:05:29 +01:00
jean-pierre charras ec59361f75 Fix a few coverity errors 2019-02-16 14:09:21 +01:00
Seth Hillbrand 5e5167f198 pcbnew: Adjust footprint properties columns
Size based on text width in 3d and check for overflow before expanding
the first column.
2019-02-14 22:09:01 -08:00
Seth Hillbrand 8b46c99c60 modedit: Fix footprint properties dialog
Checks for text in the dialog before setting width.  Also prevents
resizing beyond the width of the window (in the case of large fonts)
2019-02-14 22:02:34 -08:00
Seth Hillbrand a02f447daa pcbnew: Do not auto edit the 3d-model grid
Auto-selecting of the first grid element is performed in the footprint
editor to facility rapid editing.  Rapid editing of the 3d-model fields
is not as useful and requires multiple esc-keys to cancel.  This limits
the auto-edit to only the reference tab.

Fixes: lp:1815456
* https://bugs.launchpad.net/kicad/+bug/1815456
2019-02-14 16:29:51 -08:00
jean-pierre charras b6027e0815 Drill dialog: fix incorrect parent window when called from the Plot dialog.
The parent window was always the board edit frame,
but this is incorrect when this dialog is called from the Plot dialog.

Fixes: lp:1815530
https://bugs.launchpad.net/kicad/+bug/1815530
2019-02-13 11:41:52 +01:00
Wayne Stambaugh fe5d2b8710 Pcbnew: fix footprint properties dialog 3D model visibility issue.
Update 3D model panel on initial dialog load to reflect the current
visibility state of the 3D model.

Fix a few minor footprint properties dialog spacing issues.

Fixes lp:1815184

https://bugs.launchpad.net/kicad/+bug/1815184
2019-02-10 12:00:19 -05:00
jean-pierre charras a703c53312 Fixes in dialogs: mainly better sizes for grid columns, but more other minor fixes.
Fix wxGrid column minimal widths on Windows in dialogs (just fixing the size is not enough).
WX_GRID::GetVisibleWidth(): make width bigger for labels, because they usually use a bold font.
(However, the fix is just a workaround: a better code is welcome)
2019-02-10 16:40:47 +01:00
jean-pierre charras 5e318dc08a Pcbnew, PANEL_PCBNEW_ACTION_PLUGINS: make strings translatable.
Fix also a minimal size for grid columns.
2019-02-10 11:39:07 +01:00
jean-pierre charras 8dc4077d58 Fix compatibility issues with wxWidgets 3.1.1 2019-02-10 07:59:27 +01:00
Seth Hillbrand 8ff764376a wx_grid: abstract visible column width
Cleanup code for checking visible extents of grid text.  Places single
routine to extract the current spacing from the grid in WX_GRID.
2019-02-09 15:31:31 -08:00
jean-pierre charras c0a86d734d Pcbnew, Excellon drill file creation: for oval holes allows selection of an alternate command, when the normal command is not accepted.
Using the normal command, oval holes are "drilled" by a route command.
Some board houses do not accept this normal command.
In this case, the drill dialog allows using an other Excellon drill command (a slotted hole).
Note also some board houses do not understand this alternate command!
2019-02-09 14:56:02 +01:00
jean-pierre charras 756b20ace8 Fix column minimal sizes in panel_setup_text_and_graphics.cpp on Windows. 2019-02-09 14:47:45 +01:00
jean-pierre charras 61a95c5440 Fix compatibility with wxWidgets 3.1.1 2019-02-09 11:21:09 +01:00
Seth Hillbrand 76600e3436 pcbnew: Force grid sizing based on text extents
GTK does not handle enlarged text layouts automatically, so we need to
get the screen size before choosing the correct grid width for the
dialog

Fixes: lp:1788495
* https://bugs.launchpad.net/kicad/+bug/1788495
2019-02-08 20:03:45 -08:00
Seth Hillbrand c0008bc757 pcbnew: Change track width should allow no changes
When doing a global edit of the tracks and vias, we need to allow for
the possibility that the track size doesn't change and that this is
explicitly allowed without DRC error.
2019-02-08 10:49:00 -08:00
Seth Hillbrand e1bce7dccd pcbnew: Prevent using "edit width" in dialogs
Editing predefined tracks/nets/vias sizes makes sense in the toolbar but
not inside the submenu.
2019-02-08 09:50:20 -08:00
John Beard edc73de023 Pcbnew: ignore start values in "first available" grid numbering
The using the "first available" numbering option, force an
artifical linear numbering scheme starting at '1'.

Start the pad name provider at the 0'th pad index.

Also adds a few related tests and adjusts tests affected by
this change to reflect that the offset still applies.

This can be expanded in future to be more general by skipping
pad (which would allow a custom start and numbering scheme
while still avoiding duplication), but for now,
this does what the UI says and avoids string changes in 5.1rc.

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

Fixes: lp:1814917
* https://bugs.launchpad.net/kicad/+bug/1814917
2019-02-08 12:15:02 +00:00
John Beard 0c6ec7dbb3 LIB_TABLE_BASE: Const and unsigned fixes
* Make LIB_TABLE_BASE::GetCount() return unsigned. This is more
  consistent with the behaviour of STL containers (especially the
  boost::ptr_vector this is really accessing). Sadly
  wxGridTableBase() forces an int, so a cast is still required
  at the WX interface.
* Make LIB_TABLE_BASE::At() return a reference. First, this is more
  consistent with normal STL indexing operator[]'s, and secondly, it
  allows an idiomatic const index method (so you can access const
  LIB_TABLE_ROWs from a const LIB_TABLE_BASE).

The motivation is to allow use of this class and LIB_TABLE_ROW
in a test program, where the LIB_TABLE_BASE is const.
2019-02-05 08:49:52 -08:00
jean-pierre charras 73a0cbff62 pcbnew, export to STEP: fix error in command line tolerance option (--min-distance="0.0100 mm") is some countries
In countries using a comma as floating point separator, the --min-distance="0.0100 mm" was passed as --min-distance="0,0100 mm"
This is incorrect and broke the command line.

Fixes: lp:1814559
https://bugs.launchpad.net/kicad/+bug/1814559
2019-02-04 18:05:49 +01:00
Seth Hillbrand c08736e245 Assign stack pointer to lib table
When creating new lib table rows, the pointer becomes managed by the new
table through the boost::ptr_vector.  The row is non-copyable, however,
so we lose the reference as soon as it goes out of scope. Creating a
clone provides a new pointer that is moved into the table on creation.

Fixes: lp:1792456
* https://bugs.launchpad.net/kicad/+bug/1792456
2019-02-03 05:20:50 +01:00
jean-pierre charras 3ad5fd056e Pcbnew, Update PCB from schematic: Fix the reference point of the new footprints to place, when moving the cursor.
It was a regression from 5.02 version.
The block of new footprints to place has now its reference point (the point that is on the graphic cursor) fixed.
This is the first footprint loaded from the list.
2019-02-01 11:43:16 +01:00
John Beard f85f10930a Break widget save/restore out to reusable class
The CONFIG_SAVE_RESTORE_WINDOW class does not need to be tied
to the array dialog, put it in common/widgets.

Also do a refactor and tidy-up of the the class, use a union for (slightly)
better type-safety and syntax (a variant would be better but that's C++17).

Also enable integral field save/restore from text boxes.
2019-01-30 15:41:35 -08:00
John Beard 24ac9b7055 Pcbnew: array: repair dialog value init
Fully initialise the CREATE_ARRAY_DIALOG_ENTRIES object,
and use these values for the dialog on first open. Currently,
the initial values aren't all initialised, and none are used, as the
valid flag is not set. This means there are poor defaults in some
fields.

Also more declarations and defintions of CREATE_ARRAY_DIALOG_ENTRIES
to the .cpp, as these do not need to be exposed in the header,
even privately.
2019-01-30 15:41:35 -08:00
John Beard ffaf99a600 Pcbnew: Enable some numbering options in pcbnew
The numbering axis priority (h then v or v then h), and alternate
reversing are not actually numbering parameters, they are part of
the geometry of the array (the items are physically in different
orders).

So enable these options, even when numbering is disabled.

Also fix broken logic about when numbering scheme is enabled
(it still applies even if the numbering offset is fixed.)
2019-01-30 15:41:35 -08:00
John Beard 5504981d00 Separate ARRAY_OPTIONS to own class in common
The geometry and numbering logic is separate to the dialog, and
can be separated for clearer logic and better testability.

Moreover, refactor it to avoid any dependency on pcbnew
classes, so it can be move to common for potential re-use in
eeschema and friends in future.

Also convert all wxPoint logic in these classes to VECTOR2I and
fix some function visibilities.

Add some unit tests of the ARRAY_OPTIONS geometry and numbering.
2019-01-30 15:41:35 -08:00
Jeff Young 2dea3a49c8 Fix compile error in std::pow useage. 2019-01-30 16:38:34 +00:00
Seth Hillbrand 05483a06c6 pcbnew: Re-attach snap options
Snapping to item options were partially disconnected when unifying
framework.  This re-attaches the options and adds the additional option
for graphical items.

Fixes: lp:1801377
* https://bugs.launchpad.net/kicad/+bug/1801377
2019-01-29 13:36:17 -08:00
Seth Hillbrand 914596fcbb pcbnew: Allow STEP export tolerancing
kicad2step has a tolerance level that sets whether two points are at the
same location or not.  This allows KiCad to access these levels to some
degree, permitting a looser interpretation of a closed board outline.
2019-01-29 13:05:23 -08:00
Jeff Young 577bb73320 Revert 7d06651a10. 2019-01-28 20:10:13 +00:00
Seth Hillbrand 9d99fd188f Revert "Change top selection drop-down to combobox"
This reverts commit 7d06651a10.
2019-01-28 10:15:32 -08:00
jean-pierre charras e850a482d1 Gerber output: fix a potential minor issue in a G04 line comment.
In gbr files only ASCII7 chars are allowed.
However, in a comment line a UTF8 string is used. It should not create issues, but it is incorrect.
2019-01-27 10:14:16 +01:00
jean-pierre charras b8cfabd22e Fix some issues in I10n strings
Fix typo and missing I10n identifier for 2 strings
2019-01-26 09:25:12 +01:00
Wayne Stambaugh b13efdb0f2 Initial global footprint library table fixes.
Fix bug when pcbnew is launched from a folder containing an existing
fp-lib-table file by using same method as setting the initial global
symbol library table.

Fixes lp:1810169

https://bugs.launchpad.net/kicad/+bug/1810169

Fixes lp:1738871

https://bugs.launchpad.net/kicad/+bug/1738871
2019-01-20 13:51:07 -05:00
jean-pierre charras 9cac0a38cc DIALOG_GRAPHIC_ITEM_PROPERTIES: better tooltip.
minor other code enhancement (does not create any actual change)
2019-01-19 12:35:35 +01:00
Tomasz Włostowski 9657039af2 pcbnew: multiple fixes concerning track->pad net propagation used by Track/Via properties dialog:
- Added ignore netcode option to CONNECTIVITY_DATA::GetConnectedItems()
- PlaceModule() now ensures the module added to the board (and thus to the connectivity database) has correct bounding box necessary for R-trees to work
- Use recursive connected pad search so that the new net is propagated to all pads

Fixes: lp:1787961
* https://bugs.launchpad.net/kicad/+bug/1787961
2019-01-18 02:53:29 +01:00
Seth Hillbrand 9458ae8221 pcbnew: Prevent GITHUB plugin from being registered
If the user does not build the GITHUB plugin (deprecated), we cannot use
it in our footprint load and should remove the define to ensure
accidental use is caught at compile time.
2019-01-15 12:14:02 -08:00
Seth Hillbrand 90ad240660 units: Move common units and add tests
Centralizing duplicate code from Eeschema and pcbnew and adding unit
tests
2019-01-08 09:29:32 -08:00
Seth Hillbrand 1e5ba6f1b1 Replace DIM() macro
The standard DIM() macro was not typesafe as it happily deferred errors
to runtime that can be caught at compile time.  Replacing it with a
generic C++11 constexpr allows for typecasting, comparison and compile
time error checking.
2019-01-06 08:43:12 -08:00
jean-pierre charras db7dba96ad Fix a few Coverity warnings.
Mainly not initialized members, and replace not tested dynamic_cast by static_cast.
2019-01-04 09:49:21 +01:00
Seth Hillbrand 7d06651a10 Change top selection drop-down to combobox
wxChoice centers the selection on GTK.  So when switching from a
mid-list item to an item at the top, the list is always cut off for
choice lists located on the top toolbar.  Using a combobox provides a
drop-down that allows easier access to all elements in the box.

Fixes: lp:1808569
* https://bugs.launchpad.net/kicad/+bug/1808569
2019-01-03 14:48:28 -08:00
Seth Hillbrand efbc50b7b8 prevent NULL dereference in dialog_text_properties 2019-01-02 19:40:29 -08:00
Seth Hillbrand b39061855e pcbnew: Translate scripting test window 2019-01-02 14:49:55 -08:00
Jeff Young dffa399eab Set mirrored when creating footprint texts on back layer. 2018-12-31 21:50:09 +00:00
Jeff Young 061d993448 Warn the user when global track/via edits fail. 2018-12-31 21:50:09 +00:00
Jeff Young 4d9b4428fa It's never a good idea to dereference a freed pointer.
Fixes: lp:1809897
* https://bugs.launchpad.net/kicad/+bug/1809897
2018-12-27 13:33:19 +00:00
Jeff Young 0c0dda54bf Close any active editor before rebuilding netclass lists.
Fixes: lp:1809555
* https://bugs.launchpad.net/kicad/+bug/1809555
2018-12-24 01:55:02 +00:00
jean-pierre charras 5f3cbff977 Pcbnew, DIALOG_SET_GRID_BASE: A few cosmetic enhancements and fix a wxWidgets minor alert 2018-12-21 10:15:15 +01:00
Jeff Young 95dcc30ffb Load footprint browser with last-selected footprint. 2018-12-16 21:59:42 +00:00
Jeff Young f0c0f04348 Fix ReadNetList and UpdatePCB issues with new footprints.
Make sure the view is rebuilt before selecting the new footprints
so that they're shown only in the selection overlay.

Don't start the drag until the dialog is closed so we don't have
a bunch of extraneous mouse warping.

Fixes: lp:1775265
* https://bugs.launchpad.net/kicad/+bug/1775265
2018-12-10 19:48:58 +00:00
jean-pierre charras 7f20c55ed6 Pcbnew, Plot dialog, Gerber format: Enable or disable adding net metadata both in X1 and X2 format. Previously, this option was existing only in X2 format. Should be existing in both formats.
A bit of cleaning code related to this option.
2018-12-09 08:38:23 +01:00
Jeff Young 6a7ee5b107 Add locale handling for orientation combobox.
Fixes: lp:1806851
* https://bugs.launchpad.net/kicad/+bug/1806851
2018-12-05 18:08:50 +00:00
Jeff Young 4f5771f79f Don't nag user about changes they made in a text editor.
Fixes: lp:1806748
* https://bugs.launchpad.net/kicad/+bug/1806748
2018-12-04 23:32:55 +00:00
Jeff Young da40def69d Standardize on "local coordinates" terminology. 2018-12-04 23:32:55 +00:00