Jump to content


Photo

Scrollbar style


  • Please log in to reply
43 replies to this topic

#41 AIM

AIM

    Senior Member

  • Honorable Members
  • PipPip
  • 202 posts

Posted 31 July 2008 - 07:03 PM

Small bug with the NxComboBox scrollbar in the latest preview release.

I have a NxComboBox with 10 entries and a DropDown count of 20. With the latest preview version a scrollbar is displayed, but the size of the drop down is sized correctly for 10 entries. The latest official version doesn't display this scrollbar.

I think the culprit is in NxPopupControl.pas where you introduced the following line in "TNxPopupList.Popup":

VertScrollBar.Visible := Items.Count > DropDownCount;

DropDownCount is 8 instead of 20 in that case.

#42 AIM

AIM

    Senior Member

  • Honorable Members
  • PipPip
  • 202 posts

Posted 31 July 2008 - 08:00 PM

Start attached demo and popup the scroll down list...
DropDownCount is 20, but in TNxPopupList.Popup the DropDownCount is 8, that's why the scrollbar is displayed.

Attached Files



#43 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,195 posts
  • Gender:Male

Posted 31 July 2008 - 08:07 PM

Hello Aim,

Please try to replace next line (NxEdit.pas):

CODE
procedure TNxComboBox.BeforeDrop(var APoint: TPoint);
begin
  with FPopupControl as TNxPopupList do
  begin            
    DropDownColor := FDropDownColor;
    DropDownCount := FDropDownCount; // <----------------- new line
    HighlightTextColor := FHighlightTextColor;
    DisplayMode := FDisplayMode;
    Items := FItems;
    Images := FImages;
    ItemHeight := Self.ItemHeight;
    ItemIndex := Self.ItemIndex;
    ShowImages := Images <> nil;
    SelectionColor := Self.SelectionColor;
    if FListWidth > 0 then Width := FListWidth else Width := Self.Width;
    if Width < Self.Width then Width := Self.Width;
        if Items.Count <= Self.DropDownCount then ClientHeight := Items.Count * Self.ItemHeight
            else ClientHeight := Self.DropDownCount * Self.ItemHeight;
    ClientHeight := ClientHeight + 4;
  end;
end;


regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#44 AIM

AIM

    Senior Member

  • Honorable Members
  • PipPip
  • 202 posts

Posted 31 July 2008 - 08:11 PM

Thanks, adding that line fixes that behavior...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users