Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Resize a Dialog Does not work??
Resize a Dialog Does not work?? [message #457154] Mon, 20 June 2005 05:27 Go to next message
Eclipse UserFriend
Originally posted by: jerome.bourgeon.bull.net

Hi everybody,
Maybe i'm doing something wrong, I would like to resize a Dialog box i
created , but it doesn't work.
My other problem is i can't fix a size to my Text element.

Thx a lot
Jérôme
PS: here my code

for creating my Dialog

Shell parentshell = new Shell();//fWindow.getShell();
parentshell.setSize(300,200);
AddServerDialog dialog = new AddServerDialog(parentshell);
parentshell.pack();
dialog.open();


In my Dialog class
public Control createDialogArea(Composite parent){
dialog = (Composite) super.createDialogArea(parent);
FormLayout fl = new FormLayout();
fl.marginWidth = 3;
fl.marginHeight = 3;
dialog.setLayout(fl);
FormData data1 = new FormData();
data1.left = new FormAttachment(0,0);
data1.top = new FormAttachment(0,0);
data1.right = new FormAttachment(100,0);
Composite compoInfo = createInformations();
compoInfo.setLayoutData(data1);
return dialog;
}
Re: Resize a Dialog Does not work?? [message #457159 is a reply to message #457154] Mon, 20 June 2005 07:52 Go to previous messageGo to next message
Eclipse UserFriend
This is a multipart message in MIME format.
--=_alternative 00413880C1257026_=
Content-Type: text/plain; charset="US-ASCII"

Can you post the code, you use to resize your dialog ?

Usually you would call

yourDialogObject.getShell().setSize(x,y);

Is that what you are trying to do ?

-philipp

--=_alternative 00413880C1257026_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Can you post the code, you use to resize
your dialog ?</font>
<br>
<br><font size=2 face="sans-serif">Usually you would call </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; yourDialogObject.getShell().setSize(x,y);</font>
<br>
<br><font size=2 face="sans-serif">Is that what you are trying to do ?</font>
<br>
<br><font size=2 face="sans-serif">-philipp</font>
<br>
--=_alternative 00413880C1257026_=--
Re: Resize a Dialog Does not work?? [message #457162 is a reply to message #457154] Mon, 20 June 2005 09:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Do you mean you want it to be resizable by the user, in that case you
need to turn on the resize style. The default style is DIALOG.TRIM,
which is Title, Close button, and Border. In your Dialog subclass
constructor you should add:
setShellStyle(getShellStyle() | MIN | MAX | RESIZE);

If you mean you want to programtically come up with a specific dialog
size, then in your Dialog subclass you need to override getInitialSize()
and return a different size then the default, which is the preferred
size for the dialog depending on the contents.

I can't answer about the Text element because your example here has no
text element in it to see what you are doing.

--
Thanks,
Rich Kulp
Re: Resize a Dialog Does not work?? [message #457171 is a reply to message #457159] Mon, 20 June 2005 10:32 Go to previous message
Eclipse UserFriend
Originally posted by: jerome.bourgeon.bull.net

philipp_tiedt@de.ibm.com wrote:
>
> Can you post the code, you use to resize your dialog ?
>
> Usually you would call
>
> yourDialogObject.getShell().setSize(x,y);
>
> Is that what you are trying to do ?
>
> -philipp

Thx that was the point i have missed :D
Previous Topic:first table column no alignment
Next Topic:Menus on wrapped objects
Goto Forum:
  


Current Time: Sat Nov 08 06:16:30 EST 2025

Powered by FUDForum. Page generated in 0.04640 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top