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 visible and active.
  6. #end
  7. Field Activated:Void()
  8. #rem monkeydoc Invoked when a view is no longer visible 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 axis.
  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. event=event.TransformToView( Self )
  324. OnMouseEvent( event )
  325. If event.Eaten Return
  326. Endif
  327. If _parent _parent.SendMouseEvent( event )
  328. End
  329. #rem monkeydoc Checks if the view is a child of another view.
  330. #end
  331. Method IsChildOf:Bool( view:View )
  332. If view=Self Return True
  333. If _parent Return _parent.IsChildOf( view )
  334. Return False
  335. End
  336. #rem monkeydoc @hidden
  337. #end
  338. Method RequestRender()
  339. App.RequestRender()
  340. End
  341. #rem monkeydoc @hidden
  342. #end
  343. Method InvalidateStyle()
  344. _styleSeq|=$40000000
  345. App.RequestRender()
  346. End
  347. #rem monkeydoc @hidden
  348. #end
  349. Method ValidateStyle()
  350. If _styleSeq=_themeSeq Return
  351. Local themeChanged:=(_styleSeq & $3fffffff<>_themeSeq)
  352. _styleSeq=_themeSeq
  353. _rstyle=_style
  354. If Enabled
  355. _rstyle=_style.GetState( _styleState )
  356. Else
  357. _rstyle=_style.GetState( "disabled" )
  358. Endif
  359. _styleBounds=_rstyle.Bounds
  360. If themeChanged OnThemeChanged()
  361. OnValidateStyle()
  362. End
  363. Method MeasureLayoutSize:Vec2i()
  364. Measure()
  365. Return _layoutSize
  366. End
  367. Protected
  368. #rem monkeydoc @hidden
  369. #end
  370. Method Measure()
  371. ' If Not _visible Return
  372. For Local view:=Eachin _children
  373. view.Measure()
  374. Next
  375. ValidateStyle()
  376. Local size:=OnMeasure()
  377. Local scale:=App.Theme.Scale
  378. If _minSize.x size.x=Max( size.x,Int( _minSize.x*scale.x ) )
  379. If _minSize.y size.y=Max( size.y,Int( _minSize.y*scale.y ) )
  380. If _maxSize.x size.x=Min( size.x,Int( _maxSize.x*scale.x ) )
  381. If _maxSize.y size.y=Min( size.y,Int( _maxSize.y*scale.y ) )
  382. _measuredSize=size
  383. _layoutSize=size+_styleBounds.Size
  384. End
  385. #rem monkeydoc @hidden
  386. #end
  387. Method UpdateLayout()
  388. _rect=New Recti( 0,0,_measuredSize )
  389. _bounds=_rect+_styleBounds
  390. _matrix=New AffineMat3f
  391. If _parent _matrix=_matrix.Translate( _frame.min.x,_frame.min.y )
  392. _matrix=_matrix.Translate( _offset.x,_offset.y )
  393. Select _layout
  394. Case "fill","resize"
  395. _rect=New Recti( 0,0,_frame.Size-_styleBounds.Size )
  396. _bounds=_rect+_styleBounds
  397. Case "fill-x"
  398. _rect.max.x=_frame.Width-_styleBounds.Width
  399. _bounds.min.x=_rect.min.x+_styleBounds.min.x
  400. _bounds.max.x=_rect.max.x+_styleBounds.max.x
  401. _matrix=_matrix.Translate( 0,(_frame.Height-_bounds.Height)*_gravity.y )
  402. Case "fill-y"
  403. _rect.max.y=_frame.Height-_styleBounds.Height
  404. _bounds.min.y=_rect.min.y+_styleBounds.min.y
  405. _bounds.max.y=_rect.max.y+_styleBounds.max.y
  406. _matrix=_matrix.Translate( (_frame.Width-_bounds.Width)*_gravity.x,0 )
  407. Case "float"
  408. _matrix=_matrix.Translate( (_frame.Width-_bounds.Width)*_gravity.x,(_frame.Height-_bounds.Height)*_gravity.y )
  409. _matrix.t.x=Round( _matrix.t.x )
  410. _matrix.t.y=Round( _matrix.t.y )
  411. Case "stretch"
  412. Local sx:=Float(_frame.Width)/_bounds.Width
  413. Local sy:=Float(_frame.Height)/_bounds.Height
  414. _matrix=_matrix.Scale( sx,sy )
  415. Case "stretch-int"
  416. Local sx:=Float(_frame.Width)/_bounds.Width
  417. Local sy:=Float(_frame.Height)/_bounds.Height
  418. If sx>1 sx=Floor( sx )
  419. If sy>1 sy=Floor( sy )
  420. _matrix=_matrix.Scale( sx,sy )
  421. Case "scale","letterbox"
  422. Local sx:=Float(_frame.Width)/_bounds.Width
  423. Local sy:=Float(_frame.Height)/_bounds.Height
  424. If sx<sy
  425. _matrix=_matrix.Translate( 0,(_frame.Height-_bounds.Height*sx)*_gravity.y )
  426. _matrix=_matrix.Scale( sx,sx )
  427. Else
  428. _matrix=_matrix.Translate( (_frame.Width-_bounds.Width*sy)*_gravity.x,0 )
  429. _matrix=_matrix.Scale( sy,sy )
  430. Endif
  431. Case "scale-int","letterbox-int"
  432. Local sx:=Float(_frame.Width)/_bounds.Width
  433. Local sy:=Float(_frame.Height)/_bounds.Height
  434. If sx>1 sx=Floor( sx )
  435. If sy>1 sy=Floor( sy )
  436. Local sc:=Min( sx,sy )
  437. _matrix=_matrix.Translate( (_frame.Width-_bounds.Width*sc)*_gravity.x,(_frame.Height-_bounds.Height*sc)*_gravity.y )
  438. _matrix=_matrix.Scale( sc,sc )
  439. End
  440. _matrix=_matrix.Translate( -_bounds.min.x,-_bounds.min.y )
  441. If _parent _rmatrix=_parent._rmatrix * _matrix Else _rmatrix=_matrix
  442. _rclip=TransformRecti( _rect,_rmatrix )
  443. _rbounds=TransformRecti( _bounds-_rstyle.Margin,_rmatrix )
  444. If _parent
  445. _rclip&=_parent._rclip
  446. _rbounds&=_parent._rclip
  447. _clip=TransformRecti( _rclip,-_rmatrix )
  448. Else
  449. _clip=_rclip
  450. End
  451. OnLayout()
  452. For Local view:=Eachin _children
  453. view.UpdateLayout()
  454. Next
  455. End
  456. #rem monkeydoc @hidden
  457. #end
  458. Method Render( canvas:Canvas )
  459. If Not _visible Return
  460. canvas.BeginRender( _bounds,_matrix )
  461. _rstyle.Render( canvas,New Recti( 0,0,_bounds.Size ) )
  462. canvas.Viewport=_rect
  463. OnRender( canvas )
  464. For Local view:=Eachin _children
  465. view.Render( canvas )
  466. Next
  467. canvas.EndRender()
  468. End
  469. Protected
  470. #rem monkeydoc Called during layout if theme has changed.
  471. This is called immediately before [[OnValidateStyle]] if the theme has changed.
  472. #end
  473. Method OnThemeChanged() Virtual
  474. End
  475. #rem monkeydoc Called during layout if [[Style]] or [[StyleState]] have changed.
  476. Views can use this method to cache [[RenderStyle]] properties if necessary.
  477. #end
  478. Method OnValidateStyle() Virtual
  479. End
  480. #rem monkeydoc Called during layout to measure the view.
  481. Overriding methods should return their preferred content size.
  482. #end
  483. Method OnMeasure:Vec2i() Virtual
  484. Return New Vec2i( 0,0 )
  485. End
  486. #rem monkeydoc Called during layout when the view needs to update its child views.
  487. Overriding methods should set the [[Frame]] property of any child views they are resposible for.
  488. #end
  489. Method OnLayout() Virtual
  490. End
  491. #rem monkeydoc Called when the view needs to render itself.
  492. #end
  493. Method OnRender( canvas:Canvas ) Virtual
  494. End
  495. #rem monkeydoc Called when the key view changes.
  496. This method is invoked on both the old key view and new key view when the key view changes.
  497. #end
  498. Method OnKeyViewChanged( oldKeyView:View,newKeyView:View ) Virtual
  499. End
  500. #rem monkeydoc Keyboard event handler.
  501. Called when a keyboard event is sent to this view.
  502. #end
  503. Method OnKeyEvent( event:KeyEvent ) Virtual
  504. End
  505. #rem monkeydoc Mouse event handler.
  506. Called when a mouse event is sent to this view.
  507. #end
  508. Method OnMouseEvent( event:MouseEvent ) Virtual
  509. End
  510. #rem monkeydoc The last size returned by OnMeasure.
  511. #end
  512. Property MeasuredSize:Vec2i()
  513. Return _measuredSize
  514. End
  515. #rem monkeydoc MeasuredSize plus the current [[RenderStyle]] bounds size.
  516. Use this instead of MeasuredSize when calculating layout size for child views.
  517. #end
  518. Property LayoutSize:Vec2i()
  519. Return _layoutSize
  520. End
  521. #rem monkeydoc The current [[RenderStyle]] bounds rect.
  522. #end
  523. Property StyleBounds:Recti()
  524. Return _styleBounds
  525. End
  526. '***** INTERNAL *****
  527. #rem monkeydoc @hidden
  528. For height-dependant-on-width views - clean me up!
  529. #end
  530. Method OnMeasure2:Vec2i( size:Vec2i ) Virtual
  531. Return New Vec2i( 0,0 )
  532. End
  533. #rem monkeydoc @hidden
  534. For height-dependant-on-width views - clean me up!
  535. #end
  536. Method Measure2:Vec2i( size:Vec2i )
  537. size=OnMeasure2( size-_styleBounds.Size )
  538. If size.x And size.y _layoutSize=size+_styleBounds.Size
  539. Return _layoutSize
  540. End
  541. #rem monkeydoc @hidden
  542. #end
  543. Method SetWindow( window:Window )
  544. _window=window
  545. For Local view:=Eachin _children
  546. view.SetWindow( window )
  547. Next
  548. End
  549. #rem monkeydoc @hidden
  550. #end
  551. Method UpdateActive()
  552. 'Note: views are activated top-down, deactivated bottom-up.
  553. '
  554. Local active:=_visible And _enabled And _window And (Not _parent Or _parent._active )
  555. Local changed:=active<>_active
  556. If changed
  557. _active=active
  558. If Not _active Deactivated()
  559. Endif
  560. For Local child:=Eachin _children
  561. child.UpdateActive()
  562. Next
  563. If changed And _active Activated()
  564. End
  565. Private
  566. Global _themeSeq:Int
  567. Field _styleSeq:Int=0
  568. Field _parent:View
  569. Field _window:Window
  570. Field _children:=New Stack<View>
  571. Field _visible:Bool=True
  572. Field _enabled:Bool=True
  573. Field _active:Bool=False
  574. Field _acceptsKeyEvents:Bool=True
  575. Field _acceptsMouseEvents:Bool=True
  576. Field _style:Style
  577. Field _styleState:String
  578. Field _layout:String="fill"
  579. Field _gravity:=New Vec2f( .5,.5 )
  580. Field _offset:=New Vec2i( 0,0 )
  581. Field _minSize:Vec2i
  582. Field _maxSize:Vec2i
  583. Field _frame:Recti
  584. 'After measuring...
  585. Field _rstyle:Style
  586. Field _styleBounds:Recti
  587. Field _measuredSize:Vec2i
  588. Field _layoutSize:Vec2i
  589. 'After layout..
  590. Field _rect:Recti
  591. Field _bounds:Recti
  592. Field _matrix:AffineMat3f
  593. Field _rmatrix:AffineMat3f
  594. Field _rbounds:Recti
  595. Field _rclip:Recti
  596. Field _clip:Recti
  597. End