We have detected that cookies are not enabled on your browser. Please enable cookies to ensure the proper experience.
Results 1 to 6 of 6

Thread: ListBox Query

  1. #1
    Join Date
    Jun 2009
    Location
    UK
    Posts
    1,461

    ListBox Query

    Hey,

    I wonder if anyone can help me with a problem I'm having with listboxes.

    I have a listbox which I want to add items to horizontally and vertically to tile-fill the box. I can use SetMaxItemsPerLine() to force the listbox to add controls over a certain count to a new line.. I don't want the listbox to scroll horizontally or vertically as there should be enough space. When the controls are all the same size, I can easily calculate how many would fit into a line in the box and set the max items per line to accommodate. Now, the problem I'm having is that the controls are dynamic in size and it's no longer possible to calculate how many will fit into one line. What I'm looking for is a way to wrap automatically when no scrollbar is set. Does anyone know how this can be done? Perhaps I am missing something obvious? As it stands, my controls are running off the side of the box and can't be seen

    Thank you.
    [CENTER][SIZE=3][B]Galuhad | Narvelan[/B]
    Lore Breakers of Eldar[/SIZE]

    [URL="http://www.lotrointerface.com/list.php?skinnerid=3762"]Plugins[/URL] | [URL="https://www.lotro.com/forums/showthread.php?538975-Accounts-for-New-Players"]New Player Guide[/URL] | [URL="http://www.twitch.tv/galuhad"]Twitch[/URL]
    [/CENTER]

  2. #2
    Join Date
    Mar 2007
    Posts
    1,191
    When you say the items are dynamic do you mean variable as in they can be different sizes but once added to the list they stay whatever size they are or are they truly dynamic in that the size can change once they are in the list?

  3. #3
    Hi Galuhad,

    I'm at work so I can't try it, but have you thought of using a variation of Garan's method for sizing text boxes (https://www.lotro.com/forums/showthr...#post5784197)? I.e., go ahead and bind a scrollbar to it, and use the scrollbar's IsVisible () method to determine whether you need to do any wrapping.
    Thurallor, Warden of Landroval

  4. #4
    Join Date
    Jun 2009
    Location
    UK
    Posts
    1,461
    The items vary in size when added. Once added the size does not change. However clicking on an item will move it to a second list box, and clicking again will move it back. The item size will not change, but the position may. I am using the scrollbar method for sizing the items - which are basically labels of various lengths. But because the item width is determined at run time, I need a way to wrap the items without the max items per line setting. It seems silly to me that it doesn't do this automatically.
    [CENTER][SIZE=3][B]Galuhad | Narvelan[/B]
    Lore Breakers of Eldar[/SIZE]

    [URL="http://www.lotrointerface.com/list.php?skinnerid=3762"]Plugins[/URL] | [URL="https://www.lotro.com/forums/showthread.php?538975-Accounts-for-New-Players"]New Player Guide[/URL] | [URL="http://www.twitch.tv/galuhad"]Twitch[/URL]
    [/CENTER]

  5. #5
    Yeah, I meant putting a scrollbar on the list control itself. Don't know if you can do that.
    Thurallor, Warden of Landroval

  6. #6
    Join Date
    Jun 2009
    Location
    UK
    Posts
    1,461
    I've made my own class to handle this instead. Works the same as the ListBox, except when adding a new item, if the new item:GetLeft() + GetWidth() exceeds the width of the control, then it is automatically moved to a new line. Works like a charm
    [CENTER][SIZE=3][B]Galuhad | Narvelan[/B]
    Lore Breakers of Eldar[/SIZE]

    [URL="http://www.lotrointerface.com/list.php?skinnerid=3762"]Plugins[/URL] | [URL="https://www.lotro.com/forums/showthread.php?538975-Accounts-for-New-Players"]New Player Guide[/URL] | [URL="http://www.twitch.tv/galuhad"]Twitch[/URL]
    [/CENTER]

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

This form's session has expired. You need to reload the page.

Reload