Newb question - displays only the first of several fields

As a first application of Bb, I write a stopwatch and I want the larger time scale and the small milliseconds. As part of what I am trying to display several bitmap or label side-by-side fields, but when I run it using the Simulator, only the first is displayed.

So, for example, what I want is:

1-2: 3 4:5:6 7 8 9

with each number in own field but what I mean is just

1

that is the first field. If I then use buttons they all appear in the verticalFieldManager by default in horizontalField Manager but if I use labels or bitmaps, then all I get is the first field, even if I remove the horizontalFieldManager and just use the default verticalFieldManager. I googled the question, this forum and spent several hours reading the code examples and documentation, but I have yet to understand why I can't put several fields of these types of side-by-side. I have to have something between them as separators or empty fields?

The code that I've got so far is the following...

 public TimerView()    {     super();      HorizontalFieldManager timerField = new HorizontalFieldManager();

      Bitmap hour10 = Bitmap.getBitmapResource("num_1.png");        Bitmap hour01 = Bitmap.getBitmapResource("num_2.png");        Bitmap minute10 = Bitmap.getBitmapResource("num_3.png");      Bitmap minute01 = Bitmap.getBitmapResource("num_4.png");      Bitmap second10 = Bitmap.getBitmapResource("num_5.png");      Bitmap second01 = Bitmap.getBitmapResource("num_6.png");      Bitmap ms100 = Bitmap.getBitmapResource("num_7.png");     Bitmap ms010 = Bitmap.getBitmapResource("num_8.png");     Bitmap ms001 = Bitmap.getBitmapResource("num_9.png");     Bitmap colon = Bitmap.getBitmapResource("Colon.png");

      BitmapField bfHour10 = new BitmapField(hour10);       BitmapField bfHour01 = new BitmapField(hour01);       BitmapField bfHourColon = new BitmapField(colon);     BitmapField bfMinute10 = new BitmapField(minute10);       BitmapField bfMinute01 = new BitmapField(minute01);       BitmapField bfMinuteColon = new BitmapField(colon);       BitmapField bfSecond10 = new BitmapField(second10);       BitmapField bfSecond01 = new BitmapField(second01);       BitmapField bfSecondColon = new BitmapField(colon);       BitmapField bfMs100 = new BitmapField(ms100);     BitmapField bfMs010 = new BitmapField(ms010);     BitmapField bfMs001 = new BitmapField(ms001);

      timerField.add(bfHour10);     timerField.add(bfHour01);     timerField.add(bfHourColon);      timerField.add(bfMinute10);       timerField.add(bfMinute01);       timerField.add(bfMinuteColon);        timerField.add(bfSecond10);       timerField.add(bfSecond01);       timerField.add(bfSecondColon);        timerField.add(bfMs100);      timerField.add(bfMs010);      timerField.add(bfMs001);

        add(timerField);  }

I know that this code violates probably some best practices or standards, but I intend to clean later.

-edited for spelling

Give it a go with images of the numbers.  You have it easy with BitmapFields, because you know how much space they need with

getPreferredHeight() and getBitmapWidth().  Then you should be able to stick them next to each other.

If I was doing this and who are looking for a special look at the clock, which seems to be what you are doing, I would like to have the digital icons as you do, and then set an image large enough to hold the value of the clock and in my routine of painting, select draw digital icon proper, in the right place.  As long as you load the bitmaps only once, I think it's the most effective way to do it.

Of course, a much simpler way would be to have just a RichTextField formatted as you suggest - RichTextField because you can have two different fonts in a single field.

Tags: BlackBerry Developers

