Continue the control resize problem, Can anyone tell me that whether or not the nested composite hav [message #445319] |
Tue, 02 November 2004 02:39 |
Eclipse User |
|
|
|
Originally posted by: liankun_mail.21cn.com
This is a multi-part message in MIME format.
------=_NextPart_000_0024_01C4C0C8.2F43C820
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
OS: Win2000 .
Can anyone tell me that whether or not the nested composite have the =
number limit ?
and how to avoid this problem ?
SOURCE CODE :
/*
* Created on 2004-11-2
*
*/
package org.jeff.swt;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
/**
* @author JeffLian.
*
*/
public class T10 {
public static void main(String[] args) {
//create shell
final Display display =3D new Display();
Shell shell =3D new Shell(display);
shell.setLayout(new FillLayout());
=20
//create content=20
Composite content =3D new Composite(shell, SWT.NONE);
content.setLayout(new FillLayout());
=20
/**---------------------------------------------
* add child composite=20
* When the variable "len" less than 11, the Button will show =
normal=20
*=20
* Can anyone tell me that whether or not the nested composite =
have the number limit ?
* and how to avoid this problem ?
* =20
---------------------------------------------*/
int len =3D 11;
Composite kk =3D new Composite(content, SWT.BORDER);
kk.setLayout(new FillLayout());
for(int i=3D0; i< len ;i++ ){
kk =3D new Composite(kk, SWT.BORDER);
kk.setLayout(new FillLayout());
}
=20
new Button(kk,SWT.PUSH).setText("BUTTON");
=20
=20
shell.setBounds(20, 30, 500, 500);
shell.open();
while (!shell.isDisposed()){
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
=20
}
}
------=_NextPart_000_0024_01C4C0C8.2F43C820
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3D"Courier New" size=3D2>OS: Win2000 .</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Can anyone tell me that whether =
or not the=20
nested composite have the number limit ?<BR>and how to avoid this =
problem=20
?<BR></FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>SOURCE CODE :</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2><FONT =
face=3D=CB=CE=CC=E5></FONT> </DIV></FONT>
<DIV><FONT face=3D"Courier New" size=3D2>/*<BR> * Created on=20
2004-11-2<BR> *<BR> */<BR>package org.jeff.swt;</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>import =
org.eclipse.swt.SWT;<BR>import=20
org.eclipse.swt.layout.*;<BR>import =
org.eclipse.swt.widgets.*;</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>/**<BR> * @author=20
JeffLian.<BR> *<BR> */<BR>public class T10 {</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2> public =
static void=20
main(String[] args) {<BR> =
//create=20
shell<BR> final Display =
display =3D new=20
Display();<BR> Shell shell =3D =
new=20
Shell(display);<BR> =20
shell.setLayout(new =
FillLayout());<BR> =20
<BR> //create content=20
<BR> Composite content =3D new =
Composite(shell, =
SWT.NONE);<BR> =20
content.setLayout(new=20
FillLayout());<BR> =20
<BR> =20
/**---------------------------------------------<BR> &nb=
sp; =20
* add child composite =
<BR> *=20
When the variable "len" less than 11, the Button will show normal=20
<BR> *=20
<BR> * Can anyone tell =
me that=20
whether or not the nested composite have the number limit=20
?<BR> * and how to avoid =
this=20
problem ?<BR> * =20
<BR> =20
---------------------------------------------*/<BR> &nbs=
p; =20
int len =3D 11;<BR> Composite =
kk =3D new=20
Composite(content, =
SWT.BORDER);<BR> =20
kk.setLayout(new =
FillLayout());<BR> =20
for(int i=3D0; i< len ;i++=20
){<BR> =
kk =3D=20
new Composite(kk,=20
SWT.BORDER);<BR> &nb=
sp; =20
kk.setLayout(new =
FillLayout());<BR> =20
}<BR> =20
<BR> new=20
Button(kk,SWT.PUSH).setText("BUTTON");<BR> &=
nbsp; =20
<BR> =20
<BR> shell.setBounds(20, 30, =
500,=20
500);<BR> =20
shell.open();<BR> while=20
(!shell.isDisposed()){<BR>  =
; =20
if (!display.readAndDispatch())=20
display.sleep();<BR> =20
}<BR> =20
display.dispose();<BR> <BR> =20
}<BR>}<BR></FONT></DIV></BODY></HTML>
------=_NextPart_000_0024_01C4C0C8.2F43C820--
|
|
|
Re: Continue the control resize problem, Can anyone tell me that whether or not the nested composite [message #445331 is a reply to message #445319] |
Tue, 02 November 2004 15:41 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0070_01C4C0C8.81B065F0
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
On XP, WORKSFORME.
"JeffLian" <liankun_mail@21cn.com> wrote in message =
news:cm6s0s$qoc$1@eclipse.org...
OS: Win2000 .
Can anyone tell me that whether or not the nested composite have the =
number limit ?
and how to avoid this problem ?
SOURCE CODE :
/*
* Created on 2004-11-2
*
*/
package org.jeff.swt;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
/**
* @author JeffLian.
*
*/
public class T10 {
public static void main(String[] args) {
//create shell
final Display display =3D new Display();
Shell shell =3D new Shell(display);
shell.setLayout(new FillLayout());
=20
//create content=20
Composite content =3D new Composite(shell, SWT.NONE);
content.setLayout(new FillLayout());
=20
/**---------------------------------------------
* add child composite=20
* When the variable "len" less than 11, the Button will show =
normal=20
*=20
* Can anyone tell me that whether or not the nested composite =
have the number limit ?
* and how to avoid this problem ?
* =20
---------------------------------------------*/
int len =3D 11;
Composite kk =3D new Composite(content, SWT.BORDER);
kk.setLayout(new FillLayout());
for(int i=3D0; i< len ;i++ ){
kk =3D new Composite(kk, SWT.BORDER);
kk.setLayout(new FillLayout());
}
=20
new Button(kk,SWT.PUSH).setText("BUTTON");
=20
=20
shell.setBounds(20, 30, 500, 500);
shell.open();
while (!shell.isDisposed()){
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
=20
}
}
------=_NextPart_000_0070_01C4C0C8.81B065F0
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>On XP, WORKSFORME.</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"JeffLian" <<A=20
href=3D"mailto:liankun_mail@21cn.com">liankun_mail@21cn.com</A>> =
wrote in=20
message <A=20
=
href=3D"news:cm6s0s$qoc$1@eclipse.org">news:cm6s0s$qoc$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>OS: Win2000 .</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Can anyone tell me that =
whether or not=20
the nested composite have the number limit ?<BR>and how to avoid this =
problem=20
?<BR></FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>SOURCE CODE :</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2><FONT =
face=3D=CB=CE=CC=E5></FONT> </DIV></FONT>
<DIV><FONT face=3D"Courier New" size=3D2>/*<BR> * Created on=20
2004-11-2<BR> *<BR> */<BR>package org.jeff.swt;</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>import =
org.eclipse.swt.SWT;<BR>import=20
org.eclipse.swt.layout.*;<BR>import =
org.eclipse.swt.widgets.*;</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>/**<BR> * @author=20
JeffLian.<BR> *<BR> */<BR>public class T10 {</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2> public =
static void=20
main(String[] args) {<BR> =
//create=20
shell<BR> final Display =
display =3D=20
new Display();<BR> Shell =
shell =3D new=20
Shell(display);<BR> =20
shell.setLayout(new=20
FillLayout());<BR> =20
<BR> //create content=20
<BR> Composite content =3D =
new=20
Composite(shell, =
SWT.NONE);<BR> =20
content.setLayout(new=20
FillLayout());<BR> =20
<BR> =20
=
/**---------------------------------------------<BR> &nb=
sp; =20
* add child composite =
<BR> *=20
When the variable "len" less than 11, the Button will show normal=20
<BR> *=20
<BR> * Can anyone tell =
me that=20
whether or not the nested composite have the number limit=20
?<BR> * and how to =
avoid this=20
problem ?<BR> * =20
<BR> =20
=
---------------------------------------------*/<BR> &nbs=
p; =20
int len =3D 11;<BR> =
Composite kk =3D new=20
Composite(content, =
SWT.BORDER);<BR> =20
kk.setLayout(new =
FillLayout());<BR> =20
for(int i=3D0; i< len ;i++=20
=
){<BR> =
kk =3D=20
new Composite(kk,=20
=
SWT.BORDER);<BR> &nb=
sp; =20
kk.setLayout(new =
FillLayout());<BR> =20
}<BR> =20
<BR> new=20
=
Button(kk,SWT.PUSH).setText("BUTTON");<BR> &=
nbsp; =20
<BR> =20
<BR> shell.setBounds(20, 30, =
500,=20
500);<BR> =20
shell.open();<BR> while=20
=
(!shell.isDisposed()){<BR>  =
; =20
if (!display.readAndDispatch())=20
display.sleep();<BR> =20
}<BR> =20
display.dispose();<BR> <BR> =20
}<BR>}<BR></FONT></DIV></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0070_01C4C0C8.81B065F0--
|
|
|
|
Powered by
FUDForum. Page generated in 0.03625 seconds