CellRenderer attracts more when resizing to a list

I can't understand why the box drawn in my CellRenderer class shoot each other when resizing to height of the list. Here's the example code to demonstrate. Click resize.

package
{
    import flash.display.Sprite;
    import flash.events.MouseEvent;

    import qnx.fuse.ui.buttons.LabelButton;
    import qnx.fuse.ui.listClasses.List;
    import qnx.ui.data.DataProvider;

    [SWF(height="600", width="1024", frameRate="30", BackgroundColor="#000000")]
    public class test3 extends Sprite
    {
        private var l:List = new List();
        public function test3()
        {
            var dp:DataProvider = new DataProvider();
            for (var i:int = 0;i<=10;i++)
            {
                dp.addItem({number:i});
            }
            l.dataProvider = dp;
            l.setPosition(10,50);
            l.width = 1004;
            l.height = 500;
            l.cellRenderer = test3CellRenderer;
            addChild(l);

            var b:LabelButton = new LabelButton();
            b.label = "Resize List";
            b.addEventListener(MouseEvent.CLICK, but_click);
            addChild(b);
        }
        private function but_click(e:MouseEvent):void
        {
            if (l.height != 200)
                l.height = 200;
            else
                l.height = 500;
        }
    }
}

and my CellRenderer class:

package
{
    import flash.display.Sprite;

    import qnx.fuse.ui.listClasses.AlternatingCellRenderer;
    import qnx.fuse.ui.text.Label;

    public class test3CellRenderer extends AlternatingCellRenderer
    {
        private var label1:Label;

        public function test3CellRenderer()
        {
            super();
        }

        override protected function init():void
        {
            label1 = new Label();
            label1.width = 200;
            addChild( label1 );
            super.init();
        }

        override public function set data( data:Object ):void
        {
            super.data = data;

            if (data != null)
            {
                label1.text = data.number;
                var _color:uint;
                if(data.number == 0 || data.number == 2 || data.number== 4 || data.number ==  6 || data.number== 8)
                    _color = 0x068000;
                else
                _color = 0xC40000;
                var s:Sprite = new Sprite();
                s.graphics.beginFill(_color);
                s.graphics.drawRect(200, 1, 100, 48);
                s.alpha = .5;
                addChild(s);
            }
        }
    }
}

You must add elements in the function onAdded() Overrides and remove them to the function onRemoved() override.

//////////////////////////////////////////////////////////////////
    override protected function onAdded():void
    {
        super.onAdded();
        this.addChild( this.label1 );
    }

        ////////////////////////////////////////////////////////////////
    override protected function onRemoved():void
    {
        super.onRemoved();
        this.removeChild( this.label1 );
    }

Tags: BlackBerry Developers

