41 |
import java.awt.Dimension; |
import java.awt.Dimension; |
42 |
import java.awt.Font; |
import java.awt.Font; |
43 |
import java.awt.FontMetrics; |
import java.awt.FontMetrics; |
44 |
|
import java.awt.Rectangle; |
45 |
import java.awt.TextArea; |
import java.awt.TextArea; |
46 |
import java.awt.peer.TextAreaPeer; |
import java.awt.peer.TextAreaPeer; |
47 |
|
import java.awt.peer.TextComponentPeer; |
48 |
|
|
49 |
public class GtkTextAreaPeer extends GtkTextComponentPeer |
public class GtkTextAreaPeer extends GtkComponentPeer |
50 |
implements TextAreaPeer |
implements TextComponentPeer, TextAreaPeer |
51 |
{ |
{ |
52 |
private static transient int DEFAULT_ROWS = 10; |
private static transient int DEFAULT_ROWS = 10; |
53 |
private static transient int DEFAULT_COLS = 80; |
private static transient int DEFAULT_COLS = 80; |
57 |
native void gtkWidgetModifyFont (String name, int style, int size); |
native void gtkWidgetModifyFont (String name, int style, int size); |
58 |
native void gtkWidgetRequestFocus (); |
native void gtkWidgetRequestFocus (); |
59 |
|
|
60 |
|
public native void connectSignals (); |
61 |
|
|
62 |
|
public native int getCaretPosition (); |
63 |
|
public native void setCaretPosition (int pos); |
64 |
|
public native int getSelectionStart (); |
65 |
|
public native int getSelectionEnd (); |
66 |
|
public native String getText (); |
67 |
|
public native void select (int start, int end); |
68 |
|
public native void setEditable (boolean state); |
69 |
|
public native void setText (String text); |
70 |
|
|
71 |
|
public int getIndexAtPoint(int x, int y) |
72 |
|
{ |
73 |
|
// FIXME |
74 |
|
return 0; |
75 |
|
} |
76 |
|
|
77 |
|
public Rectangle getCharacterBounds (int pos) |
78 |
|
{ |
79 |
|
// FIXME |
80 |
|
return null; |
81 |
|
} |
82 |
|
|
83 |
|
public long filterEvents (long filter) |
84 |
|
{ |
85 |
|
// FIXME |
86 |
|
return filter; |
87 |
|
} |
88 |
|
|
89 |
void create () |
void create () |
90 |
{ |
{ |
91 |
Font f = awtComponent.getFont (); |
Font f = awtComponent.getFont (); |
118 |
public GtkTextAreaPeer (TextArea ta) |
public GtkTextAreaPeer (TextArea ta) |
119 |
{ |
{ |
120 |
super (ta); |
super (ta); |
121 |
|
|
122 |
|
setText (ta.getText ()); |
123 |
|
setCaretPosition (0); |
124 |
} |
} |
125 |
|
|
126 |
public native void insert (String str, int pos); |
public native void insert (String str, int pos); |