Home » Eclipse Projects » JFace » How To Set Size For InputDialog Properly
How To Set Size For InputDialog Properly [message #482909] |
Fri, 28 August 2009 14:04 |
Eclipse User |
|
|
|
Originally posted by: runzhou.li.gmail.com
Hi,
I don't really want to rewrite a dialog that does the same thing as
InputDialog, but the size of InputDialog is not desired.
How should I set a size for InputDialog properly?
Thanks in advance!
--
Runzhou Li
|
|
| |
Re: How To Set Size For InputDialog Properly [message #484254 is a reply to message #483769] |
Fri, 04 September 2009 19:49 |
Eclipse User |
|
|
|
Originally posted by: runzhou.li.gmail.com
Thank you Will.
I also have a minor question, what's the best way to center this dialog?
Currently I'm doing something like this:
protected void configureShell( Shell shell ) {
Point centerPoint = Geometry.centerPoint(
shell.getParent().getBounds() );
super.configureShell( shell );
shell.setBounds( centerPoint.x, centerPoint.y, 800, 400 );
}
Apparently it's not the perfect way, it somewhat places the dialog near
middle, but not as perfect as the original InputDialog.
"Will Horn" <will.horn@gmail.com> 写入消息
news:h7mngu$br0$1@build.eclipse.org...
> How about writing a subclass and overridding configureShell? For example,
>
> protected void configureShell(Shell shell) {
> super.configureShell(shell);
> shell.setBounds(100, 100, 100, 100); // or whatever you want
> }
>
> "Runzhou Li" <runzhou.li@gmail.com> wrote in message
> news:h78o4h$c3l$1@build.eclipse.org...
>> Hi,
>>
>> I don't really want to rewrite a dialog that does the same thing as
>> InputDialog, but the size of InputDialog is not desired.
>>
>> How should I set a size for InputDialog properly?
>>
>> Thanks in advance!
>>
>> --
>> Runzhou Li
>
|
|
|
Re: How To Set Size For InputDialog Properly [message #486752 is a reply to message #484254] |
Fri, 18 September 2009 22:42 |
Will Horn Messages: 265 Registered: July 2009 |
Senior Member |
|
|
Maybe:
protected void configureShell( Shell shell ) {
super.configureShell( shell );
shell.setBounds(shell.getBounds().x, shell.getBounds().y, 800, 400);
}
"Runzhou Li" <runzhou.li@gmail.com> wrote in message
news:h7rr08$5uk$1@build.eclipse.org...
> Thank you Will.
>
> I also have a minor question, what's the best way to center this dialog?
> Currently I'm doing something like this:
>
> protected void configureShell( Shell shell ) {
> Point centerPoint = Geometry.centerPoint(
> shell.getParent().getBounds() );
>
> super.configureShell( shell );
> shell.setBounds( centerPoint.x, centerPoint.y, 800, 400 );
> }
>
> Apparently it's not the perfect way, it somewhat places the dialog near
> middle, but not as perfect as the original InputDialog.
>
> "Will Horn" <will.horn@gmail.com> 写入消息
> news:h7mngu$br0$1@build.eclipse.org...
>> How about writing a subclass and overridding configureShell? For
>> example,
>>
>> protected void configureShell(Shell shell) {
>> super.configureShell(shell);
>> shell.setBounds(100, 100, 100, 100); // or whatever you want
>> }
>>
>> "Runzhou Li" <runzhou.li@gmail.com> wrote in message
>> news:h78o4h$c3l$1@build.eclipse.org...
>>> Hi,
>>>
>>> I don't really want to rewrite a dialog that does the same thing as
>>> InputDialog, but the size of InputDialog is not desired.
>>>
>>> How should I set a size for InputDialog properly?
>>>
>>> Thanks in advance!
>>>
>>> --
>>> Runzhou Li
>>
|
|
|
Re: How To Set Size For InputDialog Properly [message #487309 is a reply to message #486752] |
Tue, 22 September 2009 17:56 |
Eclipse User |
|
|
|
Originally posted by: runzhou.li.gmail.com
I guess not. The way I was doing is acceptable, but not precise.
"Will Horn" <will.horn@gmail.com> 写入消息
news:h912di$1v7$1@build.eclipse.org...
> Maybe:
>
> protected void configureShell( Shell shell ) {
> super.configureShell( shell );
> shell.setBounds(shell.getBounds().x, shell.getBounds().y, 800, 400);
> }
>
> "Runzhou Li" <runzhou.li@gmail.com> wrote in message
> news:h7rr08$5uk$1@build.eclipse.org...
>> Thank you Will.
>>
>> I also have a minor question, what's the best way to center this dialog?
>> Currently I'm doing something like this:
>>
>> protected void configureShell( Shell shell ) {
>> Point centerPoint = Geometry.centerPoint(
>> shell.getParent().getBounds() );
>>
>> super.configureShell( shell );
>> shell.setBounds( centerPoint.x, centerPoint.y, 800, 400 );
>> }
>>
>> Apparently it's not the perfect way, it somewhat places the dialog near
>> middle, but not as perfect as the original InputDialog.
>>
>> "Will Horn" <will.horn@gmail.com> 写入消息
>> news:h7mngu$br0$1@build.eclipse.org...
>>> How about writing a subclass and overridding configureShell? For
>>> example,
>>>
>>> protected void configureShell(Shell shell) {
>>> super.configureShell(shell);
>>> shell.setBounds(100, 100, 100, 100); // or whatever you want
>>> }
>>>
>>> "Runzhou Li" <runzhou.li@gmail.com> wrote in message
>>> news:h78o4h$c3l$1@build.eclipse.org...
>>>> Hi,
>>>>
>>>> I don't really want to rewrite a dialog that does the same thing as
>>>> InputDialog, but the size of InputDialog is not desired.
>>>>
>>>> How should I set a size for InputDialog properly?
>>>>
>>>> Thanks in advance!
>>>>
>>>> --
>>>> Runzhou Li
>>>
>
|
|
|
Goto Forum:
Current Time: Fri Apr 19 20:49:17 GMT 2024
Powered by FUDForum. Page generated in 0.03366 seconds
|