1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
12 import cc
.squirreljme
.jvm
.mle
.brackets
.UIDisplayBracket
;
13 import cc
.squirreljme
.jvm
.mle
.brackets
.UIFormBracket
;
14 import cc
.squirreljme
.jvm
.mle
.brackets
.UIItemBracket
;
15 import cc
.squirreljme
.jvm
.mle
.constants
.UIItemPosition
;
16 import cc
.squirreljme
.jvm
.mle
.constants
.UIItemType
;
17 import cc
.squirreljme
.runtime
.lcdui
.mle
.UIBackend
;
20 * Tests all the special slots.
24 public class TestAllSpecial
32 protected void test(UIBackend __backend
, UIDisplayBracket __display
,
35 int n
= (-UIItemPosition
.MIN_VALUE
) + 1;
36 UIItemBracket
[] special
= new UIItemBracket
[n
];
37 UIItemBracket
[] normals
= new UIItemBracket
[n
];
39 for (int i
= 0; i
< n
; i
++)
41 special
[i
] = __backend
.itemNew(UIItemType
.BUTTON
);
42 normals
[i
] = __backend
.itemNew(UIItemType
.SINGLE_LINE_TEXT_BOX
);
46 for (int i
= 0; i
< n
; i
++)
48 // Skip the body so it is not there
49 if (i
> 0 && i
!= -UIItemPosition
.BODY
)
50 __backend
.formItemPosition(__form
, special
[i
], -i
);
52 // Add normal items otherwise
53 __backend
.formItemPosition(__form
, normals
[i
], i
);
56 // Remove all the items
57 for (int i
= n
- 1; i
>= 0; i
--)
59 // Skip the body so it is not there
60 if (i
> 0 && i
!= -UIItemPosition
.BODY
)
61 __backend
.formItemRemove(__form
, -i
);
63 // Add normal items otherwise
64 __backend
.formItemRemove(__form
, i
);
68 for (int i
= 1; i
< n
; i
++)
70 __backend
.itemDelete(special
[i
]);
71 __backend
.itemDelete(normals
[i
]);