Commit Graph

180 Commits

Author SHA1 Message Date
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Ian McInerney b9d8849b28 Unify unsaved changes detection logic in all frames
Create an IsContentModified() function in each frame
that provides if the content has been modified, and
use that instead of always copying the checks.
2019-12-19 15:34:01 +00:00
Mark Roszko 686b768a3d Add shutdown blocking on Windows for pcbnew, eeschema and pleditor
ADDED: Block shutdown/logoff on Windows when contents have been modified
2019-12-19 14:11:11 +00:00
Jeff Young 102b530162 Fix library tree updating bug present at least on OSX. 2019-11-29 17:55:01 +00:00
Ian McInerney e82795ba58 Fix grid settings in pcbnew/modedit/cvpcb
* Make the grid display settings separate from the board object
* Ensure that the grid is initialized on creation in all the frames

Fixes: lp:1843169
* https://bugs.launchpad.net/kicad/+bug/1843169
2019-11-23 23:35:21 +00:00
Ian McInerney 69e20c73ad fpeditor: Fix initial grid display setting
The footprint editor didn't respect the display setting showing/hiding
the grid on startup.

Fixes: lp:1843169
* https://bugs.launchpad.net/kicad/+bug/1843169
2019-11-11 22:56:06 +00:00
Jeff Young ddf887d24a Add layer selector to Footprint Editor for consistency.
Fixes: lp:1850858
* https://bugs.launchpad.net/kicad/+bug/1850858
2019-11-05 17:22:51 +00:00
jean-pierre charras 1c2891e6d4 Fp editor: allow internal layers in footprint keep-out zones Especially: Enable one internal layer to manage keep-out areas only on internal layers Allowing one internal layer is a trick to manage these keep-out areas (visibility and selection) In fact this internal layer groups all internal layers enabled is these keep-out areas. 2019-10-29 11:24:57 +01:00
jean-pierre charras 16f4958430 Pcbnew: avoid crash when closing pcbnew if the DRC dialog is open.
Cvpcb: change from commit 9ceca583:
the root class close event that save settings is now seeing the close event.
2019-09-19 09:16:12 +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 10c25a2290 Update frame type enum to match current class names. 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 6688e80131 Update description in footprint tree when it's edited.
Also implements a more useful message panel for Footprint Editor.

Fixes: lp:1842660
* https://bugs.launchpad.net/kicad/+bug/1842660
2019-09-04 17:19:25 +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
Jeff Young 195fbbaf23 Reduce confusion by putting all dialog pages as leaf nodes. 2019-08-19 17:46:25 +01: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 13d61e4b2b Cleanup. 2019-07-10 01:14:21 +01:00
Jeff Young 4eaba20cd3 Real-time highlighting for Pcbnew and ModEdit delete tools. 2019-06-25 21:10:21 +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
Seth Hillbrand 98124e68c7 Update exit strategy to match UI guidelines
In singletop mode, all frames show the "Quit" option in the file menu
and will quit on Ctrl-Q.  When launched from the main KiCad interface,
sub-programs show the "Close" option instead and will close with Ctrl-W.
In this mode, Ctrl-Q will instruct the main program to exit.

Fixes: lp:1779938
* https://bugs.launchpad.net/kicad/+bug/1779938
2019-06-24 21:46:42 -07:00
Jeff Young 4eab89d9ef Fix OSX button order issue in Unsaved Changes dialog.
Also changes the presentation of the string when the checkbox appears
so that the "Changes will be lost" warning isn't hidden by the turndown.
This last part may require conditional compilation as it's undocumented.

