Skip to content

Commit bb8e7ef

Browse files
author
jossonsmith
committed
Fixed bug that on child Shell is counted in parent#getChildren.
Fixed bug that child Shell will be override by parent Shell even with MODAL style. Fixed bug that Decorations#setVisible does not work. Fixed bug that Shell#getText does not return correct title. ...
1 parent f8d1431 commit bb8e7ef

File tree

10 files changed

+774
-736
lines changed

10 files changed

+774
-736
lines changed

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/internal/xhtml/Element.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public class Element {
4141

4242
public String nodeName;
4343

44+
public String nodeValue;
45+
4446
public String className;
4547

4648
public Object onmousedown;
@@ -94,7 +96,7 @@ public class Element {
9496
public String rel;
9597

9698
public int tabIndex;
97-
99+
98100
//private String
99101

100102
public native void appendChild(Element child);

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class Composite extends Scrollable {
5454
Control [] tabList;
5555
int layoutCount = 0;
5656
// Control [] children = new Control[0];
57-
protected Control [] children;
57+
Control [] children;
5858
boolean waitingForLayoutWithResize;
5959

6060
/**
@@ -115,7 +115,7 @@ public Composite (Composite parent, int style) {
115115
Control [] newChildren = new Control [0];
116116
for (int i = 0; i < count; i++) {
117117
Control control = children[i]; //display.getControl (handle.childNodes[i]);
118-
if (control != null && control != this) {
118+
if (control != null && control != this && !(control instanceof Shell)) {
119119
newChildren [index++] = control;
120120
}
121121
}
@@ -606,7 +606,7 @@ public void layout (Control [] changed) {
606606
checkWidget ();
607607
// System.out.print("control");
608608
if (changed == null) error (SWT.ERROR_INVALID_ARGUMENT);
609-
Date d = new Date();
609+
// Date d = new Date();
610610
int length = changed.length;
611611
for (int i=0; i< length; i++) {
612612
Control control = changed [i];
@@ -622,7 +622,7 @@ public void layout (Control [] changed) {
622622
if (!ancestor) error (SWT.ERROR_INVALID_PARENT);
623623
}
624624
// System.out.println(":::" + (new Date().getTime() - d.getTime()));
625-
d = new Date();
625+
// d = new Date();
626626
int updateCount = 0;
627627
Composite [] update = new Composite [16];
628628
for (int i=0; i< length; i++) {
@@ -645,12 +645,12 @@ public void layout (Control [] changed) {
645645
}
646646
}
647647
// System.out.println(":::" + (new Date().getTime() - d.getTime()));
648-
d = new Date();
648+
// d = new Date();
649649
for (int i=updateCount-1; i>=0; i--) {
650650
update [i].updateLayout (true, false);
651651
}
652652
// System.out.println(":::" + (new Date().getTime() - d.getTime()));
653-
d = new Date();
653+
// d = new Date();
654654
}
655655

656656
void markLayout (boolean changed, boolean all) {
@@ -1017,12 +1017,12 @@ protected boolean SetWindowPos(Object hWnd, Object hWndInsertAfter, int X, int Y
10171017

10181018
void updateLayout (boolean resize, boolean all) {
10191019
if (isLayoutDeferred ()) return;
1020-
10211020
if ((state & LAYOUT_NEEDED) != 0 && !waitingForLayout) {
10221021
// boolean changed = (state & LAYOUT_CHANGED) != 0;
10231022
// state &= ~(LAYOUT_NEEDED | LAYOUT_CHANGED);
10241023
// if (resize) setResizeChildren (false);
10251024
// layout.layout (this, changed);
1025+
// if (resize) setResizeChildren (true);
10261026
this.waitingForLayout = true;
10271027
this.waitingForLayoutWithResize = resize;
10281028
display.sendMessage(new MESSAGE(this, MESSAGE.CONTROL_LAYOUT, new boolean[] {resize, all}));
@@ -1033,6 +1033,7 @@ void updateLayout (boolean resize, boolean all) {
10331033
Control [] children = _getChildren ();
10341034
int length = children.length;
10351035
for (int i=0; i<length; i++) {
1036+
// children [i].updateLayout (resize, all);
10361037
if (children[i] instanceof Composite) {
10371038
display.sendMessage(new MESSAGE(children[i], MESSAGE.CONTROL_LAYOUT, new boolean[] {resize, all}));
10381039
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2221,7 +2221,7 @@ public void setCursor (Cursor cursor) {
22212221
checkWidget ();
22222222
if (cursor != null && cursor.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
22232223
this.cursor = cursor;
2224-
handle.style.cursor = cursor.getCSSHandle();
2224+
handle.style.cursor = (cursor == null) ? "" : cursor.getCSSHandle();
22252225
/*
22262226
if (OS.IsWinCE) {
22272227
int hCursor = cursor != null ? cursor.handle : 0;

0 commit comments

Comments
 (0)