15
15
using TextStyle = Unity . UIWidgets . painting . TextStyle ;
16
16
17
17
namespace UIWidgets . Tests {
18
- public class RenderEditable : EditorWindow {
18
+ public class RenderEditable : EditorWindow , TextSelectionDelegate {
19
19
readonly Func < RenderBox > [ ] _options ;
20
20
21
21
readonly string [ ] _optionStrings ;
@@ -150,7 +150,8 @@ RenderBox textEditable() {
150
150
new _FixedViewportOffset ( 0.0f ) , new ValueNotifier < bool > ( true ) ,
151
151
onSelectionChanged : this . selectionChanged , cursorColor : Color . fromARGB ( 255 , 0 , 0 , 0 ) ,
152
152
maxLines : 100 ,
153
- selectionColor : Color . fromARGB ( 255 , 255 , 0 , 0 ) )
153
+ selectionColor : Color . fromARGB ( 255 , 255 , 0 , 0 ) ,
154
+ textSelectionDelegate : this )
154
155
) ) ;
155
156
156
157
span = new TextSpan ( "" , children :
@@ -164,7 +165,8 @@ RenderBox textEditable() {
164
165
new _FixedViewportOffset ( 0.0f ) , new ValueNotifier < bool > ( true ) ,
165
166
onSelectionChanged : this . selectionChanged , cursorColor : Color . fromARGB ( 255 , 0 , 0 , 0 ) ,
166
167
maxLines : 100 ,
167
- selectionColor : Color . fromARGB ( 255 , 255 , 0 , 0 ) )
168
+ selectionColor : Color . fromARGB ( 255 , 255 , 0 , 0 ) ,
169
+ textSelectionDelegate : this )
168
170
) ) ;
169
171
170
172
span = new TextSpan ( "" , children :
@@ -175,7 +177,8 @@ RenderBox textEditable() {
175
177
new Unity . UIWidgets . rendering . RenderEditable ( span , TextDirection . ltr ,
176
178
new _FixedViewportOffset ( 0.0f ) , new ValueNotifier < bool > ( true ) ,
177
179
onSelectionChanged : this . selectionChanged , cursorColor : Color . fromARGB ( 255 , 0 , 0 , 0 ) ,
178
- selectionColor : Color . fromARGB ( 255 , 255 , 0 , 0 ) )
180
+ selectionColor : Color . fromARGB ( 255 , 255 , 0 , 0 ) ,
181
+ textSelectionDelegate : this )
179
182
, width : 300 ) ) ;
180
183
return flexbox ;
181
184
}
@@ -186,5 +189,13 @@ void selectionChanged(TextSelection selection, Unity.UIWidgets.rendering.RenderE
186
189
Debug . Log ( $ "selection { selection } ") ;
187
190
renderObject . selection = selection ;
188
191
}
192
+
193
+ public TextEditingValue textEditingValue { get ; set ; }
194
+
195
+ public void hideToolbar ( ) {
196
+ }
197
+
198
+ public void bringIntoView ( TextPosition textPosition ) {
199
+ }
189
200
}
190
201
}
0 commit comments