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.
Split antialiasing options out from display options. Move
antialiasing to common. Duplicate the rest of display options
for Eeschema.
Implement OnSelectGrid and hookup GAL canvas refresh to
SetPresetGrid.
Add Grid Settings... to View menu and move Show Grid from
preferences to View Menu to match Pcbnew.
It would appear that some platforms process the KILL_FOCUS event
after running TransferDataFromWindow(). This change makes sure
that the evaluation is done no matter the order.
Fixes: lp:1793911
* https://bugs.launchpad.net/kicad/+bug/1793911
There are lot of places where constants are used in the KiCad UI
as "magic numbers". The most common one is "5", used in many
wxFormBuilder and manual UI constructions as the margin.
This commit provides a place for all UI to look up shared
constants and other functions, to help create a consistent UI using
functions that provide meaning and intent to these magic numbers.
This is in preparation for making this widget optionally read-only.
Major changes:
* Construct panel in code, not with wxFormBuilder. This make's it
easier to conditionally construct elements that won't be used
in a read-only mode (e.g. the buttons).
* Use a generic "button row panel" widget for the buttons, as the
sizing and layout logic is reusable in nearly all dialogs, and
it's simplifies layout in the higher-level dialog widget. This
widget is one example of many possible "reuable widgets".
This version makes use of lots of things learned going down the
other rat hole. Avoiding the wxComboFocusHandler is key, as well
as specifying using the AltPopupWindow.
The key handler is still tricky with respect to those platforms
that use native controls, but the starting-key strategy is similar
to the one used with wxGrid text editors.
This is caused by:
* Not checking the hotkey data is not null when performing a
hotkey action
* Allowing hotkey actions on non-hotkey rows.
This fixes both of these, and adds an assert to warn if someone
does manage to fire a hotkey action on a non-hotkey row (but it
won't crash).
Fixes: lp:1794756
* https://bugs.launchpad.net/kicad/+bug/1794756
It was possible to get conflicting hotkeys when undoing and resetting hotkeys
to defaults.
This uses the same logic as when setting hotkeys to avoid conflcits in these
other two cases.
Fixes: lp:1794730
* https://bugs.launchpad.net/kicad/+bug/1794730
This separates the "ground truth" store of hotkeys from what is shown
in the dialog. This will allow us to filter the displayed hotkeys
while keeping the same underlying data structures.
Now, the UI data items interact with an intermediate set of data, which
represents the "original" hotkey data, and the "changed" data. The
ultimate aim here is to allow UI elements to come and go, but the
hotkeys that are "in-edit" are preserved.
This also allows us to abstract some bookkeeping complexity
out of the WIDGET_HOTKEY_LIST class into a separate non-GUI
class.
Also fixes a bug where nets wouldn't get changed because the
pads weren't changed and so the pad nets would propagate and
wipe out the changed nets on the tracks.
Also includes warning dialogs that pad nets will be changed if the
track nets are.
Fixes: lp:1779854
* https://bugs.launchpad.net/kicad/+bug/1779854
Don't beep when inserting character from focused grid cell (but
before editor is opened).
Handle reference validation separately from name validation and
separately from user field value validation. The old way of setting
the fieldId on the validator wasn't working because the validator
gets copied.
Run validation when leaving cell. Don't just check for empty
(particularly for fields that CAN be empty).
Fixes: lp:1782917
* https://bugs.launchpad.net/kicad/+bug/1782917
(cherry picked from commit 79e04de)
... and GetMsgPanelInfo.
Step 4 in the g_UserUnit eradication effort.
Also removes a couple of conversion routines that were close
enough to extinction.
(cherry picked from commit c75da51)
Work around wxWidgets failure to send first key through validator.
Unify treatment of INDETERMINATE values (such as for multiple
selections with mixed values).
(cherry picked from commit 7308729)
The general idea is to support user-units inheritance. The
UNIT_BINDER allows wrapped controls to inherit units from their
parent dialog, while KEYWAY_HOLDER and DIALOG_SHIM allow child
KEYWAY_HOLDERs or DIALOG_SHIMs to inherit units from their
parent.
The GetUserUnits() method signature has to move to KEYWAY_HOLDER
rather than KEYWAY_PLAYER (where it makes more sense) as it’s the
only common ancestor of KEYWAY_PLAYER and DIALOG_SHIM.
As long as we'll be using the UNIT_BINDER more widely, it also
makes sense to move evaluation and validation into it.
This commit also provides eeschema’s DIALOG_LABEL_EDITOR and
pcbnew’s DIALOG_TRACK_VIA_PROPERTIES and DIALOG_SET_GRID as
models of how to use the new user-units inheritance, eval, and
validation.
Fixes: lp:593795
* https://bugs.launchpad.net/kicad/+bug/593795
(cherry picked from commit c8bc53e)
There are a bunch of problems with event processing and closing
documents, etc., when enabled. See the bug report for more
info.
Fixes: lp:1774777
* https://bugs.launchpad.net/kicad/+bug/1774777
Also removes parallel implementation in favour of using the
normal one (with a new wxGauge-backed PROGRESS_REPORTER).
Fixes: lp:1764196
* https://bugs.launchpad.net/kicad/+bug/1764196
Also update the rest of the symbol-chooser usage to current
specs, including examining the timestamp to see if the list
needs loading at all.
Partial fix to: lp:1760936
* https://bugs.launchpad.net/kicad/+bug/1760936