Seems to me that overriding isPopUp for these purposes isn't very good idea,
as isPopUp might be used to determine whether component is popped up by a
PopUpManager. And something like custom MOWSE_DOWN handling proposed by Doug
or overriding startDragging proposed by Mike looks more flexible.

Excerpt from documentation (Class UIComponent):
"isPopUp property

public var 
isPopUp:Boolean<http://livedocs.macromedia.com/flex/2/langref/Boolean.html>

Set to true by the PopUpManager to indicate that component has been popped
up."
Have I understood this correctly?

R.

On 12/1/06, Dustin Mercer <[EMAIL PROTECTED]> wrote:

   Ah yes, well should have tested before I spoke.  That was the old Flex
1.5 way, now you can to override that method as Doug said.  Nice catch.  J



I overrided the isPopUp method and it worked like a champ.  Looks like you
can use the TitleWindow and just use this code.



override public function get isPopUp():Boolean {

            return false;

}



Dustin Mercer


 ------------------------------

*From:* [email protected] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Doug McCune
*Sent:* Thursday, November 30, 2006 3:21 PM
*To:* [email protected]
*Subject:* Re: [flexcoders] not draggable TitleWindow



As far as I know the dragging functionality has nothing to do with
TitleWindow vs. Panel, it's all about whether the Panel was created by the
PopupManager. So if you use the PopupManager to add the Panel then it will
be draggable. The code that determines whether or not to drag a Panel when
the user clicks on the title bar is this:

if (enabled && isPopUp && isNaN(regX))
            startDragging(event);

So it seems like the only difference between TitleWindow and Panel has to
do with showing the close button or not. Using a Panel instead of
TitleWindow shouldn't change whether it's draggable or not. I haven't tested
this, I'm just assuming from looking at the code. You either need to extend
Panel (or TitleWindow) or use something other than Panel.

Another option might be to extend Panel and simply override isPopUp to
make that always return false.


Dustin Mercer wrote:

 Actually, the TitleWindow extends from the Panel, so they share the same
base code.  The only main differences between the 2 are the closeButton and
the drag features (Panel does not have a close button).  If you can
sacrifice the close button (just use a button with a label of close or
cancel in the control bar of the Panel) then you will have basically the
same class, with no drag ability.  You can still use the same static methods
on the PopUpManager like you would with a TitleWindow.  Which sounds like
what you were looking for.  Tracy's advice is spot on.



Dustin Mercer


 ------------------------------

*From:* [email protected] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Roman Protsiuk
*Sent:* Thursday, November 30, 2006 1:13 PM
*To:* [email protected]
*Subject:* Re: [flexcoders] not draggable TitleWindow



Hi, Tracy.

Maybe. But we needed the dialog to look like TitleWindow and what I know
about TitleWindow is that it specially designed to be used as pop-up. Why to
use Panel? By the way if dialog is Panel we'll have to include something
like TitleBar or some kind of Label, FormHeader, etc in it to show title.

Thanks for the advise.

Roma

On 11/30/06, *Tracy Spratt* <[EMAIL PROTECTED]> wrote:

Are you committed to using TitleWindow?  You can pop-up most any other
component, like Panel, which would not be draggable by default.



Tracy


 ------------------------------

*From:* [EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com] *On
Behalf Of *Roman Protsiuk
*Sent:* Thursday, November 30, 2006 5:15 AM
*To:* [email protected]
*Subject:* [flexcoders] not draggable TitleWindow



Hi, everyone.

I guess there is some way to make TitleWindow not draggable, isn't there?
Tried
titleBar.mouseEnabled = false;
that didn't help.

Any ideas?

Thanks,
R.





Reply via email to