Commit Graph

1133 Commits

Author SHA1 Message Date
John Beard 44a6a61ff9 Gerbview: fix formatting assert
In GERBVIEW_FRAME::loadListOfGerberAndDrillFiles, the variables
ii and aFilenameList.GetCount() are unsigned and size_t, respectively.

This means the format string must be %u and %lu, respectively.
2019-11-24 12:27:23 +08:00
Ian McInerney 99b9354a51 Add clear recent files action to the menus
ADDED: Menu item to allow the recent file lists in each program to be
cleared

Fixes: lp:1821685
* https://bugs.launchpad.net/kicad/+bug/1821685
2019-11-23 23:35:21 +00:00
jean-pierre charras 71cd8c57bf ADDED: Pcbnew, add "pin function" (pin name in eeschema) to pads.
The pin name defined in Eeschema is now available as pad info.
Useful for the board designer (the pin function is displayed in the message panel).
Needed for the Gerber P&P files.
2019-11-23 09:12:43 +01:00
jean-pierre charras 32043cfa26 Gerbview: add parsing of optional Aperture Macro parameter.
AMP_CIRCLE primitive has 4 or 5 parameters (last is optional)
Reading the optional parameter was missing.

Fixes: lp:1852924
https://bugs.launchpad.net/kicad/+bug/1852924
2019-11-18 09:06:43 +01:00
Jeff Young 04b0feb365 Fix a couple of issues in new Save As command.
Handle symbols as well as strings in the "source" lists of
netlist files.

Handle Protex gerber file extensions.

Check for project_name-whatever pattern for files that we
don't recognize (such as project_name-NPTH-drl_map.ps)
2019-11-11 20:36:48 +00:00
Jeff Young 10abc6097f Cleanup, commenting, etc. 2019-11-10 14:52:01 +00:00
jean-pierre charras 4de6ed6206 Fix issues created by Adds Save As... to the Kicad manger.
Mainly replacing std::string by wxString to manage filenames.
On Windows, a sdt::string cannot manage a filename, unless using
in many places TO_UTF8 and FROM_UTF8.
So the best way is to use a wxString for filenames and error messages.
2019-11-10 09:37:39 +01:00
Jeff Young b5904b0401 Installment one of project Save As... feature.
ADD: Adds Save As... to the File menu for the project window.

Fixes: lp:594051
* https://bugs.launchpad.net/kicad/+bug/594051
2019-11-09 20:22:44 +00:00
Seth Hillbrand 6625d0721e Implement Get/Set display options
The pointer passing for display options is deprecated.  This removes the
excess casting as the EDA_FRAME didn't need the base call with no value.
All requests for display options are now returned const and are updated
with a Set() routine after modification.

In Gerbview, this resolves an issue where the display options were not
stored because it was receiving the NULL from EDA_FRAME.
2019-11-07 08:26:44 -08:00
jean-pierre charras c59fa1b672 Gerbview: Fix outdated warning message about missing D-Codes and old RS274D files.
RS274X Gerber files using only regions (polygons) can be valid, and are not old RS274D files
Now a warning is raised only if there are some missing D codes definitions
(RS274D file or broken RS274X file)

Remove unused var and add comments

