HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: Scrollbar issue when resizing a cell  (Read 1848 times)

Irushian

  • General Accounts
  • *
  • Posts: 44
    • View Profile
Scrollbar issue when resizing a cell
« on: May 07, 15, 06:01:05 PM »

I've created a sortablecollection with a scrollbar, I have the header predefined in the gui so it's not created via HSL. I've noticed that when doing this the cell height defaults to 20, if I create the header via HSL then it resizes the cell to what the correct height should be for my content however I lose the scrollbar.

So, I attempted to get around this, and I called _recalculateAllCollectionRowsHeight() on the GUI, this resized the cells to the correct height but again caused the scrollbar to vanish. So finally I attempted manually setting the cell height just incase something under the hood was being called that I had not yet noticed, I did this via:

Code: [Select]
   ClientArea as NodeRef of Class GUIControl = FindGUIcontrolByName( me, "Container.sortableCollection.clientarea" )
   foreach Child in ClientArea.children
      child.size.y = 28
   .

Again, the cells height changed to what I wanted it to be and again, the scrollbar vanishes.

I'm stumped and about finished for the night, so I figured best to post this on here and hopefully someone can point me in the right direction when I return in the morning before work, or note if in the unlikely event that this is a bug.

Thanks in advance!
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1156
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: Scrollbar issue when resizing a cell
« Reply #1 on: May 07, 15, 07:12:18 PM »

Something of note, the scrollbar will not show if the children of the window do not fill the window up, unless you set the flag for always showing the bar.

  scrollbar.visible = true  // its initialized to false

Do you create the client area each time the GUI opens? If not, you might need to clear out what was previously in there.

  foreach child in clientarea.children
     destroynode(child)
  .

Do you use the _scollableParent with the prebuilt in _scrollbar and clientarea ? I use the prebuilt GUIs, but modify the actual textures used.

In adding to the clientarea, do you create a new child that is defined as a prototype already? This is where you might set the size.y of that prototype GUI.
Logged

Irushian

  • General Accounts
  • *
  • Posts: 44
    • View Profile
Re: Scrollbar issue when resizing a cell
« Reply #2 on: May 08, 15, 02:23:29 AM »

The visible flag is indeed set to true and the gui is created upon being opened each time.

When I create the new cell, I do create it from a prototype as well, although this does actually have the correct height already which doesn't do anything for the actual sortable selection. The issue isn't the cell content, but the cell itself. It's not expanding to fit the contents when they are added and manually setting the height of the actual cell (not the content, because the content is fine and already at the correct height, just clipped off due to the cell) causes the scrollbar to vanish, and it doesn't return even when you add enough rows to make the scrollbar required to view all of the data.

I hope that clears it up a bit more for you.
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Scrollbar issue when resizing a cell
« Reply #3 on: May 08, 15, 10:58:14 AM »

There is a bit of bug, I believe, in the scrollbar source code where it sometimes gets hidden when it shouldn't.  For what it is worth, when I've seen that happen, I found that changing the size of the window by dragging an edge will make the bar appear.  I find that this issue happens sometimes when I press Control-Shift-T on a gui and select Analyze on a control that has a lot of children below it.  In that case the scrollbar appears and disappears with each one added to the list and at the end the bar is often hidden, even when there are many more items than appear on screen.

I thought I remembered an Idea Fabrik commenting on this before, but I cannot find it in the forums.
« Last Edit: May 08, 15, 11:00:09 AM by FI-ScottZ »
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Irushian

  • General Accounts
  • *
  • Posts: 44
    • View Profile
Re: Scrollbar issue when resizing a cell
« Reply #4 on: May 08, 15, 11:38:41 AM »

I've been examining the gui with the ctrl+shift+t analyser as well and I also noticed that the visible property is getting changed to false when the cell height changes, and changing the properties inside that tool makes the scroll bar appear for a split second and disappear again, with its property reverted back to hidden. Though I haven't managed to track down the source of that within the engine scripts.

Hopefully one of the HE devs will notice this thread and experiment with it a little to track down if this is indeed a bug, or offer some advise to fix it on our end if it's possible as I changing the window size doesn't seem to have any affect on my control.
Logged

Irushian

  • General Accounts
  • *
  • Posts: 44
    • View Profile
Re: Scrollbar issue when resizing a cell
« Reply #5 on: May 11, 15, 11:28:06 AM »

Any news with this, HE devs? :)
Logged