Split the autocorrect disabling stuff on Mac OS X into its own function and marked the TextArea TODO as a future plan.
This commit is contained in:
parent
57cdc83280
commit
4bede4aa8d
|
@ -0,0 +1,16 @@
|
||||||
|
// 11 august 2014
|
||||||
|
|
||||||
|
#include "objc_darwin.h"
|
||||||
|
#include <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
void disableAutocorrect(id onwhat)
|
||||||
|
{
|
||||||
|
NSTextView *tv;
|
||||||
|
|
||||||
|
tv = (NSTextView *) onwhat;
|
||||||
|
[tv setEnabledTextCheckingTypes:0];
|
||||||
|
[tv setAutomaticDashSubstitutionEnabled:NO];
|
||||||
|
// don't worry about automatic data detection; it won't change stringValue (thanks pretty_function in irc.freenode.net/#macdev)
|
||||||
|
[tv setAutomaticSpellingCorrectionEnabled:NO];
|
||||||
|
[tv setAutomaticTextReplacementEnabled:NO];
|
||||||
|
}
|
|
@ -21,6 +21,8 @@ Area
|
||||||
Repaint(rect image.Rectangle)
|
Repaint(rect image.Rectangle)
|
||||||
Tree
|
Tree
|
||||||
Mac OS X: make sure newScrollView() has the correct parameters for Table and Tree (and that Area has the appropriate ones from both + its own no border)
|
Mac OS X: make sure newScrollView() has the correct parameters for Table and Tree (and that Area has the appropriate ones from both + its own no border)
|
||||||
|
TextArea
|
||||||
|
Mac OS X: be sure to call disableAutocorrect()
|
||||||
|
|
||||||
so I don't forget, some TODOs:
|
so I don't forget, some TODOs:
|
||||||
windows
|
windows
|
||||||
|
|
|
@ -110,4 +110,7 @@ extern uintptr_t pressedMouseButtons(void);
|
||||||
extern uintptr_t keyCode(id);
|
extern uintptr_t keyCode(id);
|
||||||
extern void areaRepaintAll(id);
|
extern void areaRepaintAll(id);
|
||||||
|
|
||||||
|
/* common_darwin.m */
|
||||||
|
extern void disableAutocorrect(id);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -47,13 +47,7 @@ id newWindow(intptr_t width, intptr_t height)
|
||||||
// so we have to turn them off here
|
// so we have to turn them off here
|
||||||
// thanks akempgen in irc.freenode.net/#macdev
|
// thanks akempgen in irc.freenode.net/#macdev
|
||||||
// for some reason, this selector returns NSText but is documented to return NSTextView...
|
// for some reason, this selector returns NSText but is documented to return NSTextView...
|
||||||
// TODO isolate into its own function when (if?) we add TextArea
|
disableAutocorrect((id) [w fieldEditor:YES forObject:nil]);
|
||||||
tv = (NSTextView *) [w fieldEditor:YES forObject:nil];
|
|
||||||
[tv setEnabledTextCheckingTypes:0];
|
|
||||||
[tv setAutomaticDashSubstitutionEnabled:NO];
|
|
||||||
// don't worry about automatic data detection; it won't change stringValue (thanks pretty_function in irc.freenode.net/#macdev)
|
|
||||||
[tv setAutomaticSpellingCorrectionEnabled:NO];
|
|
||||||
[tv setAutomaticTextReplacementEnabled:NO];
|
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue