QNX. UI. List and custom converters

Hi, I created a CellRenderer for my qnx.ui.list, so that I can format the text inside.

everything works fine, except that before, when I used the default, I got stripes (alternating white and blue) on my list, and now I no longer receive them.

While this isn't a huge thing, I would like to get some advice here in accordance with the implementation of the same thing on my cell display.

Here's what it looks like:

package renderers
{
    import flash.text.TextFormat;

    import qnx.ui.listClasses.CellRenderer;
    import qnx.ui.skins.SkinStates;

    public class TimeTravellerListCellRenderer extends CellRenderer
    {
        public function TimeTravellerListCellRenderer()
        {
            super();
            var newFormat:TextFormat = new TextFormat();
            newFormat.font = "Arial";
            this.setTextFormatForState(newFormat, SkinStates.UP);
            this.setTextFormatForState(newFormat, SkinStates.SELECTED);
        }
    }
}

Thanks in advance

to change the colors of alternating CellRenderer, you must create a custom for her appearance. then in the cell renderer, you'd setSkin (CustomCellRendererSkinWhite) and that he would use the next skin:

package
{
    import flash.display.DisplayObject;
    import flash.display.Sprite;

    import qnx.ui.skins.SkinAssets;
    import qnx.ui.skins.SkinStates;
    import qnx.ui.skins.listClasses.CellRendererSkinWhite;

    public class CustomCellRendererSkinWhite extends CellRendererSkinWhite
    {
        private var upSkinOdd1:Sprite;

        public function CustomCellRendererSkinWhite()
        {
            super();
        }

        override protected function initializeStates():void
        {
            super.initializeStates();

            upSkinOdd1 = new Sprite();

            upSkinOdd1.graphics.clear();
            upSkinOdd1.graphics.beginFill(0xFF0000);
            upSkinOdd1.graphics.drawRect(0,0,26,47);
            upSkinOdd1.graphics.endFill();

            /**
             * Due to the new system you need to set the scale9grid
             */

            var oldUpSkinOdd:DisplayObject = new SkinAssets.CellRendererUpOddWhite();

            upSkinOdd1.scale9Grid = oldUpSkinOdd.scale9Grid;

            this.setSkinState(SkinStates.UP_ODD, upSkinOdd1);
        }
    }
}

hope that things cleared up. Good luck!

Tags: BlackBerry Developers

