This allows them to work in places like search boxes in standard file
dialogs. If wxWidgets doesn't find the standard IDs in our menus
then it won't enable them.
These can happen when a tool is active that sends signals when exiting
(e.g. deselectEvent). These may be caught by the active loop in another
tool which might try to update the UI after it has been freed. By
marking all tools as "shutdown", the only event returned to them should
be null. As an extra precaution, we flag the shutdown globally within
the tool manager and check this flag before launching either events or
new tools
Fixes https://gitlab.com/kicad/code/kicad/issues/10698
Our menu bar code is interestingly complex. But we were throwing away newly made menu items to the void in the cases of constructed on the fly submenus
Fixes:
* Various special cases around junctions on pins and dragging.
* Some rotations of endpoints resulting in a 45 degree rotate.
* Some cases where it was possible to get a line with neither
endpoint selected, and also substractive unselecting only one of two
selected endpoints unselecting both.
* Use line midpoint for sorting. Start and endpoints aren't
consistent in the order they appear on the X or Y axis. So,
we need to use the midpoint for our position for consistent
sorting when dragging groups of parallel lines where some
have the start and end reversed.
Other:
* Rename TEMP_SELECTED TO SELECTED_BY_DRAG. This is the actual meaning
of the flag, and should reduce confusion as
to when it should be used.
* Move usage of TEMP_SELECTED as an algorithmic mark to CANDIDATE
instead.
* Fix mistaken clearing of START_POINT and ENDPOINT.
* Move endpoint setting and clearing out of narrowSelection, and into
selectPoint and selectMultiple.
* Don't show dangling end warnings on new lines
This is for the out-of-box experience for novice users. It is presumed
that folks with larger more complicated boards will turn it off.
Fixes https://gitlab.com/kicad/code/kicad/issues/6413
We need the item to be currently selected when repeating the last symbol
insert. This ensures we have a valid selection before starting the move
tool and possibly getting odd system behavior from mouse positions
Fixes https://gitlab.com/kicad/code/kicad/issues/10619
(cherry picked from commit 7642a9db79)
Also regularizes some of the other selection filtering options.
This also fixes an invalidated iterator (and subsequent segfault) in
the old code.
Fixes https://gitlab.com/kicad/code/kicad/issues/9896
Adds "UpdatePreferences" action that is called when the preferences are
updated, allowing running tools to act on changes that may affect them
Fixes https://gitlab.com/kicad/code/kicad/issues/9737
Also removes the return value from the BITMAP_STORE's themeChanged
method as it will provide the wrong answer for the second frame it's
called on.
Also hooked up ACTION_TOOLBAR, the app launcher, and the project tree
to the wx event for system color changes so they change on the fly.
Fixes https://gitlab.com/kicad/code/kicad/issues/6026
Moving points should not be overrided by disambiguation menu, so we
track where the disambiguation event started and only trigger the menu
if the mouse hasn't moved a full unit in x/y
Fixes https://gitlab.com/kicad/code/kicad/issues/9132
Previously, we were checking if the selection tool was the top of the
stack but this ignored many other "secondary" tools that might be
running such as the point editor. These still allow the selection tool
to handle events such as clicks. This change allows the selection tool
to handle clicks when it is the primary tool on the stack rather than
the top
Fixes https://gitlab.com/kicad/code/kicad/issues/9110
This standardizes selection tools in SELECTION_TOOL class to be able to
handle a long-click as asking for a non-heuristic disambiguation menu.
Fixes https://gitlab.com/kicad/code/kicad/issues/8490
Found via `codespell -q 3 -S *.po,./thirdparty -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,dout,einstance,modul,ot,overide,serie,te,,tesselate,tesselator,tht`
wx/wx.h includes all wxWidgets .h files, and sometimes creates collision
names in #define between kicad and windows headers
Moreover, blindly including a lot of useless files is compil time consuming
The native cursor must be set on the GAL canvas wx object,
not its frame (otherwise on GTK the cursor is only set
when we get a request for it from the WM and not immediately).
Fixes https://gitlab.com/kicad/code/kicad/issues/6421
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.