ui::SpellCheckOptions¶
Header: winui/ui/WindowOptions.hpp.
TextBox spell checking for one window. Read once, when the OS window is created. The user's own system settings (language, "Highlight misspelled words", "Autocorrect misspelled words") are still followed live.
Example:
int main()
{
ui::Window window{{.title = "Notes"}};
window.options().spell_check.autocorrections = {{"libwnui", "libwinui"}, {"widgit", "widget"}};
return ui::run(window);
}
| Field | Type | Default | |
|---|---|---|---|
enabled |
bool |
true |
False turns the spell checker off: no squiggles, no autocorrect and no spelling entries in the right-click menu, which still offers Cut, Copy and Paste. A single field opts out with TextBoxControl::set_spell_check(false) or ui::TextBox. |
builtin_autocorrections |
bool |
true |
A small built-in table of common English typos (teh → the, ...). |
autocorrections |
std::vector<std::pair<std::string, std::string>> |
The app's own corrections (from → to), on top of the built-in table. See SpellChecker::add_autocorrection(). |