Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit15f61a2

Browse files
author
zhourenjian
committed
Fixing browser's setText method's bug that it does not support subdomain "document.domain=..." setting
Fix bug of Combo key controling and mouse controling do not work togetherFixed bug of IE 6.0/7.0 that display minimized button 2px offsetFixed bug that Text control show scrollbar unexpected in IE 7.0
1 parent5d1d635 commit15f61a2

File tree

6 files changed

+93
-35
lines changed

6 files changed

+93
-35
lines changed

‎sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/browser/Browser.java‎

Lines changed: 51 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,12 @@ protected void createHandle() {
806806

807807
browserHandle =document.createElement ("IFRAME");
808808
browserHandle.className ="browser-default";
809+
810+
browserHandle.style.border ="0 none transparent";
811+
if (OS.isIE) {
812+
browserHandle.setAttribute("frameBorder","0");
813+
}
814+
809815
handle.appendChild(browserHandle);
810816
}
811817

@@ -1388,31 +1394,55 @@ public boolean setText(String html) {
13881394
returntrue;
13891395
}
13901396

1397+
1398+
/**
1399+
* @j2sNative
1400+
return function () {
1401+
try {
1402+
var doc = handle.contentWindow.document;
1403+
doc.open ();
1404+
if (O$.isIE) {
1405+
doc.domain = domain;
1406+
}
1407+
doc.write (html);
1408+
doc.close ();
1409+
handle = null;
1410+
} catch (e) {
1411+
window.setTimeout (arguments.callee, 25);
1412+
}
1413+
};
1414+
*/
1415+
nativeObjectgenerateLazyIframeWriting(Objecthandle,Stringdomain,Stringhtml);
1416+
13911417
/**
13921418
* @param handle
13931419
* @param html
13941420
* @j2sNative
13951421
var handle = arguments[0];
13961422
var html = arguments[1];
1423+
var domain = document.domain;
1424+
if (O$.isIE) {
1425+
document.domain = domain;
1426+
}
13971427
if (handle.contentWindow != null) {
1398-
handle.contentWindow.location = "about:blank";
1428+
if (O$.isIE) {
1429+
handle.contentWindow.location = "#"diff-5e6243b82ffcbc9f3d96ce3d0b687512adbf072754a6fd25e0083e29dea8d619-1398-1430-0" data-selected="false" role="gridcell" tabindex="-1" valign="top">
1430+
} else {
1431+
handle.contentWindow.location = "about:blank";
1432+
}
13991433
} else { // Opera
14001434
handle.src = "about:blank";
14011435
}
14021436
try {
14031437
var doc = handle.contentWindow.document;
14041438
doc.open ();
1439+
if (O$.isIE) {
1440+
doc.domain = domain;
1441+
}
14051442
doc.write (html);
14061443
doc.close ();
14071444
} catch (e) {
1408-
window.setTimeout ((function (handle, html) {
1409-
return function () {
1410-
var doc = handle.contentWindow.document;
1411-
doc.open ();
1412-
doc.write (html);
1413-
doc.close ();
1414-
};
1415-
}) (handle, html), 25);
1445+
window.setTimeout (this.generateLazyIframeWriting (handle, domain, html), 25);
14161446
}
14171447
*/
14181448
privatenativevoidiframeDocumentWrite(Objecthandle,Stringhtml);
@@ -1526,18 +1556,18 @@ public void stop() {
15261556
}
15271557
}
15281558

1529-
publicvoidsetBounds(intx,inty,intwidth,intheight) {
1530-
super.setBounds(x,y,width,height);
1531-
if (handle.style.filter !=null) {
1532-
// one more pixel so onmousemove can be triggered before
1533-
// entering IFRAME
1534-
browserHandle.style.width = (width -2 >0 ?width -2 :0) +"px";
1535-
browserHandle.style.height = (height -2 >0 ?height -2 :0) +"px";
1536-
}else {
1537-
browserHandle.style.width = (width -4 >0 ?width -4 :0) +"px";
1538-
browserHandle.style.height = (height -4 >0 ?height -4 :0) +"px";
1539-
}
1540-
}
1559+
//public void setBounds(int x, int y, int width, int height) {
1560+
//super.setBounds(x, y, width, height);
1561+
//if (handle.style.filter != null) {
1562+
//// one more pixel so onmousemove can be triggered before
1563+
//// entering IFRAME
1564+
//browserHandle.style.width = (width - 2 > 0 ? width - 2 : 0) + "px";
1565+
//browserHandle.style.height = (height - 2 > 0 ? height - 2 : 0) + "px";
1566+
//} else {
1567+
//browserHandle.style.width = (width - 4 > 0 ? width - 4 : 0) + "px";
1568+
//browserHandle.style.height = (height - 4 > 0 ? height - 4 : 0) + "px";
1569+
//}
1570+
//}
15411571

