Okay, I actually got a bit distracted and didn't end up working on this for the 
last day or so, however after a brief search I did find the solution in the 
archives, however I implemented it slightly differently (it's along the lines 
of what you were saying, Alex):

private function handleOpen (
                                                aEvent:DropDownEvent
                                               ):void
{
  var myScreenWidth:Number  = Application(Application.application).width;
  var myCombo:cComboBox    = aEvent.currentTarget as cComboBox;
  var myCurrentX:Number        = localToGlobal(new Point(this.x, this.y)).x;

  if(myCurrentX + myCombo.dropdown.width - 50) > myScreenWidth) {
      myCombo.dropdown.x = myScreenWidth - myCombo.dropdown.width;
  }
}

This is specifically because I don't really care unless it's at the right edge 
of the screen and will be cut off, so only in that case do I do anything.  
cComboBox is my own extended combo box, and as you can tell the function is 
within it with the listener being added in the constructor.

Thanks for the direction!

-Julian




________________________________
From: Alex Harui <aha...@adobe.com>
To: "flexcoders@yahoogroups.com" <flexcoders@yahoogroups.com>
Sent: Thu, November 19, 2009 1:09:10 AM
Subject: RE: [flexcoders] Combo box right-anchor

   
There is no API for this.  You might find an old discussion of
this problem in the archives.  I think you have to get the dropdown, add an
eventListener for “show” and/or “move” and reposition then.  You may also have
to adjust the scrollRect.
 
Alex Harui
Flex SDK Developer
Adobe
Systems Inc.
Blog: http://blogs. adobe.com/ aharui
 
From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of Julian
Alexander
Sent: Wednesday, November 18, 2009 6:16 PM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] Combo box right-anchor
 
  
That's kinda what I'm trying to
do - I've already got it solved where it sets the drop down width dynamically
based on the content of the lookup, however the combo box is on the right side
of the screen and the drop down gets cut off by the right side of the screen,
thus I'm trying to anchor it on the right.

Is there any way to do this?
 

________________________________
 
From:Alex Harui
<aha...@adobe. com>
To: "flexcod...@yahoogro ups.com" <flexcod...@yahoogro ups.com>
Sent: Wed, November 18, 2009 6:39:23 PM
Subject: RE: [flexcoders] Combo box right-anchor

  
Setting dropDownWidth will make it
wider, but you may not like where it puts the left edge.
 
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs. adobe.com/
aharui
 
From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf
Of wb...@ymail. com
Sent: Wednesday, November 18, 2009 12:19 PM
To: flexcod...@yahoogro ups.com
Subject: [flexcoders] Combo box right-anchor
 
  
Dear All,

I am trying to make a combo box with an extended drop down (wider than the
control) anchor to the right. Basically I want

                         
------------ ----+-+
                         
|My Combo_|V|
          ------------ ---------
--------+
          |___________ _____ 
|
          |___________ _____ 
|
          |___________ _____ 
|

Hopefully my little ascii diagram makes sense...

Does aynyone know how this could be do! ne?
 
 


      

Reply via email to