Author Topic: UITable / UIPanel Requests  (Read 1425 times)

DirtyHippy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
UITable / UIPanel Requests
« on: January 24, 2014, 12:20:56 PM »
Three questions (added another):

1) For UITable, it doesn't reposition right away on the first update until it grabs a reference to the panel.  If you don't use keep within panel there doesn't appear to be a reason to wait until the update.  Can you allow Reposition () to fire immediately when KeepWithinPanel is false and initdone is false?

  1.                 if (Application.isPlaying && !mInitDone && NGUITools.GetActive(this) && keepWithinPanel)
  2.                 {
  3.  

When I put this in, it resolves a lot of problems that require me to wait a frame.  You could also put in a little optimization to not bother grabbing the panel if KeepWithinPanel is false.  I know I could subscribe to the OnReposition event, but this works better IMHO.

2) Can we get an event for panel dimensions changing?  I dynamically change clipping areas of panels in scroll views and I need to propagate those changes to subscribers so they can adjust their dimensions in some cases.  There is a panel OnChange, but it handles a different use case than UIWidget OnChange (which handles dimensions).  Why not add a OnDimensionChanged event to the UIRect that both UIWidget and UIPanel inherit?

3) Any way you could make the isEnabled in UIButton virtual?  I inherit from this class and override this behavior since UIButton expects a collider and disables itself without one.  Instead, I am using it without a collider and pushing events to it manually from underlying colliders (I use this for RowHover highlights on my multi-column list control).  This one is debatable, but I don't see any harm in it.
3.09 f4

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable / UIPanel Requests
« Reply #1 on: January 25, 2014, 02:24:07 AM »
1. UITable doesn't delay anything until the next update. It performs its logic in Start(). It will do it in Update() as well if you re-enable it later. If you re-enable it yourself and want it to execute immediately, don't re-enable it -- call Reposition() instead.

2. Since you are the one who changes the rect of the panel, why not just call the functions yourself? gameObject.BroadcastMessage("MarkAsChanged", SendMessageOptions.DontRequireReceiver); would do the trick, without even having to GetComponents.

3. Certainly. It will be virtual in 3.0.9 f5.