Bug 2967 - [Preferences] EC - Preference dialog maximum size. (1GL2U9X)
Summary: [Preferences] EC - Preference dialog maximum size. (1GL2U9X)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ian Petersen CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2001-10-10 22:46 EDT by Kevin Haaland CLA
Modified: 2002-08-26 11:46 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Haaland CLA 2001-10-10 22:46:59 EDT
From Eclipse corner.
	Summary: The preference dialog should have a maximum size so it will never be bigger then the display.


I have opened a problem report with your comment about a maximum size for the dialog. I agree the it should never get bigger then your display.

As a workaround, you can use getControl() and get/set its bounds if the size is too big. There is API in Display to get the display bounds so you can compare the dialog bounds with the display.

But I have to say that I agree with Randy and about the size of the preferences dialog. It should not be made too big and I think 70% is too big. If you have a text that needs a big area to be shown, if may be a good idea rethink about your page as Randy suggested.

Hope it helps.
Eduardo.

"leona lee" <leonal@ca.ibm.com> wrote in message news:9pfis9$mm7$1@rogue.oti.com...
> 
> Hi Randy, may be I have not made myself clear in previous note.  What I
> like to find out is :
> 
> How do I calculate a reasonable size for a multi-line editor in the
> preference page to satisfy the following: the resulting preference dialog
> fits within the desktop and the dialog is big enough to view the maximum
> number of lines and columns.
> 
> Currently there are no api that I can use to find out the size of the
> preference dialog, the title area, the tree and the button areas within
> the dialog.  I would like to have this information so I can compute the
> maximum size of the page content, I would like to have the maximum dialog
> size, may be 70 to 80% of the desktop.  Or alternatively, may be the
> preference dialog should have the logic when computing the size, that it
> would never grow beyond the desktop size.
> 
> I hope I make myself clear, and thank you for your help.
> 
> Randy Giffen wrote:
> 
> > A reasonable size for a preference page would be one that fits into any
> > standard
> > screen resolution. The preference dialog opens at a reasonable size. It is
> > designed to
> > expand "as needed" to accommodate pages but asking it to expand to the full
> > size of the screen seems excessive.
> 
> > Instead I would suggest you reconsider the design of your preference page.
> > It
> > appears you are creating a preference page which allows the user to
> > view/edit the
> > contents of some file. If you have found that the size of a typical
> > preference page
> > is too small for this purpose, perhaps your page could contain a description
> > or summary
> > of the contents or meaning of this file and a button to open an editor for
> > the file.
> 
> > contents of some file and leona lee <leonal@ca.ibm.com> wrote in message
> > news:9pf6p7$hae$1@rogue.oti.com...
> > >
> > > Hi Randy,
> > >
> > > Thank you for your help.  I was able to control the size of the page using
> > > your suggestion.  But picking an arbitrary line count to control the
> > > height of the widget could not guarantee the size of the dialog would
> > > appear properly on any screen resolution.  Is there any way I can compute
> > > the maximum size of the page content area, based on the dialog size, to
> > > ensure the result dialog can fit into any screen resolution ?
> > >
> > >
> > > Randy Giffen wrote:
> > >
> > > > The framework is setting a GridData on the control you return from
> > > > createContents.
> > > > This seems unfriendly.
> > > > I think there is already a PR for this, I will check.
> > >
> > > > For now just create a composite to hold your Text
> > >
> > > >  Composite composite = new Composite(parent, SWT.NULL);
> > > >  GridLayout layout= new GridLayout();
> > > >  composite.setLayout(layout);
> > >
> > > >  Text textEditor = new Text(composite, SWT.MULTI | SWT.BORDER |
> > SWT.H_SCROLL
> > > > |
> > > > ....
> > > > return composite;
> > >
> > > > leona lee <leonal@ca.ibm.com> wrote in message
> > > > news:9pd8q3$pqv$1@rogue.oti.com...
> > > > >
> > > > > Actually I did try this before (codes below), but it did not seem to
> > help.
> > > > >  The text control just grows beyond the desktop height.
> > > > >
> > > > > textEditor = new Text( parent, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL |
> > > > > SWT.V_SCROLL );
> > > > > data = new GridData( GridData.FILL_HORIZONTAL );
> > > > > data.heightHint = textEditor.getLineHeight()*20;
> > > > > textEditor.setLayoutData( data );
> > > > >
> > > > >
> > > > >
> > > > > Randy Giffen wrote:
> > > > >
> > > > > > Consider setting your text control to some reasonable size using its
> > > > > > GridData and letting the dialog size itself.
> > > > >
> > > > > >  data.heightHint = text.getLineHeight() * NUM_OF_LINES;
> > > > >
> > > > >
> > > > > > leona lee <leonal@ca.ibm.com> wrote in message
> > > > > > news:9pd59k$ock$1@rogue.oti.com...
> > > > > > >
> > > > > > > Hi, I have a Preference Page that contains a multi-lines Text
> > field
> > > > with
> > > > > > > scroll bars, created using
> > > > > > >
> > > > > > > new Text( parent, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL |
> > > > SWT.V_SCROLL );
> > > > > > >
> > > > > > > I read in a file to populate the content of this text field, since
> > the
> > > > > > > content of the file is longer than the height of the screen, I
> > would
> > > > like
> > > > > > > to add logic in the doComputeSize() method to control the maximum
> > > > height
> > > > > > > of the preference page area, instead of letting it grows beyond
> > the
> > > > > > > desktop height.
> > > > > > >
> > > > > > > I have not been able to figure out how I can get the size of the
> > > > > > > preference dialog, and the size of the title, button areas to
> > figure
> > > > out
> > > > > > > the correct maximum size of the preference page content area.
> > > > > > >
> > > > > > > Please advise, thank you.
> > > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
> > >
> > >
> 
> 
> 
> 
> 

NOTES:
Comment 1 Ian Petersen CLA 2002-02-04 11:03:47 EST
It looks to me like this problem was already fixed (I don't know when).  The 
showPage method of PreferenceDialog, which is responsible for resizing the 
dialog when necessary, calls an internal method setShellSize.  Before resizing 
the dialog, setShellSize compares its parameters to the bounds of its Display.

The problem with this solution is that very large preference pages are just 
clipped.  I have added a ScrolledComposite to the PreferenceDialog to allow it 
to better accomodate large preference pages.  When the change is released, I'll 
mark this bug resolved.
Comment 2 Kevin Haaland CLA 2002-05-30 20:20:09 EDT
No plans to make further changes for 2.0
Comment 3 Randy Giffen CLA 2002-08-08 16:28:55 EDT
Reopen for investigation
Comment 4 Tod Creasey CLA 2002-08-26 11:46:02 EDT
All PreferencePages have been designed to work in 1024x768 in windows extra 
large mode. Closing PR.