Pcbnew: allow tab traversal of footprint orientation text control

Disable the text update event for the orientation cutom value field before
updating it when the radio buttons are selected. This allows to use the
conventional EVT_TEXT handler, rather than KEYDOWN, which has two effects:

* Tabbing though the dialog no longer sets custom orientation
* Click-driven clipboard actions trigger the update correctly.

Introduce a helper function in validators.h to assist in updating
validated fields without triggering further events.

Fixes: lp:1819006
* https://bugs.launchpad.net/kicad/+bug/1819006
This commit is contained in:
John Beard
2019-03-07 20:27:04 +00:00
parent 4574349539
commit b6916c490c
7 changed files with 50 additions and 8 deletions
+19
View File
@@ -112,4 +112,23 @@ public:
void OnTextChanged( wxCommandEvent& event );
};
namespace KIUI
{
/**
* Call a text validator's TransferToWindow method without firing
* a text change event.
*
* This is useful when you want to keep a validator in sync with other data,
* but the act of changing it should not trigger other updates. It is the
* validator equivalent of ChangeValue() compared to SetValue().
*
* This function blocks all events, but the same technique can be used to
* selectively block events.
*
* @param aValidator the validator to update the control of
*/
void ValidatorTransferToWindowWithoutEvents( wxValidator& aValidator );
} // namespace KIUI
#endif // #ifndef VALIDATORS_H