Commit Graph

92 Commits

Author SHA1 Message Date
Seth Hillbrand 548e5f49bd Clean up unused variable usage
Unused variables in function calls can be commented out.  Unused
return variables get a new routine `ignore_unused()` that silences the
warnings with zero overhead.
2021-10-05 10:00:30 -07:00
Jeff Young 3a5d49f7b2 Make select-all hack work with Scintilla too.
Fixes https://gitlab.com/kicad/code/kicad/issues/8876
2021-07-28 00:16:18 +01:00
jean-pierre charras 1aadf45947 DIALOG_SHIM: fix not working initial size when creating a dialog.
The first time a DIALOG_SHIM was created, with a given size, this size
was not taken in account. This this is now forced.
(when recreated during a session, this is the last dialog size that is used)
2021-07-24 18:59:28 +02:00
Jeff Young 8631d670a4 Don't selectall in GTK text boxes.
It's not clear that it's normal platform behaviour, and some GTK
window managers fail to non draw the selection in inactive text
boxes.

Fixes https://gitlab.com/kicad/code/kicad/issues/8197
2021-06-20 21:37:02 +01:00
Marek Roszko 564826feae Use wxRect in dialog_shim rather than eda_rect for purely gui logic 2021-06-03 21:11:08 -04:00
Marek Roszko 7faee5eda5 Stop salt the eart with wxhtml.h 2021-06-03 07:49:49 -04:00
Ian McInerney ecd9bf696e Be consistent about using nullptr instead of 0
0 can be too easily overloaded into an int, so ensure we use nullptr
when we mean pointers.
2021-04-22 22:20:34 +01:00
jean-pierre charras 5d2dc0b50e Fix a few (minor) issues:
- Make DIALOG_SHIM::SetPosition working)
- rename PCB_BASE_FRAME::SelectLayer() to PCB_BASE_FRAME::SelectOneLayer()
- PCB_BASE_FRAME::SelectOneLayer(): make dismiss dialog by escape key working.
Fixes #7578
https://gitlab.com/kicad/code/kicad/issues/7578
2021-02-17 20:56:43 +01:00
jean-pierre charras bf332b3189 Fix minor compil warnings 2021-01-07 20:55:24 +01:00
Jeff Young f372c8025b Better sizing for some conditional dialogs.
These dialogs don't have growable features but do have conditional
features, so the size is better adjusted automatically by the code
then by the user.
2021-01-07 01:27:12 +00:00
Jeff Young 3e6b658b92 Use stronger language when talking to wx. 2020-12-06 14:57:26 +00:00
Jeff Young fc2bdc49de Once more into the depths of hell... er, I mean fix a focus issue.
So the new steals-focus protection stuff works well when there's a
focused control, but not as well when there's a modal dialog up which
happens not to have a focused control (or worse, a focusable control).

This adds a second mechanism for also checking to see if a modal dialog
is up (something that wxWidgets, true to form, makes very difficult).

Fixes https://gitlab.com/kicad/code/kicad/issues/6520
2020-11-26 16:47:40 +00:00
Jeff Young 94de8ada97 Formatting and naming conventions. 2020-11-26 16:47:40 +00:00
Werni 0e44f5128c Add const specifiers 2020-11-18 19:50:36 +00:00
Jeff Young a207bd97bb Naming conventions. 2020-11-17 16:05:49 +00:00
Jeff Young 1aaa690eb5 Remove errant extra include. 2020-11-13 18:10:41 +00:00
Jeff Young bfe750f88a Temp hack for square looking buttons on OSX. 2020-11-13 17:55:54 +00:00
Marek Roszko 6fa8ebab85 Remove the auto centering of dialog_shims as a experiment
Windows handles default positions better such as remembering the last position if we don't start centering it unconditionally

Fix #6032
2020-10-18 12:34:24 -04:00
jean-pierre charras f6b4b66a86 Avoid include wx/wx.h in many files that do not actually use this include.
Including wx.h includes the full set of wxWidgets include files, that is not good,
and can create some conflicts with some Windows headers on msys2.
2020-10-18 18:21:34 +02:00
Wayne Stambaugh ede39780e2 Remove all debugging output that cannot be disabled.
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.
2020-08-18 10:17:36 -04:00
Simon Richter c407e96b14 std::min/std::max requires <algorithm> 2020-07-11 15:46:57 +02:00
Jeff Young 5ee806c3a3 The dispatch-behind & whitelist stuff got broken again, so I've
retired them in favour of a much dumber hack that special-cases
only ctrl-U for units switch.
2020-06-24 12:22:42 +01:00
Jeff Young 0ddf53397f Make sure CvPcb gets its Cancel button fixed up.
It's no longer a DIALOG_SHIM so it can't depend on its fixup.

Fixes https://gitlab.com/kicad/code/kicad/issues/4611
2020-06-04 22:35:01 +01:00
Ian McInerney a843c74529 Add new kiplatform library for platform-specific code
* Implement ReparentQuasiModal for OSX natively
* Implement ForceFocus of OSX natively

This change means we no longer rely on the kicad-specific functions in our osx wx fork.
2020-06-03 14:58:54 +00:00
Jeff Young bdf9491682 Re-factor the event whitelist stuff so that it doesn't promise what it can't deliver. 2020-05-03 20:56:32 +01:00
Jeff Young a3486b7cd4 Fix ESC handling with whitelist. 2020-05-03 20:56:32 +01:00
jean-pierre charras da05b43a9f DIALOG_SHIM: fix incorrect escape key handling.
Fixes #4304
https://gitlab.com/kicad/code/kicad/issues/4304
2020-05-03 12:52:27 +02:00
Jeff Young 73eda91ec7 Allow some events to run behind a modal dialog.
Right now this is just unit switching.

