Creating an undraggable titlewindow container in flex

Source: Internet
Author: User

The following examples show how you can create an undraggable titlewindow container by settingIspopupPropertyFalseOn the titlewindow instance.

 

<? XML version = "1.0" encoding = "UTF-8" ?>
<! -- Http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/ -->
< MX: Application Name = "Popupmanager_titlewindow_ispopup_test"
Xmlns: MX = "Http://www.adobe.com/2006/mxml"
Layout = "Vertical"
Verticalalign = "Middle"
Backgroundcolor = "White" >

<MX: script>
<! [CDATA [
Import MX. containers. titlewindow;
Import MX. Managers. popupmanager;

Private var titlewin: mytitlewin;

Private function launch (): void {
Titlewin = popupmanager. createpopup (this, mytitlewin, true) as mytitlewin;
Popupmanager. centerpopup (titlewin );
}
]>
</MX: script>

< MX: applicationcontrolbar Dock = "True" >
< MX: button ID = "BTN"
Label = "Launch titlewindow popup"
Click = "Launch ();"   />
</ MX: applicationcontrolbar >

</MX: Application>

 

Mytitlewin. mxml

 

<? XML version = "1.0" encoding = "UTF-8" ?>
<! -- Http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/ -->
< MX: titlewindow Xmlns: MX = "Http://www.adobe.com/2006/mxml"
Layout = "Absolute"
Showclosebutton = "True"
Title = "Titlewindow"
Width = "300"
Height = "200"
Close = "Titlewin_close (event );" >

mx: script >

Import MX. core. iflexdisplayobject;
Import MX. events. closeevent;
Import MX. managers. popupmanager;

private function titlewin_close (EVT: closeevent): void {
popupmanager.removepopup(evt.tar get as iflexdisplayobject);
}

private function checkbox_change (EVT: Event): void {
This. ispopup = checkbox. selected;
}< br> ]>
mx: script >

<MX: LabelText= "Drag this window"
Horizontalcenter= "0"
Verticalcenter= "0" />

< MX: controlbar >
< MX: checkbox ID = "Checkbox"
Label = "Ispopup :"
Labelplacement = "Left"
Selected = "True"
Change = "Checkbox_change (event );"   />
</ MX: controlbar >

</MX: titlewindow>

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.