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]
<mailto:[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 <http://ups.com>
[mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ups.com
<http://ups.com>] *On Behalf Of *Roman Protsiuk
*Sent:* Thursday, November 30, 2006 5:15 AM
*To:* [email protected] <http://ups.com>
*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.