As of wxWidgets 3.2, the wxWidgets event handler runs code after the
the client event handler that depends on the menu still existing.
Because there are potentially many paths to call ReCreateMenuBar from
within a menu event handler, let's just wrap this action in a CallAfter
to make sure it happens after the wx handler call completes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13149
The paged book initialization (and others) can generate events,
re-laying out the whole dialog multiple times during initialization.
This halts events during the layout period
Fixes https://gitlab.com/kicad/code/kicad/issues/13158
The crash was caused by an unhandled exception. The uncaught exception
caused a cacophony of null configuration setting pointers so guards were
added to prevent crashes should other exceptions occur that do not get
handled correctly.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13046
dropping files to Kicad manager :
*.kicad_pro, *.pro -> open project;
gerber and job files -> open in Gerbview editor;
Eagle and Cadstar files -> open project.
dropping file to schematic editor -> append schematic;
dropping library file to Symbol editor -> add library;
dropping board file to PCB editor -> append board;
dropping library or footprint file to Footprint editor -> add library or import footprint;
dropping ZIP file or gerber files to Gerbview editor -> open files;
dropping sheet file to Drawing Sheet editor -> open sheet.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11638
Processing a menu event for quitting results in the frame being
destroyed. This crashes the program when it tries to access the newly
freed frame to check for autosave data. We bind the closing flag into
the base program which will be the last item freed on exit to ensure we
can correctly check for data loss
Fixes https://gitlab.com/kicad/code/kicad/issues/8638
For some reason this does not affect the KiCad frame manager window so it
is an exception to prevent it from becoming an ever growing window height
issue.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8889
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
For some reason once a player is opened from the Kicad Manager window
all the items under the help menu get grayed out. This prevents that
from happening.
- Remove outdated y-offset that prevented restoring full-height
(client area returned by wx is correct these days)
- Clamp frame geometry to fit new display when display is changed
- Handle when an automatic window reposition causes a DPI change
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8341
This prevents restoring perfectly-valid screen locations, and
I'm not sure what problem it is trying to solve (it's already
disabled on Windows, and this is confirmed to mess up restoring
locations on Mac/Linux).
If this was actually fixing a problem, the fix needs to be more
targeted, but since I don't know what the problem was, I'm just
going to take it out for now and wait for a potential problem
to pop up again.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8595
* Remove unused wxLogDebug calls.
* Add add application level character tracing to detect unhandled key
events.
* Catch unhandled exceptions in KiCad main event loop like single top
applications.
Windows doesnt need an ambiguous "screen border region" defined in percent, it's an absolute area given in pixels
Also we need to check the top corner y value to the ClientArea returned from the wxDisplay, in the situation the task bar is on top.
Fix#7850
Action plugin authors can specify alternative icon path for dark theme.
If it's not specified then standard icon will be used for both light and
dark themes. If neither icon is specified then the default puzzle piece
icon is used.
Fixes#7984
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.
This function is introduced in wxWidgets 3.1.5 and allows you to
query the event with if it should be checked or not instead of
having to figure it out based on the item type.
windowClosing() calls Destroy() when the wxCloseEvent has no veto.
This is fine for usual EDA_BASE_FRAME frames, but not for frames shown in modal mode.
In modal mode, windowClosing() should not call Destroy(), because the calling frame
expects the instance not deleted after closing.
(the caller has to call Destroy() only once the frame can be actually deleted)