After commit 9535153f9e there were no more IDs inside the legacy ID
system. Therefore the entire system for dispatching and looking up
the legacy ideas and handling those events can now be removed and
the tool dispatcher simplified (it no longer needs to know about
the ACTIONS class).
Saying "Import/Export" on the labels when the submenu has "Import"
or "Export" in it is redundant.
Note that we can't just update the action text with the new name,
because that is used in the hotkey list and would become too confusing
without the "Import"/"Export" text.
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.
The move tool can stack on others, so when we re-enter the previous tool
this caused another immediate action. We flag re-entry in the tool
stack to check for this and avoid unexpected tool starts
The proposed overload did not compile on gcc and using adjustments to
get to compile by moving definition into cpp results in false positives.
This is removed until we can come up with a better solution and test
The automatic wire tool was not working in the gridless mode because the
grid snapping on/off logic present in `EE_GRID_HELPER`, based on the
value of `m_enableGrid`, was not taking into account that another check,
but for the global KiCad setting, would be performed in the `Align()`
method, which is inherited from `GRID_HELPER`.
I've modified all tests of `m_enableGrid` value to also take the global
setting into account, and moved checks for it to `Align()` method, as
it's more consistent this way.
I've also removed an override of the `Align()` method in the
`PCB_GRID_HELPER` class, as it was made redundant by my changes.
Fixes https://gitlab.com/kicad/code/kicad/issues/7402
Can happen if someone hammers away on the probe and/or tune tools
without ever mousing over the schematic in between.
*May* fix the below bug.
Fixes https://gitlab.com/kicad/code/kicad/issues/6876
We had some spurious bugs where both ends would get dragged to a
single point (making them disappear). While I never caught it
in the debugger, I'm guessing that the flags weren't getting
cleared properly or were getting overwritten or something. Anyway,
it now uses std::pair instead.
Fixes https://gitlab.com/kicad/code/kicad/issues/6550
Fixes https://gitlab.com/kicad/code/kicad/issues/6431
Rotate text using the Rotate90() function which gets the orientation
right.
Also, when calculating the center point for rotation, don't include
labels if the selection contains other stuff. It just makes the
rotation odd, and tends to cause walking when continuing to rotate
(due to keep-upright being non-symmetrical).
Fixes https://gitlab.com/kicad/code/kicad/issues/git
Copy to clipboard save items (using S expr description) using wide strings
(not UTF8 encoding).
But Paste from clipboard was not converting the wide string to UTF8 string
when getting the stored data to send it as std::string to the S expr reader.
Fixes#6449https://gitlab.com/kicad/code/kicad/issues/6449
This will always show 1 unit from each system, with the primary unit
being the current frame unit and the secondary unit being the
most recent unit used from the other system. These are saved in
the settings, so they are saved between runs.
* Make the ruler able to switch to mils after creation
* Cleanup an unused flag in Pcbnew dimensions
* Move unit changed notification into EDA_DRAW_FRAME so more
frames to use it.
* Allow switching units when GerbView ruler tool is active
Previously, init order depended on the ordering of the
tool state map, which is opaque from the point of view of
registration. This makes it challenging to make one tool's
init depend on another. With this change, registration
order defines init order.
in most of files, including wx.h is not necessary, when only 2 or 3 wx files must be included.
Moreover, on windows, including wx.h sometimes create compil warnings about
shadowed vars defined in some specific windows headers.
When invoking "Break Track" from the RMB context menu, Pcbnew
gets and uses the current position of the mouse to figure out where to
break the track. The problem is that the mouse has to be moved to select
the "Break Track" menu item, and the mouse position used is wrong. This
can result in the break in the wrong location or not happening at all.
CHANGED: This commit determines if the "Break Track" was invoked from a
context menu or a hotkey. If a hotkey, it uses the current mosue position.
If a context menu, it uses the original postion of the mouse when the menu
was opened.
CHANGED: The margin used in 'Zoom to Fit' is now 2% instead of 10%.
ADDED: Added 'Zoom to Objects' to Eeschema which does not include
the page and border in the bbox calculations.
CHANGED: Removed pre-existing code that tweaked the center to account
for the scrollbars. It actually made the view off center. Removing it
results in perfectly centered zooms.
Fixes https://gitlab.com/kicad/code/kicad/issues/5145
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
Also moves to WX_GRID to get rid of some wxGrid bugs, and moves the
provision of attrs to the GRID_TABLE (as those applied to the grid
are ignored when a table is specified).
Fixes https://gitlab.com/kicad/code/kicad/issues/5260
The center point on polygons now maintains the axis of the dragged line
and, optionally with Ctrl pressed, maintains the slope of the adjacent
segments as well.
This also fixes a longstanding issue that prevented the ctrl-snapping
from using the original point rather than the last updated point when
constraining.
Fixes https://gitlab.com/kicad/code/kicad/issues/2465
This time remove the push/pop from the picker tools as that's
responsible for the issue of trying to re-activate the move action
when its popped. Instead do the push/pop from the client code
of other actions that need it, and not at all from the move-with-
reference action.
Fixes https://gitlab.com/kicad/code/kicad/issues/5336
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.
This leaves the decision to check/enable menu items to the main UI
conditions, and only the menu has control over showing/hiding the menu
items. Also rip out a special case for the preferenes item that isn't
needed on OSX anymore since all the main menus have been moved to
ACTION_MENUs now.
* 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.
This allows for the tool framework to keep track of a universal
set of conditions for the UI state (enabled/checked/shown) for
controls of actions. It removes the need for the main menubar
menus to be CONDITIONAL_MENUs and be rebuilt on each open,
and instead makes the updates of the check and enabling of
items handled in the native wxWidgets way.
This commit switchs the 3d viewer and kicad project manager window
over to this system.
Move the camera out to its own so that everything else is board-
related, and then rename BOARD_ADAPTER.
At some point the flags should probably be moved out too, and they
can have the EDA_3D_SETTINGS name.
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme
Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
ADDED: Back annotation algorithm,
eeschema back annotation dialog
CHANGED: added some minor helper methods to SCH_REFERENCE_LIST and SCH_REFERENCE,
split SCH_REFERENCE_LIST::CheckAnnotation on 2 parts to reuse code
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions
This is part of cleaning the build system for #1906.
* Make the events generated by the selection of context menu items
have the position where the menu was opened
* Ensure that TC_COMMAND type events have their position set to
be the cursor position where the event originated
This allows rapid debugging of the coroutine memory issues. It moves
the default stack size to 256 * 4096 = 2^20, which will utilize full
pages on all architectures.
* 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
Our coroutine system can make debugging memory issues harder by not
following a standard stack allocation system. We can get around this by
using valgrind's built-in stack instrumentation. Each coroutine
registers a stack allocation allowing memcheck to recognize when
accesses are bounded.
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)
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
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.
Delete the copy ctor and assignment operator to start with, but
even then the separate apps each have their own statically allocated
copy of the common actions. So we need to update all of them, which
also means having the kicad manager frame's set of actions on hand).
This changelist also adds a Clear Hotkey Assignment function since
the hotkeys set is now likely to be sparse with respect to the
actions.
It was confusing that the primary frames registered their tools
differently than the other frames. In addition, since the other
frames also added their own tools, foo_actions::RegisterAllTools()
didn't really register all tool but rather those used by the
principal frame (PCB_EDIT_FRAME, SCH_EDIT_FRAME, etc.)