Fixes: lp:1850821
https://bugs.launchpad.net/kicad/+bug/1850821
2019-11-01 08:34:24 +01:00
jean-pierre charras 4a0bd46ed6 More work on Gerber pick and place files
In P&P files, user strings are now quoted, and use UTF8 encoding
2019-11-01 08:34:24 +01:00
jean-pierre charras 0878c7c64c Fix typo 2019-10-15 17:51:29 +02:00
jean-pierre charras 337244d423 Gerbview: displays aperture attribute value (TA.attribute) for Regions (polygons) having no dcode 2019-10-12 14:04:41 +02:00
jean-pierre charras 1a3f4fb38b Gerbview: enhancement: show attributes for polygons (Regions in Gerber dialect) 2019-10-06 17:34:35 +02:00
jean-pierre charras 9d617502d5 Gerbview: fix missing grid initialization at starting. 2019-10-03 18:33:16 +02:00
jean-pierre charras c3175b45af Gerbview: fix incorrect canvas type saving after closing Gerbview.
Was due to the fact the canvas type was now saved into m_canvasType when opening Gerbview.
2019-10-02 18:19:44 +02:00
jean-pierre charras 937b5bd69a Gerbview allows larger DCodes values (previously DCode id number max 999, now 10000)
This is not the DCodes max count but the DCode id (like in %ADD20C,0.05*%: the id is 20)
2019-09-16 14:49:26 +02:00
Jeff Young 2553dd2942 Bail on our custom dockart provider.
It appears that it was causing some crashes, and it was never clear
that it looked better anyway.
2019-09-06 23:38:20 +01:00
Jeff Young 3bd38ec245 Improve zoom-to-extents for footprints with long text.
Fixes: lp:1820540
* https://bugs.launchpad.net/kicad/+bug/1820540
2019-09-05 21:02:29 +01:00
Jeff Young ebbb12e978 Give empty preference pages the right parent.
Fixes: lp:1841665
* https://bugs.launchpad.net/kicad/+bug/1841665
2019-08-27 21:50:52 +01:00
jean-pierre charras 4f73530c4a Gerbview: better progress reporter info when loading more than one file 2019-08-25 20:32:40 +02:00
Seth Hillbrand 77488e379c gerbview: Ensure selection lives on top
Just picking the next layer will be overwritten when we have multiple
objects on the same layer in gerbview.  Move the selection to the top to
ensure it is out top-most layer when drawing.

Fixes: lp:1833868
* https://bugs.launchpad.net/kicad/+bug/1833868
2019-08-22 10:51:35 -07: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 195fbbaf23 Reduce confusion by putting all dialog pages as leaf nodes. 2019-08-19 17:46:25 +01:00
Jeff Young 3cdf88f2c6 CERN copyrights for work packages. 2019-08-14 09:35:15 +01:00
Ian McInerney 8493daf9ff Unify menu item creation for closing a window
* Push a function into CONDITIONAL_MENU that adds the item
* Modify the tooltip for close and exit items to have the
  program name

Fixes: lp:1835454
* https://bugs.launchpad.net/kicad/+bug/1835454
2019-08-14 09:35:15 +01:00
Seth Hillbrand 50b7027b22 gerbview: Don't use worksheet items as GERBER_DRAW items
The static cast caught items that don't have the GetLayerPolarity
function (worksheet view)
2019-08-06 15:28:24 -07:00
Jeff Young cc82e59003 Push the Quit/Close menu logic down into common. 2019-08-02 14:32:49 -06:00
Michael Kavanagh 58cfc13649 Fix some lost menubar menu separators 2019-07-30 19:12:34 +02:00
Jeff Young 77334628c4 Change default tool behaviour to skip unhandled events.
The problem is that wxEVT_CHAR_HOOK doesn’t do the key translation
properly.  wxEVT_CHAR does, but we only get to that if we skip the
event at the end of the tool’s event processing loop, which most tools
don’t do.  (Selection tools, point editors, pickers, and a couple of
others do skip, which is probably why this didn’t get reported earlier.)

I played around with a couple of ways to fix wxEVT_CHAR_HOOK.  Most of
them don’t work, and the few egregious hacks I tried weren't cross-
platform.

So I’m changing it so that most tools now skip at the end of their
event loops.  I left out a couple that I felt were high risk (length
tuning, for instance).  But there’s still enough risk that I’m 100%
sure it will break something, I just haven’t a clue what.

Fixes: lp:1836903
* https://bugs.launchpad.net/kicad/+bug/1836903
2019-07-26 12:21:24 -06:00
jean-pierre charras 858db3c104 Synchronize toolbars state with current options after rebuilding them.
Previously, for instance after modifying preferences or language,
they were rebuilt but the tools state was not set due to a missing call to SyncToolbars() after rebuilding.
2019-07-20 18:16:35 +02:00
Jeff Young 58ca5b71a9 A more robust fix for 36f1d023f0.
This one also handles when the events get out-of-order due to them
starting out in the Simulation window and not getting dispatched until
the mouse goes over the Schematic window.

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

Fixes: lp:1836544
* https://bugs.launchpad.net/kicad/+bug/1836544
2019-07-15 14:15:24 +01:00
Jeff Young 1a7cef2950 Improve performance, commenting and API of some polygon classes. 2019-07-14 10:39:38 +01:00
Jeff Young 2d17d2b91f Cleanup and commenting. 2019-07-14 10:36:48 +01:00
jean-pierre charras fc2379ca8a Fix some issues in .gbrjob file.
2 issues are fixed: a missing double quote, and a incorrect handling of unicode chars

