Commit Graph

1251 Commits

Author SHA1 Message Date
jean-pierre charras 84363c8e06 Gerbview test file: fix incorrect file. 2020-09-30 12:56:55 +02:00
jean-pierre charras 04aa5519d0 Gerbview: code cleanup. Remove many include, now useless. 2020-09-30 12:56:55 +02:00
Ian McInerney fc565edb33 Add a palette to the toolbars to display groups of actions
This adds a palette to toolbar items that displays groups
of actions when long-pressed on a button.
2020-09-27 01:00:44 +01:00
PJM d1322e7d1d Refactor GetDocumentExtents()
CHANGED: GetDocumentExtents() in 'eda_draw_frame.h' now has a bool
parameter "aIncludeAllVisible" with a default value "true" which makes
it behave as it did before adding parameter.  If "aIncludeAllVisible"
is false, the returned bbox ignores some items depending on which
program it is running in.

CHANGED: Made "Zoom to Objects" use only PCB edge in Pcbnew.  This
allows text, notes, etc outside the PCB edge to be excluded in the
zoom calculation.

CHANGED: Added "Zoom to Objects" to Pcbnew main menu, and to RMB context
menus for Eeschema and Pcbnew.

Fixes https://gitlab.com/kicad/code/kicad/issues/5787
2020-09-25 00:31:56 -07:00
PJM e77b7e3360 Make MMB double click perform 'Zoom to Fit'
ADDED: Make middle mouse button double click do a 'Zoom to Fit'
in Eeschema, Pcbnew, and Gerbview.  Ctrl-MMB does a 'Zoom to Objects'
in Eeschema.

Fixes https://gitlab.com/kicad/code/kicad/issues/1988
2020-09-22 23:21:44 +00:00
jean-pierre charras 456735f803 VIEW::ViewGetLOD() returns double now instead of int.
ViewGetLOD() returns the minimal value of a zoom to show an item.
However a zoom is a double, and using int as minimal value does not
allows setting a correct value in some cases.
2020-09-21 17:55:24 +02:00
Ian McInerney 70a7d1bc7c Cleanup variable usage and assignment in gerber reader 2020-09-21 12:19:49 +01:00
Ian McInerney 7dfbb3cb18 Cleanup formatting 2020-09-21 12:15:03 +01:00
Seth Hillbrand f493e270ea ADDED: Menu option to enable/disable snap to grid
You can now enable and disable snap to grid when drawing/editing across
all apps.  You can also tie snap to grid to the visibility of the grid
to allow rapid enable/disable via grid display.
2020-09-10 20:09:30 -07:00
Seth Hillbrand 4026904cc4 Make grid snapping depend on grid visibility
Turning the grid view on enables snapping to the grid.  Turning it off
removes the snap and allows free draw
2020-09-09 10:18:15 -07:00
Seth Hillbrand 173b4ff588 Add snapping to eeschema
This generalizes both the SetPosition() function and ORIGIN_VIEWITEM
class away from the pcbnew-centric.
2020-09-09 10:18:15 -07:00
Ian McInerney f28b60896c Allow toolbar items to cancel tools when pressed
There was a regression in v6 where the zoom to selection toolbar
item wasn't canceling the tool when pressed and the tool was active
(it was in v5). This implements a more generic framework for canceling
tools on button presses.

Fixes https://gitlab.com/kicad/code/kicad/issues/5103
2020-09-05 01:49:38 +01:00
Seth Hillbrand d6a4ab0eec Shortening filenames in titlebar
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2096
2020-09-03 06:38:34 -07:00
Michael Kavanagh de03d3d427 Application title bar: app name after filename
Fixes https://gitlab.com/kicad/code/kicad/issues/2096
2020-09-03 06:35:48 -07:00
Jeff Young 2697fc3864 Remove canvas-switching from OSX.
The Cairo renderer doesn't work on Retina displays.

Fixes https://gitlab.com/kicad/code/kicad/issues/4788
2020-08-31 18:48:25 +01:00
Jeff Young 88635ee5b6 Clean up error messages.
Convert a lot of nags to InfoBar errors/warnings/messages, and some
that never should have been exposed to wxFAIL_MSGs.
2020-08-31 14:19:57 +01:00
Jeff Young cc64709407 Reimplement skip-parent-page to work with MacHack.
This prevents the "leaking" pages where the layers panel is shown
in the background of all other panels.

