HeroEngine Forums

HeroEngine Support => GUI Creation => Topic started by: AWW_boss on May 30, 13, 01:27:06 PM

Title: _sortableCollection wonky scrollbar behaviour
Post by: AWW_boss on May 30, 13, 01:27:06 PM
Hi!

I have a _window control with a _sortableCollection child. The layout is shown in this picture:
(https://dl.dropboxusercontent.com/u/79625595/sortablecollection.png)

The problem in my setup is that when i populate _sortableCollection with enough rows it can scroll, the scrollbar never shows. Also when i resize the control it sometimes shows the scrollbar and sometimes not, and sometimes it flickers as i resize the window.

Anyone knows what could be the problem in my setup???
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: Thazager on May 30, 13, 07:28:09 PM
Just a guess. Since the client area is most likely the place the text is going to, in order for the _sortableCollection to be a part of that scrolling, it may need to be a child of the clientarea under the scrollable.
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: AWW_boss on May 31, 13, 02:15:18 AM
Hi!

Thanks, that removed the problem with flickerish scrollbar - it no longer flickers. But the following problem remains: i need to initially resize the window just a little bit in order for the scrollbar to pop up. Once i resize it, it continues to work as expected. Wierd.
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: FI-ScottZ on May 31, 13, 04:07:26 AM
Boss,

I believe that is an issue with the underlying engine code, as it happens even with some standard HeroBlade guis.  The autohide sometimes seems to hide the bar when an item is added and does not unhide until the window is resized.   I am guessing it is a call to layout that triggers the unhiding.
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: AWW_boss on May 31, 13, 06:12:02 AM
Blargh, my frustration levels just vent high. Do you know of a workaround i could use?
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: FI-ScottZ on May 31, 13, 09:46:29 AM
You could try calling ForceLayout on the gui after items are added and see if that helps.
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: AWW_boss on Jun 01, 13, 09:30:06 AM
ForceLayout didn't help either :(

If it is possible, I would like to kindly ask the heroengine engineers if they could take a look at the problem and suggest a solution or a workaround.

Here is the video that describes it, the scrollbar flickering when adding/removing collection rows:
https://dl.dropboxusercontent.com/u/79625595/HeroBlade%202013-06-01%2015-51-56-18.mp4

Here is the guixml of my control:

Code: [Select]
<createControlType class='MUD_GUIOverviewWindow' type='MUD_GUIOverviewWindow' description='MUD_GUIOverviewWindow' treePath='CleanEngine' name="MUD_GUIOverviewWindow" gotoTopOnMouseDown="true" owner="0" skipTextureAlphaTest="true" allowTitlebar="true" allowCloseButton="true" allowDragging="true" resizeable="ALL" scrollable="VERTICAL">
  <size x="208" y="240"/>
  <minimumSize x="200" y="200"/>
  <defaultStatePresentation>
    <color a="0"/>
  </defaultStatePresentation>
  <_resizeTop name="resizeTop"/>
  <_resizeBottom name="resizeBottom"/>
  <_resizeLeft name="resizeLeft"/>
  <_resizeRight name="resizeRight"/>
  <_titlebar name="titlebar"/>
  <_spacer name="_spacer" dockMode="FILL">
    <size x="200" y="204"/>
    <_sortableCollection name="_sortableCollection">
      <set name='MUD_GUIOverviewWindow._spacer._sortableCollection.scrollbar' attribute='visible' value="false"/>
    </_sortableCollection>
  </_spacer>
</createControlType>



And here is the code i am using to add/remove rows:


Code: [Select]
remote function aww (type as String)
  overviewWindow as NodeRef of Class MUD_GUIOverviewWindow = FindGUIControlByName( None, "MUD_GUIOverviewWindow")
 
  if (overviewWindow <> None)
    sortableCollection as NodeRef of Class _GUISortableCollection = FindGUIControlByName( overviewWindow, "_spacer._sortableCollection")
   
    if type == "add"
      row as List of String
      add back "BLA1" to row
      add back "BLA2" to row
      add back "BLA3" to row
      add back "BLA4" to row
      add back "BLA5" to row
      sortableCollection._addCollectionRow(row)
    else if type == "remove"
      var clientarea = sortableCollection.getClientarea()
      assert(clientarea != 0, "Couldn't find the content area!")
      remove clientarea.children at clientarea.children.length destroy
      forceLayout(clientarea)
    .
  .
.



Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: Thazager on Jun 01, 13, 07:19:14 PM
The flashing looks like the scrollbar is displaying, and then something is displaying over the top of the GUI. Perhaps setting the size of the overlay to a value just short of reaching the scrollbar. Another idea is that when you make something the child of the scrollable/clientarea that new child then becomes the child that you want to put your new info into, rather than still using the clientarea as the place to add in new info. A third possibility is that making the scrollbar visible = false, it removes the display after the adding of items creates the display of the scrollbar (as its beyond the window height).
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: AWW_boss on Jun 02, 13, 03:27:23 AM
Quote
The flashing looks like the scrollbar is displaying, and then something is displaying over the top of the GUI. Perhaps setting the size of the overlay to a value just short of reaching the scrollbar. Another idea is that when you make something the child of the scrollable/clientarea that new child then becomes the child that you want to put your new info into, rather than still using the clientarea as the place to add in new info. A third possibility is that making the scrollbar visible = false, it removes the display after the adding of items creates the display of the scrollbar (as its beyond the window height).

I've been looking into this for a couple of days and i am out of ideas how to solve it. Would it be possible for me to hire you to solve this problem? ;)

It should be really easy to reproduce since i provided all the code. Name your price!

Cheers
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: Thazager on Jun 02, 13, 08:01:25 PM
I might be able to help, though I have not worked with all the different GUIs they made for the hero engine. I'm not looking for money at present, and already on team of my choosing. I could take a look at it and maybe find a solution, or at least make it a little better.
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: AWW_boss on Sep 27, 13, 04:40:26 PM
Hi! I beg you, i still have a problem with this. I have a very simple setup and all the time i get a wonky hidden scrollbar. Can someone give me any clues what am i doing wrong here?
I have a simple window with a scrollable parent. Inside the scrollable parents clientarea i am putting collection rows. Here is the xml and here is a video:

https://dl.dropboxusercontent.com/u/79625595/HeroBlade%202013-09-27%2023-17-08-96.mp4

<createControlType class='MUD_GUI_NEWOverviewWindow' type='MUD_GUI_NEWOverviewWindow' description='MUD_GUI_NEWOverviewWindow' treePath='CleanEngine' name="MUD_GUI_NEWOverviewWindow" gotoTopOnMouseDown="true" owner="0" skipTextureAlphaTest="true" allowTitlebar="true" allowCloseButton="true" allowDragging="true" resizeable="ALL" scrollable="VERTICAL">
  <size x="208" y="240"/>
  <minimumSize x="10" y="10"/>
  <defaultStatePresentation>
    <color a="0"/>
  </defaultStatePresentation>
  <_resizeTop name="resizeTop"/>
  <_resizeBottom name="resizeBottom"/>
  <_resizeLeft name="resizeLeft"/>
  <_resizeRight name="resizeRight"/>
  <_titlebar name="titlebar"/>
  <_scrollableParent name="_scrollableParent"/>
</createControlType>
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: Thazager on Sep 27, 13, 06:44:02 PM
I have been trying to recreate the gui and the functions with it, but I am missing the setup sections for it.

error - "Row has incorrect number of entries: got 5, needed 0"

I can get it to display on screen as the window, but I am not getting the info to start displaying in the window.

One thought I had while putting it together. There is a client in the _scrollableParent, and a client in the _sortableCollection area. Perhaps try removing the _scrollableParent section amd just using the client from the _sortableCollection? The _sortableCollection does have its own scrollbar.
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: AWW_boss on Sep 27, 13, 11:52:04 PM
I am not using a _sortableCollection here. I decided to build this component from scratch, because i kinda hoped if i build it from scratch and i understand it, i won't have the flickerish problem anymore. The only clientarea here is the client in the _scrollableParent
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: Thazager on Sep 28, 13, 12:15:40 AM
OK, that works. Though when you build it, remember to not use both client areas, as one of them might be displaying on top of the other causing the flicker.
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: AWW_boss on Sep 28, 13, 12:17:18 AM
OK, that works. Though when you build it, remember to not use both client areas, as one of them might be displaying on top of the other causing the flicker.

I don' understand what you are trying to say. Can you be more specific?
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: Thazager on Sep 28, 13, 12:24:06 AM
When you have 2 client areas they might be conflicting, both of them trying to display what is in their client section. First one will try to show what it has, then the other will try to show what they have, and since they both are trying to show, it might cause the flickering.
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: AWW_boss on Sep 28, 13, 12:49:08 AM
But i don't have two, i just have one client area.
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: Thazager on Sep 28, 13, 01:06:38 AM
Good, then building your own _sortableCollection from scratch wont cause flickering.
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: AWW_boss on Sep 28, 13, 01:36:28 AM
Nevertheless, i think this is a bug. To reproduce you'd need to add _collection (class GUICollection, dockmode TOP) to a _scrollablePanel (GUIScrollablePanel) and make it scroll.
Now if someone could reproduce it, to confirm that it is not only me that is seeing it, it would be nice.
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: AWW_boss on Sep 28, 13, 02:13:42 AM
Here is new development. If i resize client screen the scrollbar pops out and starts working correctly. So the question is... what is it that the resize does to the client that i could mimic. It is not forceLayout, because i tried all sorts of forced layout combinations all over my code.
Title: Re: _sortableCollection wonky scrollbar behaviour
Post by: AWW_boss on Sep 28, 13, 07:54:46 AM
It seems that the solution to my problem was rather simple.

Before putting a collection inside something that scrolls,  i packed it inside a simple panel ... now i have something like this:


collection (dockmode FILL) which is inside panel (dockmode UP) which is inside scrollablePanel


i have a good feeling about this