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.
It's time to fix the focus issues. This adds a new SetInitialFocus()
routine to DIALOG_SHIM which will need to be called from a lot of
dialogs.
(cherry picked from commit 6d9647a)
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)
- Add helper methods for DPI-independent sizes
- Make splitter sashes visible on macOS
- Remove SetSizeInChars() - wx has a built-in way that I missed
- DIALOG_CHOOSE_COMPONENT: DPI-indep splitter sizes
- DIALOG_RESCUE_EACH: DPI-indep default size and sensible HTML window
size
- COMPONENT_TREE: DPI-indep sizing
- DIALOG_FP_LIB_TABLE, DIALOG_SYMBOL_LIB_TABLE
Move the OSX dialog fix ups later so they come after some wxWindow
deferred processing.
Also provides a facility for doing a selectAll in each text field
so that tabbing between text fields behaves correctly.
Fixes: lp:1599157
* https://bugs.launchpad.net/kicad/+bug/1599157
Setfocus now works on macos dialogs by setting DLGSHIM_USE_SETFOCUS.
This option is only enabled __WXMAC__ is defined.
FixOSXCancelButtonIssue() is now called inside DIALOG_SHIM::SHOW.
All other calls from within the dialogs were removed.
It is especially true in some Window Managers like KDE, but can be true in any WM, when initializations are made by TransferDataToWindow() method, called by the default wxInitDialogEvent handler.
* Add event handler to check all button clicks for default command event
IDs and handle them appropriately by either calling EndQuasiModal() or
passing the event up the event handler chain to allow the default dialog
handlers to perform their magic.
* Add event handler to handle the close window event properly.
* Add scope brackets so the wxBusyCursor will stop being displayed when
the footprint library loading is complete in CvPcb.
*) KIWAY_PLAYER::IsModal() is now a retained state, controlled by SetModal()
*) Fully re-work the KIWAY_PLAYER::ShowModal() to use a nested event loop.
*) Add support to DIALOG_SHIM for a "quasi-modal" dialog presentation and mode.
See top of dialog_shim.cpp about that for benefits and need.
*) You can now pick footprint from the schematic component field dialog, although
if you do this before you open the BOARD, you will only get the global footprint
libraries, not also the project specific ones. Opening the BOARD first avoids this
problem.
This is the first example of cross KIFACE invocation, it is also the first
instance of using a TOP_FRAME other than FRAME_PCB as the first thing. It works,
but it's missing support for opening the project specific table because
historically the FRAME_PCB did that. This is now starting to expose all the near
term needs for KIWAY_PLAYER <-> PROJECT interaction, independence and out of
sequence usage.
A fix for this will be coming in a few days.
However it mostly starts to show why the KIWAY is terribly useful and important.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
columns. DIALOG_SHIM would resize each separate usage to the same
size. DIALOG_SHIM now supports and alternate m_hash_key in lieu
of the class name, optionally.
This works, but in my version of wxformbuilder there is a bug which does not properly show the
subclass property, even though it is still in play. This happens after saving then loading the *.fbp file.
So it is a nuisance bug, but does not affect functionality.