view.monkey2 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928
  1. Namespace mojo.app
  2. #rem monkeydoc The View class.
  3. #end
  4. Class View
  5. #rem monkeydoc Invoked when a view becomes visble and active.
  6. #end
  7. Field Activated:Void()
  8. #rem monkeydoc Invoked when a view is no longer visble or active.
  9. #end
  10. Field Deactivated:Void()
  11. Method New()
  12. If Not _themeSeq
  13. _themeSeq=1
  14. App.ThemeChanged+=Lambda()
  15. _themeSeq+=1
  16. If _themeSeq=$40000000 _themeSeq=1
  17. End
  18. Endif
  19. _style=New Style( App.Theme.DefaultStyle )
  20. _styleSeq=_themeSeq
  21. InvalidateStyle()
  22. End
  23. #rem monkeydoc View visibility state.
  24. #end
  25. Property Visible:Bool()
  26. Return _visible
  27. Setter( visible:Bool )
  28. If visible=_visible Return
  29. _visible=visible
  30. RequestRender()
  31. UpdateActive()
  32. End
  33. #rem monkeydoc View enabled state.
  34. #end
  35. Property Enabled:Bool()
  36. Return _enabled And (Not _parent Or _parent.Enabled)
  37. Setter( enabled:Bool )
  38. If enabled=_enabled Return
  39. _enabled=enabled
  40. InvalidateStyle()
  41. UpdateActive()
  42. End
  43. #rem monkeydoc View active state.
  44. A view is active it is visible, enabled, attached to a window and all its parents are also active.
  45. Events are only sent to active windows.
  46. #end
  47. Property Active:Bool()
  48. Return _active
  49. End
  50. #rem monkeydoc Whether the view accepts key events.
  51. #end
  52. Property AcceptsKeyEvents:Bool()
  53. Return _acceptsKeyEvents
  54. Setter( acceptsKeyEvents:Bool )
  55. _acceptsKeyEvents=acceptsKeyEvents
  56. End
  57. #rem monkeydoc Whether the view accepts mouse events.
  58. #end
  59. Property AcceptsMouseEvents:Bool()
  60. Return _acceptsMouseEvents
  61. Setter( acceptsMouseEvents:Bool )
  62. _acceptsMouseEvents=acceptsMouseEvents
  63. End
  64. #rem monkeydoc View style.
  65. #end
  66. Property Style:Style()
  67. Return _style
  68. Setter( style:Style )
  69. If style=_style Return
  70. _style=style
  71. InvalidateStyle()
  72. End
  73. #rem monkeydoc View style state.
  74. #end
  75. Property StyleState:String()
  76. Return _styleState
  77. Setter( styleState:String )
  78. If styleState=_styleState Return
  79. _styleState=styleState
  80. InvalidateStyle()
  81. End
  82. #rem monkeydoc View render style.
  83. This is the style used to render the view, and is dependant on [[Style]] and [[StyleState]].
  84. #end
  85. Property RenderStyle:Style()
  86. ValidateStyle()
  87. Return _rstyle
  88. End
  89. #rem monkeydoc Layout mode.
  90. The following layout modes are supported
  91. | Layout mode | Description
  92. |:------------------|:-----------
  93. | "fill" | View is resized to fit its layout frame.
  94. | "float" | View floats within its layout frame according to the view [[Gravity]].
  95. | "fill-x" | View is resized on the x axis and floats on the y axis.
  96. | "fill-y" | View is resized on the y axis and floats on the x axs.
  97. | "stretch" | View is stretched non-uniformly to fit its layout frame.
  98. | "letterbox" | View is uniformly stretched on both axii and centered within its layout frame.
  99. | "letterbox-int" | View is uniformly stretched on both axii and centered within its layout frame. Scale factors are integrized.
  100. #end
  101. Property Layout:String()
  102. Return _layout
  103. Setter( layout:String )
  104. If layout=_layout Return
  105. _layout=layout
  106. End
  107. #rem monkeydoc View frame rect.
  108. The 'frame' the view is contained in.
  109. Note that the frame rect is in parent space coordinates, and is usually set by the parent view when layout occurs.
  110. #end
  111. Property Frame:Recti()
  112. Return _frame
  113. Setter( frame:Recti )
  114. _frame=frame
  115. End
  116. #rem monkeydoc Gravity for floating views.
  117. #end
  118. Property Gravity:Vec2f()
  119. Return _gravity
  120. Setter( gravity:Vec2f )
  121. If gravity=_gravity Return
  122. _gravity=gravity
  123. End
  124. #rem monkeydoc @hidden
  125. #end
  126. Property Offset:Vec2i()
  127. Return _offset
  128. Setter( offset:Vec2i )
  129. If offset=_offset Return
  130. _offset=offset
  131. End
  132. #rem monkeydoc Minimum view size.
  133. #end
  134. Property MinSize:Vec2i()
  135. Return _minSize
  136. Setter( minSize:Vec2i )
  137. _minSize=minSize
  138. End
  139. #rem monkeydoc Maximum view size.
  140. #end
  141. Property MaxSize:Vec2i()
  142. Return _maxSize
  143. Setter( maxSize:Vec2i )
  144. _maxSize=maxSize
  145. End
  146. #rem monkeydoc View content rect.
  147. The content rect represents the rendering area of the view.
  148. The content rect is in view local coordinates and its origin is always (0,0).
  149. #end
  150. Property Rect:Recti()
  151. Return _rect
  152. End
  153. #rem monkeydoc Width of the view content rect.
  154. #end
  155. Property Width:Int()
  156. Return _rect.Width
  157. End
  158. #rem monkeydoc Height of the view content rect.
  159. #end
  160. Property Height:Int()
  161. Return _rect.Height
  162. End
  163. #rem monkeydoc @hidden
  164. #end
  165. Property Bounds:Recti()
  166. Return _bounds
  167. End
  168. #rem monkeydoc Mouse location relative to the view.
  169. #end
  170. Property MouseLocation:Vec2i()
  171. Return TransformPointFromView( App.MouseLocation,Null )
  172. End
  173. #rem monkeydoc View clip rect.
  174. The clip rect represents the part of the content rect NOT obscured by an parent views.
  175. The clip rect is in view local coordinates.
  176. #end
  177. Property ClipRect:Recti()
  178. Return _clip
  179. End
  180. #rem monkeydoc @hidden
  181. #end
  182. Property RenderRect:Recti()
  183. Return _rclip
  184. End
  185. #rem monkeydoc @hidden
  186. #end
  187. Property RenderBounds:Recti()
  188. Return _rbounds
  189. End
  190. #rem monkeydoc @hidden
  191. #end
  192. Property LocalMatrix:AffineMat3f()
  193. Return _matrix
  194. End
  195. #rem monkeydoc @hidden
  196. #end
  197. Property RenderMatrix:AffineMat3f()
  198. Return _rmatrix
  199. End
  200. #rem monkeydoc The parent view of this view.
  201. #end
  202. Property Parent:View()
  203. Return _parent
  204. End
  205. #rem monkeydoc The Window this view is attached to, if any.
  206. #end
  207. Property Window:Window()
  208. Return _window
  209. End
  210. #rem monkeydoc Gets a style.
  211. This is a convenience method equivalent to App.Theme.GetStyle( name ).
  212. #end
  213. Method GetStyle:Style( name:String )
  214. Return App.Theme.GetStyle( name )
  215. End
  216. #rem monkeydoc Adds a child view to this view.
  217. AddChildView is normally used internally by 'layout' views. However you can also add a child view to any view directly by calling this method.
  218. If you use this method to add a child view to a view, it is your responsiblity to also manage the child view's frame using the [[Frame]] property.
  219. #end
  220. Method AddChildView( view:View )
  221. If Not view Return
  222. Assert( Not view._parent,"View already has a parent" )
  223. Assert( Not Cast<Window>( view ),"Windows cannot be child views" )
  224. view._parent=Self
  225. view.SetWindow( _window )
  226. _children.Add( view )
  227. RequestRender()
  228. view.UpdateActive()
  229. End
  230. #rem monkeydoc Removes a child view from this view.
  231. #end
  232. Method RemoveChildView( view:View )
  233. If Not view Return
  234. Assert( view._parent=Self,"View is not a child view" )
  235. view._parent=Null
  236. view.SetWindow( Null )
  237. _children.Remove( view )
  238. RequestRender()
  239. view.UpdateActive()
  240. End
  241. #rem monkeydoc @hidden
  242. #end
  243. Method FindViewAtWindowPoint:View( point:Vec2i )
  244. If Not _visible Return Null
  245. If Not _rbounds.Contains( point ) Return Null
  246. For Local i:=0 Until _children.Length
  247. Local child:=_children[_children.Length-i-1]
  248. Local view:=child.FindViewAtWindowPoint( point )
  249. If view Return view
  250. Next
  251. Return Self
  252. End
  253. #rem monkeydoc Transforms a point to another view.
  254. Transforms `point` in coordinates local to this view to coordinates local to `view`.
  255. @param point The point to transform.
  256. @param view View to transform point to.
  257. #end
  258. Method TransformPointToView:Vec2i( point:Vec2i,view:View )
  259. Local t:=_rmatrix * New Vec2f( point.x,point.y )
  260. If view t=-view._rmatrix * t
  261. Return New Vec2i( Round( t.x ),Round( t.y ) )
  262. End
  263. #rem monkeydoc Transforms a point from another view.
  264. Transforms `point` in coordinates local to 'view' to coordinates local to this view.
  265. @param point The point to transform.
  266. @param view View to transform point from.
  267. #end
  268. Method TransformPointFromView:Vec2i( point:Vec2i,view:View )
  269. Local t:=New Vec2f( point.x,point.y )
  270. If view t=view._matrix * t
  271. t=-_rmatrix * t
  272. Return New Vec2i( Round( t.x ),Round( t.y ) )
  273. End
  274. #rem monkeydoc Transforms a rect to another view.
  275. Transforms `rect` from coordinates local to this view to coordinates local to `view`.
  276. @param rect The rect to transform.
  277. @param view View to transform rect to.
  278. #end
  279. Method TransformRectToView:Recti( rect:Recti,view:View )
  280. Return New Recti( TransformPointToView( rect.min,view ),TransformPointToView( rect.max,view ) )
  281. End
  282. #rem monkeydoc Transforms a rect from another view.
  283. Transform `rect` from coordinates local to `view` to coordinates local to this view.
  284. @param rect The rect to transform.
  285. @param view The view to transform rect from.
  286. #end
  287. Method TransformRectFromView:Recti( rect:Recti,view:View )
  288. Return New Recti( TransformPointFromView( rect.min,view ),TransformPointFromView( rect.max,view ) )
  289. End
  290. #rem monkeydoc Transforms a point in window coordinates to view coordinates.
  291. Transforms `point` in window coordinates to coordinates local to this view.
  292. @param point The point to transform.
  293. @return The transformed point.
  294. #end
  295. Method TransformWindowPointToView:Vec2i( point:Vec2i )
  296. Local t:=-_rmatrix * New Vec2f( point.x,point.y )
  297. Return New Vec2i( Round( t.x ),Round( t.y ) )
  298. End
  299. #rem monkeydoc Makes this view the key view.
  300. The key view is the view that receives keyboard events.
  301. #end
  302. Method MakeKeyView()
  303. Local oldKeyView:=App.KeyView
  304. If oldKeyView=Self Return
  305. If Not Active Return
  306. App.KeyView=Self
  307. If oldKeyView oldKeyView.OnKeyViewChanged( oldKeyView,Self )
  308. OnKeyViewChanged( oldKeyView,Self )
  309. End
  310. #rem monkeydoc Sends a key event to the view.
  311. #end
  312. Method SendKeyEvent( event:KeyEvent )
  313. If _acceptsKeyEvents
  314. OnKeyEvent( event )
  315. If event.Eaten Return
  316. Endif
  317. If _parent _parent.SendKeyEvent( event )
  318. End
  319. #rem monkeydoc Sends a mouse event to the view.
  320. #end
  321. Method SendMouseEvent( event:MouseEvent )
  322. If _acceptsMouseEvents
  323. OnMouseEvent( event.TransformToView( Self ) )
  324. If event.Eaten Return
  325. Endif
  326. If _parent _parent.SendMouseEvent( event )
  327. End
  328. #rem monkeydoc Checks if the view is a child of another view.
  329. #end
  330. Method IsChildOf:Bool( view:View )
  331. If view=Self Return True
  332. If _parent Return _parent.IsChildOf( view )
  333. Return False
  334. End
  335. #rem monkeydoc @hidden
  336. #end
  337. Method RequestRender()
  338. App.RequestRender()
  339. End
  340. #rem monkeydoc @hidden
  341. #end
  342. Method InvalidateStyle()
  343. _styleSeq|=$40000000
  344. App.RequestRender()
  345. End
  346. #rem monkeydoc @hidden
  347. #end
  348. Method ValidateStyle()
  349. If _styleSeq=_themeSeq Return
  350. Local themeChanged:=(_styleSeq & $3fffffff<>_themeSeq)
  351. _styleSeq=_themeSeq
  352. _rstyle=_style
  353. If Enabled
  354. _rstyle=_style.GetState( _styleState )
  355. Else
  356. _rstyle=_style.GetState( "disabled" )
  357. Endif
  358. _styleBounds=_rstyle.Bounds
  359. If themeChanged OnThemeChanged()
  360. OnValidateStyle()
  361. End
  362. Method MeasureLayoutSize:Vec2i()
  363. Measure()
  364. Return _layoutSize
  365. End
  366. Protected
  367. #rem monkeydoc @hidden
  368. #end
  369. Method Measure()
  370. ' If Not _visible Return
  371. For Local view:=Eachin _children
  372. view.Measure()
  373. Next
  374. ValidateStyle()
  375. Local size:=OnMeasure()
  376. Local scale:=App.Theme.Scale
  377. If _minSize.x size.x=Max( size.x,Int( _minSize.x*scale.x ) )
  378. If _minSize.y size.y=Max( size.y,Int( _minSize.y*scale.y ) )
  379. If _maxSize.x size.x=Min( size.x,Int( _maxSize.x*scale.x ) )
  380. If _maxSize.y size.y=Min( size.y,Int( _maxSize.y*scale.y ) )
  381. _measuredSize=size
  382. _layoutSize=size+_styleBounds.Size
  383. End
  384. #rem monkeydoc @hidden
  385. #end
  386. Method UpdateLayout()
  387. _rect=New Recti( 0,0,_measuredSize )
  388. _bounds=_rect+_styleBounds
  389. _matrix=New AffineMat3f
  390. If _parent _matrix=_matrix.Translate( _frame.min.x,_frame.min.y )
  391. _matrix=_matrix.Translate( _offset.x,_offset.y )
  392. Select _layout
  393. Case "fill","resize"
  394. _rect=New Recti( 0,0,_frame.Size-_styleBounds.Size )
  395. _bounds=_rect+_styleBounds
  396. Case "fill-x"
  397. _rect.max.x=_frame.Width-_styleBounds.Width
  398. _bounds.min.x=_rect.min.x+_styleBounds.min.x
  399. _bounds.max.x=_rect.max.x+_styleBounds.max.x
  400. _matrix=_matrix.Translate( 0,(_frame.Height-_bounds.Height)*_gravity.y )
  401. Case "fill-y"
  402. _rect.max.y=_frame.Height-_styleBounds.Height
  403. _bounds.min.y=_rect.min.y+_styleBounds.min.y
  404. _bounds.max.y=_rect.max.y+_styleBounds.max.y
  405. _matrix=_matrix.Translate( (_frame.Width-_bounds.Width)*_gravity.x,0 )
  406. Case "float"
  407. _matrix=_matrix.Translate( (_frame.Width-_bounds.Width)*_gravity.x,(_frame.Height-_bounds.Height)*_gravity.y )
  408. _matrix.t.x=Round( _matrix.t.x )
  409. _matrix.t.y=Round( _matrix.t.y )
  410. Case "stretch"
  411. Local sx:=Float(_frame.Width)/_bounds.Width
  412. Local sy:=Float(_frame.Height)/_bounds.Height
  413. _matrix=_matrix.Scale( sx,sy )
  414. Case "stretch-int"
  415. Local sx:=Float(_frame.Width)/_bounds.Width
  416. Local sy:=Float(_frame.Height)/_bounds.Height
  417. If sx>1 sx=Floor( sx )
  418. If sy>1 sy=Floor( sy )
  419. _matrix=_matrix.Scale( sx,sy )
  420. Case "scale","letterbox"
  421. Local sx:=Float(_frame.Width)/_bounds.Width
  422. Local sy:=Float(_frame.Height)/_bounds.Height
  423. If sx<sy
  424. _matrix=_matrix.Translate( 0,(_frame.Height-_bounds.Height*sx)*_gravity.y )
  425. _matrix=_matrix.Scale( sx,sx )
  426. Else
  427. _matrix=_matrix.Translate( (_frame.Width-_bounds.Width*sy)*_gravity.x,0 )
  428. _matrix=_matrix.Scale( sy,sy )
  429. Endif
  430. Case "scale-int","letterbox-int"
  431. Local sx:=Float(_frame.Width)/_bounds.Width
  432. Local sy:=Float(_frame.Height)/_bounds.Height
  433. If sx>1 sx=Floor( sx )
  434. If sy>1 sy=Floor( sy )
  435. Local sc:=Min( sx,sy )
  436. _matrix=_matrix.Translate( (_frame.Width-_bounds.Width*sc)*_gravity.x,(_frame.Height-_bounds.Height*sc)*_gravity.y )
  437. _matrix=_matrix.Scale( sc,sc )
  438. End
  439. _matrix=_matrix.Translate( -_bounds.min.x,-_bounds.min.y )
  440. If _parent _rmatrix=_parent._rmatrix * _matrix Else _rmatrix=_matrix
  441. ' _rmatrix.t.x=Round( _rmatrix.t.x )
  442. ' _rmatrix.t.y=Round( _rmatrix.t.y )
  443. _rclip=TransformRecti( _rect,_rmatrix )
  444. _rbounds=TransformRecti( _bounds,_rmatrix )
  445. If _parent
  446. _rclip&=_parent._rclip
  447. _rbounds&=_parent._rclip
  448. _clip=TransformRecti( _rclip,-_rmatrix )
  449. Else
  450. _clip=_rclip
  451. End
  452. OnLayout()
  453. For Local view:=Eachin _children
  454. view.UpdateLayout()
  455. Next
  456. End
  457. #rem monkeydoc @hidden
  458. #end
  459. Method Render( canvas:Canvas )
  460. If Not _visible Return
  461. canvas.BeginRender( _bounds,_matrix )
  462. _rstyle.Render( canvas,New Recti( 0,0,_bounds.Size ) )
  463. canvas.Viewport=_rect
  464. OnRender( canvas )
  465. For Local view:=Eachin _children
  466. view.Render( canvas )
  467. Next
  468. canvas.EndRender()
  469. End
  470. Protected
  471. #rem monkeydoc Called during layout if theme has changed.
  472. This is called immediately before [[OnValidateStyle]] if the theme has changed.
  473. #end
  474. Method OnThemeChanged() Virtual
  475. End
  476. #rem monkeydoc Called during layout if [[Style]] or [[StyleState]] have changed.
  477. Views can use this method to cache [[RenderStyle]] properties if necessary.
  478. #end
  479. Method OnValidateStyle() Virtual
  480. End
  481. #rem monkeydoc Called during layout to measure the view.
  482. Overriding methods should return their preferred content size.
  483. #end
  484. Method OnMeasure:Vec2i() Virtual
  485. Return New Vec2i( 0,0 )
  486. End
  487. #rem monkeydoc Called during layout when the view needs to update its child views.
  488. Overriding methods should set the [[Frame]] property of any child views they are resposible for.
  489. #end
  490. Method OnLayout() Virtual
  491. End
  492. #rem monkeydoc Called when the view needs to render itself.
  493. #end
  494. Method OnRender( canvas:Canvas ) Virtual
  495. End
  496. #rem monkeydoc Called when the key view changes.
  497. This method is invoked on both the old key view and new key view when the key view changes.
  498. #end
  499. Method OnKeyViewChanged( oldKeyView:View,newKeyView:View ) Virtual
  500. End
  501. #rem monkeydoc Keyboard event handler.
  502. Called when a keyboard event is sent to this view.
  503. #end
  504. Method OnKeyEvent( event:KeyEvent ) Virtual
  505. End
  506. #rem monkeydoc Mouse event handler.
  507. Called when a mouse event is sent to this view.
  508. #end
  509. Method OnMouseEvent( event:MouseEvent ) Virtual
  510. End
  511. #rem monkeydoc The last size returned by OnMeasure.
  512. #end
  513. Property MeasuredSize:Vec2i()
  514. Return _measuredSize
  515. End
  516. #rem monkeydoc MeasuredSize plus the current [[RenderStyle]] bounds size.
  517. Use this instead of MeasuredSize when calculating layout size for child views.
  518. #end
  519. Property LayoutSize:Vec2i()
  520. Return _layoutSize
  521. End
  522. #rem monkeydoc The current [[RenderStyle]] bounds rect.
  523. #end
  524. Property StyleBounds:Recti()
  525. Return _styleBounds
  526. End
  527. '***** INTERNAL *****
  528. #rem monkeydoc @hidden
  529. For height-dependant-on-width views - clean me up!
  530. #end
  531. Method OnMeasure2:Vec2i( size:Vec2i ) Virtual
  532. Return New Vec2i( 0,0 )
  533. End
  534. #rem monkeydoc @hidden
  535. For height-dependant-on-width views - clean me up!
  536. #end
  537. Method Measure2:Vec2i( size:Vec2i )
  538. size=OnMeasure2( size-_styleBounds.Size )
  539. If size.x And size.y _layoutSize=size+_styleBounds.Size
  540. Return _layoutSize
  541. End
  542. #rem monkeydoc @hidden
  543. #end
  544. Method SetWindow( window:Window )
  545. _window=window
  546. For Local view:=Eachin _children
  547. view.SetWindow( window )
  548. Next
  549. End
  550. #rem monkeydoc @hidden
  551. #end
  552. Method UpdateActive()
  553. 'Note: views are activated top-down, deactivated bottom-up.
  554. '
  555. Local active:=_visible And _enabled And _window And (Not _parent Or _parent._active )
  556. Local changed:=active<>_active
  557. If changed
  558. _active=active
  559. If Not _active Deactivated()
  560. Endif
  561. For Local child:=Eachin _children
  562. child.UpdateActive()
  563. Next
  564. If changed And _active Activated()
  565. End
  566. Private
  567. Global _themeSeq:Int
  568. Field _styleSeq:Int=0
  569. Field _parent:View
  570. Field _window:Window
  571. Field _children:=New Stack<View>
  572. Field _visible:Bool=True
  573. Field _enabled:Bool=True
  574. Field _active:Bool=False
  575. Field _acceptsKeyEvents:Bool=True
  576. Field _acceptsMouseEvents:Bool=True
  577. Field _style:Style
  578. Field _styleState:String
  579. Field _layout:String="fill"
  580. Field _gravity:=New Vec2f( .5,.5 )
  581. Field _offset:=New Vec2i( 0,0 )
  582. Field _minSize:Vec2i
  583. Field _maxSize:Vec2i
  584. Field _frame:Recti
  585. 'After measuring...
  586. Field _rstyle:Style
  587. Field _styleBounds:Recti
  588. Field _measuredSize:Vec2i
  589. Field _layoutSize:Vec2i
  590. 'After layout..
  591. Field _rect:Recti
  592. Field _bounds:Recti
  593. Field _matrix:AffineMat3f
  594. Field _rmatrix:AffineMat3f
  595. Field _rbounds:Recti
  596. Field _rclip:Recti
  597. Field _clip:Recti
  598. End