Commit Graph

118 Commits

Author SHA1 Message Date
Wayne Stambaugh 37b200cb3e Pass wxString objects by reference instead of on the stack. 2021-07-27 08:41:27 -04:00
luz paz f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
Marek Roszko 3a129a623a Kick wx.h out of eeschema 2021-06-07 18:38:51 -04:00
Roberto Fernandez Bautista 2c75911669 Fix SortByPageNumbers: use Sheet Name when page numbers are equal 2021-05-03 16:54:42 +01:00
Marcus A. Romer 1632707d9b Replace tabs with spaces 2021-04-05 01:13:39 +00:00
Jon Evans 18037e2f65 Rework bitmap system to load from archived PNGs
Bitmaps are now identified by an enum class instead of by pointers.
Bitmap loading and caching is now handled by a class in common, and
we no longer compile most bitmaps into the binary, so there is no
longer a bitmaps static library.

Instead, bitmaps are archived to a .tar.gz file which is installed
in ${KICAD_DATA}/resources/images.tar.gz

The source PNGs are checked in to Git as the original CPP files were,
so that people can build without the required dependencies to convert
SVGs to PNGs.

Initial support is also added for dark theme icons, although this
is not yet exposed in the GUI.

Stubs are present for multi-resolution image resources, but this is
not fully-baked yet and could use some refinement.
2021-03-11 08:37:35 -05:00
Jeff Young a3b9e8ddb4 Round 2 of Worksheet -> Drawing Sheet. 2021-02-23 11:57:44 +00:00
Wayne Stambaugh 5ecef204cd Coding policy fixes.
Using "this->" violates coding policy section 2.7.
2021-02-09 11:35:43 -05:00
Mikolaj Wielgus 8eca23aabe Mark null project initial screen as zoom-initialized
The variable `m_Initialized` in `BASE_SCREEN` is used by
`SCH_EDIT_FRAME` to mark whether a screen had its zoom level initialized
by the "zoom to fit screen" action. When this variable is `false`, the
function `SCH_EDIT_FRAME::DisplayCurrentSheet()` performs "zoom to fit
screen", modifying the zoom level. This function is indirectly called in
the undo routines, so if `m_Initialized` is not set to `true`, a zoom
change will occur when the user undoes an operation, a behavior that is
undesired.

`m_Initialized` was not initialized to `true` for the null schematic
(the schematic that is loaded if no project is loaded), causing the
aforementioned undesired behavior.

To prevent this, I've changed the `SCH_EDIT_FRAME` constructor to set
`m_Initialized` to `true`, since it zooms to fit screen already. I've
moved `m_Initialized` from `BASE_SCREEN` to `SCH_SCREEN`, as it is used
only in Eeschema, and renamed it to `m_zoomInitialized`, a name I
believe that better describes what this variable does.

I've also introduced the function `SCH_EDIT_FRAME::initScreenZoom()` to
group the "zoom to fit screen" action with setting `m_Initialized` to
`true`, as they often should occur together.

I'd also like to say that I'm not confident whether
`SCH_EDIT_FRAME::DisplayCurrentSheet()` should perform the zoom level
initialization at this point, but I have decided to not change this
behavior for now, as the commit history suggests it's several years old.

Fixes https://gitlab.com/kicad/code/kicad/issues/7343
2021-01-31 00:49:11 +00:00
jean-pierre charras e10025db64 Hierarchy navigation: keep the last used zoom level in a sheet when go back to this sheet.
Fixes #7107
https://gitlab.com/kicad/code/kicad/issues/7107
2021-01-17 09:41:49 +01:00
Roberto Fernandez Bautista 9380d6f533 eeschema page numbers: match ordering in hierarchy navigator to sheet page number ordering
- update hierarchy navigator after any modifications to the SCH_EDIT_FRAME
- do not generate ghost selection events after updating hierarchy tree
- use Human Readable path in SCH_EDIT_TOOL::EditPageNumber
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5760
2020-11-30 16:49:33 +00:00
jean-pierre charras 7865d8de43 more cleanup about removing useless include 2020-10-02 15:50:46 +02:00
Seth Hillbrand 975e5562a0 EEschema: Sort Hierarchy tree
This sorts the hierarchy tree children alphabetically
2020-09-21 11:17:33 -07:00
Jeff Young 7340c97ef9 Undo for schematic-wide operations.
Editing value/footprint fields of multi-unit components.
Find/Change.
Annotation.
Back annotation.

