Skip to content

Commit e9a94a7

Browse files
author
jossonsmith
committed
Update bug fixing of Text widget cursor
Update bug fixing of Table widget on IE.
1 parent ff81d42 commit e9a94a7

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets/Decorations.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -596,11 +596,11 @@ public boolean updateShellBounds(int x, int y, int w, int h) {
596596
});
597597
dnd.bind(handle);
598598
}
599-
contentHandle.onclick = new RunnableCompatibility(){
600-
public void run(){
601-
contentHandle.focus();
602-
}
603-
};
599+
// contentHandle.onclick = new RunnableCompatibility(){
600+
// public void run(){
601+
// contentHandle.focus();
602+
// }
603+
// };
604604
contentHandle.onkeydown = new RunnableCompatibility() {
605605
public void run() {
606606
HTMLEvent e = (HTMLEvent) getEvent();

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets/Table.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,14 @@ public void run() {
849849
// }
850850
//}
851851

852+
private Element createCSSElement(Object parent, String css) {
853+
Element div = document.createElement("DIV");
854+
div.className = css;
855+
if (parent != null) {
856+
((Element) parent).appendChild(div);
857+
}
858+
return div;
859+
}
852860

853861
void createItem (TableColumn column, int index) {
854862
/*
@@ -1017,7 +1025,11 @@ void createItem (TableColumn column, int index) {
10171025
if (theadTR == null) {
10181026
theadTR = document.createElement ("TR");
10191027
theadHandle.appendChild(theadTR);
1020-
theadTR.innerHTML = "<td class=\"table-column-last\"><div class=\"table-head-text\">&#160;</div></td>";
1028+
//theadTR.innerHTML = "<td class=\"table-column-last\"><div class=\"table-head-text\">&#160;</div></td>";
1029+
Element theadTD = document.createElement("TD");
1030+
theadTD.className = "table-column-last";
1031+
theadTR.appendChild(theadTD);
1032+
createCSSElement(theadTD, "table-head-text").appendChild(document.createTextNode("" + (char) 160));
10211033
}
10221034
// if (index < theadTR.childNodes.length) {
10231035
// if (theadTR.childNodes[index] != null

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets/Text.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
padding:0;
88
font-family:Tahoma, Arial, sans-serif;
99
font-size:8pt;
10-
/*white-space:nowrap;*/
10+
/*white-space:nowrap;*/
11+
overflow:hidden;
1112
}
1213
.text-default textarea {
1314
border-style:none;

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets/Text.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,11 @@ public void run() {
231231
textHandle.focus();
232232
}
233233
};
234-
handle.appendChild(textHandle);
234+
Element wrapper = document.createElement("DIV");
235+
wrapper.style.overflow = "auto";
236+
handle.appendChild(wrapper);
237+
wrapper.appendChild(textHandle);
238+
//handle.appendChild(textHandle);
235239

236240
//setTabStops (tabs = 8);
237241
//fixAlignment ();
@@ -337,7 +341,7 @@ public void run() {
337341
e.item = Text.this;
338342
e.widget = Text.this;
339343
sendEvent(e);
340-
toReturn(e.doit);
344+
toReturn(e.doit);
341345
}
342346
};
343347
textHandle.onfocus = new RunnableCompatibility() {
@@ -2340,8 +2344,8 @@ boolean SetWindowPos(Object hWnd, Object hWndInsertAfter, int X, int Y, int cx,
23402344
// textHandle.style.height = ((cy - 4) > 0 ? (cy - 4) : 0) + "px";
23412345
// return super.SetWindowPos(hWnd, hWndInsertAfter, X, Y, cx - 4, cy - 4, uFlags);
23422346
}
2343-
textHandle.style.width = (cx > 0 ? cx : 0) + "px";
2344-
textHandle.style.height = (cy > 0 ? cy : 0) + "px";
2347+
textHandle.style.width = (cx - 2 > 0 ? cx - 2 : 0) + "px";
2348+
textHandle.style.height = (cy - 2 > 0 ? cy - 2 : 0) + "px";
23452349
Element el = (Element) hWnd;
23462350
// TODO: What about hWndInsertAfter and uFlags
23472351
el.style.left = X + "px";

0 commit comments

Comments
 (0)