Lastly, regularizes the Unsaved Changes strings between the apps.
2019-06-17 17:01:57 +01:00
Jeff Young 909aeba3d9 Transition some more stuff from the MVC view to the controller. 2019-06-16 19:53:30 +01: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
Jeff Young 5e49517781 Move hotkeys to ACTION architecture. 2019-06-10 23:46:00 +01:00
Jeff Young e606587ff6 Move remaining Symbol Tree ctx menu cmds to ACTIONS.
Also moves the various Player instantiators down into COMMON_TOOLS
for better sharing.
2019-06-10 23:46:00 +01:00
Jeff Young 2d40425e4d Move footprint & symbol tree context menus to tool infrastructure.
Fixes: lp:1831692
* https://bugs.launchpad.net/kicad/+bug/1831692
2019-06-05 20:16:48 +01:00
Jeff Young 1ea5b04e22 More ACTIONS work. Nearly done now. 2019-06-04 22:31:42 +01:00
Jeff Young 1ea001d497 Go back to event-loop zooming for new frames.
The immediate mode appears to have made things worse not better.
2019-06-04 13:56:54 +01:00
Jeff Young 1bf04d1722 More ACTIONs work. 2019-06-04 00:51:16 +01: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 e517199794 Move ConfigurePaths and LibTable management to common ACTIONs. 2019-06-03 21:08:30 +01:00
Jeff Young da4fe27447 More ACTIONS work. 2019-06-02 21:10:56 +01:00
Jeff Young 6ac273264d Move Show3DViewer to common action. 2019-06-02 16:21:44 +01:00
Seth Hillbrand d1877d7c1b Moving modules from DLIST to std::deque 2019-06-01 09:53:23 -07:00
Jeff Young 69e60d3982 Make sure grid settings get set in new canvas when switching. 2019-06-01 01:57:24 +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 cdaba24f0d pcbnew: Remove some legacy code
The menu IDs were used for disambiguation in legacy canvas.
2019-05-28 20:33:17 -07:00
Seth Hillbrand 453eb9c3eb pcbnew: Reconnect Grid settings dialog
Connects using the new common grid settings ID
2019-05-28 20:32:40 -07:00
Jeff Young 1e9da7f57b Remove CurItem() architecture and legacy routers and drawing code. 2019-05-29 00:26:30 +01:00
Jeff Young a27e4246e0 Move some more menu commands to ACTIONs. 2019-05-29 00:26:29 +01:00
Jeff Young c0909611d3 Remove a bunch more legacy editing code. 2019-05-29 00:26:29 +01:00
Jeff Young 718ad77891 Fix a bug introduced when UseGalCanvas() no longer switches.
We still need to setup the viewport the first time.
Also removes some more legacy editing code.
2019-05-27 18:47:20 +01:00
Jeff Young 9d9745b555 Remove more legacy editing code. 2019-05-27 18:47:20 +01:00
Jeff Young e9e28b9aac Retire legacy block architecture. 2019-05-27 11:58:56 +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
Jeff Young 323bb0f8e1 Moving PageLayout editor to GAL canvas and modern toolset. 2019-05-24 19:49:09 +01:00
Jeff Young 7d9a0b06e0 Push help menu down into EDA_BASE_FRAME. 2019-05-18 13:14:08 +01:00
Jeff Young fbb807f3bb Move some more menu & toolbar items to modern toolset. 2019-05-16 19:57:06 +01:00
Jeff Young 69afa27a5f Implement ACTION_TOOLBAR and update some of the menus to ACTION_MENU.
This gives us better separation of MVC in line with the design of
the modern toolset.  It also reduces a whole bunch of duplicated
data.
2019-05-15 17:50:52 +01:00
Wayne Stambaugh 3c4f8c1bf7 Fix frame name capitalization in all about dialogs.
This is a stop gap fix.  It should be possible to use the wxFrame title
string for this but some of the frame windows have appropriated the title
string for configuration file naming purposes which is less than ideal.

Fixes lp:1825977

https://bugs.launchpad.net/kicad/+bug/1825977
2019-05-13 15:40:44 -04:00
Jeff Young f602ccd814 Insert EE_TOOL_BASE under SchEdit and LibEdit tools, and fix errant rename scope which clobbered PCBNew's PICKER_TOOL. 2019-05-12 13:47:08 +01:00
Jeff Young c1539ae014 Naming changes to reflect sharing between SchEdit and LibEdit. 2019-05-10 19:56:20 +01:00
Jeff Young ecfa05e2ca Allow adding symbols/footprints from editors and browsers.
This was always possible from modal browsers and from the footprint
editor, but it's now also possible from non-modal browsers and the
symbol editor.

Fixes: lp:920380
* https://bugs.launchpad.net/kicad/+bug/920380
2019-04-16 16:20:51 +01:00
Jeff Young 3c11b89e4c Hook up refresh buttons to library tree synchronisation.
Fixes: lp:1820057
* https://bugs.launchpad.net/kicad/+bug/1820057
2019-04-11 19:45:10 +01:00
Jeff Young ca25f352ce Make Footprint Editor save command context-sensitive.
Fixes: lp:1795961
* https://bugs.launchpad.net/kicad/+bug/1795961
2019-04-03 10:18: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 3524bed75a libtree: Remember pane width
Stores the library pane width in settings to keep user preferences
2019-02-12 10:06:36 -08:00
Seth Hillbrand 9d99fd188f Revert "Change top selection drop-down to combobox"
This reverts commit 7d06651a10.
2019-01-28 10:15:32 -08:00
Jeff Young 7bec707160 Fix 2 separate issues with saving the m_canvasType setting.
Fixes: lp:1811982
* https://bugs.launchpad.net/kicad/+bug/1811982
2019-01-17 20:34:24 +00:00
jean-pierre charras 644855c5ba Fix incorrect (broken) canvas type saving in config.
The config was saving a canvas type EDA_DRAW_FRAME member not always accurately initialized.
And the last canvas opened frame setup was saved, not necessary a frame having a canvas type that can be set by user.
This is a broken feature especially because the footprint viewer has a fixed canvas setting.
2019-01-11 13:19:46 +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
Jeff Young 40dac0ecbb Default sizes for edit frames in case prefs get deleted.
Fixes: lp:1807676
* https://bugs.launchpad.net/kicad/+bug/1807676
2018-12-10 12:23:16 +00:00
jean-pierre charras 430c61822d Import svg import code from experimental trunk: convert dxf importer 2018-12-03 13:42:23 +01:00
Jeff Young 0de9cb345c Add shortcuts to setting dialogs for track widths, via sizes and grid sizes.
Fixes: lp:1803671
* https://bugs.launchpad.net/kicad/+bug/1803671
2018-11-17 00:35:06 +00:00
Wayne Stambaugh f1f4473d8b Footprint editor: add save view to PNG file.
Factor out save current canvas view to image file code from symbol editor
code so it can be used anywhere.

