[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => bdeen [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> Title Window Resizable - Macromedia Flex General Discussion

Title Window Resizable - Macromedia Flex General Discussion

I have the code that allows you to create a ResizableTitleWindow. If anyone would be interested in this please let me know and I'll share the basic code that I wrote to do the job....

  1. #1

    Default Title Window Resizable

    I have the code that allows you to create a ResizableTitleWindow. If anyone would be interested in this please let me know and I'll share the basic code that I wrote to do the job.


    bdeen Guest

  2. #2

    Default Re: Title Window Resizable

    Yeah, man!

    We need more extended components available, post that bad boy!

    Tracy
    ntsiii Guest

  3. #3

    Default Re: Title Window Resizable

    Here it is. Now be nice, this was my first time using the MovieComponent as a
    drawing area. I hope I got all the measurements and what not correct. Here
    are a few nice things about it. 1) if you have a footer colors set, it will
    do it's best to match those colors. 2) it uses an empty movie component for
    the icon. 3) when you roll over the movie component is should turn the color
    of the theme color (like the buttons, it also seems to get set with style
    sheets). 4) it calculates a minimum width and minimum height. 5) This
    component is built to be used just like the TitleWindow. Let me know if anyone
    improves upon this.

    <!-- Author: Bruce Deen (bdeencopera.org) -->


    <mx:TitleWindow xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns="*"
    backgroundColor="#FFFFFF" creationComplete="getSmallest()">
    <mx:Script>
    <![CDATA[
    import mx.containers.Panel;
    import mx.utils.Delegate;
    // used for the resizable Area.
    var resizeBox:MovieClip;
    var currentBoxColor:Number;

    private var __smallestWidth: Number; // gives the smallestwidth including
    title bar.
    private var __state: Number=1; // 0=Minimized 1=Maximized

    private var originalBackgroundColor: Number;

    function layoutChildren():Void
    {
    super.layoutChildren();
    drawResizeBox();
    }
    /**
    * Calculates the smallest width the title bar can be sized down to,
    without crossing the title and the buttons together.
    **/
    function getSmallest()
    {
    var gap=4;
    var vm = border_mc.borderMetrics;
    var buttonWidth=10;
    back_mc.title_mc.measure();
    __smallestWidth=back_mc.title_mc.width+vm.right+bu ttonWidth+gap;
    }

    function createChildren(): Void
    {

    super.createChildren();

    if(controlBar_mc != undefined && controlBar_mc.visible != false)
    resizeBox = controlBar_mc.createEmptyMovieClip("resizeBox", 20201);
    else resizeBox = this.createEmptyMovieClip("resizeBox", 20201);
    resizeBox.height=10;
    resizeBox.width=10;
    resizeBox.onPress = Delegate.create(this, beginDrag);
    resizeBox.onMouseUp = Delegate.create(this, endDrag);
    resizeBox.onMouseMove =Delegate.create(this, updateMouse);
    resizeBox.onRollOver=Delegate.create(this,resizeHi ghlight);
    resizeBox.onRollOut=Delegate.create(this,resizeUnH ighlight);
    currentBoxColor = resizeBox._parent.getStyle("borderColor");


    }
    function resizeUnHighlight()
    {
    currentBoxColor=resizeBox._parent.getStyle("border Color");
    drawResizeBox();
    }
    function resizeHighlight()
    {
    currentBoxColor = resizeBox._parent.getStyle("themeColor")
    drawResizeBox();
    }
    function drawResizeBox(color)
    {
    var buttonWidth=14;
    var buttonHeight=14;
    var gap=4;
    var vm = border_mc.borderMetrics;
    var x = resizeBox._parent.layoutWidth - vm.right- (resizeBox.width);
    var y = resizeBox._parent.layoutHeight -vm.bottom
    -(resizeBox.height);//Math.round((resizeBox._parent.height -
    resizeBox._parent.getStyle("marginBottom")))-vm.bottom-gap;
    resizeBox.clear();

    resizeBox.lineStyle(1,currentBoxColor, 100);
    if(controlBar_mc != undefined && controlBar_mc.visible != false)
    {
    var alphas = [Math.round((resizeBox.height/controlBar_mc.height)*100), 100];
    var ratios = [0,0xFF];
    var matrix = {matrixType:"box", x:x, y:y, w:resizeBox.width,
    h:resizeBox.height, r:(90/180)*Math.PI};
    resizeBox.beginGradientFill("linear",
    resizeBox._parent.getStyle("footerColors"), alphas, ratios, matrix);
    }else
    {
    x -=resizeBox._parent.getStyle("marginRight") ;
    y -= resizeBox._parent.getStyle("marginBottom") ;

    resizeBox.beginFill(resizeBox._parent.getStyle("ba ckgroundColor"));
    }
    resizeBox.onPress = Delegate.create(this, beginDrag);
    resizeBox.onMouseUp = Delegate.create(this, endDrag);
    resizeBox.onMouseMove =Delegate.create(this, updateMouse);
    resizeBox.moveTo(x+resizeBox.width, y);
    resizeBox.lineTo(x+resizeBox.width, y+resizeBox.height);
    resizeBox.lineTo(x, y+resizeBox.height);
    resizeBox.lineTo(x+resizeBox.width, y);
    }

    var doDrag:Boolean=false;
    var mXBegin;
    var mYBegin;
    function beginDrag()
    {
    mXBegin=this.width - this.mou;
    mYBegin = this.height - this.mouseY;
    doDrag = true;
    }
    function endDrag()
    {
    if(doDrag)
    {
    var resize:mx.effects.Resize = new mx.effects.Resize(this);
    resize.widthBy=_root.mou-this.width-this.x+mXBegin;
    resize.heightBy=_root.mouseY-this.height-this.y+mYBegin;
    var newWidth = this.width+resize.widthBy;
    var newHeight = this.height+resize.heightBy;
    var smallestHeight =
    getStyle("headerHeight")+10+(resizeBox.height);
    if(newHeight<smallestHeight)
    {
    currentBoxColor=resizeBox._parent.getStyle("border Color");
    resize.heightBy=smallestHeight-this.height;
    }
    if(newWidth<__smallestWidth)
    {
    currentBoxColor=resizeBox._parent.getStyle("border Color");
    resize.widthBy=__smallestWidth-this.width;
    }
    resize.duration=1;
    resize.playEffect();
    doDrag=false;
    this.redraw(true);
    drawResizeBox();
    }
    }
    function updateMouse(event)
    {
    if(!doDrag) return;
    var resize:mx.effects.Resize = new mx.effects.Resize(this);
    resize.widthBy=_root.mou-this.width-this.x+mXBegin;
    resize.heightBy=_root.mouseY-this.height-this.y+mYBegin;

    var newWidth = this.width+resize.widthBy;
    var newHeight = this.height+resize.heightBy;
    var smallestHeight = getStyle("headerHeight")+10+(resizeBox.height);
    if(newHeight<smallestHeight)
    {
    resize.heightBy=smallestHeight-this.height;
    }
    if(newWidth<__smallestWidth)
    {
    resize.widthBy=__smallestWidth-this.width;
    }
    resize.duration=1;
    resize.playEffect();
    }
    ]]>
    </mx:Script>
    </mx:TitleWindow>

    bdeen Guest

  4. #4

    Default Re: Title Window Resizable

    For my next component I'll be doing a multi window management piece that
    extends the resizable window. the features (hopefully) 1) max (given a
    container area). 2) minimize (with an effect down to the widget that controls
    the window) 3) restore 4) tile windows functionality (this is the last one I
    need to do).

    bdeen Guest

  5. #5

    Default Re: Title Window Resizable

    Quote Originally Posted by bdeen View Post
    I have the code that allows you to create a ResizableTitleWindow. If anyone would be interested in this please let me know and I'll share the basic code that I wrote to do the job.
    Yes i need it my email is [email]rajesh.singhoutworx.com[/email]
    Unregistered Guest

  6. #6

    Default Title Window Resizable

    Quote Originally Posted by bdeen View Post
    I have the code that allows you to create a ResizableTitleWindow. If anyone would be interested in this please let me know and I'll share the basic code that I wrote to do the job.
    could you please send me the resizable title window code for flex 3?
    Kavi Guest

Similar Threads

  1. How to get the browser window title or the http url?
    By Venkata_Vadnala@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 5
    Last Post: February 5th, 04:25 AM
  2. Auto resizable popup window
    By JJulien in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: April 29th, 06:52 PM
  3. How to turn off the title bar on a MIAW window?
    By GYULA CZINANO in forum Macromedia Director Basics
    Replies: 2
    Last Post: August 31st, 03:49 PM
  4. Setting Window Title On New Window
    By Daniel Morrissey in forum ASP.NET General
    Replies: 3
    Last Post: July 15th, 02:59 PM
  5. Application Window Title
    By mmonet webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 3
    Last Post: July 9th, 04:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •