Need help with Custom Field Layout - getting wirer height value

In the BB Simulator, I get a strange value placed in in my field layout() method custom. The width is 320, which is correct, but the height is 1073741823 and it takes 240 or less. In this test, my custom field is the only field in the Manager, so I expect to 240.

I tried two different simulators - BB curve and the 8800. I use JDE 4.5.0 in Eclipse 3.4.1. This is the code for my method of layout:

Protected Sub layout (int width, int height) {}
s long = getStyle().
If ((s & USE_ALL_WIDTH)! = USE_ALL_WIDTH) {}
width = Math.min (width, getPreferredWidth());
}
If ((s & USE_ALL_HEIGHT)! = USE_ALL_HEIGHT) {}
height = Math.min (height, getPreferredHeight());
}
setExtent (width, height);
model.setExtent (width, height);
Model.Scroll (0, 0);
}

I expect the value of the screen height, or less, if the domain is configured correctly.

I'm upgrading my custom field in a VerticalField Manager with the following attributes:

Super (VerticalFieldManager.USE_ALL_WIDTH
| VerticalFieldManager.USE_ALL_HEIGHT
| VerticalFieldManager.FIELD_HCENTER | VerticalFieldManager.FIELD_VCENTER);

Is this a bug in the Simulator, or I understand the API correctly? Is there a way to 'reset' the Simulator - I tried to get out of Eclipse and restart Windows, but I always get the same value.

Thank you!

Mark

A VerticalFieldManager comes, I think, with default VERTICAL_SCROLL.  If you do not want to scroll through this particular Manager, add VerticalFieldManager.NO_VERTICAL_SCROLL to your forests of style and it will be laid out with only the height and the actual width.

Also, since you setExtent() by yourself, USE_ALL_HEIGHT and USE_ALL_WIDTH are redundant, I think.

Hope that helps,

Arkady.

Tags: BlackBerry Developers