Fixes https://gitlab.com/kicad/code/kicad/issues/2122

Fixes https://gitlab.com/kicad/code/kicad/issues/4869

Fixes https://gitlab.com/kicad/code/kicad/issues/3933

Fixes https://gitlab.com/kicad/code/kicad/issues/4871

Fixes https://gitlab.com/kicad/code/kicad/issues/3899
2020-07-13 12:32:17 +01:00
Jeff Young f84406009b Push a couple of layers of indirection out of grid settings. 2020-06-13 11:35:56 +01:00
Jon Evans d7bd4c9b04 Move Eeschema globals to new SCHEMATIC object
Set up a new lineage for SCH_ITEMS to get back to the SCHEMATIC
they live on: Items will all be parented to the SCH_SCREEN that
they are added to, and each SCH_SCREEN will point back to the
SCHEMATIC that it is part of.  Note that this hierarchy is not
the same as the actual schematic hierarchy, which continues to
be managed through SCH_SHEETs and SCH_SHEET_PATHS.
2020-05-18 13:04:56 -04:00
Jeff Young 0370eff7ba Add sheet number processing to sheet fields.
Also fixes a bug where we were depending on the old deque stuff's
deterministic traversal, which isn't provided by the new RTree stuff.

Fixes https://gitlab.com/kicad/code/kicad/issues/2433
2020-05-03 20:56:32 +01:00
Jeff Young 122b1ddaae Unwrap an unnecessary layer now that we have new config stuff. 2020-04-13 20:58:12 +01:00
jean-pierre charras d714773c22 Fix a minor compil warning. Add a wxASSERT in hierarch.cpp. 2020-01-18 18:23:21 +01:00
Seth Hillbrand 6e5e453d0d Replace EESchema DLIST
This moves EESchema DLIST structures to rtree.  These changes are more
fundamental than the pcbnew changes from 9163ac543 888c01d11 d1877d7c1
and 961b22d60 as eeschema operations were more dependent on passing
drawing list references around with SCH_ITEM* objects.
2020-01-10 06:37:08 -08:00
jean-pierre charras fd0d5fdb38 HIERARCHY_NAVIG_DLG: fix crash when in a subsheet one open the dialog
and switch to the paren sheet from the context menu.

Mainly, change the way the dialog is managed from the sch_edit_frame:
the pointer to find the created dialog is replaced by a call to wxWidows::FindWindowByName().

Using a pointer set and cleared by events is a recipe for crashes.
2020-01-08 15:01:22 +01:00
Franck Jullien ea218bc722 eeschema: Allow hierarchy navigator to stay open
ADD: User can now decide to keep the hierarchy navigator open while working
on a schematic.

This behavior can be configured in eeschema->preferences->eeschema->Editing options.
2020-01-03 21:08:40 +01:00
Jon Evans 972d765aea Use direct call to update highlighting on new sheet load 2019-11-29 21:11:44 -05:00
Jeff Young 83ee51370c Cancel interactive editing when switching sheets.
Fixes: lp:1819278
* https://bugs.launchpad.net/kicad/+bug/1819278
2019-06-14 16:54:46 +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 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 67cc2aac2e Rework Eeschema find/replace for modern toolset.
Fixes: lp:1827274
* https://bugs.launchpad.net/kicad/+bug/1827274

Fixes: lp:1827240
* https://bugs.launchpad.net/kicad/+bug/1827240
2019-05-22 21:48:04 +01:00
Jeff Young e850592587 Cleanup. 2019-05-15 17:50:52 +01:00
Jeff Young ef5c69167a Start moving some LibEdit and SchEdit menubar menus to actions.
Also includes a bunch of bug fixes that got intermingled.

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

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

