Disable the text update event for the orientation cutom value field before
updating it when the radio buttons are selected. This allows to use the
conventional EVT_TEXT handler, rather than KEYDOWN, which has two effects:
* Tabbing though the dialog no longer sets custom orientation
* Click-driven clipboard actions trigger the update correctly.
Introduce a helper function in validators.h to assist in updating
validated fields without triggering further events.
Fixes: lp:1819006
* https://bugs.launchpad.net/kicad/+bug/1819006
wxWidgets has several bugs that result in cell editors being closed
right after they're opened. There are two wxWidgets hacks to
partially address this: the SetInSetFocus() hack, and a slow-click
hack. We used to try and work-around these bugs ourselves for
single-click access, but this changelist moves those over to
wxWidget's slow-click hack.
Fixes: lp:1817965
* https://bugs.launchpad.net/kicad/+bug/1817965
The folder button handler works will for footprint libraries but we
needed a specific class for the schematic libraries as well.
Fixes: lp:1818346
* https://bugs.launchpad.net/kicad/+bug/1818346
Added checks to StrCmpNum() function in common/sting.cpp to prevent
iterating past the end of the sting. Also removed length of string
parameter since it did not seem to be used anywhere.
Fixes lp:1818157
https://bugs.launchpad.net/kicad/+bug/1818157
The cancel action was set for the escape key when editing the fields in
a dialog. But when the action is a button, we need to ensure that the
escape id is set to ANY for processing.
Fixes: lp:1818056
* https://bugs.launchpad.net/kicad/+bug/1818056
For unknown reasons, GTK3 may send resize events when editing grid
fields. This can cause the grid editor to exit, losing the focus and
overwritting the characters at the next input.
We avoid this by filtering the size events when the size doesn't change.
Fixes: lp:1817810
* https://bugs.launchpad.net/kicad/+bug/1817810
Wayland is not yet compatible with wxWidgets (or rather the other way
around). Until this happens, we must force the x11 compositor while
running. Under wayland, this will map to the wayland-x11 compatibility
layer.
Fixes: lp:1816637
* https://bugs.launchpad.net/kicad/+bug/1816637
For BUTTON_ROW_PANEL::BTN_DEF_LIST, the button definition does not need to be
passed by value, by non-const reference avoids copies and this addresses the
Coverity warnings: 184130, 184134, 184140, 184167.
Also use a unique_ptr to clarify ownership sementics when handing widget
over to WX.
In Symbol editor, axis are always shown. However after switching the backend, axis were no longer drawn.
In Cairo engine, fix a bug preventing axis to be shown.
Each dot is an integer number of pixels wide, so supporting 0.5 width
steps no longer makes sense. We round up the existing settings to the
nearest integer and only allow integers in the dialog.
Fixes: lp:1816748
* https://bugs.launchpad.net/kicad/+bug/1816748
Introduce a shortcut method to set tab ordering and use it in
the dialogs that override the tab traversal orders:
* Eeschema sheet properties
* Pcbnew Move exact
* Pcbnew Move relative
Also set some initial focus fields in the same dialogs.
Tidy a few includes.
Fixes: lp:1816009
* https://bugs.launchpad.net/kicad/+bug/1816009
We shouldn't adjust the pixel size of the grid based on alignment in
GAL. This creates artifacts on the screen at different zoom levels.
The pixel width is fixed by grid size preference
Also clean a left-over debug statement
Fixes: lp:1817377
* https://bugs.launchpad.net/kicad/+bug/1817377
A only one char is very hard to translate outside a context, so avoid to use it.
Remove also 2 "FIX ME" lines, now useless.
Fixes: lp:1817354
https://bugs.launchpad.net/kicad/+bug/1817354
Arc pixel adjustment needs to be limited to +/-1 pixel. But making this
adjustment to nearby points and then using the projection to correct the
center point accumulates errors that are large for angles near 0 and
near 360. This is a compromise that aligns _most_ arcs and provides
stable generation for all angles.
Fixes: lp:1817226
* https://bugs.launchpad.net/kicad/+bug/1817226
GTK3 provides for additional input devices via xinput2. These include
touchscreens and continuous scroll devices. But wxWidgets does not have
specialized handlers for these events, so they double up for some
devices. Until wxWidgets allows us to handle these events, we specify
that the input handler should be the old-style GDK_CORE.
GTK3 does a fade in/fade out routine for scrollbars by default. This
was problematic as it caused a cascade of full-screen repaint events on
each mouse event. Instead of disabling scrollbars (which only helped
the full canvas), we force the old scrollbar behavior is environmental
variables.
Revert "gtk3: Remove scrollbars"
This reverts commit db43bd82a7.
And filled but we don't use those yet. No pixel-alignment needed for
stroked semi-circles (I think) as we set the pixel width to be 1
regardless of the zoom level.
Fixes: lp:1816263
* https://bugs.launchpad.net/kicad/+bug/1816263
Pixel alignment is not required for track outline mode. It creates
differences between segment and radius calculations.
Also add specific width of the outlines
This creates early asserts for issues where we haven't fully implemented
a Clone() function for items or haven't correctly filtered them before
creating the undo/redo commit.
gal: pixel alignment for Cairo.
gal: pixel alignment for OpenGL
Cleanup of pixel alignment patches
gal/opengl: more pixel alignment patches:
- works on Retina displays now
- pixel alignment for circles
- correct 1-pixel strokes
- fixed unfinished 1-pixel line ends
GAL: Restore antialiasing options in Cairo
GAL: Fix arc drawing
Removes DrawArcSegment, which drew arcs whose edge was optionally
stroked (a feature that we did not use). Fixes Cairo arc drawing issue
where arcs were not visible in pcbnew.
gal: further cleanup
gal: removed unused shader parameter
The indent size was estimated by the width of characters. But MSW
indent is substantially different from OSX and Linux. It also cuts off
the middle characters rather than the end leading to poor display if the
width does not fit. This uses the system setting for indent to account
for the indent spacing + 'M' to account for the arrow inset.
Fixes: lp:1815401
* https://bugs.launchpad.net/kicad/+bug/1815401
When filtering, we update the width of the displayed column to ensure
the full text is visible to the user. Check is rough, based on line
width (doesn't completely account for differing char widths) but is
sufficient for the approximate difference
Fixes: lp:1815401
* https://bugs.launchpad.net/kicad/+bug/1815401
Fixes: lp:1788495
* https://bugs.launchpad.net/kicad/+bug/1788495
This was previously "svg:g", but the SVG is declared with only
a "default" namespace, not an "svg:" namespace (looks like
xmlns:svg="http://www.w3.org/2000/svg" in the svg tag).
This means you cannot use svg: as a NS in the document. It's not
needed anywaY: the default is already correct.
Moreover, mismatching <svg:g> and </g> is always invalid.
When adding colors to length tuner, we depend on the window background
color, which can be set by the user, resulting in an unreadable text.
This uses the HSL conversion to detect which shade it should use for the
coloring.
Also adds test cases for round-trip HSL and HSV conversion
Fixes: lp:1814530
* https://bugs.launchpad.net/kicad/+bug/1814530
Apparently FinishDialogSettings() does need to be called on windows to
get the dialog to layout properly. Hopefully this doesn't break any of
the other platforms.
Fix wxGrid column minimal widths on Windows in dialogs (just fixing the size is not enough).
WX_GRID::GetVisibleWidth(): make width bigger for labels, because they usually use a bold font.
(However, the fix is just a workaround: a better code is welcome)
When loading a part in libedit, also transfer certain screen
settings to the incoming SCH_SCREEN, from the current
SCH_SCREEN.
Currently, the grid settings are transferred, but this could
also do other settings if needed.
Also remove some duplicate commentary and mention why the
grid is set in a SCH_SCREEN even though the BASE_SCREEN ctor
sets the same default.
Fixes: lp:1815108
* https://bugs.launchpad.net/kicad/+bug/1815108
Some basic tests on LIB_TABLE and LIB_TABLE_ROW that demonstrate
the behaviour of fallbacks and various access methods.
Also add a few LIB_TABLE_BASE comments and changed some NULLs to
nullptr.
Libpolygon can provide its own includes via target_include_dirs PUBLIC.
This means any linking targets do not need to specifiy them manually.
As common requires polygon, the polygon dep is also now no longer
required downstream of libcommon, as it's transisitvely implied
by libcommon's target_link_libraries.
This resolves a circular dependency previously detected and also
simplifies CMakeLists.
The bitmap definitions (BITMAP_DEF and so on) do not
have any dependencies on other libs, including WX. This
means the bitmaps library can be isolated from the other
dependencies.
Common now depends on bitmaps, and libraries that depend
on common can pick it up from the common target_link_libraries,
as it is PUBLIC. This means a lot of targets no longer
need manual bitmap linkage.
This avoids a circular dependency that was previously reported
by static analysis.
Avoiding pulling in WX and other headers into the include
tree of each bitmap .cpp is a huge speed up (around 10x) in
compilation, and the generated static library is also 10x
smaller (20MB vs 200MB)
Add common as a link library to pnsrouter,connectivity.
THese library do still use common code (including bitmaps,
via base_screen.h) and this allows them to pick up the libcommon
includes correctly.
When the user cancels the footprint load, we should assume they are
canceling the placement of a new footprint. This also adds sanity check
when populating the list
Fixes: lp:1814181
* https://bugs.launchpad.net/kicad/+bug/1814181
Uses existing grouping in SVG output. Sets schematic components as a
grouped element in SVG as well as pcbnew elements per layer.
Fixes: lp:1011754
* https://bugs.launchpad.net/kicad/+bug/1011754
This function was incorrectly processing refdeses like "U1000".
Change the algorithm to a simpler STL-compatible one and
update the tests.
Fixes: lp:1813669
* https://bugs.launchpad.net/kicad/+bug/1813669
This breaks the following functions out to a general-purposed refdes utils
header:
* MODULE::GetReferencePrefix()
* kicad_string.h RefDesStringCompare()
This acheives:
* Slimming of MODULE interface
* Placement of refdes code in common rather than pcbnew
** Testing of this code in qa_common
* Tighter and smaller includes for code that only needed refdes functions
Note: there are failing tests commited (as expected failures). These
are the cause of lp:1813669 and will be fixed as a follow-up commit.
This is not logic specific to MODULE. Breaking it out to
kicad_string.h acheives:
* Slimming of the MODULE interface
* Enables reuse of the function
* Enables testing of the function
Also add a test under qa_common for this function.
The CONFIG_SAVE_RESTORE_WINDOW class does not need to be tied
to the array dialog, put it in common/widgets.
Also do a refactor and tidy-up of the the class, use a union for (slightly)
better type-safety and syntax (a variant would be better but that's C++17).
Also enable integral field save/restore from text boxes.
The geometry and numbering logic is separate to the dialog, and
can be separated for clearer logic and better testability.
Moreover, refactor it to avoid any dependency on pcbnew
classes, so it can be move to common for potential re-use in
eeschema and friends in future.
Also convert all wxPoint logic in these classes to VECTOR2I and
fix some function visibilities.
Add some unit tests of the ARRAY_OPTIONS geometry and numbering.
In the event that we do not have a project configuration file, the
default template will be used. But it needs a destination filename for
copy_pro_file_template().
Fixes: lp:1745022
* https://bugs.launchpad.net/kicad/+bug/1745022
When no default library tables are found, set the default wxFilePickerCtrl
to the users configuration path instead of the current project path to
prevent any project library tables from being used as the default.
Fixes lp:1809769
https://bugs.launchpad.net/kicad/+bug/1809769
If user hotkeys do not map all available actions, we still want the most
recent change to be the primary value. This can happen if the defaults
load a set of hotkeys that are not completely overwritten by the updated
hotkey preferences file. We assume that the most recent hotkey is what
the user want to map.
Fixes: lp:1778408
* https://bugs.launchpad.net/kicad/+bug/1778408
Some MSW seem to have issues with the UTF-8 characters in const
wxString. This explictly casts to wxString from UTF-8 handling the
platform differences
Fixes: lp:1813329
* https://bugs.launchpad.net/kicad/+bug/1813329