TextBox Selection- and CaretBrush
I'm trying to change the Selection- and CaretBrush of a TextBox. Setting the properties works fine in WPF and Noesis 1.2. However, when using Unity 2017.1.1f1 and Noesis 2.1.0b4 it doesn't, any thoughts?
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: TextBox Selection- and CaretBrush
I found a bug in the ShowSoftwareKeyboardCallback definition (NoesisGUI.cs) that made caret hidden by default.
The fix is just changing the return type of that callback to bool type: (Assets/NoesisGUI/Plugins/API/Core/NoesisGUI.cs line 152)
After that change, are you being able to correctly see the caret and change Selection and Caret Brushes?
The fix is just changing the return type of that callback to bool type: (Assets/NoesisGUI/Plugins/API/Core/NoesisGUI.cs line 152)
Code: Select all
delegate bool ShowSoftwareKeyboardCallback(IntPtr focusedElement);
private static ShowSoftwareKeyboardCallback _showSoftwareKeyboard = ShowSoftwareKeyboard;
[MonoPInvokeCallback(typeof(ShowSoftwareKeyboardCallback))]
private static bool ShowSoftwareKeyboard(IntPtr focusedElement)
{
try
{
if (_initialized)
{
UIElement element = Extend.GetProxy(focusedElement, false) as UIElement;
return _softwareKeyboard.Show(element);
}
}
catch (Exception e)
{
Noesis.Error.SetNativePendingError(e);
}
return false;
}
Re: TextBox Selection- and CaretBrush
I found a bug in the ShowSoftwareKeyboardCallback definition (NoesisGUI.cs) that made caret hidden by default.
The fix is just changing the return type of that callback to bool type: (Assets/NoesisGUI/Plugins/API/Core/NoesisGUI.cs line 152)After that change, are you being able to correctly see the caret and change Selection and Caret Brushes?Code: Select alldelegate bool ShowSoftwareKeyboardCallback(IntPtr focusedElement); private static ShowSoftwareKeyboardCallback _showSoftwareKeyboard = ShowSoftwareKeyboard; [MonoPInvokeCallback(typeof(ShowSoftwareKeyboardCallback))] private static bool ShowSoftwareKeyboard(IntPtr focusedElement) { try { if (_initialized) { UIElement element = Extend.GetProxy(focusedElement, false) as UIElement; return _softwareKeyboard.Show(element); } } catch (Exception e) { Noesis.Error.SetNativePendingError(e); } return false; }
Yes, it works now, thanks!
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 97 guests