15421572
protectedbooleanuseNativeScrollBar() {
15431573
returntrue;

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,12 @@ public void run(){
631631
currentIndex =items.length -1;
632632
}
633633
selectInput.selectedIndex =currentIndex;
634-
noSelection =false;
635-
updateSelection();
636-
noSelection =true;
634+
{
635+
booleanselection =noSelection;
636+
noSelection =false;
637+
updateSelection();
638+
noSelection =selection;
639+
}
637640
toReturn(false);
638641
break;
639642
case40:
@@ -644,16 +647,21 @@ public void run(){
644647
currentIndex =items.length -1;
645648
}
646649
selectInput.selectedIndex =currentIndex;
647-
noSelection =false;
648-
updateSelection();
649-
noSelection =true;
650+
{
651+
booleanselection =noSelection;
652+
noSelection =false;
653+
updateSelection();
654+
noSelection =selection;
655+
}
650656
toReturn(false);
651657
break;
652658
}
653659
}
654660
};
655661
Clazz.addEvent(textInput,"keyup",hEditKeyUp);
656662

663+
selectShown =false;
664+
657665
hDropDownClick =newRunnableCompatibility() {
658666
publicvoidrun() {
659667
longnow =newDate().getTime();
@@ -882,9 +890,9 @@ void show(){
882890
//h -= 2;
883891
}
884892
this.selectShown =true;
885-
window.currentTopZIndex =window.currentTopZIndex +1;
893+
//window.currentTopZIndex = window.currentTopZIndex + 1;
886894
// related bug: http://groups.google.com/group/java2script/browse_thread/thread/8085561fcf953fc?hl=en
887-
selectInput.style.zIndex =window.currentTopZIndex +4;//sgurin
895+
selectInput.style.zIndex =window.currentTopZIndex +100;//sgurin
888896

889897
selectInput.className ="combo-select-box-visible" + (isSimple ?"" :" combo-select-box-notsimple");
890898
intheight =OS.getContainerHeight(selectInput);

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,6 +1588,9 @@ public void setImage (Image image) {
15881588
//}
15891589
if (image ==null) {
15901590
shellIcon.style.backgroundImage ="";
1591+
if (OS.isIE50 ||OS.isIE55 ||OS.isIE60 ||OS.isIE70) {
1592+
shellIcon.style.backgroundPosition ="50% 53%";
1593+
}
15911594
if (OS.isIENeedPNGFix &&shellIcon.style.filter !=null) {
15921595
shellIcon.style.filter ="";
15931596
}
@@ -1596,6 +1599,9 @@ public void setImage (Image image) {
15961599

15971600
if (shellIcon !=null &&this.image.handle ==null &&this.image.url !=null &&this.image.url.length() !=0) {
15981601
CSSStyleiconStyle =shellIcon.style;
1602+
if (OS.isIE50 ||OS.isIE55 ||OS.isIE60 ||OS.isIE70) {
1603+
shellIcon.style.backgroundPosition ="center center";
1604+
}
15991605
if (OS.isIENeedPNGFix &&image.url.toLowerCase().endsWith(".png") &&contentHandle.style.filter !=null) {
16001606
//Element imgBackground = document.createElement("DIV");
16011607
//imgBackground.style.position = "absolute";
@@ -2204,6 +2210,9 @@ void setSystemMenu () {
22042210
if ((style &SWT.TOOL) ==0 && (style & (SWT.CLOSE |SWT.MIN |SWT.MAX)) !=0) {
22052211
shellIcon =document.createElement("DIV");
22062212
shellIcon.className ="shell-title-icon";
2213+
if (OS.isIE50 ||OS.isIE55 ||OS.isIE60 ||OS.isIE70) {
2214+
shellIcon.style.backgroundPosition ="50% 53%";
2215+
}
22072216
titleBar.appendChild(shellIcon);
22082217
hIconClick =newRunnableCompatibility() {
22092218
publicvoidrun() {
@@ -2221,6 +2230,9 @@ public void run() {
22212230
if (minable()) {
22222231
shellMin =document.createElement("DIV");
22232232
shellMin.className ="shell-title-min";
2233+
if (OS.isIE50 ||OS.isIE55 ||OS.isIE60 ||OS.isIE70) {
2234+
shellMin.style.backgroundPosition ="0% 53%";
2235+
}
22242236
shellMin.title ="Minimze";
22252237
titleBar.appendChild(shellMin);
22262238
hMinClick =newRunnableCompatibility() {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,9 +1796,9 @@ Shell getModalDialogShell () {
17961796
if (monitors ==null) {
17971797
Monitormonitor =newMonitor();
17981798
monitor.handle =document.body;
1799-
monitor.clientWidth =OS.getFixedBodyClientWidth();//document.body.clientWidth;
1799+
monitor.clientWidth =OS.getFixedBodyClientWidth();//document.body.clientWidth;
18001800
intparentWidth =OS.getContainerWidth(document.body.parentNode);
1801-
if (parentWidth >monitor.clientWidth) {
1801+
if (parentWidth >monitor.clientWidth &&parentWidth <=window.screen.availWidth) {
18021802
monitor.clientWidth =parentWidth;
18031803
}
18041804
monitor.width =window.screen.availWidth;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@
307307
top:50%;
308308
margin-top:-10px;
309309
}
310+
*html .shell-title-icon {
311+
margin-top:-8px;
312+
}
310313
.shell-title-min, .shell-title-normal-max, .shell-title-close {
311314
position:absolute;
312315
top:1px;

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ public class Text extends Scrollable {
8080
privateObjecthModifyFocus;
8181
privateObjecthModifyBlur;
8282
privateObjecthModifyKeyUp;
83-
privateRunnableCompatibilityhScrollless;
84-
privateElementwrapper;
83+
//private RunnableCompatibility hScrollless;
84+
//private Element wrapper;
8585
/*
8686
public static final String DELIMITER;
8787
@@ -264,11 +264,13 @@ public void run() {
264264
};
265265
Clazz.addEvent(handle,"focus",hFocus);
266266

267+
handle.appendChild(textHandle);
268+
/*
267269
wrapper = document.createElement("DIV");
268-
wrapper.style.overflow = ((style &SWT.MULTI) !=0) ?"auto" :"hidden";
270+
//wrapper.style.overflow = ((style & SWT.MULTI) != 0) ? "auto" : "hidden";
271+
wrapper.style.overflow = "hidden";
269272
handle.appendChild(wrapper);
270273
wrapper.appendChild(textHandle);
271-
//handle.appendChild(textHandle);
272274
if (!OS.isChrome) {
273275
// TODO: IE does not trigger onscroll when dragging inner text input
274276
if (hScrollless == null) {
@@ -284,6 +286,7 @@ public void run() {
284286
}
285287
Clazz.addEvent(wrapper, "scroll", hScrollless);
286288
}
289+
//*/
287290

288291
//setTabStops (tabs = 8);
289292
//fixAlignment ();
@@ -1786,6 +1789,7 @@ protected void releaseHandle() {
17861789
OS.destroyHandle(textHandle);
17871790
textHandle =null;
17881791
}
1792+
/*
17891793
if (wrapper != null) {
17901794
if (hScrollless != null) {
17911795
Clazz.removeEvent(wrapper, "scroll", hScrollless);
@@ -1794,6 +1798,7 @@ protected void releaseHandle() {
17941798
OS.destroyHandle(wrapper);
17951799
wrapper = null;
17961800
}
1801+
*/
17971802
super.releaseHandle();
17981803
}
17991804
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp