File tree Expand file tree Collapse file tree 4 files changed +29
-9
lines changed
sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt Expand file tree Collapse file tree 4 files changed +29
-9
lines changed Original file line number Diff line number Diff line change @@ -1392,15 +1392,19 @@ public boolean setText(String html) {
1392
1392
handle.src = "about:blank";
1393
1393
}
1394
1394
try {
1395
- handle.contentWindow.document.write (html);
1396
- handle.contentWindow.document.close ();
1395
+ var doc = handle.contentWindow.document;
1396
+ doc.open ();
1397
+ doc.write (html);
1398
+ doc.close ();
1397
1399
} catch (e) {
1398
- window.setTimeout ((function () {
1400
+ window.setTimeout ((function (handle, html ) {
1399
1401
return function () {
1400
- handle.contentWindow.document.write (html);
1401
- handle.contentWindow.document.close ();
1402
+ var doc = handle.contentWindow.document;
1403
+ doc.open ();
1404
+ doc.write (html);
1405
+ doc.close ();
1402
1406
};
1403
- }) (), 25);
1407
+ }) (handle, html ), 25);
1404
1408
}
1405
1409
*/
1406
1410
private native void iframeDocumentWrite (Object handle , String html );
Original file line number Diff line number Diff line change @@ -519,6 +519,7 @@ public void setImage (Image image) {
519
519
// imgBackground.style.height = "100%";
520
520
// imgBackground.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"" + this.image.url + "\", sizingMethod=\"image\")";
521
521
// handle.appendChild(imgBackground);
522
+ handleStyle .backgroundImage = "" ;
522
523
handleStyle .filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\" " + this .image .url + "\" , sizingMethod=\" image\" )" ;
523
524
} else {
524
525
handleStyle .backgroundRepeat = "no-repeat" ;
Original file line number Diff line number Diff line change @@ -225,8 +225,23 @@ void _setVisible (boolean visible) {
225
225
style .zIndex = "1" + window .currentTopZIndex ;
226
226
style .display = "block" ;
227
227
int height = OS .getContainerHeight (handle );
228
- if (OS .isIE ) {
229
- handle .style .width = "200px" ;
228
+ if (OS .isIE || OS .isOpera ) {
229
+ int maxWidth = 0 ;
230
+ boolean hasImage = false ;
231
+ boolean hasSelection = false ;
232
+ MenuItem [] children = getItems ();
233
+ for (int i = 0 ; i < children .length ; i ++) {
234
+ MenuItem item = children [i ];
235
+ int width = OS .getStringStyledWidth (item .getText (), "menu-item-text" , null );
236
+ if (item .getImage () != null ) {
237
+ hasImage = true ;
238
+ }
239
+ if ((item .getStyle () & (SWT .CHECK | SWT .RADIO )) != 0 ) {
240
+ hasImage = true ;
241
+ }
242
+ maxWidth = Math .max (maxWidth , width );
243
+ }
244
+ handle .style .width = (maxWidth + (hasImage ? 18 : 0 ) + (hasSelection ? 18 : 0 ) + 32 ) + "px" ;
230
245
}
231
246
int width = OS .getContainerWidth (handle );
232
247
int left = x , top = y ;
Original file line number Diff line number Diff line change 11
11
background-color : buttonface;
12
12
border-style : solid solid solid none;
13
13
border-width : 1px ;
14
- border-height : buttonshadow;
14
+ border-color : buttonshadow;
15
15
/*opacity:0.25;
16
16
filter:Alpha(Opacity=25);*/
17
17
}
You can’t perform that action at this time.
0 commit comments