#303 AutoComplete window too small

Cosmetic
closed-fixed
Scintilla (793)
5
2005-06-27
2005-05-31
No

The AutoComplete window pops up slightly too small in
the latest build, 1.63, on Windows 2000.

The problem may be related to that MaxTrackSize()
determines the size solely based on assumed string
length, not including the image, indent and possible
scrollbar.

Also I don't see the reason why the user shouldn't be
allowed to resize the listbox at least 100px wider or
taller. Many users like to expand the window just to
make sure that they are not "missing" any items
(doesn't sound very rational, does it?!)

Discussion

  • Neil Hodgson

    Neil Hodgson - 2005-05-31
    • milestone: --> Cosmetic
    • assigned_to: nobody --> nyamatongwe
    • status: open --> open-accepted
     
  • Neil Hodgson

    Neil Hodgson - 2005-06-02

    Logged In: YES
    user_id=12579

    It is GetDesiredRect rather than MaxTrackSize and it occurs
    when the string with the most characters contains narrow
    characters. This will be tweaked a little to ensure it is
    not too narrow in more cases.

    The user can resize the listbox to be high enough to show
    all the items and wide enough to show any text in the list.

     
  • Bjarke Viksøe

    Bjarke Viksøe - 2005-06-02

    Logged In: YES
    user_id=942046

    > It is GetDesiredRect rather than MaxTrackSize
    You should probably check it anyway, because on Windows
    XP it behaves strangely when you resize the window to the
    max: The window sort of jumps to the right a few pixels every
    time. This behaviour is usually related to WM_GETMINMAX.

    > The user can resize the listbox to be high enough to show
    Yes, I'm pointing out that this is overly restrictive and not a
    very user-friendly design. Why make the listbox resizable if
    you can only make it smaller than needed?

     
  • Neil Hodgson

    Neil Hodgson - 2005-06-02

    Logged In: YES
    user_id=12579

    > ... it behaves strangely when you resize the window
    > to the max: The window sort of jumps to the right a
    > few pixels every time.

    This doesn't occur for me on Windows XP.

    > Yes, I'm pointing out that this is overly restrictive
    > and not a very user-friendly design. Why make
    > the listbox resizable if you can only make it smaller
    > than needed?

    But it isn't smaller than needed. It is large enough to
    show all the information. You can tell that there is no more
    information to see because it limits the size. If it was
    infinitely expandable, how do you know that you are seeing
    everything?

    Neil

     
  • Neil Hodgson

    Neil Hodgson - 2005-06-21
    • status: open-accepted --> closed-fixed
     
  • Bjarke Viksøe

    Bjarke Viksøe - 2005-06-24
    • status: closed-fixed --> open
     
  • Bjarke Viksøe

    Bjarke Viksøe - 2005-06-24

    Logged In: YES
    user_id=942046

    Sorry but the latest build did not fix the problem.
    As first suggested the MaxTrackSize() does not take the
    indent and image into account (see attached screenshot)

    Changing the code to...
    Point ListBoxX::MaxTrackSize() const {
    PRectangle rc(0, 0, TextOffset() + (maxCharWidth *
    maxItemCharacters), ItemHeight() * lti.Count());

    fixes the problem.

     
  • Bjarke Viksøe

    Bjarke Viksøe - 2005-06-24

    Screenshot of text-overflow

     
  • Bjarke Viksøe

    Bjarke Viksøe - 2005-06-24

    Logged In: YES
    user_id=942046

    On a note, it might not just be the TextOffset(), but the call to
    AdjustWindowRectEx() that need to adjust for the scrollbar
    as well. Passing the GWL_STYLE data would solve things.

     
  • Neil Hodgson

    Neil Hodgson - 2005-06-27

    Logged In: YES
    user_id=12579

    The scroll bar width is added by
    rcDesired.right += ::GetSystemMetrics(SM_CXVSCROLL);
    The icon width is added in by the TextOffset() in
    rcDesired.right = rcDesired.left + TextOffset() + width +
    (TextInset.x * 2);

    Here are some screen shots showing that the icon width
    and scroll bar width are taken into account:
    http://scintilla.sourceforge.net/AutoComplete.html

     
  • Bjarke Viksøe

    Bjarke Viksøe - 2005-06-27

    Logged In: YES
    user_id=942046

    But that is the "desired" rectangle. When the listbox is shown
    it will immediately ask for the WM_GETMINMAX. This part of
    the code does not consider the scrollbars (in the
    AdjustWindowRectEx() call) and may refuse to resize to the
    desired rectangle. I guess it depends a lot on the font being
    used to actually see this.

     
  • Bjarke Viksøe

    Bjarke Viksøe - 2005-06-27

    Logged In: YES
    user_id=942046

    As mentioned adding TextOffset() solved my problem. I then
    realized that it would have about the same size as the
    scrollbar so I'm not sure which one it should really be. In
    reality adding both, when needed, or simply using rcDesired
    seems more appropriate.

     
  • Neil Hodgson

    Neil Hodgson - 2005-06-27

    Logged In: YES
    user_id=12579

    OK, committed.

     
  • Neil Hodgson

    Neil Hodgson - 2005-06-27
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks