My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 16 attachment: CustomItem_fix.patch (1021 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- CustomItem.java 2008-04-09 10:41:48.000000000 -0400
+++ javax/microedition/lcdui/CustomItem.java 2008-04-09 10:47:44.000000000 -0400
@@ -35,8 +35,7 @@
}

public int getGameAction(int keycode) {
- // TODO add support for keypress
- return 0;
+ return Display.getGameAction(keycode);
}

protected final int getInteractionModes() {
@@ -128,10 +127,26 @@
// Item methods

int paint(Graphics g) {
- // TODO paint content!!!
super.paintContent(g);
- return super.getHeight();
+ g.translate(0, super.getHeight());
+ paint(g, getPreferredWidth(), getHeight()-super.getHeight());
+ return getHeight();
}

// TODO write overrides for getMinimumWidth, etc
+
+ int getHeight() {
+ return super.getHeight() + getPrefContentHeight(getPreferredWidth());
+ }
+
+ boolean isFocusable() {
+ return true;
+ }
+
+ boolean select() {
+ // send a FIRE keycode here, otherwise there does not appear
+ // to be a way for a CustomItem to use that key
+ keyPressed(-5);
+ return super.select();
+ }
}
Powered by Google Project Hosting