HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.
Pages: [1] 2

Author Topic: _sortableCollection wonky scrollbar behaviour  (Read 4339 times)

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
_sortableCollection wonky scrollbar behaviour
« 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:


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???
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1156
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: _sortableCollection wonky scrollbar behaviour
« Reply #1 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.
Logged

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: _sortableCollection wonky scrollbar behaviour
« Reply #2 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.
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: _sortableCollection wonky scrollbar behaviour
« Reply #3 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.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: _sortableCollection wonky scrollbar behaviour
« Reply #4 on: May 31, 13, 06:12:02 AM »

Blargh, my frustration levels just vent high. Do you know of a workaround i could use?
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: _sortableCollection wonky scrollbar behaviour
« Reply #5 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.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: _sortableCollection wonky scrollbar behaviour
« Reply #6 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)
    .
  .
.



« Last Edit: Jun 01, 13, 11:38:31 AM by AWW_boss »
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1156
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: _sortableCollection wonky scrollbar behaviour
« Reply #7 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).
Logged

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: _sortableCollection wonky scrollbar behaviour
« Reply #8 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
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1156
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: _sortableCollection wonky scrollbar behaviour
« Reply #9 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.
Logged

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: _sortableCollection wonky scrollbar behaviour
« Reply #10 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>
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1156
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: _sortableCollection wonky scrollbar behaviour
« Reply #11 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.
Logged

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: _sortableCollection wonky scrollbar behaviour
« Reply #12 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
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1156
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: _sortableCollection wonky scrollbar behaviour
« Reply #13 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.
Logged

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: _sortableCollection wonky scrollbar behaviour
« Reply #14 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?
Logged
Pages: [1] 2