Don't assume the dialog is mode-less and call Destroy() from within a
dialog method. This will most assuredly crash if the dialog is shown
modally or quasi-modally.
Don't leak memory for mode-less dialogs created on the stack. Make sure
when the parent frame window is closed that all mode-less dialog memory
is cleaned up. Dialogs are not child windows like controls and toolbars
so their memory does not automatically get cleaned up when the parent
window is destroyed.
Do not directly access frame parent window's pointer in dialog destructors.
Apparently the tear down order when destroying mode-less dialogs is not
guaranteed so the parent window may get deleted before the dialog causing
a crash when accessing the parent window pointer from the dialog dtor.
Do not close mode-less dialogs in the parent frame's destructor. This
doesn't guarantee that the dialog(s) will be destroyed before the parent
but it may reduce some careless mode-less dialog event handling in the
future.
Moves forced-transparency setting down into VIEW_ITEM so that it can
be used to place forced-transparent objects in a different target.
This keeps EnableDepthTest() from equalizing the alpha values between
the two symbols (or two footprints).
The wxComboBox drops nicely from the top of the screen, showing the full
element list, opposed to the choice widget that centers the selection
and places the list off the top of the screen if there are many
elements. This was broke for MacOS until wx3.2
Fixes https://gitlab.com/kicad/code/kicad/issues/1866
- Avoid repetition and errors from typos
- Allow simple changes
- Simpler data type handling, the constants are wxString
(Cherry-picked from f135881bd6 in 7.0)
Old PLOTTER::Text is not (yet) removed, but it use negative text size
to mirrored text, which is not really compatible with some plotters (especially PDF).
Using TEXT_ATTRIBUTES is much easy and much better,
so PLOTTER::PlotText() is added.
Note: "old" PLOTTER::Text() is not removed yet.
The overbar function in outline fonts recursively calls the text
function which already owns the lock. To avoid this, we have an
unlocked variant that is wrapped by the exposed text function
Fixes https://gitlab.com/kicad/code/kicad/issues/14015
This is needed so Python scripts can get built-in colors using the
SETTINGS_MANAGER.GetColorSettings() member.
Otherwise calling it with a built-in name crashes.
(cherry picked from commit aee6d9d01c)
Some classes had been originally designed to be usable separate from wx,
but over time our uses of the classes have become entertwined with wx
features (e.g. colors), and various changes have also leaked wx into the
classes unguarded. So just remove the option to hide wx in those classes
to simplify the code.
ttf fonts can declare multiple language names. Many by default opt to just declare one and not tag it any particular language.
However, there are CJK languages that typically leverage this function the most. They'll tag both a "en" and a cjk lang family name in CJK characters.
To be as user friendly as possible, we need to display said fonts in the CJK languages if KiCad to set to such a locale.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14011
This adds Reset() method to KIFACE to reload global libs stored in
global static vars.
Also refactors some lib reload code in various frames to have
common MAIL_RELOAD_LIB handler.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12500
sentry KICAD-B1
https://freetype.org/freetype2/docs/reference/ft2-base_interface.html
[Since 2.5.6] In multi-threaded applications it is easiest to use one FT_Library object per thread.
In case this is too cumbersome, a single FT_Library object across threads is possible also, as long as a mutex lock is used around FT_New_Face and FT_Done_Face.
Also fixes a bug so that voltages, currents and power dissipations are
only probed if the flag is set -- this keeps ngspice from throwing an
error if you probe something twice (for instance, if you have .probe
commands in text and turn off the auto-probing).
This makes it clearer that the overrides are not inverses of each
other -- one overrides the flashing state and the other overrides
the connection state (to other zones, not to everything).
Also fixes a bug where we were failing to check the force-no-connect
for pads.
If the font face doesn't include a Bold or Italic version, we still want
to display the font as bold/italic, so we fake it with freetype.
This also prevents recurring error messages where the outline font warns
about "substitutes" within the same font family.
Also allows variants on the weight descriptor to be used without
throwing a substitution warning
Fixes https://gitlab.com/kicad/code/kicad/issues/13654
Fixes#10926
Contains the following changes:
- Adds a new ERC_SCH_PIN_CONTEXT class which is used to provide deterministic
comparison between items causing ERC violations (e.g. pins) when associated
with a SCH_SHEET_PATH context.
- Adds association of SCH_SHEET_PATHs for ERC_ITEMs and the sub-schematic items
which caused an ERC violation. This allows correct display of markers on the
sheets of interest only, and allows correct naming resolution and cross-probing
from the ERC dialog.
- Adds a new ERC_TREE_MODEL class, derived from RC_TREE_MODEL, which correctly
resolves component references across heirarchical sheets using the associated
SCH_SHEET_PATHs. This allows sheet-specific component references to be displayed
correctly in the ERC results tree.
- Updates SCH_MARKER to only draw sheet-specific markers on the sheet causing
an ERC violation.
- Increments the schematic file version.
- When loading a schematic with legacy ERC exclusions, discards those of type
ERCE_PIN_TO_PIN_WARNING, ERCE_PIN_TO_PIN_ERROR, ERCE_HIERACHICAL_LABEL, and
ERCE_DIFFERENT_UNIT_NET as there is no safe way to automatically infer the
information which is now stored with these exclusions (sheet paths for error
location and related items). Requiring users to (once) re-add exclusions is
preferable to silently incorrectly matching new ERC issues to legacy exclusions.
If KiCad does not detect an environmental variable set for the old
library table variables AND the library table being opened references
the unset env var, we will dynamically update the env var to the new
value
Fixes https://gitlab.com/kicad/code/kicad/issues/13464
The pressure relief valve was not useful for common work patterns as it
forced the recalculation on many common actions such as bus expansion.
This caused it to actually feel slower than with the pressure relief
valve off.
For most schematics, realtime is now fast enough to not need the valve
and for those that are extremely complex, removing the valve helps this
run more predictably
EDA_ITEMs are responsible for giving their parent a crack at it if
they failed to resolve it. This recurses all the way up to the schematic/
board, and then to the project.
Cross-reference handling is also move to the EDA_ITEMs. It must be done
before bubbling up so that we don't end up in loops. (The aDepth parameter
will break the loop, but without having done anything useful.)
Fixes https://gitlab.com/kicad/code/kicad/issues/13541
In particular, record which children caused a parent footprint to be
added to the commit so we can determine if they have intersecting
bounding boxes and/or layers.
Fixes https://gitlab.com/kicad/code/kicad/issues/13512
We block events when a modal window is active. But detecting when the
modal window is closed is harder on GTK than just counting modal closes
because the modal flag can sometimes be unset before the wxEVT_SHOW
event fires. Instead, we track the stack of modal windows opened and
close the window and subsequent windows when the object pointer matches
Fixes https://gitlab.com/kicad/code/kicad/issues/13372
We shouldn't include the kicad_build_info.h outside of the wrapper
build_info.h. Also adds an error directive to prevent re-introduction
of define dependencies
Also improves some terminology for english-speakers.
Also substitues [] vector access (which creates empty elements) over
at() (which throws if the item is not found).
The disable grid hotkey should allow the snap scale to be completely
determined by the snapSize and world scale. This prevents snapRange
from overriding in the case where grid is disabled.
Additionally, we disallow grid snapping when the grid scale is not
visible. This means that when zoomed out sufficiently to not show the
minor ticks, these minor ticks will not override a snap
Fixes https://gitlab.com/kicad/code/kicad/issues/12303
The search field on the Symbol Editor is focused when its window
is first opened. Similar behavior has been implemented in the search
field of the Footprint Editor with this change.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13100
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
Check for already loaded schematics in the current sheet path as well
as the current project root sheet path to prevent multiple loads of
shared schematic. This bug was causing shared sheets to be loaded more
than once which caused instance data to get separated by each copy rather
than saved in one copy of the schematic which would result in all instance
data being lost except the last saved copy of the schematic. This bug has
been around forever and may be the cause of some unexplained schematic
instance data corruption issues. This bug does not apply when opening
the full project.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11076
Some of these are due to moving to wxWidgets 3.2, but I'm not sure
all of them are. In particular, the need for CallAfter() in the
search pane's selection handler is probably just a wxWidgets bug on
Mac (the control lies about the current selection inside the event
handler).
Also sets better column widths in the search pane.