Adobe 12040118 Using Help - Page 203
Creating a window using window resource specifications, field to display
UPC - 718659361808
View all Adobe 12040118 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 203 highlights
Adobe After Effects Help Using Help Creating User Interface Elements Back 203 You can control the size of each 'step' by setting the stepdelta property. Clicking ahead of or behind the position indicator makes the position indicator jump a fixed number of values toward the point where you clicked. You can control the size of this jump by setting the jumpdelta property. You can create scrollbars with horizontal or vertical orientation; if width is greater than height, the orientation is horizontal, otherwise it is vertical. The following example creates a Scrollbar element with associated StaticText and EditText elements within a panel: d l g . s i ze Pn l = d l g . a d d ( 'p a n e l ', [ 6 0 , 2 4 0 , 3 2 0 , 3 1 5 ] , ' D i m e n s i o n s' ) ; d l g . s i ze Pn l . w i d t h S t = d l g . s i ze Pn l . a d d ( 's t a t i c tex t', [ 1 5 , 1 5 , 6 5 , 3 5 ] , 'Width:'; d l g . s i ze Pn l . w i d t h S c r l = d l g . s i ze Pn l . a d d ( 's c ro l l b a r ', [75,15,195,35],300, 300, 800); d l g . s i ze Pn l . w i d t h Et = d l g . s i ze Pn l . a d d ( 'e d i t tex t', [ 2 0 5 , 1 5 , 2 4 5 , 3 5 ] ) ; Note that the last 3 arguments to the add() method that creates the scrollbar define the values for the value, minvalue and maxvalue properties. Scrollbars are often created with an associated EditText field to display the current value of the scrollbar, and to allow setting the scrollbar's position to a specific value. Creating a window using window resource specifications A specially formatted string provides a simple and compact means of creating a window and its component elements as a resource specification. A resource specification allows you to define and configure multiple window components in one easy-to-reference script. The special string is passed as the type parameter to the Window constructor function, as follows: // create a new dialog from a resource specification var alertBuilderResource = "d ia l o g { text: 'Al er t B ox Bu i ld e r ', b ou n d s : [ 1 0 0 , 1 0 0 , 4 8 0 , 4 9 0 ] , \ m s g Pn l : Pa n e l { tex t : ' Me s s a g e s', b o u n d s : [ 2 5 , 1 5 , 3 5 5 , 1 3 0 ] , \ t i t l e S t : S t a t i c Tex t { tex t : ' A l e r t b ox t i t l e : ', \ bounds:[15,15,105,35] }, \ titl eEt: E d i tText { text: 'S a mp le Ale r t', b ou n d s : [ 1 1 5 , 1 5 , 3 1 5 , 3 5 ] } , \ msg S t: S ta ticText { text: 'A l e r t m e s s a ge : ', \ bounds:[15,65,105,85] }, \ msg Et: E d i tText { text: ' ', \ bounds:[115,45,315,105], properties:{multiline:true} } \ }, \ hasBt nsCb: Checkbox { text:'Has aler t buttons?', alig nment:'center', \ bounds:[125,145,255,165] }, \ aler tB t n sPn l : Pa n el { text: 'Bu tton a li g n m e n t', b ou n d s : [ 4 5 , 1 8 0 , 3 3 5 , 2 2 5 ] , \ a l ig n LeftR b: R a d io Bu tton { tex t: ' Le f t', b ou n d s : [ 1 5 , 1 5 , 9 5 , 3 5 ] } , \ alig nCenterRb:RadioButton { text:'Center', \ bounds:[105,15,185,35] }, \ a l ig n R ig htR b: R a d io Bu tton { tex t : ' R i g h t', b ou n d s : [ 1 9 5 , 1 5 , 2 7 5 , 3 5 ] } \ }, \ si zePn l : Pa n el { text: 'D i men sio n s', b ou n d s : [ 6 0 , 2 4 0 , 3 2 0 , 3 1 5 ] , \ w i d t h S t : S t a t i c Tex t { tex t : ' Wi d t h : ', b o u n d s : [ 1 5 , 1 5 , 6 5 , 3 5 ] } , \ widthScrl:Scrollbar { minvalue:300, maxvalue:800, \ bounds:[75,15,195,35] }, \ w i d t h Et : E d i t Tex t { b o u n d s : [ 2 0 5 , 1 5 , 2 4 5 , 3 5 ] } , \ h e i g h t S t : S t a t i c Tex t { tex t : ' He i g h t : ', b o u n d s : [ 1 5 , 4 5 , 6 5 , 6 5 ] } , \ heightScrl:Scrollbar { minvalue:200, maxvalue:600, \ bounds:[75,45,195,65] }, \ hei g htEt: E d itText { bo u n d s: [2 05 , 4 5 , 2 4 5 , 6 5 ] } \ }, \ b t n Pn l : Pa n e l { tex t : ' Bu i l d i t', b o u n d s : [ 1 5 , 3 3 0 , 3 6 5 , 3 7 5 ] , \ testB t n : Bu tton { text: 'Test', b ou n d s : [ 1 5 , 1 5 , 1 1 5 , 3 5 ] } , \ buildBt n:Button { text:'Build', bounds:[125,15,225,35], \ properties:{name:'ok'} }, \ Using Help Back 203