View Single Post
Colen
Senior Member
Lone Wolf Staff
 
Join Date: Dec 2008
Posts: 4,690

Old February 24th, 2009, 09:04 AM
In this case, it's not reasonable to expect things to work correctly when all 5 things are present. At most, you'll have a 400-ish pixel wide space, and unless you want to have a 2-row high table cell, you're just not going to be able to fit everything in and still have enough space.

In situations like this, I would think a reasonable assumption was "No more than 3 selections will be needed for any one pick". Then you can write a position script that operates as follows (pseudocode):

Code:
var nextleft as number
nextleft = right of name portal + 10
~nextleft is now the starting left position for the next visible portal

if domain portal is not used,
  hide it
else
  domain portal position = nextleft
  domain portal width = 1/3 of space to the right of the name
  nextleft = right of domain portal + 10
  endif

if thing menu 1 is not used,
  hide it
else
  thing menu 1 position = nextleft
  thing menu 1 width = 1/3 of space to the right of the name
   nextleft = right of thing menu 1 + 10
  endif

... repeat for other 3 portals ...
That way you're positioning all the portals one by one, putting them into an appropriate amount of space for each. If you have more than 3, the extras will be positioned off to the side, and not appear - you can also track the visible count and just hide them yourself.

The UserSelect component should be in the file "components.core", near the top.
Colen is offline   #2 Reply With Quote