Add ability to save to any image format supported by wxBitmapType.  See
https://docs.wxwidgets.org/3.0/gdicmn_8h.html#a90a1eb6d85b5044a99b706fd979f27f5.
Currently only PNG output is implemented.

Please note that there is a minor bug that appears to be due to the
scroll bars which causes unfilled areas on the right and bottom edges
of the image.  This always existed in the save symbol editor view
image but it was not as noticeable because by default the background
color is white.  It is very noticeable in the footprint editor with
a black background.

The usual smattering of coding policy and comment fixes.

Fixes lp:1802127

https://bugs.launchpad.net/kicad/+bug/1802127
2018-11-09 08:32:36 -05:00
Jeff Young 68b07d1aff Add show/hide search tree to modedit, and fix it in libedit.
Fixes: lp:1801531
* https://bugs.launchpad.net/kicad/+bug/1801531
2018-11-04 12:35:01 +00:00
Jeff Young 9a213207fb Clearer titles for editing board footprints.
Also cleans up the naming on the symbol editor side.
2018-10-05 14:17:58 +01:00
Jeff Young c9ca1013b2 Make ModEdit and LibEdit library tree actions more consistent.
Adds Cut/Copy/Paste and Revert for footprints; introduces a new
shared Revert Changes? dialog; hooks up Add Library for footprints,
standardizes the Save As terminology.
2018-10-03 22:46:41 +01:00
jean-pierre charras 2c0fe8f595 Pcbnew: minor fix: avoid flicker in Layer Manager when closing Pcbnew.
It was due to useless paint events during closing, on some platforms.
2018-10-03 09:46:17 +02:00
Jeff Young 86b654e493 Hook up 3D viewer to common preferences.
Also removes nanny limits on text sizes.

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

Fixes: lp:1794345
* https://bugs.launchpad.net/kicad/+bug/1794345
2018-09-25 20:47:03 +01:00
Jeff Young 37f7faf433 Move lock checks to CLIENT_SELECTION_FILTER.
Also checks render item visibility as well as layer visibility
when making selections.

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

Fixes: lp:1541756
* https://bugs.launchpad.net/kicad/+bug/1541756
2018-09-25 17:56:38 +01:00
Jeff Young a5e2ddd65a Don't save footprint when it's renamed; wait for the user to save.
Fixes: lp:1792243
* https://bugs.launchpad.net/kicad/+bug/1792243
2018-09-14 10:21:45 +01:00
Jeff Young cbb3492d98 Standardize Footprint Viewer and Footprint Browser.
Add Display Settings to Footprint Browser.
Make each of them OpenGL on OSX and Cairo on other platforms.
Allow auto-zoom to be turned off and save last zoom setting.
Make ordering of tools in htoolbar consistent.
Standardize grid and zoom drop-downs.

Fixes: lp:1791667
* https://bugs.launchpad.net/kicad/+bug/1791667
2018-09-12 14:01:35 +01:00
Jeff Young 2e8f2d2850 Allow Export even when libId is empty.
For instance, after an import.

Fixes: lp:1785226
* https://bugs.launchpad.net/kicad/+bug/1785226
2018-08-29 20:08:01 +01:00
Jeff Young e55547223e ModEdit Save should save back to board if that's where the FP came from.
Use Save As... if you want to put it in a library.

Fixes: lp:1788924
* https://bugs.launchpad.net/kicad/+bug/1788924
2018-08-29 20:08:01 +01:00
Seth Hillbrand c6d1433523 modedit: clear the pcb when closing the window
Before closing the window in the footprint editor, we clear the existing
pcb, undo/redo stack and associated memory to prevent callbacks
double-freeing on destruction.