Fixes https://gitlab.com/kicad/code/kicad/issues/2344
2020-05-02 14:37:24 +01:00
Ian McInerney e2853862e5 Cleanup redundant type casting 2020-01-13 14:00:45 +00:00
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Wayne Stambaugh 54f066fed7 Implement simple inheritance for library symbols.
This change completely removes the LIB_ALIAS design pattern an replaces
it by allowing LIB_PART objects to inherit from other LIB_PART objects.
The initial implementation only allows for single inheritance and only
supports the mandatory fields in the derived part because that is all
that the current symbol library file format will support.  Once the new
file format is implemented and saving to the old file format is deprecated,
more complex inheritance will be added.  The LIB_ALIAS information saved
in the document files was move into the LIB_PART object.  This change
impacts virtually every part of the schematic and symbol library editor
code so this commit message is woefully incomplete.

REMOVE: Removed the symbol aliases concept from the schematic and symbol
editors and the symbol viewer.

NEW: Replace the symbol alias concept with simple inheritance that allows
a library symbol to be derived from another library symbol.
2019-12-06 11:33:52 -05:00
Jeff Young 14c4175040 Tighten up the board setup dialog layout a bit. 2019-09-07 13:57:38 +01:00
Seth Hillbrand 37b3c698c8 fixing comparison warning 2019-09-06 13:17:06 -07:00
Seth Hillbrand ccc3b812b8 Make dialogs look more like frames
We use DIALOG_SHIM to display many items that should behave more like
frames with the ability to min/max/resize.  This changes the default
custom dialog behavior to the frame-type.

Fixes: lp:1829950
* https://bugs.launchpad.net/kicad/+bug/1829950
2019-08-30 09:24:50 -07:00
Jeff Young f21467e340 Support tabbing to non-text controls on non-Mac platforms.
Fixes: lp:1840991
* https://bugs.launchpad.net/kicad/+bug/1840991
2019-08-23 22:14:37 +01:00
Jeff Young c85d1fa00c Try out our own tabbing logic.
Fixes: lp:1840991
* https://bugs.launchpad.net/kicad/+bug/1840991
2019-08-22 21:18:24 +01:00
Jeff Young a33d67f6b4 Push shift/cmd+<enter> processing down into dialog shim.
This will make them more uniform rather than only supported when
something else is using <enter>.

Fixes: lp:1838353
* https://bugs.launchpad.net/kicad/+bug/1838353
2019-08-13 16:53:40 +01:00
Jeff Young 485d436860 Clear ctx-menu before rebuilding; don't veto ctx-menu mousewarp for non-ctx-menu dialog.
Fixes: lp:1833312
* https://bugs.launchpad.net/kicad/+bug/1833312
2019-06-19 21:17:56 +01:00
Jeff Young 6025256e07 Push KIWAY_HOLDER down a level so we can move a bunch of stuff that doesn't belong there out. 2019-06-10 23:46:00 +01:00
Jeff Young adf3637476 Allow dialogs to veto mouse-warping when called from context menu.
Fixes: lp:1745731
* https://bugs.launchpad.net/kicad/+bug/1745731
2019-04-08 20:07:40 +01:00
Jeff Young 0fb956cdbe Apply OSX select-all-when-tabbing fix to other platforms.
Fixes: lp:1822890
* https://bugs.launchpad.net/kicad/+bug/1822890
2019-04-03 22:15:02 +01:00
jean-pierre charras 5ebec518d0 DIALOG_SHIM: disable a debug trace (a printf in debug build), now not very useful.
(It can be re-enabled easily)
2019-04-02 11:54:29 +02:00
jean-pierre charras 23086deccd Pcbnew fix: chamfered corners settings not copied with copy/paste pad properties
Fixes: lp:1819595
https://bugs.launchpad.net/kicad/+bug/1819595
2019-03-12 11:28:07 +01:00
Seth Hillbrand 307a7154b6 DIALOG_SHIM: Enable Cancel button when editing
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
2019-02-28 18:52:35 -08:00
Baranovskiy Konstantin 65f5bd6a01 Dialog: Esc key closes a grid editor first.
CHANGED: By default dialog closes on Esc key immediately and if dialog
has a grid control there is no way to close a cell editor with canceling
changes. New behavior is next: if dialog has a grid and the grid has an
active cell editor Esc key closes cell editor, otherwise Esc key closes
the dialog.
2019-01-19 14:55:15 -05:00
Jeff Young 98849bde96 Generalize OSX &Cancel fix to work for other languages.
Fixes: lp:1784350
* https://bugs.launchpad.net/kicad/+bug/1784350
2018-08-01 10:56:45 +01:00
Jeff Young c1df78d531 Finish project frame library table editing.
Fixes: lp:1782761
* https://bugs.launchpad.net/kicad/+bug/1782761
2018-07-20 18:48:06 +01:00
Jeff Young da35b16392 Allow dialogs to have no parent.
Fixes: lp:1782661
* https://bugs.launchpad.net/kicad/+bug/1782661
2018-07-20 00:07:07 +01:00
Jeff Young 7841f8a466 Unified preferences dialog framework.
(cherry picked from commit 8ee3e77)
2018-07-17 15:11:17 +01:00
Jeff Young 8f0aa68ab8 Fold 3D Search Paths dialog into Configure Paths.
Use in-place editing for both.

Fixes: lp:1743823
* https://bugs.launchpad.net/kicad/+bug/1743823

(cherry picked from commit 33622cd)
2018-07-17 15:11:01 +01:00