Don't change wxTextCtrl colour automatically under macOS

When wxColourDialog is shown, any changes to the colour selected in it
apparently result in broadcast messages to all currently visible text
controls, which was unexpected.

Block the changeColor: message to prevent this from happening.

Closes https://github.com/wxWidgets/wxWidgets/pull/830
This commit is contained in:
mrX
2018-06-10 23:33:10 +02:00
committed by Vadim Zeitlin
parent 175756506c
commit 89ecd81460
2 changed files with 10 additions and 0 deletions

View File

@@ -379,6 +379,7 @@ public:
}
- (void)textDidChange:(NSNotification *)aNotification;
- (void)changeColor:(id)sender;
@end

View File

@@ -436,6 +436,15 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil;
impl->controlTextDidChange();
}
- (void)changeColor:(id)sender
{
// Define this just to block the color change messages - these are sent from
// the shared color/font panel resulting in unwanted changes of color when
// shared color panel is used (as when using wxColourPickerCtrl for example).
}
- (void) setEnabled:(BOOL) flag
{
// from Technical Q&A QA1461