Focus BitmapField occuping all GridFieldManager cell...

Hello

I have the following problem, I have a Focus bitmapfield 30 x 30 which I add to a 100 x 100 GridFieldManager cell.

The problem is when I click in the cell, but out of the picture, the complete cell concentrates and the navigationClick is still running... How can adjust the focus to the image and not the cell area?

My code is very simple

BitmapField refreshImg = new BitmapField(Bitmap.getBitmapResource(RutasUtils.REFRESH_IMAGE),BitmapField.FOCUSABLE);
grid.add(refreshImg);

OK, thanks anyway.

I found a 'solution '.

I use setPadding, because I am by aligning the button refresh to the upper right. Instead of using zero for the bottom and left padding, I increased the value to convert the entire region of the 'empty' cell padding and to avoid the previous behavior:

refreshImg.setPadding (5, 10, 55, 10);

Tags: BlackBerry Developers

Similar Questions

  • How can I select all the cells in an AdvancedDataGrid with ActionScript?

    How can I select all the cells in an AdvancedDataGrid with ActionScript? I selectionMode = "multipleCells" and designViewDataType = "flat".
    Basically, I have a contextmenu and want to add a "select all" option.

    Thank you

    Yes you can do in actionscript as well.
    If selectionMode is set to multipleCells then:
    Section A Code attached

    If selectedMode is set to multipleRows, then there are two ways to do it.
    1 - the solution is given by Bryan Dresselhaus in his last message.
    2-section B in the attached Code

  • All excel cell number format using "excel cell format.vi set.

    Hi all

    I am writng 12 numbers to Excel cell, but it seems to me that 2.00207E + 11 instead of 200207106040. I use entire excel function cell phone format.vi but it is not useful, because I have no number format...

    Reference in the image file setting a VI.

    Thank you

    Got the answer.

  • BitmapField consumes all clicks on the screen

    Hello

    I hope someone can help me with this problem: I have a screen that has only BitmapField is on. When you click on this 'something' BitmapField should be here which works very well.

    The problem is that even if I click elsewhere on the screen the 'click' fires.

    This is the main code on the screen:

    VerticalFieldManager view = new VerticalFieldManager();
    
    Bitmap bm = Bitmap.getBitmapResource("image.jpg"); // size 60x60
    MyBitmapField bmf = new MyBitmapField(bm, BitmapField.FOCUSABLE);
    bmf.setChangeListener(this);
    view.add(bmf);
    add(view);
    

    And that the implementation of the 'MyBitmapField ':

    public class MyBitmapField extends BitmapField
    {
      public MyBitmapField(Bitmap bitmap)
      {
        super(bitmap);
      }
    
      public MyBitmapField(Bitmap bitmap, long style)
      {
        super(bitmap, style);
      }
    
      protected boolean navigationClick(int status, int time)
      {
        FieldChangeListener listener = getChangeListener();
        if (null != listener)
        {
          Dialog.alert("Clicked");
          listener.fieldChanged(this, 1);
          return true;
        }
    
        return super.navigationClick(status, time);
      }
    
      protected boolean touchEvent(TouchEvent message)
      {
        /*
        if (TouchEvent.CLICK == message.getEvent())
        {
          int index = this.getManager().getFieldAtLocation(message.getX(1), message.getY(1));
          if (index == -1)
              return super.touchEvent(message);
          Field field = this.getManager().getField(index);
          if (field != this)
            return super.touchEvent(message);
    
          FieldChangeListener listener = getChangeListener();
          if (null != listener)
            listener.fieldChanged(this, 1);
        }*/
        return super.touchEvent(message);
    }
    
    }
    

    In the touchEvent method is a point that I also tried - but that didn't work either.

    The fieldChanged Manager is as usual:

      public void fieldChanged(Field field, int arg)
      {
        if (field instanceof MyBitmapField)
        {
          MyBitmapField bmf = (MyBitmapField) field;
          Dialog.alert("Clicked: " + Integer.toString(arg));
        }
      }
    

    I'm actually on the 9550 Simulator.

    Can someone please help me and tell me what I need to do to avoid that the click event is fired even if I click outside the BitmapField (I also put a border, just to make it visible, it is not expanded).

    Thank you very much

    That's exactly how BlackBerry works, even if it is IMHO pretty buggy: the key CLICK event is translated into navigationClick() in the field that currently has the focus. The problem lies in the fact that EVENT moves the focus to the field under him that if there is an active field where you press the screen, otherwise the focus remains where it is.

    To overcome this obstacle, program your touchEvent similar to this:

    protected boolean touchEvent(TouchEvent message) {
      if (TouchEvent.CLICK == message.getEvent()) {
        int x = message.getX(1);
        int y = message.getY(1);
        XYRect myExtent;
        getExtent(myExtent);
        myExtent.translate(0, 0); // getX, getY values are relative to this field's upper-left corner
        if (!myExtent.contains(x, y)) {
          return true;
        }
      }
      return super.touchEvent(message);
    }
    

    You can allow a 'near miss' avoid the frustration of users - extend the myExtent in any quantity you want of each side.

  • Not able to focus BitmapField

    Hi gurus

    I searched for this error but have not been able to find a solution.

    I have a HorizontalFieldManager where I add BitmapFields. These BitmapFields have FOCUSABLE, no problem with that style.

    What I'm trying to do, it is only when the user focuses on a different field, outside the HorizontalFieldManager and then returns to the HorizontalFieldManager, enforcement "remembers" field was centered in the HorizontalFieldManager, much as the menus of Twitter and Facebook on their BB applications.

    To do this, I'm saving SelectedIndex when the Manager is blurry:

       protected void onUnfocus(){
            BitmapField focusedField = (BitmapField) getFieldWithFocus();
            if (focusedField != null) selectedIndex = focusedField.getIndex();      
    
            super.onUnfocus();
        }
    

    It works very well, I'm able to get the selectedIndex property. So what I try to do next is to focus this field when the manager gets concentrate:

     protected void onFocus(int direction) {     
    
            BitmapField fieldToFocus = (BitmapField) getField(selectedIndex);
            if (fieldToFocus != null) fieldToFocus.setFocus();              
    
            super.onFocus(direction);
        }
    

    I see that fieldToFocus is recovered succcesfully, is not null and the selectedIndex property is valid, but when I run the method

    fieldToFocus.setFocus()
    

    It is for me a StackOverflow Exception.

    I tried many other ways and have not been able to understand how to fix it. I also tried to comment the last line on the onFocus event: super.onFocus (branch);

    But it does not work.

    Help, please!

    a Board exception stackoverflow on a loop without end. maybe onFocus is called again when you run setFocus? Avoid it along with a check on the target area.

    I would also call great.

  • The value of conditional tag to all table cells, including content

    Hello

    I use FM12, unstructured. I want to put all the content of a chapter to some conditional text (by selecting all of the content and defining the condition).

    My problem is with tables. This action only sets the table as a framework, but does not define the content of the table as conditional cell. Is there a simple way to do this without script?

    Thanks in advance,

    Hani

    I got a simple solution in the FrameMaker community - tag conditional on all cells in the table, including the content of the value

    Thanks for your time.

  • Change all the cells in all Tables

    Hello

    This is my first post, but I have worked with InDesign scripting for a while and I'm pretty fluent in Javascript.

    My scenario is, I have a document with about 1,000 pages. On each page is a table with about 100 cells, 10 rows and 10 columns with a description to the 0-space of each, followed by a floating point number (in the form of a percentage) in all the other cells. What I need to do, is to put the color of the text of each percentage in each line according to its value. For example, in the first row, each percentage less than 80.00% is red, while everything should be green. All I have to do is color based on their value. However, this value changes throughout the 10 different lines.

    I could make a script that would allow me to go over each cell in the row 1 of each table on one page, then iterate over all the other pages in the same way before continuning on line 2. It is a long process, typically leading to a crash in any document more than ~ 30 pages long. Since I want to run it on a document of more than 1000 pages gigantic (granted there are only 1 table per page), it becomes a bit unrealistic...

    I am just curious to know if there is a way to run it in a more realistic way. There must be a quick way to iterate over each line, simply check the values, green or red brand and do with it. My idea was to, perhaps, make each row of the table on one page and then go on the next page, as opposed to the 1st row on the entire document, followed in line 2 and so on and so forth? Maybe this would help?

    The code is FARRR too long to post here, but the rough process I have at the moment is the following:

    1.) configuration variables to define the cells of each row:

    var allTables = app.activeDocument.stories.everyItem ().tables.everyItem ();

    var firstRowCells = allTables.rows [1].cells.everyItem () .getElements ();

    (There must be a way to optimize that?)

    2.) call a bunch of statements for the amount of lines, I need process (10) by table:

    for (var i = 0; i < firstRowCells.length; ++ I)

    {

    var a = parseFloat (firstRowCells [i] .silence);

    If (one < = 80.00)

    {

    firstRowCells [i] .texts .appliedCharacterStyle [0] = "FAILURE Red."

    } ElseIf (a > 80,00) {}

    firstRowCells [i] .texts [0] .appliedCharacterStyle = "Green PASS";

    }

    }

    .. .the all this (about 10 for instructions) translates into a pretty rough fall. Does anyone have a solution? Or at least a tip of optimization?

    Thank you

    -Chris

    It's a bit more stylish

    // by Trevor http://forums.adobe.com/message/4623699#4623699
    app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.ENTIRE_SCRIPT, "Format Table");
    function main()
    {
    var myCellStyle=["80","80","80","40","50","30"],v=myCellStyle.length,
        myTables=app.documents[0].stories.everyItem().tables.everyItem();
    while (v--)
    {
    myTables.rows[v+1].cells.itemByRange(2,5).appliedCellStyle=myCellStyle[v];
    myTables.rows[v+1].cells[7].appliedCellStyle=myCellStyle[v];
    }
    myTables.cells.everyItem().clearCellStyleOverrides (1);
    myTables.rows[1].cells[6].appliedCellStyle="Trend";
    }
    

    Curious to know how long does it to treat 1000 dashboards

    Trevor

  • Auto focus stopped working all of a sudden

    Hello dear community,

    my English is not that good, I'm sorry.

    Here's my problem:

    a few days earlier, I wanted to take a quick snapshot of a nice car but the camera was only in black, I tried to get to the front camera (it took a while), but it worked perfectly fine. I restarted, hard I restarted, reset etc after that I dropped. Somedays later, my camera was working again except the autofocus on the back and the front camera (!). I tried everything like unlock the AF lock by pressing the screen about 2 or 3 seconds until it said AF-unlocked. > > > Does not.

    There is no damage of fall or something like that. There is no dust or other dirt on the camera back, he just used focusing. I think that the update to 9.2.1. the cause of the problem of camera. I have this iPhone for about 2 or 2.5 years and the camera never stopped working like that.

    I hope you can help me.

    Greetings from the Germany.

    To make sure that it is not software related, that the phone back to factory settings, without using backups and test the camera.

    If the device still does not work, take it to an Apple Retail Store or Apple authorized service next to your place provider to check the phone.

    Please contact Apple for repair.

    Use iTunes to restore your device to factory settings - Support Apple iOS

    Apple iPhone - contact Support - support

    Find an Apple authorized service provider

  • Which occupies all the memory on my hard drive to 500 GB?

    Last year, I bought a new computer with 500 GB hard drive and now I barely 48 GB left. I checked all my files and they take no way up to more than 400 GB of space. My internet is incredibly slow. I did a system restore, nothing. I wipe my hard drive, nothing. Check for the presence of virus, nothing. Help. What is the problem and how to fix it.

    Thank you

    Hello

    Are you sure that those are GB and MB not? If you want to keep control of Trend Micro with their support.
    Because the files are LOG files and .txt format, they can be deleted however in Trend Micro may
    make it again later. Check the change of people dates to see if that helps to determine the cause.

    ===============================================================

    Trend - Micro seems to cause or worsen a large number of questions, so I would like to move on to something more
    compatible. Uninstall it and then run the Trend Micro removal tool or check for special
    removal on their website instructions to avoid debris that can cause strange problems.

    TrendMicro removal tool
    http://eSupport.trendmicro.com/pages/how-do-I-remove-old-or-new-versions-of-trend-micro-products-in-my-comp.aspx

    List of tools to clean/uninstall anti-malware programs
    http://social.answers.Microsoft.com/forums/en-us/msestart/thread/407bf6da-C05D-4546-8788-0aa4c25a1f91/

    ------------------------------------------------------------

    Here's what I use and recommend: (these are all free and very effective versions.)

    Avast and Prevx proved extremely reliable and compatible with all I have
    launched on them. Microsoft Security Essentials and Prevx have also proven to be very
    reliable and compatible. Use MSE or Avast and Prevx, Prevx 3 but not all.

    Avast Home free - stop any shields is not necessary except leaving Standard, Web, and
    Operation of the network.

    Prevx - Home - free

    Windows Firewall

    Windows Defender (is not necessary if you use MSE)

    Protected IE - mode

    IE 8 - SmartScreen filter WE (IE 7 phishing filter)

    I also IE always start with asset if filter InPrivate IE 8.
    (It may temporarily turn off with the little icon to the left of the + bottom
    right of IE)

    Two versions of Avast are available 5.x and 4.8 x

    Avast - home - free - 5.x stop shields you do not use (except files, Web, network, &)
    Shields of behavior) - double click on the icon in the Notification area - real time Orange - click on the
    Shield that you want to stop - STOP. To stop the Orange icon to show an error indicator-
    Click on the Orange icon - top right - settings - click on the status bar - uncheck shields you
    disabled - click OK
    http://www.avast.com/free-antivirus-download

    Avast 4.8 x - home - free - stop shields, you don't need except leaving Standard, Web,.
    and the network running. (Double-click the blue icon - look OK. - upper left - Shields details
    Finish those you don't use).
    http://www.avast.com/free-antivirus-download#TAB4

    Or use Microsoft Security Essentials - free
    http://www.Microsoft.com/Security_Essentials/

    Prevx works well alongside MSE or Avast

    Prevx - home - free small, fast, exceptional protection CLOUD, working with other security
    programs. It is a single scanner, VERY EFFICIENT, if it finds something come back here
    or use Google to see how to remove.
    http://www.prevx.com/   <-->
    http://info.prevx.com/downloadcsi.asp  <-->

    PCmag - Prevx - Editor's choice
    http://www.PCMag.com/Article2/0, 2817,2346862,00.asp

    Also get Malwarebytes - free - use as scanner only. If you ever think malware and that
    would be unusual with Avast and occasional Prevx running with the exception of a low level cookie
    (not much), to UPDATE and then run it as a scanner. I have a lot of scanners and they
    never find anything of note that I started to use this configuration.

    http://www.Malwarebytes.org/

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • Why all the cells in my form are seen in my browser.

    Here is the overview of IExplore

    register 2.JPG

    I see just the textfields and lables, the entire form!

    Seems to me that you forgot to zero on the border of the table and cell spacing in the html code. It is difficult to say without seeing the code well.

  • All of a sudden, the page to 'save' occupies all of my screen and I can't find a way to reduce its size - this has never happened before, which is very annoying

    When I click on 'save' the resulting dialog box fills the entire screen. I'm unable to reduce its size with the mouse to shoot within the borders of the dialog box, and I can't find another way to reduce it. This problem appeared spontaneously. He did not begin immediately after installing a new plug-in or a new version of Firefox - it just happened one day. I have used Firefox for years and never had this embarrassing problem before.

    This is the dialog box that appears to save the Page under? Like other windows, it could be maximized/restored by double-clicking the title bar. Does make a difference?

    Otherwise, it might be necessary to rename or delete the localstore.rdf file, which stores the positions of windows and related settings...

  • Windows XP, the power option button is gray and does not work. The hiberfil.sys file occupies all the available space.

    I can't install the updates, especially antiviruse updates and everything is slow because the hiberfil.sys file is huge.  I can't Devil Hibernate because the power button is gray-no matter how or where I'm trying to open it.  Also at the same time, the sound disappeared and the sound card displays a yellow button.  Difficult to use the computer and dangerous online.   Help!
    Eve

    Hi EveMontgomery,
     
    You can disable hibernation by running the hotfix given below article tool to solve this problem:
     
    To solve the sound problem, follow the three steps solution given in the link below and see if this helps you.
  • Return all column names of the cells that match a value in a single cell

    I want to be able to scan all the cells in column 1 in column 3 (there could be several) which belong to the same line and check if they all have a value y (X). If they have no value, I want all columns to display all the names of the matching columns as follows: "column 1, column 2" for Elemento.

    This can be a good start:

    B2 = if (counta (C2) > 0, C$ 1, "" ") & IF (COUNTA (D2) > 0', ' & D$ 1," ") & IF (COUNTA (E2) > 0', ' & E$ 1," "") & IF (COUNTA (F2) > 0', '& F$ 1,' ')

    It's shorthand dethrone select cell C2, then type (or copy and paste it here) the formula:

    = IF (counta (C2) > 0, C$ 1, "" ") & IF (COUNTA (D2) > 0', ' & D$ 1," ") & IF (COUNTA (E2) > 0', ' & E$ 1," "") & IF (COUNTA (F2) > 0', '& F$ 1,' ')

    Select cell B2, copy

    Select the cells B2 the bottom of column D, dough

    To add additional columns, you copy the atomic unit:

    & IF (COUNTA (D2) > 0', '& D$ 1,' ')

    and update D2 with the new column and D$ 1 with the new column.

    then... If you add a new column (G, for example) that you want to change it:

    and IF (COUNTA (D2) > 0', '&D$1,' ')

    TO

    and IF (COUNTA (G2) > 0', "&G$1," ")

    and the updated formula would be:

    = IF (counta (C2) > 0, C$ 1, "" ") & IF (COUNTA (D2) > 0', ' & D$ 1," ") & IF (COUNTA (E2) > 0', ' & E$ 1," "") & IF (COUNTA (F2) > 0', ' & F$ 1,"") & IF (COUNTA (G2) > 0', '& G$ 1,' ')

    fill down like before

  • Not all cells in the table is formatted but just the first.

    var doc = app.activeDocument,

    _pages = doc.pages, i, j, k, l.

    _textframes, _tables _row, _cell, rownum;

    for (i = 0; i < _pages.length; i ++) {}

    _tables = _pages.item (i). Tables;

    for (j = 0; j < _tables.length; j ++) {}

    _Row = _tables.item (i) Rows;

    rowlen = _row.length;

    for (k = 0; k < _row.length; k ++) {}

    _cell = _row.item (i) .cells.

    for (l = 0; l < _cell.length; l ++) {}

    _cell. Item (i) .appliedCellStyle = "CellA ';

    _cell. Item (i).paragraphs.everyItem () .appliedParagraphStyle = 'ParA ';

    }

    }

    }

    }

    Hi, I'm stuck in this code. I want to format all the cells of the table, but using the code above only the first cell of the first row is updated with the format. The other problem is that, in all the lines, it is a cell unique couting. "CellA" and 'ParA' is the cell styles and paragraph styles I made in my pc. I'm relatively new to indesign scripting and try to learn something new.

    Hello

    1. There is no property, '.table' for 'page' pages.item (i) .tables returns error;

    2 Javascript is case sensitive so watch start a property with a small letter names ("Tables" are false);

    3. There is no need to browse the pages, tables, lines and cells - just use . everyItem().

    so

    app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().appliedCellStyle = "CellA";
    app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().paragraphs.everyItem().appliedParagraphStyle = "ParA";
    

    should work.

    Jarek

  • gridfieldmanager custom

    Dear all,

    I tried to implement a GridFieldManager by copying one of the displayed example. I realize that there is a such GridFieldManager documented in API 5.0. However, I may need to cater for older devices, i.e. running 4.5. The problem is after I added in BitmapFields in this GridFieldManager and I try to navigate around, the first field is always focused. He never sail anywhere. Here are the updated navigationMovement

    protected boolean navigationMovement (int dx, int dy, int, int time status) {}
            
    int focusIndex = getFieldWithFocusIndex();
            
    While (dy > 0) {}
    focusIndex += columns;
    {If (focusIndex > = {getFieldCount())}
    Returns false; The focus moves on this manager
    }
    else {}
    Field f = getField (focusIndex);
    If (f.isFocusable ()) {/ / only move the focus on the fields of the object of focus}
    If (f instanceof ImageButtonField)
    {
    IBF ImageButtonField = f (ImageButtonField);
    If (IBF.isOnFocus ())
    {
    f.setFocus ();
    -DY;
    }
    }
    on the other
    {
    f.setFocus ();
    -DY;
    }
    }
    }
    }
            
    While (dy< 0)="">
    focusIndex = columns;
    If (focusIndex< 0)="">
    Returns false;
    }
    else {}
    Field f = getField (focusIndex);
    If (f.isFocusable ()) {}
    If (f instanceof ImageButtonField)
    {
    IBF ImageButtonField = f (ImageButtonField);
    If (IBF.isOnFocus ())
    {
    f.setFocus ();
    DY ++;
    }
    }
    on the other
    {
    f.setFocus ();
    DY ++;
    }
    }
    }
    }
            
    While (dx > 0) {}
    focusIndex ++;
    {If (focusIndex > = {getFieldCount())}
    Returns false;
    }
    else {}
    Field f = getField (focusIndex);
    If (f.isFocusable ()) {}
    If (f instanceof ImageButtonField)
    {
    IBF ImageButtonField = f (ImageButtonField);
    If (IBF.isOnFocus ())
    {
    f.setFocus ();
    -DX;
    }
    }
    on the other
    {
    f.setFocus ();
    -DX;
    }
    }
                    
    }
    }
            
    While (dx< 0)="">
    -focusIndex;
    If (focusIndex< 0)="">
    Returns false;
    }
    else {}
    Field f = getField (focusIndex);
    If (f.isFocusable ())
    {
    If (f instanceof ImageButtonField)
    {
    IBF ImageButtonField = f (ImageButtonField);
    If (IBF.isOnFocus ())
    {
    f.setFocus ();
    DX ++;
    }
    }
    on the other
    {
    f.setFocus ();
    DX ++;
    }
    }
    }
    }
            
    Returns true;
    }

    I wonder if there is a problem with it. Help, please. Thank you...

    Hi guys,.

    apparently moveFocus (focusIndex, status, time); the round is played. I have inserted after f.setFocus.

Maybe you are looking for

  • How to remove the advertising popping up

    I keep getting some advertising popping up when you use Safari, I tried to remove it manually by using the option to go on the record, passing through all the article, also tried OS upgraded to Captian with security was last updated, but it's always

  • Given the wording and the value setting method

    Given a name/value pair, how to set a Panel control with the label name for a value of value? This seems like it should be simple, but I can't.

  • Deploy the CVI RTE onto many computers on network

    What is the best way to deploy a new RTE of several machines on a network?  I currently have several production testers that have shortcuts to the EXE file that is stored on a server.  If I create an EXE file with a newer version of LabWindows/CVI, s

  • Computer does not recognize my hdmi connection after sleep

    OT: Audio playback problemI am running win7 Home premium 64-bit and use media center to record tv programs, therefore, I use "sleep" mode my problem is when the computer wakes up it does not recognize my hdmi connection [says its unplugged when actua

  • How do printerhead cleaning: HP Photosmart C4250 All In One error?

    I have a HP Photosmart C4250 All In One error?  Installed new ink cartridges, seemed to work fine, now upper half of the page is nice and dark, but half lower is pale.  How can I run a clean up for this?  Maybe the Black print head dry or partially s