Fixes https://gitlab.com/kicad/code/kicad/issues/5182
2020-08-29 20:53:53 +01:00
Mark Roszko 1082402b33 Convert UNDO_REDO_T to an enum class 2020-08-26 18:04:32 +00:00
Jeff Young d1371e513d Make sure Gerber print options have a color settings.
We probably don't need it, but some code attempts to dereference
it so safer to have one then to start checking everywhere for
dereferences.

Fixes https://gitlab.com/kicad/code/kicad/issues/5353
2020-08-25 14:08:09 +01:00
Mark Roszko 89e74140eb Save file / window states for kicad project locally 2020-08-24 02:01:14 +00:00
Ian McInerney 92fd3d7119 Gerbview: Fix open menu items
These were broken due to a copy-paste error when rebuilding
the menu infrastructure.

Fixes https://gitlab.com/kicad/code/kicad/issues/5258
2020-08-19 11:35:00 +01:00
Ian McInerney e44c44f62c Update layer codes in gerbview to be correct
The worksheet now has its own layer code in GerbView for coloring,
so it must be referenced using that new code (otherwise an assert
triggers).
2020-08-18 19:27:41 +01:00
Wayne Stambaugh ede39780e2 Remove all debugging output that cannot be disabled.
The use of printf, wxLogDebug, and std::err/std::out causes excessive
debugging output which makes finding specific debugging messages more
difficult than it needs to be.

There is still some debugging output in test code that really needs to
be moved into a unit test.

Add debugging output section to the coding policy regarding debugging
output.
2020-08-18 10:17:36 -04:00
Ian McInerney 4491f24d5e Ripout the old SyncToolbars infrastructure reminants
The tool framework no longer needs to request updates of the UI
state for the controls, wxWidgets will do it for us.
2020-08-16 19:10:26 +00:00
Ian McInerney fd4388710d Migrate eeschema, libview and libedit to the UI condition framework
Also, fix some issues in other frames identified along the way.
2020-08-16 19:10:25 +00:00
Ian McInerney 45fb030b9b Rename and shorten the names in ACTION_CONDITIONS 2020-08-16 19:10:25 +00:00
Ian McInerney 3b05d7cddd Move more frames to the new UI condition framework
* Frames moved: cvpcb, cvpcb footprints frame, gerbview, pagelayout editor

This also introduces new EDITOR_CONDITIONS that are used to set the
conditions of very common editor settings.

Also, some IDs were converted to tools in the pagelayout editor.
2020-08-16 19:10:25 +00:00
Ian McInerney d01e22232a Remove unused GerbView IDs for items that were already actions
All these IDs were for commands that have already been transitioned
to actions and there was no wxCommandEvent interface for them.
2020-08-16 12:37:51 +01:00
Ian McInerney 61cdf3436b Ensure PAINTER::Draw routines properly handle EDA_ITEM casting
EDA_ITEM is a child of VIEW_ITEM, so a static_cast is not appropriate,
since in some cases it could be called with a non-EDA_ITEM argument.
This was triggering an ASAN heap-buffer-overflow in GerbView.
2020-08-16 12:37:51 +01:00
Jon Evans bd14f8a82a ADDED: New appearance control widget for PcbNew
Featuring:
- Layer view presets
- Per-type opacity for tracks, vias, pads, zones
- Net and netclass color and visibility controls

CHANGED: Simplified object visibilty controls

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1951
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1981
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2003
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2173
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2254
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4325
2020-08-15 15:24:28 -04:00
PJM e28c882ce2 GerbView #4872 : Map loaded X2 Gerbers or Gerbers using KiCad naming conventions when exporting to Pcbnew
This Merge Request creates a function called 'findKnownGerbersLoaded()'.  That function in turn
calls the existing 'findNumAltiumGerbersLoaded()' and two new functions:

findNumX2GerbersLoaded()
findNumKiCadGerbersLoaded()

This approach allows a single call to detect Altium/Protel Gerbers, X2 Gerbers, and Gerbers using
KiCad naming conventions.

If it's desired to add detection of Gerbers from other EDA programs, new functions can be written
and then called from 'findKnownGerbersLoaded()'.

Fixes issue https://gitlab.com/kicad/code/kicad/-/issues/4872
2020-07-29 16:45:04 +00:00
PJM 4d2bc1fa54 GerbView #2501 - Add mirror display function to GerbView
Adds the ability to flip (mirror) the display, just like "Flip
Board View" does in Pcbnew.

Also added this to vertical toolbar since it's handy to not
have to go into the menu system to flip the display back and
forth.

