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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user