Fixes: lp:1836448
https://bugs.launchpad.net/kicad/+bug/1836448
2019-07-14 10:23:45 +02:00
Jeff Young 483dc24e87 Homogenize selection tools around our HIG.
In particular make addative and exclusive-or selections work the
same way.

Also give Highlight Net a hotkey now that it can't use ctrl-click
anymore.
2019-07-09 21:59:46 +01:00
Jeff Young c600b758b3 Fix a few more actions missing from the hotkey list.
Fixes: lp:1828673
* https://bugs.launchpad.net/kicad/+bug/1828673
2019-07-06 21:10:16 +01:00
Jeff Young 9effd24f3a Allow move tool to run on top of other tools.
Fixes: lp:1784480
* https://bugs.launchpad.net/kicad/+bug/1784480
2019-07-01 22:15:25 +01:00
Seth Hillbrand 7297208119 Handle all non-length units
Statusbar length updates need to handle default with wxASSERT if there
is not a specific, handled unit.
2019-06-29 09:46:25 -07:00
Jeff Young 981072598b Overhaul cursor code for new tool/action framework.
Includes the addition of an onSetCursor() handler which must be called
from both the GAL canvas AND the GAL backend (at least on OSX) to prevent
cursor flickering between (for instance) pencil and arrow.

Also includes new architecture for point editors which allows them to
coordiate cursors with the editing tools (so we can switch to an arrow
when over a point).
2019-06-27 22:37:11 +01:00
Jeff Young 2f23aa9556 Implement a more robust tool stacking architecture.
We were running into various corner conditions where a tool's event
loop would exit while the tool was still active, or the tool would
get popped while we were still in the event loop.  (A lot of these
had to do with the POINT_EDITOR's, but not all of them.)

The new architecture:
1) tools always do a Push()/Pop()
2) everyone is responsible for their own pops; no more stack-clearing
on a cancel
3) CancelInteractive events go to all tools to facilitate (2)
2019-06-27 17:01:31 +01:00
Jeff Young da645c5d16 Don't select items on inactive layers in high-contrast mode.
Fixes: lp:1833870
* https://bugs.launchpad.net/kicad/+bug/1833870
2019-06-26 01:13:51 +01:00
Jeff Young f9702aab87 Immediate actions for PlEditor, PcbNew, etc. 2019-06-25 11:34:28 +01:00
Jeff Young f088d4d762 Add env-var setting to CommonSettingsChanged().
Fixes: lp:1804925
* https://bugs.launchpad.net/kicad/+bug/1804925
2019-06-25 11:34:28 +01:00
Jeff Young 1f35ec5521 Beware of copying events and losing the m_passEvent flag.
Fixes: lp:1833031
* https://bugs.launchpad.net/kicad/+bug/1833031
2019-06-17 14:44:39 +01:00
Jeff Young e6d5110ccf Implement I18N for ACTIONs.
It's a bit of a hack because they're statically initialized and
so we can't make use of the _() macro.  We do still want it in the
code, however, because the string harvesting is based off of it.

Fixes: lp:1833000
* https://bugs.launchpad.net/kicad/+bug/1833000
2019-06-17 10:45:23 +01:00
jean-pierre charras 66d2060942 Partial fix for missing language selection menu.
The fix is partial because in the list of languages the menuitem corresponding to the selected language is not checked.
2019-06-16 20:35:57 +02:00
Jeff Young e4fbd003e0 Make m_passEvent event-specific rather than global.
If a tool called something like clearSelection while processing a
MOUSE_CLICK, the SELECTION_TOOL will pass the clearSelection
COMMAND_EVENT because it handles it as a transition, not as an
event. Because m_passEvent is effectively global, the tool manager
would then interpret that as passing the MOUSE_CLICK and we'd end
up processing the click by multiple tools.
2019-06-16 12:06:49 +01:00
Jeff Young 19aba615c2 Remove selection condition from conditional menu separators.
We don't allow duplicate separators anyway so all they really do
is complicate the code.
2019-06-15 20:43:51 +01:00
Jeff Young 5610261dce Immediate-action hotkeys (and context menu actions) for eeschema. 2019-06-15 20:43:51 +01:00