Fixes: lp:1784504
* https://bugs.launchpad.net/kicad/+bug/1784504
2018-08-28 12:36:06 -07:00
Jeff Young 4b1a31ffad Regularize save-changes dialogs. 2018-08-12 00:02:37 +01:00
Jeff Young acec00f80a Fix bug displaying canvasses when starting in Legacy mode. 2018-08-11 23:43:19 +01:00
Jeff Young d81faa72c9 Overhaul border drawing in all the Kicad frames.
Primary change is to replace most control/window borders with
AUI pane borders.  We implement our own AUI border drawing
routine which avoids the ugly one-pixel white frames around
dark canvasses.

Also increases the signal-to-noise ratio of all the pane
creation code in the various frames.
2018-08-11 17:25:38 +01:00
jean-pierre charras 009044bd6b FOOTPRINT_EDIT_FRAME: fix incorrect layer manager initialization depending on canvas type.
Especially, the color selector is not the same when selecting GAL or Legacy canvas.
Due to this incorrect init, the color selector type was incorrect.
2018-08-11 13:16:41 +02:00
jean-pierre charras bd46f720a1 Fix a few AUI issues. 2018-08-11 11:26:47 +02:00
Jeff Young d788c9d479 Move library table dialogs from PLAYER to KIFACE interface.
Spooling up a full PLAYER in the background takes too long.

This also fixes bugs around how the tables are saved, although
that was just missing code rather than anything architectural.

Fixes: lp:1785436
* https://bugs.launchpad.net/kicad/+bug/1785436
2018-08-06 21:31:53 +01:00
Jeff Young be1d6113d6 More performance enhancements.
Be more intelligent about sorting lib tree items.  (Footprint
entries, for instance, come out of an already-sorted list.)

Don't recreate menus twice when laoding Footprint Editor.

More pervasive use of WX_FILENAME to avoid expensive calls to
wxFileName::SplitPath() and string concatenation.

For POSIX kernels do all the work on the file-system side so we
don't have to keep converting back and forth between encodings.
2018-08-06 13:49:27 +01:00
Jeff Young fd3e57d67f Layout adjustments and language-change-updating for modview. 2018-08-04 12:59:04 +01:00
Jeff Young 33fc74a04d Performance enhancements for Footprint Editor construction. 2018-08-04 10:29:17 +01:00
Jeff Young d8d4f75fa1 Fix button order and genralize Exit dialog so it can be shared more.
This also fixes a bunch of bugs where an error during save would
still close the window (rather than cancelling the close action).

Fixes: lp:1785034
* https://bugs.launchpad.net/kicad/+bug/1785034
2018-08-02 11:01:03 +01:00
Jeff Young 0a35c5c97e Convert Footprint Editor to component tree.
Fixes: lp:1784178
* https://bugs.launchpad.net/kicad/+bug/1784178

Fixes: lp:1780363
* https://bugs.launchpad.net/kicad/+bug/1780363
2018-08-01 09:35:46 +01:00
Jeff Young 0cca1c6721 Remove active library concept from footprint editor.
Also bring the menu system and toolbar in line with Pcbnew,
eeschema, and the symbol library editor, which includes moving
to a standard Save As paradigm for renaming/moving items.

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

Fixes: lp:1778202
* https://bugs.launchpad.net/kicad/+bug/1778202
2018-07-26 21:34:25 +01:00
Jeff Young abae094955 Remove unused variables.
(cherry picked from commit 4fc5281)

(cherry picked from commit b151c8d)
2018-07-17 15:14:22 +01:00
Jeff Young 909f850d16 Give panels the correct parent (the treebook, not the dialog).
(cherry picked from commit 7338533)

(cherry picked from commit 3ce75be)
2018-07-17 15:14:19 +01:00
Jeff Young da69a7cd9c Enable position-relative tool in footprint editor.
Fixes: lp:1778624
* https://bugs.launchpad.net/kicad/+bug/1778624

(cherry picked from commit 3ee9703)
2018-07-17 15:12:43 +01:00
Jeff Young 49ea6e1670 Fix occurrences of "edition" which should be "editing"
Fixes: lp:1778168
* https://bugs.launchpad.net/kicad/+bug/1778168

(cherry picked from commit bcb1220)
2018-07-17 15:12:39 +01:00
Jeff Young aab97c8385 Consolidate design rules UI.
Implement new Board Setup paged dialog which includes:
  Layers Setup
  Design Rules
  Solder Mask & Paste
  Text & Drawings

Moves line width and text properties to a layer-class-based
system.  Renames unlocked to upright (which also reverses the
logic).

New Edit Text and Graphic Properties dialog which replaces
Edit Footprint Text and adds layer-class-based editing and the
italic, upright and visibility properties.

Adds Import Settings functionality which allows settings to
be imported from another project at page granularity.

Also UNIT_BINDERizes the dialog and adds editing of pcb text.

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

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

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

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

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

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

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

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

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

(cherry picked from commit 3944a5e)
2018-07-17 15:12:34 +01:00