Fixes issue https://gitlab.com/kicad/code/kicad/-/issues/2501
2020-07-25 21:20:07 -07:00
Simon Richter 95c2b261e8 Don't mandate ownership semantics in API
This API doesn't transfer ownership, so no smart pointers are required --
this just needlessly tightens requirements on the user of the interface.

(Fixes five instances of MSVC C26410 warning)
2020-07-26 02:45:27 +00:00
Peter Montgomery 33af2d9a95 Disable 'Get Stored Choice' button when no choices have been stored 2020-07-24 22:22:38 +00:00
Peter Montgomery 5fd7064f76 Add Gerber filename to 'Select Layer:' dialog
The 'Select Layer:' dialog pops up directly over the dialog with the loaded
Gerbers and hides all Gerber file names.  This is just an aid so users remember
exactly which Gerber layer they're working on without having to move the dialog.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4893
2020-07-22 02:03:43 +00:00
Mark Roszko 3b727b5d16 Make preference groups not selectable 2020-07-20 13:45:46 +00:00
Ian McInerney 7b705af038 Refactor common QA components to create a single common library
This moves the program-specific code (e.g. BIU files) into
the program tests.

Also, create title_block.cpp to break a dependency that pulled
in eda_text.cpp when using the TITLE_BLOCK object.
2020-07-18 16:21:15 +01:00
Jeff Young 3fd0a3f842 Update text variables even when they're changed from other binary.
For instance, you might have PCBNew open but change the variable
value through EEschema > Schematic Setup.

Fixes https://gitlab.com/kicad/code/kicad/issues/4918
2020-07-17 21:05:11 +01:00
Seth Hillbrand 7f991ce855 Revert "Set DoubleBuffering to reduce flicker"
This reverts commit 106259f6e6.
2020-07-13 20:23:12 -07:00
Seth Hillbrand e19a7910f8 Revert "Revert "Set DoubleBuffering to reduce flicker""
This reverts commit c18cab6154.
2020-07-13 20:19:10 -07:00
Seth Hillbrand c18cab6154 Revert "Set DoubleBuffering to reduce flicker"
This reverts commit 106259f6e6.

In its place, we set double buffering to only menubars in an attempt to
find a soluton to #4785

Fixes https://gitlab.com/kicad/code/kicad/issues/4863
2020-07-11 09:43:30 -07:00
Peter Montgomery 73168a9405 Gerbview: Keep existing layer selected if user clicks Cancel on 'Select Layer' dialog
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4752
2020-07-11 09:40:46 +00:00
jean-pierre charras a1a8eca844 Gerbview: fix crash in LAYERS_MAP_DIALOG when trying to use a stored choice,
if no choice exists (new install for instance)

Fixes #4862
https://gitlab.com/kicad/code/kicad/issues/4862
2020-07-11 09:36:59 +02:00
Seth Hillbrand 106259f6e6 Set DoubleBuffering to reduce flicker
This sets double buffering for GTK and MSW to minimize flicker when
redrawing window elements.

Fixes https://gitlab.com/kicad/code/kicad/issues/4785
2020-07-10 09:29:42 -07:00
jean-pierre charras ef0ae8a8ee Gerbview: show a message instead of an error when trying to open a job file as plot file.
Fixes #4844
https://gitlab.com/kicad/code/kicad/issues/4844
2020-07-10 14:20:35 +02:00
jean-pierre charras 8c15ecf8e4 Gerbview: fix issues when setting the grid color and the worksheet color.
The issue for the grid color was due to the fact there are 2 places to
store the color: the color settings and the m_gridColor GERBVIEW_FRAME member.
The worksheet color (color set to RED after a color change in layer render)
is a bit strange: looks like LAYER_GERBVIEW_WORKSHEET and LAYER_WORKSHEET
are both used to draw the worksheet.
2020-07-08 18:49:12 +02:00
Ian McInerney 4fe4870d86 Gerbview: Empty highlight menu before building the new menu
Fixes https://gitlab.com/kicad/code/kicad/issues/4716
2020-07-07 23:12:17 +01:00
Tomasz Wlostowski c1d5394e46 properties: post-rebase fixes 2020-07-05 22:44:38 +02:00
PJM 06599d8d46 GerbView issue #4729 : Map loaded Gerbers with Altium file extensions to matching KiCad layers when exporting to PCBNew 2020-07-04 15:12:49 -07:00
Peter Montgomery 3c0de2b542 Gerbview: Set 'Do Not Export' as default for all layers when exporting to PCBNew
CHANGED: Gerbview to Pcbnew export now defaults to setting all layers to Do Not Export

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4753
2020-07-04 01:21:24 +00:00