Similar Questions

  • Using ListView with ArrayDataModel displays only the first element in each QVariantMap within the matrix

    I have this QML who have a ListView with datasource to a full ArrayDataModel from the CPP file for creationcompleted, I loop in the table to add the hour together to appear as a label on the page, what works. However, when I want to view these items in the list, it will display only the first element of the QVariantMap within the table, no error on the log of the device. Also, triggered more does not work, but when I click it, it will have a blue border surrounding it, but the onTriggered does not fire.

    Here is an excerpt of the CPP on the table fill

    This-> eventsModel = new ArrayDataModel();

    QVariantMap event;

    event ['EventName'] = "Event1";

    event ["EventHour"] = "00";

    event ["EventMinute"] = "01";

    event ["EventSecond"] = '02 ";

    QML-> setContextProperty ("eventsModel", it-> eventsModel);

    Here's the QML

    {Of container

    ID: eventListContainer

    {To ListView

    ID: eventList

    dataModel: eventsModel

    Use a ListItemComponent to customize the appearance of the list view

    listItemComponents:]

    {ListItemComponent}

    type: 'point '.

    {StandardListItem}

    Title: 'Event' + ListItemData.EventName;

    Description: "time:" + ListItemData.EventHour + ":" + ListItemData.EventMinute + ":" + ListItemData.EventSecond; "»

    }

    }

    ]

    onTriggered: {}

    var selectedEvent = dataModel.data (row);

    var eventDetailPage = eventDetailDefinition.createObject ();

    eventDetailPage.txtEventName.text = selectedEvent ['EventName'];

    eventDetailPage.pickEventTime.value = picker.dateFromTime(selectedEvent["EventHour"]+":"+selectedEvent["EventMinute"]+":"+selectedEvent["EventSecond"]);

    eventDetailPage.open ();

    }

    }

    Any help would be appreciated.

    Thank you.

    ListView determines ItemType of the element by calling the function itemType of the dataModel. By default, an ArrayDataModel returns an empty string for this call (see https://developer.blackberry.com/cascades/reference/bb__cascades__arraydatamodel.html).

    This leaves you with a few options:

    (1) If you have no header and all the elements are the same, you can make

    ListItemComponent {
         type: ""
         ...
    

    (2) If you have headers or different elements, you can extend ArrayDataModel and implement your own function of itemType

    (3) you can define a function of ItemType on your ListView in QML. Documentation:

    ListView called DataModel::itemType() for each item in order to know the type. QML, this can be overridden by declaring the itemType function (data, row) on the ListView element. ListView then call this function instead of the function DataModel.

    Here's how to create a list in QML which creates a header for all items on the high level and aStandardListItem for each item below the top level:

  • Windows displays only the first page of a multipage document - solutions?

    I recently installed an HP printer on my laptop with the help of a support HP online technician, but only the first page printed - the other eight were empty.

    Also, one-third of the right side of the document (electronic mail) was chopped up, while the leftmost column prints (Windows Live/Hotmail/Hotmail address) in the full preview and printing is not available since I upgraded to IE8 on my laptop HP under Vista Home Premium.

    How do I Center this document so that it will print correctly, and can I add the "Print preview" option in my Google toolbar, or install an another toolbar that includes?

    Thank you!

    http://welcome.HP.com/country/us/en/support_task.html

    Go to the above link > 'See support and troubleshooting information' > key in your number of printer > there is the use of manuals there.

    For more information, contact HP:

    http://welcome.HP.com/country/us/en/contact_us.html

    See you soon.

    Mick Murphy - Microsoft partner

  • Master page link to a details page displays only the first record

    Hello

    Could someone tell me please how to fix this problem:

    I have a master page that lists all users of my, and I have links next to them to take them to the specific user details. However, the links of all other records only show details for the first record.

    This is the link that is supposed to brings me to the details page:

    < a href = "patientlist2.php? Patient_id = <? PHP echo $row_rsPatients ["Patient_id"];? > "> <?" PHP echo $row_rsPatientlist ["Patient_id"];? > < / a >

    I have the same problem when you try to update the files, only the first record will appear.

    I'd appreciate any help.

    Thank you

    There is probably something wrong with your recordset. Test the query in the window of recordset for the generation of game records to ensure that you get the results desired of the recordset before placing and repeat on the page.

  • The LEXMARK 2300 series printer displays only the first page in Vista

    Printer only prints the first page but another page #s are displayed; However once you have printed the first page, other pages do not print and those page # disappear off the screen

    Printer only prints the first page of the document, even when the other page #s displayed. is my badly installed driver because I did everything he asked to uninstall then reinstall

    Hi lcwater,

    Please do not forget to download the latest drivers/software from the Lexmark Web site:

    http://support.Lexmark.com/index?page=home&locale=en&UserLocale=en_US&segment=download

    In addition, please see the following article on the Lexmark Web site:

    http://support.Lexmark.com/index?page=content&ID=SO4442&ACTP=search&viewlocale=en_US&UserLocale=en_US&segment=support&ProductCode=&searchID=1275498114885

    I hope this helps!

    Debra
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • When I try to start lightroom 6 it opens only the first window, but nothing more. ligthroom closed several times, restarted the computer, update system, nothing. What can I do?, when I try to start lightroom 6 it opens only the first.

    When I try to start lightroom 6 it opens only the first window, but nothing more. ligthroom closed several times, restarted the computer, update system, nothing. What can I do?, when I try to start lightroom 6 it opens only the first.

    Hi silvers.

    Please make sure that your graphics card and Lightroom 6 are up-to-date. Latest version of Lightroom is 6.4.

    Please check the FAQ and troubleshooting of Adobe Lightroom GPU and disable the use of the GPU in Lightroom.

    What is your operating system?

    Kind regards

    Assani

  • Rule RTP company fills only the first member of the form

    Hello

    I have a form where the accounts are in lines and measures in columns.

    I have created a business with the {FormAccounts} Variable rule (TYPE: members ... is not a member). Variable is used in the declaration of FIX, so that the calculation applies only to members of the selected account.

    When I select several accounts (online) and BR (via right click Menu) on the appeal form, the guest opens and only the first member of the selection is filled in the variable. When I run the BR, the calculation is applied to this member (which is OK)

    However, I can select several members by clicking the Member Selector and add more members to the variable. The calculation is properly invoked for these members.

    So my question is, why my variable get filled with selected members (I tried selecting names of members [who selects all lines], cells). The variable is RTP, because I wanted to see which members are getting selected, otherwise it may be hidden.


    Somehow the BR integrated: setting-> adjust the data is used when several data cells (members) are selected. Basically, I want my BR to be populated with selected members of the form adjust data works the same way.

    Is this a bug or planning simply cannot fill custom variable br with several selected members of the form.

    I don't make any sense?

    Thank you in advance...

    Sašo

    I think that this is how it works. I tried with a variable whose type is members.

    It is not showing me a prompt when I select several lines. However only works for the first row. (even if the menu is started from the second row).

    Multiple lines selected, variable of type members. only works for the first line of the selection. (in 11.1.2.2) You can try to connect an SR and see what Oracle has to say.

    Concerning

    Celvin

    http://www.orahyplabs.com

  • Can I use automatically select only the first line of a legend to include in the list of Figures?

    Is there a setting in the FAKE ID CS6 utility that will allow me to use only the first sentence in a legend to include in a list of numbers?

    Example of

    Willard Wharf, Cocoa, Florida, 1887.   It was the first blah blah blah of cocoa.  Photo by a dead guy.  with the permission of a lovely old lady whose grandmother collected it.

    In the example above, the whole passage is currently formatted with a paragraph style sheet in the Arno Pro Caption.  When I'm done, I would like to have this first phrase or sentence in "BOLD", which I planned to do with a character style sheet.  The rest will be normal.

    Now I understand more how the TOC utility works, I wonder, can I do a paragraph for the sentence of the title style and a second paragraph style for the remaining text in the legend that follows in the affirmative, how to make sure that the second paragraph will follow on the same line where ever the first paragraph style ends?  Nested styles, perhaps?  If the nested styles are the way to go, any comments or pointers to the simplest strategy to do this work will be appreciated.

    Legends do not match.  Some have a name and date; others are a title phrase or sentence, follow, sometimes up to several sentences.  In General, however, there is only one sentence after the title. I also usually a "courtesy of...". "statement recognizing the source of the photo.

    I'm a newbie using id cs6, for the first time, to format a book.  I'm enjoying using the program, but some details lead me sometimes at a stop.

    Thank you

    Roy

    If the TOC utility will choose paragraph or character style?

    If so, I'm good.  But the instructions in the site of Adobe and 2 manuals that I speak using paragraph styles.  The ones of my choice list.  Will have to do an essay on character styles.

  • If someone checks the mail from yahoo to my computer, their code is displayed if the first letter from my ID is the same with theirs. How can I delete their history on my computer?

    If someone checks the mail from yahoo to my computer, their code is displayed if the first letter from my ID is the same with theirs. How can I delete their history on my computer?

    Hey ioanaatc,

    Go in Tools > Options > Security tab click on passwords saved. This will give you a list of sites that you have saved passwords yahoo just find and delete other connections

    There are a lot of useful information in this article on the Firefox Password Manager. He should answer any other questions you might have.

    It can be saved as Auto form fill data. If this is the case, the article I just linked will show you you how to remove these entries as well.

    Hope this helps!

  • Why my printer has suddenly started printing only the first three quarters of a page...?

    Why my printer has suddenly started printing only the first three quarters of a page...?

    Hello

    Thanks for posting the question in the Microsoft Community!

    If I understand correctly, you are facing problem with the printer of. I understand that it must be frustrating, but don't worry, we are here to help solve the problem and guide you in the right direction.

    We start with two questions:

    1 have had any changes made on the computer before the show?

    2. What is the brand and model of the printer?

    I suggest for the link and try to run the troubleshooter and check if it helps.

    Printer in Windows problems

    If the problem is not resolved, please provide more information to help you best.

    Thank you.

  • How can I burn only the first 2 hours of a 4 hour program in Windows Media Center?

    The Today show is listed as 4 hours in the Guide.  I want to only record from 07:00 to 09:00 and not paws full of 07:00 to 11:00.  Is there a way to save only the first 2 hours?

    see if
    helps you.
     
     
    Barb
     
    MVP - Windows/entertainment and connected home
     
     
    Please mark as answer if that answers your question
     
     
     
     
  • When I click on play now only the first track plays

    I downloaded a few albums but when I click on play now only the first track is playing. Why is this? play the entire album?

    OP - music play all

    Hello Terence,

    Thanks for posting your query on the Microsoft Community.

    We understand the inconvenience caused and we will try our best to solve the problem.

    To help you better, I would like to know; are you clicking on play now on the individual song or the whole album?

    As a first step, I suggest you try to play the entire album and check if it helps.

    If the problem persists, perform audit and resolution of the problems of the app if it helps.

    See the link below:

    http://Windows.Microsoft.com/en-us/Windows-8/what-troubleshoot-problems-app

    For more information on the application of music, see the link below:

    http://Windows.Microsoft.com/en-us/Windows-8/music

    It can be useful, we meet with the status of your question. We will be happy to help you.

  • Mr President, how can I enter two rows at the same time with different default values that only the first line to use see?

    Mr President.

    My worm jdev is 12.2.1

    How to enter two rows at the same time with different default values that only the first line to use see?

    Suppose I have a table with four fields as below

    "DEBIT" VARCHAR2(7) , 
      "DRNAME" VARCHAR2(50),
      "CREDIT" VARCHAR2(7) , 
      "CRNAME" VARCHAR2(50),
    

    Now I want that when I click on a button (create an insert) to create the first line with the default values below

    firstrow.png

    So if I click on the button and then validate the second row with different values is also inserted on commit.

    The value of the second row are like the picture below

    tworows.png

    But the second row should be invisible. It could be achieved by adding vc in the vo.

    The difficult part in my question is therefore, to add the second row with the new default values.

    Because I already added default values in the first row.

    Now how to add second time default values.

    Concerning

    Mr President

    I change the code given by expensive Sameh Nassar and get my results.

    Thanks once again dear Sameh Nassar .

    My code to get my goal is

    First line of code is

        protected void doDML(int operation, TransactionEvent e) {    
    
            if(operation != DML_DELETE)
                 {
                     setAmount(getPurqty().multiply(getUnitpurprice()));
                 } 
    
            if (operation == DML_INSERT )
                       {
                               System.out.println("I am in Insert with vid= " + getVid());
                           insertSecondRowInDatabase(getVid(),getLineitem(),"6010010","SALES TAX PAYABLE",
                            (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                           }
    
            if(operation == DML_UPDATE)
                              {                                                    
    
                                 System.out.println("I am in Update with vid= " + getVid());
                             updateSecondRowInDatabase(getVid(),
                                 (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                              }                      
    
            super.doDML(operation, e);
        }
        private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object value4, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "Insert into vdet (VID,LINEITEM,DEBIT,DRNAME,AMOUNT) values " +
                 "('" + value1 + "','" + value2 + "','" + value3 + "','" + value4 + "','" + value5 + "')";  
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }
                  }  
    
                  private void updateSecondRowInDatabase(Object value1, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "update vdet set  AMOUNT='"+ value5+"' where VID='" + value1 + "'";                     
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);  
    
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }                  
    
                  }
    

    Second line code is inside a bean method

        public void addNewPurchaseVoucher(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("VoucherView1Iterator");
                   RowSetIterator rsi = dciter.getRowSetIterator();
                   Row lastRow = rsi.last();
                   int lastRowIndex = rsi.getRangeIndexOf(lastRow);
                   Row newRow = rsi.createRow();
                   newRow.setNewRowState(Row.STATUS_NEW);
                   rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
                   rsi.setCurrentRow(newRow);
    
                   BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter1 = (DCIteratorBinding) bindings1.get("VdetView1Iterator");
                   RowSetIterator rsi1 = dciter1.getRowSetIterator();
                   Row lastRow1 = rsi1.last();
                   int lastRowIndex1 = rsi1.getRangeIndexOf(lastRow1);
                   Row newRow1 = rsi1.createRow();
                   newRow1.setNewRowState(Row.STATUS_NEW);
                   rsi1.insertRowAtRangeIndex(lastRowIndex1 +1, newRow1);
                   rsi1.setCurrentRow(newRow1);
        }
    

    And final saveUpdate method is

        public void saveUpdateButton(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindingsBC = BindingContext.getCurrent().getCurrentBindingsEntry();      
    
                   OperationBinding commit = bindingsBC.getOperationBinding("Commit");
                   commit.execute(); 
    
            OperationBinding operationBinding = BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit");
            operationBinding.execute();
            DCIteratorBinding iter = (DCIteratorBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("VdetView1Iterator");// write iterator name from pageDef.
            iter.getViewObject().executeQuery();  
    
        }
    

    Thanks for all the cooperation to obtain the desired results.

    Concerning

  • Problem with player search - only the First Instance is highlighted

    I use WIN 8.1 with Adobe Acrobat Reader DC [15.10.200056.167417 'updated 12/18/15"indicated in the program properties] as my default PDF reader.

    Until recently, I was able to do a search of words/texts of .pdfs using CTRL-F, who showed me every instance highlight of this word.  I would simply hit 'find' several times.  These days, only the first occurrence of the word is highlighted.  Along the right margin are yellow "tics" that, in my opinion, indicate the existence of other occurrences.

    If something has changed in the drive?  Some can tell me how to regain the ability that I hope

    mikec2222 wrote:

    Bernd - Do I understand you though, when you search for "" this document, you can find a second occurrence of "the" highlighted by pressing 'find' or 'next' or 'enter' again?  If this is true, my copy of AA CD player must be faulty.  I can't wait to see your response.

    It's true.

  • Help! Only the first part of my production of exports.

    Hello world. I must begin by saying that I am completely new to the first Pro CC 2015 have switched to Sony Vegas only a week ago.

    I have a difficulty that doesn't seem wise for one big reason. The problem is that my production lasts 5 minutes and I can see it in the preview but very late. Waiting and waiting and waiting for its encode following export command that I find myself disappointed to see that the finished video contains only the first 35 seconds or so my production of all 5 minutes. The video works great, everything in these 35 seconds is how it should be, it is perfect, except the missing 4 minutes and 30 seconds. A fat that is not sensible is because the video, I'm trying to export is just the latest version. It was previously exported twice now. All I've done since then is add additional sounds and a few titles. I made sure that the Begin/End markers to cover the entire timeline on my screen of export

    There was an error that arose on a previous export, which then had to be restarted. The error referred to in audio encoding and suggested I should switch to one pass instead of two during the encoding. I've only seen this error once and honestly do not know if it is related to this problem or not.

    Intel Core i7

    principal of 16 GB of Ram

    2 GB of video Ram

    Windows 8

    Thanks indeed if you can shed some light.

    Thanks for the reply of Bill.

    Do you mean the main timeline? Forgive me, getting used to the Prime Minister. To answer your question, my best... There's no marker for the beginning or end up on the main screen. When you click export that I'm double-checking that the entire Sequence is selected as the Source and the start and end markers are in fact at the beginning and at the end. After four attempts, I had just finished with the first half minute of video rendering, however.

    I found a fix for the problem now, but still did not work what caused (to my slight annoyance).

    As an experiment, I deleted each sound track and the silent video exported now very well. To develop on this I have reinserted all the sounds, made all the sound tracks. Who has also exported very well which means that I have a video in its entirety. I fixed my own problem. I do not understand what may have caused it well.

Maybe you are looking for