Similar Questions

  • Need help with custom script to rename the layers

    Hello world.

    I need help to write a custom script (because I suck at it) that will allow me to go through all the layers and sous-calques for a specific name ('X') and give it a new specific name ('Y').

    I have had success using the script below, but it does not work on any text layers names where the text layer was previously particularly well-known in 'X' and now changed needs.

    Any help is greatly appreciated.

    * Note: this script was originally used to find any layer with 'Copy' in its name and remove with anything after (to correct the problem of duplication of layers by adding this text).

    This is why the function is named removeCopy. It works for renaming layers also - just not a layer of text unfortunately.

    #target illustrator

    function removeCopy() {}
    If (app.documents.length == 0) return;
    var app.activeDocument = docRef;
    recurseLayers (docRef.layers);
    }
    removeCopy();
    function recurseLayers (objArray) {}
    for (var i = 0; i < objArray.length; i ++) {}
    ObjArr [i] .name = ObjArr [i].name.replace (/ \s*current name\s*\d*/, 'new name');
    If (objArray [i] .layers) recurseLayers (. layers.length > 0 ObjArr [i]);
    }
    }

    I finally found something after searching forums for a week. My confusion was related to the way Illustrator treats real layers against text/path/object "layers." Instead of layers, I had to use the pageItems in the script. The code below works. Thanks to Gustavo for his answer in another thread and Carlos I thank you for this looking too good! You're great to be ready to help models do more advanced things with Illustrator.

    var doc = app.activeDocument;
    var items = doc.pageItems;
    for (var g = 0; g)
        elements [g] .name = elements [g].name.replace ('Century Schoolbook text line', ' MonogramText: Century Schoolbook ");
    };
    App.Redraw ();
  • Need help with custom calculation Script

    Hey everybody.  I'm using Acrobat X Pro and stumbling a bit on the syntax of the following equation.  I need to add the value of "Cell1" & "Cell2" then add the value of "Cell3.  However, the value of "Cell3" is entered by the user and specifies a percentage of the sum of "Cell1 &"Cell2".  For example: If the user enters "3" in "Cell3" I need the value returned at 3% of the sum of "Cell1" + "Cell2".  If the user enters "9" in "Cell3" I need the value returned for "Cell3" 9% of the sum of "Cell1 and Cell2" and the end result should be the sum of "Cell1 Cell2 + Cell3.  In more detail:

    If "Cell1" = "Cell2" $ 500 = $500 and "Cell3" = '3' then I need the returned value to be $1030,00.

    I hope this makes sense. Here's what I have so far, but alas, it does not work.  Any help would be GREATLY appreciated.

    Get the first value in the field, as a number

    var v1 = + getField("Cell1").value;

    Get the second field value, as a number

    var v2 = + getField("Cell2").value;

    Get the value of a field, a number transformation

    var v3 = + getField("Cell3"/100).value;

    Calculate and set the value of this field for the result

    Event.Value = v3 + (v1 + v2);

    Thank you

    Solan

    I have posted a reply, but realized that it wasn't what you wanted. There is some confusion about what you want for Cell3. A hand, you say that the user enter a vaule in the area, but them you say you want its calculated value based on what the user has entered and two other field values. It seems to me Cell3 should be the domain that the user enters the percentage, and the calculated field (Cell4) script could be:

    Get the first value in the field, as a number

    var v1 = + getField("Cell1").value;

    Get the second field value, as a number

    var v2 = + getField("Cell2").value;// get treatment field value, as a number

    Get the percentage

    var v3 = + getField("Cell3").value;

    Calculate and set the value of this field for the result

    Event.Value = (1 + v3 / 100) * (v1 + v2);

  • Need help with custom dialog box

    I created a custom help dialog box. The problem is that 5 buttons do not properly fit in my manager of horizontal field on some blackberry devices. How can I make own? I tried to use my own custom buttons that allow me to specify their width and height, but I'm unable to get the width of the dialog box, so I can't determine how wide should be buttons.

    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    
    public class HelpDialog extends Dialog
    {
        static int ButtonPressed;
        HorizontalFieldManager hfmChoices = new HorizontalFieldManager();
        ButtonField cmdFirst = new ButtonField("|<")
        {
            protected boolean navigationClick(int status, int time)
            {
                ButtonPressed = 0;
                close();
                return true;
            }
        };
        ButtonField cmdPrev = new ButtonField("<")
        {
            protected boolean navigationClick(int status, int time)
            {
                ButtonPressed = 1;
                close();
                return true;
            }
        };
        ButtonField cmdNext = new ButtonField(">")
        {
            protected boolean navigationClick(int status, int time)
            {
                ButtonPressed = 2;
                close();
                return true;
            }
        };
        ButtonField cmdLast = new ButtonField(">|")
        {
            protected boolean navigationClick(int status, int time)
            {
                ButtonPressed = 3;
                close();
                return true;
            }
        };
        ButtonField cmdClose = new ButtonField("Close")
        {
            protected boolean navigationClick(int status, int time)
            {
                close();
                return true;
            }
        };
    
        public HelpDialog(String message, int page, int maxPages)
        {
            super("Help (Page: " + page + " of " + maxPages + ")\n\n" + message + "\n", null, null, -1, null, 0);
            ButtonPressed = -1;
            if (page <= 1)
            {
                cmdFirst.setEnabled(false);
                cmdPrev.setEnabled(false);
            }
            if (page >= maxPages)
            {
                cmdNext.setEnabled(false);
                cmdLast.setEnabled(false);
            }
            hfmChoices.add(cmdFirst);
            hfmChoices.add(cmdPrev);
            hfmChoices.add(cmdNext);
            hfmChoices.add(cmdLast);
            hfmChoices.add(cmdClose);
            add(hfmChoices);
        }
    }
    

    Thank you

    Most people have no need a close button, they expect the ESC to do it for them.

    That said, I disagree with this statement:

    "I think that the only good way to use managers other than the AbsoluteFieldManager, is to use them at all."

    Designing a user experience that works well on multiple devices is difficult, and I don't think that has a size fits all approach work.  In addition, I don't have the time to create formats for specific screens for each device type, and although this will not happen now, I didn't have to rework screen designs every time that a new device came out.  I think that it is possible to create a common user interface experience given the size of the screen, and whether it is touch.  If you want to read my thoughts on this, have a look at the tutorial of the user interface you will find here:

    http://supportforums.BlackBerry.com/T5/Java-development/tutorials-for-new-developers-part-1/m-p/1621...

  • Need help with custom class main event to a class not related.

    Hey guys,.

    I am new to Flash and not very well with OOP.  I did it pretty far with google and hidden, but I was pulling my hair on this problem for a day and everything I try get an error or just simply don't touch the listener.

    I'm trying to get my main class to send an event customized to an unrelated class called BigIcon.  The rest of the code works fine, it's just the addEventListener and dispatchEvent method that does not work.

    I put in the codes below.  Let me know if something else is needed to solve the problems.  Thank you!

    Main.As

    package 
    {
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
    
    
        public class Main extends MovieClip
        {
            var iconLayer_mc:MovieClip = new MovieClip();
    
            public function Main()
            {
                Spin_btn.addEventListener(MouseEvent.CLICK,fl_MouseClickHandler);
    
                addChildAt(iconLayer_mc,0);
                placeIcons();
            }
    
            function placeIcons():void
            {
                var i:int;
                var j:int;
    
                for (i = 0; i < 4; i++)
                {
                    for (j = 0; j < 5; j++)
                    {
                        //iconString_array has the names of illustrator objects that have been converted to MovieClips and are in the library.
                        var placedIcon_mc:BigIcon = new BigIcon(iconString_array[i][j],i,j);
                        iconLayer_mc.addChild(placedIcon_mc);
                    }
                }
            }
    
            function fl_MouseClickHandler(event:MouseEvent):void
            {
                dispatchEvent(new Event("twitchupEvent",true));
            }
        }
    }
    

    BigIcon.as

    package 
    {
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.utils.getDefinitionByName;
    
        public class BigIcon extends MovieClip
        {
            private var iconImage_str:String;
            private var iconRow_int:int;
            private var iconColumn_int:int;
    
            public function BigIcon(iconImage_arg:String, iconRow_arg:int, iconColumn_arg:int)
            {
                iconImage_str = iconImage_arg;
                iconRow_int = iconRow_arg;
                iconColumn_int = iconColumn_arg;
    
                this.addEventListener(Event.ADDED_TO_STAGE, Setup);
    
            }
    
            function Setup(e:Event)
            {
    
                this.y = iconRow_int;
                this.x = iconColumn_int;
    
                var ClassReference:Class = getDefinitionByName(iconImage_str) as Class;
                var thisIcon_mc:MovieClip = new ClassReference;
                this.addChild(thisIcon_mc);
    
                addEventListener("twitchupEvent", twitchUp);
            }
    
            function twitchUp(e:Event)
            {
                this.y +=  10;
            }
        }
    }
    

    This could be a bit abstract to understand, but think about what you assign event listeners to when you implement the.

    When you want to have a function to respond to a button that is clicked, what do you attribute the event listener to?  She is assigned to the object that generated the event, the button.

    In your case the main class generates the event.

    You could take a different route with this, where if all your BigIcon objects were stored in a table in the main class, you could loop through that array and manage your contractions without having to have every BigIcon object involved in this transformation.

  • need help with 'ifs' field calculation

    Hello

    I am trying to create a field in a form that adds 20% for a cost base according to which of these options is selected in a drop down list which forms the title of the form

    This is a form of new/used vehicle and requires 20% VAT to be added to the basic price if the vehicle is "new".

    If the "vehicle" then no VAT should be added

    Is this possible?

    If this can help I could use radio buttons to determine whether the vehicle is 'New' or 'Used' in the upper part of the form?

    I'm out of my depth here with java - I'm a humble designer more usually responsible to make things just look pretty on the page!

    You can you "techies" help?

    Yes, and it is even possible to do it without an 'if' statement and without writing any JavaScript.

    You need to know about domain names. Using the field names, types, and properties:

    Subtotal - amount to calculate the tax on - field digital - read-write - visible

    TaxRate - tax rate applies if taxable - digital field - read-only - hidden

    Taxable - check 2 boxes eponymous - an export value of 1 (default is checked), the other export value 0

    TaxAmount - amount of tax to be applied - field digital - read only - visible - calculation: "field is the product of the following fields: ', subtotal, TaxRate, taxable.

    -Sum of the subtotal and TaxAmount - GrandTotal numeric field, read-only, visible - calculation "field is the sum of the following fields:" TaxAmount and GrandTotal

  • Need help with the query to get the County

    Hello

    Oracle 10 g 2 10.2.0.3 - 64 bit

    I want back the number of accounts with two different types of funds (say A and B). Some accounts hold only one of the two funds, and some support both. I want to get the counts like this:

    • account held funds - has only
    • accounts holding funds-B only
    • accounts holding the Fund-A and B funds

    Here is what I started with but need assistance to meet the requirement above:

    select 
    count(distinct acct.bkoff_acct_no ) accounts_holding_fund_A
    from xe_account acct,
            xec_tal_investment_mandate iman,
            xec_tal_asset_allocation alloc,
            xe_benchmark bmark,
            xe_benchmark_usage bu,
            xe_object_description xod,
            xec_asset_class cls
    where iman.mandate_status_cd='A'
    and cls.asset_class_cd = alloc.asset_class_cd
    and iman.mandate_id = alloc.mandate_id
    and acct.account_id = iman.object_id
    and iman.object_type_cd = 'ACCT'
    and iman.mandate_id = xod.object_id
    and xod.field_nm='XEC_TAL_INVESTMENT_MANDATE.COMMENT_TXT'
    and xod.language_cd = 'E'
    and acct.acct_status_cd = 'O'
    and bu.object_type_cd(+) = 'TMAA'
    and bu.object_id(+) = alloc.asset_allocation_id
    and bmark.benchmark_id(+) = bu.benchmark_id
    and alloc.resp_txt like '%fund-A%'
    
    
    

    And suppose that the Fund-B has resp_txt like ' % of Fund-B»

    Please suggest.

    Concerning

    Hello

    Here is another way, it is easier to adapt to different jobs and different numbers of jobs:

    WITH got_distinct_jobs AS

    (

    SELECT DISTINCT deptno, job

    FROM scott.emp

    WHERE job IN ("ANALYST", "CLERKS") - or what

    )

    got_job_list AS

    (

    SELECT LISTAGG (job, ",") THE Group (ORDER BY work) AS job_list

    OF got_distinct_jobs

    GROUP BY deptno

    )

    SELECT job_list

    COUNT (*) AS num_departments

    OF got_job_list

    GROUP BY job_list

    ;

    This shows all the combinations of the jobs listed in the WHERE clause of got_distinct_jobs.  You don't need to change anything else in the query.  There may be any number of jobs.

    Output:

    JOB_LIST NUM_DEPARTMENTS

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

    CLERK                                        2

    ANALYST, CLERK 1

  • Need help with custom roles

    Hello

    Ive been charged with leading a small project... Here's the scenario:

    We have 25 shared Lun connected to each host in a cluster. The LUNS are labeled & lt; The names of LUN & gt; _Windows or Linux.

    What I want to do a role where only the team the team of linux or windows only would see their LUNS and not other teams lun.

    Is it possible... ??

    Thank you in advance.

    Navigate to the folder create, click permissions and ADD to assign the role to the folder.

    You can use custom (expand all topics and select you want) role, and no (default) access

    If you have found this information useful, please consider awarding points to 'Correct' or 'Useful'*.

  • Need help with "simplified field Notation.

    Im running Adobe Acrobat 8 Professional

    Question #1

    I am taking a total total of a series of 14 numbers and multiply this total by 25%.

    I've done research on how use calculation tool "Simplified field Notation" However when I type in what others told me to type nothing happens.

    Here's what I've been hit by

    TotalBid *.25

    This script is back nothing in the field.

    Question #2

    I have a list of areas in which data can be transferred. For example:

    Unit1 unit Price1 Total1

    UNIT2 unit Price2 Total2

    Unit 3 operation3 Unit3

    I've implemented simply calculations using the option "Value is (product) of the following fields" and it works fine.  My question is if for example there is no entry in Unit2 and unit Price2 how do I get the Total2 field to stay blank.  Right now it's showing $0.00 and I would total fields to display only a number if there are data entry in the fields of the unit and the unit price.

    The problem is most likely that the field calculation order is incorrect. To fix it, go to the forms editing mode (forms > add or edit fields), and then select "forms > edit fields > set field calculation stopped... '. »

  • Need help with full screen layout...

    I create a logon screen for an application that has several RichTextFields and two ButtonFields.  The fields are all arranged vertically.

    I use a table of HorizontalFieldManagers to center the vertical fields horizontally within the VerticalFieldManager.  The problem is that the centering work for the ButtonFields, but not the RichTextFields.

    Here is the screen on the Simulator:

    Here's what the code looks like the VerticalFieldManager for full screen:

        public tumblingIntroScreen(String appTitle, String description)
        {
            super(new VerticalFieldManager(Manager.FIELD_VCENTER), Screen.DEFAULT_CLOSE | Manager.FIELD_VCENTER);
    

    Here is the code for the table HorizontalFieldManager.

    // set up the array
        HorizontalFieldManager hfmTitle, hfmDesc, hfmBOne, hfmBTwo, hfmThree, hfmFour;
        HorizontalFieldManager[] hfm = {hfmTitle, hfmDesc, hfmBOne, hfmBTwo, hfmThree, hfmFour};
    
    ......
    
    // initialize each HorizontalFieldManager
            for(int j=0;j
    

    The following code adds the HorizontalFieldManagers to the full screen

            // add fields to screen
            add(new LabelField()); // this and next are for spacing
            add(new LabelField());
            add(new LabelField()); // this and next are for spacing
            add(new LabelField());
            hfm[0].add(firstLine);
            add(hfm[0]);
            add(new LabelField()); // for spacing
            hfm[1].add(secondLine);
            add(hfm[1]);
            add(new LabelField()); // this and next are for spacing
            add(new LabelField());
            hfm[4].add(thirdLine);
            add(hfm[4]);
            add(new LabelField());
            hfm[2].add(authenticate);
            add(hfm[2]);
            add(new LabelField());  // more spacing
            add(new LabelField());
            hfm[5].add(fourthLine);
            add(hfm[5]);
            add(new LabelField());  // more spacing
            hfm[3].add(signUp);
            add(hfm[3]);
    

    no idea why the Manager is only the ButtonFields centering?

    Solved.

    Fact the first field I added to the VerticalFieldManager a RichTextField (Field.USE_ALL_WIDTH).  That fixed the problem of centering.

  • Need help with mobile layout

    Hello. Need help with my layout sensitive, using straight lines only html5 and css3 that I can understand and explain a novice level please - without any restart. Desktop and mobile are in a single html doc. The desktop version is 'ok '.

    current version (6_2)

    Try to match these mobile Office layouts

    On the mobile version:

    -Impossible to get the buttons nav blocks, vertical text button Align, and align the image of the product (square pictures) to the Center. (margin: auto; does not work)

    I used heights in the header because I'll have code for desktop, mobile and tablet in the CSS so it changes (and do not know how to support better). Also need to Add a link to the logo image background in header.

    Thanks in advance!

    TheOriginal150mph wrote:

    Hello. Need help with my layout sensitive, using straight lines only html5 and css3 that I can understand and explain a novice level please - without any restart. Desktop and mobile are in a single html doc. The desktop version is 'ok '.

    current version (6_2)

    Try to match thesemobile Officelayouts     

    On the mobile version:

    -Impossible to get the buttons nav blocks, vertical text button Align, and align the image of the product (square pictures) to the Center. (margin: auto; does not work)

    Commenting on just a habit of property changing the css if you have defined it for the desktop version. Your nav elements are not vertically Center because you have a bottom padding set on them for the office, there are only changes for mobile in your css media query.

    .main-nav a {}

    display: block;

    text-decoration: none;

    / * padding-bottom: 15px;   */

    Padding: 12px 0;

    }

    Change the properties for the .product-images for mobile boxes: you have float attached to them for the desktop version and which cascade down to the mobile version, unless you change in the media query:

    .product-image {}

    float: none;

    Width: 50%;

    margin: 0 auto 20px auto;

    }

    As I mentioned in one of my posts related to your project, you will probably have to make your product images a bit larger. They fill the area once they form a column to width of 768px screen or you could resist transform them to one column until a little more by using a media query extra set at a narrow screen width to evoke this action

  • Need help with auto-fill the fields

    Hello

    I need help with a form that has multiple pages.  I have some areas I are duplicated in my document.  How I got these fields auto fill throughout the form/paper? For example, I'm going to fname lname, address, telephone, etc... How can I get these fields automatically on the other pages of the form?  Is this possible?  Any suggestions are welcome.

    Thank you in advance.

    If it's just a fill operation then make sure the fields have the same name. Then set the binding to the global level and all the fields with the same name will get the same value.

    Paul

  • [Error number: 0x8024400A] Need help with this error... I reinstalled XP SP1 and I can't get an auto update that's simple to install, just get this error every time

    [Error number: 0x8024400A] Need help with this error... I reinstalled XP SP1 and I can't get an automatic update that's simple to install, just get this error at each time HHHHEEEELLLPPPPP! Thank you

    I had the same problem.  But finally found a solution.  If your listing is similar to mine, then keep.  XP Media Center Edition 2005 (sp2).  AMD Athlon 64 x 2 Dual-Core, HP a1630n desktop computer.

    Go to the HP website, search for sp37394-XP sp3 Upgrade utility Microsoft for systems equipped with AMD processors.

    I had the same 0 x 80240036, 0x8024400a error, but realize my problem was really get manually downloaded sp3 and installed without continue loop crashing and not error messages.

  • NEED HELP WITH SERVICE PACK 3. After downloading and the computer goes into rebooting mode I get the screen to restart with three options, network security safe mode and the other thing. ,

    NEED HELP WITH SERVICE PACK 3.  After downloading and the computer goes into rebooting mode I get the screen to restart with three options, network security safe mode and the other thing. , but it of although he gets, he keeps countdown to restart and reboots and restarts, over and over again, never reboots, same screen. my computer won't let me out this screen even after I turned off the computer and turn it back on, I get the same screen. the only way I can get out of this is to erase my computer everything and bring it back to factory, right out of the box, this big headaches. Thanks for anyone who can help me. PS. Keep the answers in simple terms please.

    Hi BSRC$, in stock

    1. You have security software installed on the computer?
    2. You receive an error message when you restart the computer?

    Reinstalling Windows XP to the factory setting would not be the first option.

    It is possible that some third-party programs or the services installed on the computer interfere with the installation of service pack 3.

    I suggest that you try to uninstall service pack 3 from the computer by using the recovery console and subsequently ask the article below for what to do before installing the service pack 3on the computer.

    How to remove Windows XP Service Pack 3 from your computer

    http://support.Microsoft.com/kb/950249

    Steps to take before you install Windows XP Service Pack 3

    http://support.Microsoft.com/kb/950717

  • Need help with my Mail window. I can't export my message to the PST format. I keep getting the message error "an error occurred during initialization of MAPI".

    Hello

    Need help with my Mail window. I can't export my message to the PST format. I keep getting the message error "an error occurred during initialization of MAPI". Y at - it solution or another method?

    Hi ErikLee,

    Do you have MS Outlook installed on your computer?

    Windows mail import and export opportunities are limited to an Outlook .pst file or an Exchange Server mailbox. They are available only if MS Outlook is installed.
    If MS Outlook is not installed and you start an import or export action, the necessary support files are not present for Windows mail complete the operation. Then I suggest you to install Outlook temporarily and see if the problem is resolved.

    Follow the instructions below and check if the problem is resolved.

    1. reboot your computer, and then start Windows Mail.
    2. on the Tools menu, click Options.
    3. in the connection tab, click on edit to open the Internet Properties dialog box.
    4. in the tab programs, click on an application other than Windows mail e-mail in the e-mail list. Click on apply and then click OK.
    5. click OK again to close the Options dialog box.
    6. exit Windows mail and restart Windows mail.

    If this does not work, I suggest you upgrade to Windows Live Mail to import or export messages that may help you resolve the issue.

    To download Windows Live Mail, visit the following Microsoft Web site:
    http://get.live.com/wlmail/overview

    For more information about Windows Live Mail, see the Microsoft Web site at the following address:
    http://windowshelp.Microsoft.com/Windows/en-us/help/4b30d3d6-abe2-46d1-a5fd-4a1ba786a1381033.mspx

    Check whether the problem is resolved.

    Please post back and let us know if it helped to solve your problem.

    Kind regards
    KarthiK TP

Maybe you are looking for