Similar Questions

  • Dispatched event when a LONG list of custom converters made completely?

    I have a < s:List > custom component:

    < local id: ThumbnailList = 'list' top = down "0" = "0" left = "0" right = "0" dataProvider = '{image files' allowMultipleSelection = 'true' dragEnabled = "true" dragMoveEnabled = "true" / >


    Who extends sparks list and use the itemRendererFunction to create the custom ItemRenderer:

    SerializableAttribute public class ThumbnailList extends list
    {

    public void ThumbnailList()
    {
    Super();
    itemRendererFunction = getItemRenderer;

    }

    protected function getItemRenderer (data: Object): ClassFactory
    {
    var clz: class = DefaultItemRenderer;

    clz = ThumbnailRendererImpl;

    does not work: failed to add event listener to ItemRenderer

    clz.addEventListener ("renderComplete", function ends (event: Event): void {Alert.show ("make full...) ») ;}) ;
    return new ClassFactory (clz);
    }

    }

    And my custom ItemRenderer:

    <? XML version = "1.0" encoding = "utf-8"? >
    < s:ItemRenderer dataChange = "dataChangeHandler (event)" xmlns:fx =" " http://ns.Adobe.com/MXML/2009 "
    xmlns:MX = "library://ns.adobe.com/flex/mx" xmlns:s = "library://ns.adobe.com/flex/spark" >

    < fx:Script >
    <! [CDATA

    protected function dataChangeHandler(event:FlexEvent): void {}
    IMG.Soruce = data as a string;

    }

    private function loadComplete (event: Event): void {}
    dispatchEvent (new Event ("renderComplete"));
    }
    []] >
    < / fx:Script >
    < s:Graphic >
    < s:Group id = 'group' >
    < s:layout > < s:HorizontalLayout / > < / s:layout >
    < mx:Image id = "img" horizontalCenter = "0" = "0" Red complete = "loadComplete (event); » / >
    < / s:Group >
    < / s:Graphic >
    < / s:ItemRenderer >

    The dataprovider of this list is very large and the thumbnails that are created are also very wide... which means

    the list takes a long time to make completely.  Once the list is rendered completely, it works fine.  Now, since it

    takes a long time to make, I would like to add a popup or progress bar to show the user that the list is rendered.  Thus,.

    my question: is it possible to say when ALL the miniature custom renderers have all finished to load their respective

    image data?

    I have tried everything I can think and am unable to advance this project until I have a solution.

    Thank you!

    You can compare the number of events sent to the length of the dataProvider.

    This could be included in your custom list component then dispatch progress events and a complete event final...

    OR

    You could manage all this from outside the element of list in your application.  Just to set the events in the bubble of the ItemRenderer and pull

    dispatchEvent( new Event( "renderComplete", true ) );
    
  • Nasty problem with resizing a list and a class custom CellRenderer

    Create a list (_myList) in a class with a custom CellRenderer class. In the custom CellRenderer class, I draw a rectangle with a gradient in the data() function:

    override public function set data (value:Object) : void
    {
        super.data = value;
    
        var tab_color:Array = this.data.rowColor;
        ...
        _matrix.createGradientBox(this.width, this.height, 90/180*Math.PI);
    
        with (_sprTab.graphics)
        {
            clear();
            beginGradientFill(GradientType.LINEAR, [tab_color[0], tab_color[1], tab_color[2]], [alpha,alpha,alpha], [0,127,255], _matrix);
            drawRoundRectComplex(0, 0, this.width, this.height, 15, 0, 15, 0);
            endFill();
        }
        ...
    }
    

    When policy changes I want to resize the list. Therefore, in a function in the class in which the list is created, I resize the list:

    public function setListSize (w:Number, h:Number) : void
    {
        _myList.setSize(w, h);
    }
    

    And this function is called with the new dimensions on the change of orientation in the main class.

    However, this.width in the custom CellRenderer class does not get the new width of list a reason any.

    No idea why?

    You must refresh the visible items in the list. You can loop through the list and replaceItem (...) of the call and who should do it. You can check that it would work by scrolling through the list of invisible items and they should have picked up the new width.

  • Custom objects and custom lists

    Hi all

    In my apps on the platform of bb that I'm used to the addition of my objects in a list and to implement the display of these objects, by using the properties of objects such as images and text that appears. It is then easy to retrieve these objects on the selection, etc..

    I do not see it in examples of list, I was look for the pb, I see an option to set the label of the inserted list item and also define an icon.

    How to add my item to the list and display say the name property of this object?

    Thanks in advance.

    QNX can handle the large number of items in their native controls, but since you create your own 'list', you need to be to limit the number of items in the list (~ 50-100, depending on the complexity of the user interface) or you need manage the object like the fact list QNX (Articles swaping in and out so that those who are visible). Too many items in your own list, that you will begin to see it hard to scroll the list autour.

    The scrolling container must match all elements it contains, and then the 'update()' pane scroll function should be called it can update this slider and etc. (In your example) if the height< 250,="" then="" calling="" scrolly="" to="" 250="" will="" probably="" get="" some="" odd="">

    Hope that helps.

  • Number of list and bulleted list w / Custom Style sheet

    Hello
    I am a new user to RoboHelp 7 and must say that I find useful but also painful to use. I'm trying to solve something that looks like a bug in RoboHelp 7, but before I give in and accept defeat, I wanted to check with the forum.

    I of FrameMaker 8 and import the files to HR where I use them to create WebHelp projects.

    This is an accelerated procedure:
    1. I import my files with a stylesheet predefined matching styles of FM.

    2. I have also check the option convert to HTML list and the bullet and numbering styles the value defined by the user.
    -After importing RH did the usual thing and creates a bunch of stylesheets in itself

    3. I select all files in the pod of the list of subjects and apply a new style sheet custom. This allows me to have a style sheet for all HTML files with the correct layout and formatting

    4. I have generate the output and HR uses the new style sheet reference
    HTML shows files that the output is not the same as the HTML generated, shown in the mode of the editor HTML HR

    -View Editor: < class li = 'style' >
    -Display: < li >

    6. If I make a change (for example, add a space) and save the HTML file and build the project again the HTML code is correct in the browser

    It could be argued that it is not a big problem; However, with a large project that begins to look more like a nightmare ;)

    Does anyone know of this problem and if so can it be solved?

    Kind regards
    Jon

    Thanks Milot,
    I hope that my company will see your 'solution' as an argument to upgrade licenses FM and FM 9 and 8 HR HR. Would be so nice if Adobe would let us by licenses cheaper that we bought just FM 8 and RH 7 2 months ago. 7 HR isn't really worth the money spent to date in my mind.

    Once again thank you for answering my questions.

    Kind regards
    Jon

  • Expose a list of custom objects from C++ to QML (via QDeclarativeListProperty)

    Hello

    I am trying to expose a list of custom from C++ to QML objects. I have a scene object that uses QDeclarativeListProperty (I followed the example here: http://harmattan-dev.nokia.com/docs/library/html/qt4/declarative-cppextensions-referenceexamples-pro...)

    When I try to add a location to the list object, I get the following error in C++:

    no matching function for call to 'bb::cascades::Locations::setLocation(bb::cascades::Location*&)'
    

    applicationui. HPP:

    ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
    QObject(app) {
    
    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    qml->setContextProperty("app", this);
    
    qml->setContextProperty("locationList", locations);
    
    app->setScene(tabbedPane);
    

    Locations.h:

    #ifndef LOCATIONS_H_
    #define LOCATIONS_H_
    
    #include 
    #include 
    
    namespace bb {
    namespace cascades {
    
    class Locations : public QObject {
    Q_OBJECT
    Q_PROPERTY(QDeclarativeListProperty locations READ locations WRITE setLocation)
    
    public:
    Locations();
    virtual ~Locations();
    
    QDeclarativeListProperty locations();
    int locationsCount() const;
    Location *getLocationAt(int) const;
    
    Q_SLOT void setLocation(Location newLocation);
    
    private:
    QList m_locations;
    };
    
    } /* namespace cascades */
    } /* namespace bb */
    #endif /* LOCATIONS_H_ */
    

    Locations.cpp:

    #include "Locations.h"
    
    namespace bb {
    namespace cascades {
    
    Locations::Locations() {
    }
    
    Locations::~Locations() {
    }
    
    QDeclarativeListProperty Locations::locations()
    {
    return QDeclarativeListProperty(this, m_locations);
    }
    
    int Locations::locationsCount() const
    {
    return m_locations.count();
    }
    
    Location *Locations::getLocationAt(int index) const
    {
    return m_locations.at(index);
    }
    
    void Locations::setLocation(Location newLocation)
    {
    m_locations.append(newLocation);
    }
    
    } /* namespace cascades */
    } /* namespace bb */
    

    and here is my controller, when I try to add an object location :

    Location *loc = new Location();
    app->locations->setLocation(loc);
    

    I'm getting the error on:

    app->locations->setLocation(loc);
    

    Any ideas? Thank you!

    I wonder about your use of setLocation as a writable property for the list, strange to have a single object as a setter for the list of sounds.

    I use is no longer QDeclarativeListProperty that it doesn't work in some cases, instead I keep the list in c ++ and publish the size to and handling using Q_INVOKABLE methods necessary.

  • problems with customization select lists and popup LOVs

    Hello


    I have 2 problems on selection lists and popup LOVs.

    The first is on a list in tabular form.
    It must be created with APEX_ITEM. SELECT_LIST_FROM_LOV or similar and take its values of a named LOV.
    This worked fine, but now it should also have the possibility to enter a free value.
    I tried to accomplish this by creating an APEX_ITEM. POPUP_FROM_LOV, but there is a problem with the function which is called the icon of the right arrow to the input field (for eg. genList_f11_5()).
    If the line is added by addRow, then it works fine, but if the line is not empty
    Then the function call is as genList_f11_$ _row () and the input field becomes worthless, when an LOV is selected.


    The other problem is on a list of selection that should have the opportunity to enter a custom value and
    It should also be able to select multiple values. I tried to implement this in a text box that contains the selected values, and a multiple select list, with an event handler in each option. The user can click on options and they would be copied into the text box. The problem is that I couldn't make the event handler works in Internet Explorer.

    I would like ideas on one of these problems.



    Tiina

    Hello

    It can be created at APEX_ITEM. TEXT.
    APEX_ITEM also generates the name attribute that I use the jQuery selector in the sample.
    Use jQuery UI autocomplete just similarly as in my example with APEX_ITEM

    Kind regards
    Jari

  • Problem with list and itemRenderer

    Hallo. I need a little help. I have a list and populate this list with this code:

    var myArrayList:ArrayList = new ArrayList (myArray);

    this.myList.dataProvider = myArrayList;

    The code of my list is as follows:

    < s:List id=" lst_listaAmiciDaInvitare "width =" " 220 "height =" "x =" 15 "y =" 56 245 "skinClass =" componentiInterni.listaAmiciDaInvitare.listaAmiciPerInvito "buttonMode =" true " " > ""

    < s:layout >

    < s:VerticalLayout gap=" 2 " />

    < / s:layout >

    < s:itemRenderer >

    < fx:Component >

    < listaAmiciDaInvitare:listaAmiciItemRenderer / >

    < / fx:Component >

    < / s:itemRenderer >

    < / s:List >

    The code of my item converter is as follows:

    <? XML version = "1.0" encoding = "utf-8"? >

    < s:ItemRenderer ' xmlns:s = ' Library://ns.Adobe.com/Flex/spark "xmlns:fx =" " http://ns.Adobe.com/MXML/2009 "

                    xmlns:d=" http://ns.Adobe.com/FXG/2008/DT "width =" " 200 "height =" 16 "autoDrawBackground =" true " " > "

    < fx:Script >

    <! [CDATA]

    protected function gruppoPrimario_clickHandler(event:MouseEvent): Sub

    {

    if ()this. chk_selezioneAmicoDaInvitare.selected)

    ce . chk_selezioneAmicoDaInvitare.selected = fake;

    else

    ce . chk_selezioneAmicoDaInvitare.selected = true;

    }

    []] >

    < / fx:Script >

    < s: states >

    < s: State " name =" normal " />

    < s: State " name =" hovered " />

    < s: State " name =" selected " />

    < / s: states >

    < s:Group click = "gruppoPrimario_clickHandler (event)" " >

    < s:CheckBox id=" chk_selezioneAmicoDaInvitare "width =" " 5 "height =" 5 "left =" 0 "red =" 0 " " / > "

                                              <s:Label id=" lbl_nomeGiocatore " x=" 15 "top =" 4 "width =" 190 "maxWidth =" 190 "maxDisplayedLines =" 1 "text =" {data.nome} "fontFamily =" Arial "fontSize =" 12 "textAlign =" left '' / > "" "" ""

    < / s:Group >

    < / s:ItemRenderer >

    Now, my list has 180 items and as you can see from the code, each element is a check box and a label. All fills properly and I see each box and the text. The problem is that when I click on a box, this box are selected but not only... The entire list on an occasional basis, he other boxes to check who is selected and I don't know why... It seems a problem of updating the lists, but I do not know... Why, if I click on a single box, 5 becomes checked?...

    Hope you can help me.

    Max

    This is because as Alex says converters are reused and as my posted code does not update the selection state of the checkbox in the datasetter, or link it it is obviously reproducible.

    override public function set data(value:Object):void

    {

    trace ("test. Data (value) ", value);

    Super.Data = value;

    CB.label = data.label;

    CB. Selected = data.selected;

    }

    Update the selected on the cb will fix the problem.

    C

  • Display States and custom components

    Hello

    I use a stack view for this application and once the user is logged on to the application that they see this "Home Page" that contains essentially two components as follows:

    It is in my file "AppMain.mxml".

    < mx:ViewStack id = "appView" height = "100%" width = "100%" >
    < mx:Canvas id = "Home" >
    < view: TeacherList id = "teacherList" / >
    < view: StudentList id = "studentList" / >
    < mx: / canvas >
    < / mx:ViewState >

    So in my TeachList.mxml file I have this < mx:ButtonBar > and one of the buttons is 'Add teachers', when this button is clicked, I want to hide the component StudentList using view States and finally display a form for the user on the same screen, so they can add a teacher. If all the code is in a single file, I think I could do it myself.

    I tried to put the tag < mx: states > in the file AppMain.mxml, but given that the < mx:ButtonBar > mxml code was inside a different file, that he did not see the block < mx: states > I added in the file 'AppMain.mxml '. So I then tried to put the block < mx: states > in the same file as < mx:ButtonBar > reality but then how do I access the id of the component (studentList) so I can hide

    Any help much appreciated.

    -Westside

    Yes - you have to control the use of custom events.

    Let me to pseudo code it for you - you'll have to maybe a little research yourself

    (1) create a State which removes the student list and displays the component that you want to display (I'll call it 'state2' for now).

    (2) in your teacherlist component, create the event, something like this:

    [Event (name = "customEventNameHere" type = "flash.events.Event")]

    (3) in your teacherList component dispatches the event:
    public function buttonClickHandler (): void {}
    var eventObj:Event = new Event ("customEventNameHere");
    dispatchEvent (eventObj);
    }

    Call this function when the user presses the special touch in your teacherList component.

    (4) manage the result. Using Flex Builder? If Yes, when you press the space bar on your call to the teacherList component, you will see the "customEventNameHere" event available.

    (5) change of State:
    public void changeTheState(eventObj:Event):void {}
    currentState = 'state2 ';
    }

    I hope that the work - please post back with your results (or mark replied if you get)

    See you soon,.

    David

  • Passing data between the component main enforcement through custom methods and custom

    Similar to what this article is talking about, I have a custom list that contains a list of names of State of the United States in chains. (Let's call this states.mxml) #comments http://www.boyzoid.com/blog/index.cfm/2006/11/22/Flex-Custom-Components-and-Custom-Methods

    I create an action script that is included in my states.mxml like < mx:Script source = "myScripts.as" / > so that I can call the method in mySpcripts.as

    Now, what I want to do is, whenever I click on an item in the list, I want this string is displayed on the Application of the hand (on a canvas or Panel) as a label.

    I don't know how I am supposed to refer to the canvas and wood, which lies on the main of the application of myScripts.as
    Is there a way to create an action script file where methods can reference components for the main application and the custom component file?

    Thank you

    this.parentApplication.canvas.label should do what you are looking for

  • I can't find my old emails that is to say the last 4 years e-mails have disappeared. I can't see in the 'archives' folder list and also in my list of "local" files

    I can't find my old emails that is to say the last 4 years e-mails have disappeared. I can't see in the 'archives' folder list and also in my list of "local" files
    I recently formatted my system. It causes this problem? Is there anyway to recover my emails?

    Assuming that really format you your hard drive.
    Can erase you every single entry to a file, message, photo, program, document, etc. When you select format you get warnings on this subject.
    The format is the last thing you want to do without going through a backup of your personal and important files.

    Local folders is automatically created when you installed Tbird.
    And it is empty until you move something over there.
    (Your former local folder with all its files and messages has been removed under format).

    Only messages that are still on your server (stbeehive.oracle.com) can be recovered.

  • My playlists on apple music continues to repeat the first progress song and custom to the next song

    My playlists on apple music continues to repeat the first progress song and custom to the next song

    Hi, tabby1008!

    Thanks a lot for the use of Community Support from Apple! After reading your post, I understand that when you listen to music from Apple, one song keeps repeating instead of skip to the next track, when it finishes. I wouldn't listen to the same song over and over again when Apple's music catalog is so big, so I'm happy to help you!

    First of all, check that the "repeat" feature is not enabled. The following article gives some information about the feature 'repeat' and what to look for.

    Use of music music Apple in the app

    The "Shuffle and repeat your music" section provides this information:

    Shuffle or repeat your music

    Press on at the bottom of the playback screen to mix songs in a playlist or album. Alternatively, you can ask Siri to scramble your music.

    Type once to play entire playlist or album looped or twice to repeat a song.

    When activated, the icon for a repetition will be "BOLD". If this is the case, type just the icon to activate the recurrence at the wide. The next page of this article will show you where these buttons:

    If the repeat function is turned off, try closing the music app using the steps described in the article below.

    Force a nearby application on your iPhone, iPad or iPod touch

    Once the music app is closed, press the icon to open it again and then try to play your songs. If one is always repeat, restart the device. Instructions on the way can be found in the following article.

    Restart your iPhone, iPad or iPod touch

    Good listening!

  • my iphone was droppped and custom lights, but you can which is a light on it as if it is in standby mode. is there any fixes for this.

    my iphone was droppped and custom lights, but you can which is a light on it as if it is in standby mode. is there any fixes for this.

    Try to do a reset. Hold home and buttons power together for 30 seconds or until you see the Apple logo.

    If that does nothing, there's a chance that the LCD connector has partially disconnected. Although it is most likely your LCD is damaged.

    Apple may offer a replacement of the screen. You must check in your country, how much they charge.

    Alternatively, you can look for a reputable independent repairer who can replace the screen for you. This means waive all the Apple warranty services. But it's a bit less expensive for a C. 5 If you go this route, choose a repairer who offers a guarantee of 6 to 12 months. And don't go with the cheapest.

  • Compressor can import markers .wav or .txt cue lists and convert them to chapter markers?

    A simple...

    Compressor can import markers .wav or .txt cue lists and convert them to chapter markers?

    Best

    T

    See this support document and go where it says "Add markers using a list of chapter markers":

    Compressor 4: Add markers

    https://support.Apple.com/kb/PH21224

  • Difference between dynamic and static converters

    Hi, I am looking to understand the difference between a static and a dynamic DAC. I will work on a project that has a very high number of analog outputs 30 IO. I need a Board of 16-bit resolution. I intend to update outputs at a low frequency in the order of 1 Hz (on user deand). I have suggested to use the NI PXI-6704 card with 32 outputs. In order to future-proof our equipment, we plan to buy a few boards that are capable of fast output update rate (a few hundred Hz). I want to know what I'm lost and win with static and dynamic converters. What advice (which are quite fast) would work better for this high number of IO? I'm looking at the 6733, but I am not quite convinced that it is the best alternative.

    Hello

    If you get all PXI/SMU modules, you'll either buy a controller MXI to connect to the desktop computer or to spend more money and get a controller embedded to the SMU chassis. If you want to run applications in real time in the future, you can spend more money upfront and get the controller shipped instead of the connection of MXI. MXI connection allows flexibility of system more than the on-board controller because it allows you to run additional devices that may not be available in PXI format. The two methods are the same in terms of future evidence, they just offer different possibilities (flexibility or real-time).

    Eric

Maybe you are looking for