Similar Questions

  • Thunderbird will download more than 1 email (the same on &amp; more) when I have 2000 + listed as new and ready for download.

    I just noticed what is happening and need help I'm talking to a company related to a new position.
    Help, please.
    KeV

    Try to connect via webmail and delete the message that is stuck.

  • Had a recent fall and rebuild and don't get 'My recent Documents' show more when 'Start' is clicked.

    Original title: my recent Documents

    Had a recent fall and rebuild and don't get 'My recent Documents' show more when 'Start' is clicked.

    Floowed instructions in 'HELP' to customize, Advanced and list but do not work.

    Help please.

    Thank you

    Bill

    Hi Bill,

    ·         What version of Windows XP you are using?

    If you are using XP Professional, follow these steps.

    Note: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following link.  http://support.Microsoft.com/kb/322756

    Step 1: Follow these steps:

    (a) click on Start and then run.

    (b) type gpedit.msc in the run box and press on enter.

    (c) in the Group Policy Editor, navigate to:

    User configuration > administrative templates > Start Menu and taskbar

    (d) double click on menu to delete Documents from the Start Menu.

    (e) select not configured.

    Step 2: Follow these steps:

    (a) click on Start then on Run.

    (b) type regedit.exe in the Run dialog box, and then press ENTER.

    (c) access: HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    (d) right-click NoRecentDocsMenu to select change.

    (e) change the value to 0.

    (f) access: HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    (g) right click NoRecentDocsMenu to select change.

    (h) change the value to 0.

    (i) leave the registry (Regedit.exe) editor.

  • How can I remove AVAST4 antivirus program when it is not listed in the list to add or REMOVE a PROGRAM?

    original title: help

    How can I remove AVAST4 antivirus program when it is not listed in the list to add or REMOVE a PROGRAM?

    Hello

    Avast uninstall utility
    http://www.avast.com/uninstall-utility

    If you need more help contacting Avast support and forums

    Avast - Support
    http://support.avast.com/

    Avast Forums
    http://Forum.avast.com/

    I hope this helps.

  • Problem when resizing the round objects

    Hello

    I have a problem with the downward revision round objects.

    In summary, here's the question:

    round_corner_problem.jpg

    As you can see when I reduce a cirle of size size B, upper side and left of the circle B are flat.

    Why this happens and how to avoid it? It is really frustraiting when working with small objects.

    See you soon.

    Howdy.

    The flats on the small circles is caused by anti-aliasing misalignment with the pixel grid when the circle is resized. You will most often see when resizing a shape with an odd number of pixels. You have one see below the center of the circle is forced off the pixel grid, and anti-aliasing is disabled.

    This is the actual size.

    What should do?

    Before you accept the processing, move the circle to the center point of the circle is on the pixel grid. Use the arrow key to move around. Experiment. Move the center of the circle at different outside the premises of the grid before accepting the transformation. You will see all kinds of permutations of anti-aliasing. Choose one that is symmetrical. The focus should be on the grid. Then smoothing should be symmetrical. When the transform is applied, anti-aliasing is cooked in, and you can move back the circle to its original position if you wish.

    Like Paulo and Noel have noted, the quality of the original circle antialiasing will notice when it is reduced to the size of the web icons. Any asymmetry in the original may be noticeable to a normal size, because it is only about one or two rows of pixels on the perimeter of the circle. A small percentage of assymetry on a circle of 300px. When the circle is reduced to 10 pixels, the asymmetry affects another one or two lines of pixels. And the circle goes PEAR because the assymmetry could be as much as 10%. My guess is that the OP is working with images that are a little unhinged to start.

    There is much more to this, but it might help.

    Peace,

    Lee

  • What DPI and the quality when resizing the photos to post-secondary studies for use in PRE?

    For use in first 7 Elements:

    When resizing my photos from digital camera in Photoshop for reduced 1000 x 750 sizes that you would recommend when panning and zoom, there are a few additional choices.

    Asked for the resolution in dpi.  Wouldn't be 600, 300, or less?

    The other thing is: convert files? The max quality JPEG or standard or what?

    I'm still a beginner at the first, then feel free to too technical!

    Thank you, Elizabeth.

    Well, my book has all the answers, if you are interested, Elisabet!

    PSD files are Photoshop files. Unlike most file formats, PSDs save their image data in an editable form, including layers and text. It also records these image lossless data - so that the files can be quite large.

    JPEG files were invented mainly for use on the internet, and their main advantage is their image data can be compressed, so that the file sizes are much smaller. (That's why your digital camera probably stores its photos in format JPEG.) But the compression does not come without a cost. If you reopen and re - save a JPEG file multiple times, you will begin finally to compromise the integrity of the image.

    With the photos that you want to use in a Premiere Elements, a JPEG file is probably fine. Quality is a good setting, and it's anything on a 7. (Probably you can compress your files even more, if you do not plan to re - open and re-save the file, but you probably don't have your file who are weak, unless you use online).

  • Strip tip that displays the coordinates while moving (delta) and size when resizing went

    I've been using LabVIEW since version 3.  I used to use it full time, but only part-time and the.

    I have a Win XP Professional computer running LabVIEW 7Express, and I have a Win 7 Home Premium computer running Labview 2013.

    I have always used and relied on small pop - up (Advanced band, ToolTips) which indicates the coordinates when you move an object on the screen: delta 4, 19 for example; and shows the new size when resizing: 4, 19 for example.  It works my Win XP Professional LabVIEW 7Express machine but NOT on my Win 7 Home Premium LabVIEW 2013 machine (and I need to work on this machine).

    I think there are 3 places to search for:

    1) LabVIEW, tools, Options, block: see the tip terminal strips - "this option is enabled on both machines.

    (2) LabVIEW.ini - "I can find similar entries on both machines.

    3) strips of MS Windows Advanced treatment - "not sure about it, Win 7 Home Premium is not easy to use with this and web sites I've found seem to point to key in regedit which seem not to be there.

    Thanks for any help!

    Nevermind, I figured it.

    My Win 7 machine is dual-boot.  I have a SSD LabVIEW 2013, on the other hand I have LabVIEW 2012.  I looked on the side of 2012.  I noticed that there are 3 places that you can treat with strips of tip under LabVIEW Options: front panel, block diagram AND UNDER environment.  Who has been disabled on my side LabVIEW 2013.  I fixed it.

    I think I have disabled all 3 places when I was trying to stop one of the most annoying things in LabVIEW.  When interacting with case and sequence stacked Structures, that terrible pop-up ads (Advanced band) would appear and cover the value of the Structures or Structures of stacked sequence case who I was interacting with blocking my view.

  • OLE1. CreateEmbed Bit_str, "Paint.Picture" works under Dos but does more when gave birth off the coast. How can I fix teachix?

    OLE1. CreateEmbed Bit_str, "Paint.Picture" works under Dos but does more when gave birth off the coast.  How can I fix teachix?  Using VB5 to obtain a bitmap for embeded in an Access database. This used to work perfectly, but gives an Error 31032 when the program is spawned off the coast.  It still works from a command prompt.  How I have the code around this, or what is the problem?  Help, please. Thank you

    Hi AllisonBlackmer,

    Your Windows XP question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the forum TechNet for assistance:

    http://social.technet.Microsoft.com/forums/en-us/category/windowsxpitpro

    Hope the helps of information.

  • 2015.1 Photoshop crashes when resizing,

    The original Photoshop 2015 would break when I did any resizing in the "Resize Image" dialog. He did the same thing with the new Photoshop 2015.1

    2014 Photoshop works very well with no crash when resizing. Someone at - he heard of this problem?

    Please open Photoshop > preferences > Performance

    Uncheck the 'use graphics processor '.

    Check if it still crashes

    ~ Assani

  • Why should I pay more when I'm from Denmark?

    Hello.

    I'm Danish and I would ask why Dreamweaver costs 20 dollars (about 133 DKK) per month, but when I want to pay in DKK it is 186 DKK.

    It's 53 DKK (about US $ 8) the difference.

    Why do I pay almost $ 8 more when I pay the Denmark? Why

    Hi balizero,

    See the changes to the regulation of VAT in the EU countryfor more information in prices in Europe, VAT-based.

    Thank you

    Preran

  • Installation of image do not cross when resizing

    I'm working on a carousel, but it doesn't sit right when resizing. Why would he do that? And how can I solve this problem?

    picture not going across.PNG

    It actually uses the class for the img. I fixed it doing it:

    . Carousel img {min-height: 500px; width: 100% ;}}

  • I downloaded version 5.7 of Lightroom in order to support the captive capture on my Nikon D750 and its still does not. More when I was invited to give my serial number for the update that was not the case that are on my Adobe profile, although I purchas

    I downloaded version 5.7 of Lightroom in order to support the captive capture on my Nikon D750 and its still does not. More when I was not invited to give my serial number for update is no where on my Adobe profile, although I bought and pays every month for my creative cloud for photography. Help, please

    Your subscription to cloud shows correctly on your account page?

    If you have more than one email, you will be sure that you use the right Adobe ID?

    https://www.adobe.com/account.html for subscriptions on your page from Adobe

    If Yes

    Some general information for a subscription of cloud

    Cloud programs don't use serial... numbers you, connect you to your cloud account paying to download & install & activate... you may need to sign out of the cloud and restart your computer and log into the cloud for things to work

    Sign out of your account of cloud... Restart your computer... Connect to your paid account of cloud

    -Connect using http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html

    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html

    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html

    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html

    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp

    -http://helpx.adobe.com/creative-cloud/kb/license-this-software.html

    If no

    This is an open forum, Adobe support... you need Adobe personnel to help

    Adobe contact information - http://helpx.adobe.com/contact.html

    -Select your product and what you need help with

    -Click on the blue box "still need help? Contact us. "

  • Muse cut the part left my site when resizing the window of the browser for anything whether it is less than the width of the page

    When you use centering nychtemerales, Muse cut the left side of my site when re the sizing of the window of the browser for anything less than the width of the page, this also happens on mobile devices.  How can I keep the page focused but have content basically left stop when resizing or viewing on a mobile screen? I don't want the edge of the page to disappear on smaller screens and when you use a smaller window. I do not want to resize the entire site at a lower resolution. Thanks in advancearbubaproblem.jpg

    If the left is cut, then you have designed offshore from the left of the page mode Design of Muse. The blue guides indicate the edge of the page and a margin guide on the page. Rule zero is the left edge of the page.

    The page is not admissible it will focus as long that the browser is wider than the page. Then, she left aligned (on point zero on the sovereign in design mode).

  • How to set up a workflow to a user an email when certain areas are listed.

    I am new to Oracle CRM and I try to use a workflow to some user by email when some areas are listed. I don't want to send the user if the file is incomplete. The only trigger actions I've seen were "when the new record is created" and "when the record is updated to" is there a way to create a custom trigger or use the wait option.

    You can use under workflow:

    The workflow trigger event: * "when changed folder Saved."
    Workflow condition: IfNull (PRE(''), "Invalid") = "Invalid" AND [] IS NOT NULL (workflow will be triggered only when Fieldname value is changed from white to a value)

    Workflow action: send an Email

  • How to resize a textFrame, when resizing as its parent (a groupitem)?

    I am trying to find the smallest textframe within a group and then match that textframe font size to the minimum size allowed for printing. Everything works, except that I can't understand how to resize the textframe when resizing as its parent, the group.

    #target illustrator

    app.activeDocument = docRef;

    gpRef = docRef.groupItems [0];

    var gpHeight = gpRef.height;

    It's printing allowed minimum font size

    var minFntSize = 18;

    var garbLay;

    var txtFrmCount = gpRef.textFrames.length;

    var container = {};

    var i;

    put each prop textframe and height in json

    for (i = 0; i < txtFrmCount; i ++) {}

    container ["prop" + i] = {"gpTfHeight':gpRef.textFrames [i] .height / 72, 'gpTarget':gpRef.textFrames [i]"};

    }

    find the value prop textframe height min. I have the max in it too just in case I need it in the future

    var min = infinity;

    var max = - infinity;

    var x;

    for (x in container) {}

    If (container [x] ['gpTfHeight'] < min) {}

    min = container [x] ["gpTfHeight"];

    minTg = container [x] ["gpTarget"];

    }

    If (container [x] ['gpTfHeight'] > max) {}

    Max = container [x] ["gpTfHeight"];

    }

    }

    duplicate textframe, convert in way and get the actual height

    var txtFrmDup = minTg.duplicate ();

    txtFrmDup.position = [(minTg.position[0]-100), (minTg.position [1] - 100)];

    txtFrmDup.name = "garbage."

    var tOutline = txtFrmDup.createOutline ();

    tOutline.name = "garbage."

    var tLogHeight = Math.round (tOutline.height);

    garbLay = gpRef.groupItems.getByName ('garbage');

    This is the part where I need to convert it into percentage? tgSize is the size of the target and I thought I could get the different from the 2 and then use this amount to resize down...

    var tgSize = minFntSize - tLogHeight;

    var PERC = Math.round((tgSize/gpRef.height)*100);

    $.writeln (minFntSize);

    $.writeln (tLogHeight);

    $.writeln (tgSize);

    $.writeln (perc);

    resize gp so that font textframe min size meets minFntSize

    if(tLogHeight < minFntSize) {}

    gpRef.resize (perc, perc);

    $.writeln ('smaller');

    garbLay.remove ();

    } else if(tLogHeight > minFntSize) {}

    gpRef.resize (perc, perc);

    $.writeln ('bigger');

    garbLay.remove ();

    } else if(tLogHeight == minFntSize) {}

    $.writeln ('equal');

    }

    I do not know if I go about it the right way. Hoping a new set of eyes can take a look and see what I'm doing wrong or not done? Thank you!

    check this out, I changed it a bit

    // scale grouped text Frames to a minimum font size
    // http://forums.adobe.com/thread/1323065?tstart=0
    // carlos canto
    
    #target illustrator
    
    var docRef = app.activeDocument;
    var gpRef = docRef.groupItems[0];
    
    //this is the minimum print font size allowed
    var minFntSize = 18;
    
    var txtFrmCount = gpRef.textFrames.length;
    
    // make the first frame the one with the minimum font size
    var idx = 0;
    var minFrameFontSize = gpRef.textFrames[idx].textRange.characterAttributes.size;
    
    // see if the other frames have smaller font size than the first
    for(i = 1; i < txtFrmCount; i++) {
        var itext = gpRef.textFrames[i];
        var fontSize = itext.textRange.characterAttributes.size;
        if (fontSize		   

Maybe you are looking for