Fixes: lp:1828793
* https://bugs.launchpad.net/kicad/+bug/1828793
2019-05-13 21:44:29 +01:00
Jeff Young 25209516a6 Adjust net highlighting after edits.
Fixes: lp:1800291
* https://bugs.launchpad.net/kicad/+bug/1800291
2019-05-12 18:20:41 +01:00
Jeff Young c1539ae014 Naming changes to reflect sharing between SchEdit and LibEdit. 2019-05-10 19:56:20 +01:00
Jeff Young f3c95ad83c Clean up the RepeatItem architecture and finish deleting the UndoItem facility. 2019-05-10 19:56:20 +01:00
jean-pierre charras 2c43d4d6bf Eeschema: fix incorrect display of the page number in a complex hierarchy.
When, inside a complex hierarchy, one switch from an instance of a sheet to an other instance of this sheet,
the page number shown in the worksheet was not updated on screen, and the initial number was displayed.

Fixes: lp:1827981
https://bugs.launchpad.net/kicad/+bug/1827981
2019-05-07 10:55:26 +02:00
Jeff Young f4b92e6acf Refactor as SCH_DRAWING_TOOL was getting too big. 2019-05-05 17:14:30 +01:00
Jeff Young 35e8a340ca Add enter/leave sheet to modern toolset. 2019-05-05 17:14:29 +01:00
Jeff Young b63fab92cf Move Eeschema net highlighting to modern toolset. 2019-04-14 12:10:48 +01:00
Jon Evans 74ace97249 Don't update graph when entering/leaving sheets 2019-03-31 19:57:25 -04:00
Jon Evans 83c7e7fc65 New connectivity algorithm and bus upgrades
Bus upgrades: core new connectivity code

Bus upgrades: eeschema integration and modifications

Bus upgrades: eeschema dialogs

Bus upgrades: netlist export

Bus upgrades: file format changes
2019-03-31 19:53:41 -04:00
jean-pierre charras bec2d7861e Eeschema: shows the opened sheet info in title bar.
Fixes: lp:1819564
https://bugs.launchpad.net/kicad/+bug/1819564
2019-03-15 13:09:04 +01:00
jean-pierre charras 58036382c1 eeschema: Fix slow redraw on net highlighting (by redrawing only modified items)
Fixes: lp:1806197
https://bugs.launchpad.net/kicad/+bug/1806197
2018-12-04 20:55:59 +01:00
Jeff Young 2d5baac77d Fix up zoom and pan issues entering/leaving sheets. 2018-10-09 11:08:56 +01:00
Tomasz Wlostowski 90c7c60471 eeschema-gal: initial GALified version. Lots of stuff still to do! 2018-10-09 11:08:52 +01:00
jean-pierre charras 8022f1cc01 fix code after renamin files 2018-01-30 11:49:51 +01:00
jean-pierre charras 795a36c9fe Fix code after renaming files, and a bit of code cleanup (remove useless includes and multiple includes of the same files) 2018-01-30 09:57:25 +01:00
jean-pierre charras 5f6f03b16c HIERARCHY_NAVIG_DLG: allows closing the dialog by ESC key (like other dialogs)
cleanup hierarch.cpp code
2017-12-12 09:54:42 +01:00
jean-pierre charras cd3122d8cd Refactor hierarch.cpp: remove old dead code and clean current code. 2017-12-04 12:46:13 +01:00
jean-pierre charras c0a539959e Fix a few Coverity warnings 2017-12-04 12:46:11 +01:00
Seth Hillbrand 069448f20e Eeschema: Automatically manage junctions
CHANGE: eeschema automatically adds and removes junctions
when required by the schematic

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

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

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

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

Fixes: lp:1491052
* https://bugs.launchpad.net/kicad/+bug/1491052
2017-11-30 10:02:24 -05:00
Seth Hillbrand bf32cc2555 Eeschema: Moving SchematicCleanup to SCH_EDIT_FRAME
SchematicCleanup function moved from SCH_SCREEN to
SCH_EDIT_FRAME to allow access to the undo stack as we
are changing the schematic.
2017-11-30 10:01:58 -05:00
Wayne Stambaugh 6816b0dc99 Schematic hierarchy selection dialog fixes.
Derive the dialog from DIALOG_SHIM and show dialog quasi-modally to prevent
other KiCad main frame window events from being blocked.

Remove redundant storing of parent window pointer.

Verify parent window pointer is actually a SCH_EDIT_FRAME since the dialog
directly accesses parent object methods.

Replace static event table with dynamic event handling.

Fixes lp:1718241

https://bugs.launchpad.net/kicad/+bug/1718241
2017-09-20 08:45:30 -04:00