Question regarding setExtent and getPreferredWidth for the custom field

I am trying to understand the difference between getPreferredWidth and setExtent, which relate to the width of a custom field.

I create a field that may be greater than the width of the screen. The field is made up of cells (for example columns and lines or cells, such as a table). The cells contain text, shapes, lines, color, etc. When I display the field I only paint the visible columns on the screen and allow the user to use the trackball to accomplish the columns out of the screen.

At present, getPreferredWidth returns the total width of the field without all the empty columns, is longer than the width of the screen. I use the same value in setExtent for width. GetPreferredWidth must return the size of the field that is painted on the screen - the total width less the width of the columns out of the screen? I have the same question about setExtent - width either in total, longer than the screen width or the width of the part of the field that is painted on the screen?

If I use the width of what is painted on the screen or the other of these methods, then the width changes when the user scrolls through the field. As the user scrolls, I calculate the number of columns will agree to a width of the screen and paint these columns. Is it a problem to have the PreferredWidth and the setExtent change width? I read that setExtent is called only when the Manager sets this field, so that the changes will not be recognized.

It seems to work in two ways in a few simple tests, but I was just curious as the value of width that is right.

Thank you!

Mark

When a field has changed in a way that requires the update of the screen (for example, after scrolling offset changes), simply call invalidate() from this area. That will eventually lead to paint (Graphics) for the field. At this point, you return the update field. (If only part of a field - as a single cell - needs to be updated, there invalidate() versions that accept arguments where, for efficiency, you can limit the update for just this part.)

If I understand your needs, you can achieve the effect desired in the paint method. You can use the current dimensions of the field, the cutting of the graphics area, and your internal roll compensates to decide what to paint and what to delete. Let your custom field leave white space where you decide of doesn't make is not part of a cell. There is no need to change the scope of the field.

If you go about it by changing the dimensions of the field, and then you ask the system to play much more work he has to do. If the custom field is the only field on the screen, it won't make much difference in the behavior (although there may be performance). With more than one field, it can be weird effects. For example, suppose that your custom field is one of several fields in a HorizontalFieldManager and you change the field width. When the HorizontalFieldManager recalculates its own layout, it will change the horizontal position of the fields to the right. The effect on the user, I think, would be really confusing: as the custom field parade, parties to the right of the screen could bounce left and right as the changed width field. I can't imagine that's what you want.

Here's another way to think about this: absent some bit of style, your custom field would prefer be exactly wide and high enough to show all without scrolling. So the width and height would be based on adding the appropriate cell widths and heights, regardless of what actually is on the display. (It's also a long time that you do not have something fanciful.) If the optimum height is a function of the width available - as with sheathed on the line of text - you would implement this logic in the layout method. You then have no use for autonomous preferred width and height).

Tags: BlackBerry Developers

Similar Questions

  • How long does it take for the custom field created in SFDC appears in the list of field mapping?

    How long does it take for the custom field created in SFDC appears in the list of field mapping? I hit the refresh field button, but it does not appear after 5 min. I just need to have patience?

    I had the same problem yesterday, I think it took about 10-15 minutes to appear.

  • Helps with the syntax of the workflow for the custom field

    I created a custom field called 'qualified Date '. Our current workflow is at work,

    (PRE ("< SalesStage > '") <>[< SalesStage >]) AND (PRE ("< SalesStage >") = 'Lead')

    The goal is that whenever the opportunity is taken from the stage of lead, it is called.
    However, I don't want the full qualified date when a lead is moved to Closed/Lost.

    Any suggestions on how to change this workflow to make that happen.

    We have a similar workflow, and we use a slight variation of what has suggested Shilei.
    PRE ("< SalesStage > '") <>[< SalesStage >] AND PRE ("< SalesStage >") = 'Lead' AND FieldValue ("< SalesStage > '") <>' closed/lost '.

    Good luck
    Thom

  • Dynamic Charting question - maximum lines and beaches for the omiy label values

    Hello

    I was wondering if it was possible to define an application variable and then referenced in a series in the chart definition.
    I have frequenctly need to go and exapnd the maximum number of lines to my definitions of chart with a value series
    15 and if I have a chart with multiple series it seems to make sense that they all have the same value. This made me think
    try to use some kind of variable. I tried to use a hidden page element. However, Apex seems to want a static numeric value
    and if I were just hard code for now value. Anyone succeeded with something else?

    Another issue I have is with the display of the label. When conspiring time series that allows the user to define a date range its hard
    to know in advance how to set the Label interval omit. An ideal solution would be to define a number of desired points as the chart
    can manage and dynamically assign omit interval based on some kind of formula. Again, the assignment of the static value is logical for some
    the entries date and not so much for others.

    Thanks for your suggestions!

    You will find the structure of the XML here: http://3.anychart.com/products/docs/anychart/index.htm

    Dimitri

  • FieldChangeListener for the custom field does not...

    Hi all

    I searched for him and almost all positions tried but failed to get the solution of it. Here is my code. My problem is when I click on the individual images the fieldchangelistener must be called and the message.

    package com.samples;
    
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.Manager;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    
    public class CustomPaintingScreen extends MainScreen implements FieldChangeListener
    {
        CustomClass[] custom;
    
        FieldChangeListener itemlistener = new FieldChangeListener() {
    
            public void fieldChanged(Field field, int context)
            {
                Dialog.alert("clicked");
            }
        };
    
        public CustomPaintingScreen()
        {
            setTitle("Custom Painting ");
            custom = new CustomClass[10];
            VerticalFieldManager vfm = new VerticalFieldManager(Manager.VERTICAL_SCROLLBAR|Manager.LEAVE_BLANK_SPACE);  
    
            for (int i = 0; i < custom.length; i++)
            {
                custom[i] = new CustomClass();
                custom[i].setChangeListener(itemlistener);
                vfm.add(custom[i]);
            }
            this.add(vfm);
        }
    
        public void fieldChanged(Field field, int context)
        {
            if(field instanceof CustomClass)
            {
                Dialog.alert("clicked");
            }
        }
    }
    

    and here's my customclass

    package com.samples;
    
    import java.util.Vector;
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.XYRect;
    
    public class CustomClass extends Field //implements FieldChangeListener
    {
        private XYRect dest;
        private Bitmap bitmap;
        private Vector vtr;
        private Bitmap next;
    
        public CustomClass()
        {
            bitmap = Bitmap.getBitmapResource("laptop.png");
            next = Bitmap.getBitmapResource("next.png");
            dest = new XYRect(20,15,bitmap.getWidth(),bitmap.getHeight());
            //this.setChangeListener(this);     
    
            vtr = new Vector();
        }
    
        protected void layout(int width, int height)
        {
            height = getFont().getHeight()* 5;
            setExtent(Display.getWidth(), height);
        }
    
        protected void paint(Graphics graphics)
        {
            graphics.setColor(0xFF7F24);
            graphics.fillRoundRect(5, 5, (getWidth()-10), (getFont().getHeight()*5), 30, 40);
            graphics.drawBitmap(dest, bitmap, 0, 0);
            graphics.setColor(Color.BLACK);
            int x = bitmap.getWidth()+25;
            int y = 15;
            graphics.setFont(getFont().derive(Font.BOLD));
            graphics.drawText("Dell Laptop", x, y, 0, getWidth());
            graphics.setFont(getFont().derive(Font.PLAIN,15));
    
            String str= "Discover Dell Inspiron and XPS Laptops with advanced technology.this is dell laptop";
            vtr = wrap(str, 300,graphics);
            System.out.println(" "+vtr.toString());
    
            graphics.drawBitmap(335, 15, next.getWidth(), next.getHeight(), next, 0, 0);
    
    //      graphics.drawText(vtr.toString(), x, (y+20), 0,300 );
        }
    
        private Vector wrap (String text, int width,Graphics graphics)
        {
            int x = bitmap.getWidth()+25;
            int y = 35;
    
            Vector result = new Vector ();
            if (text == null)
               return result;
    
            boolean hasMore = true;
    
            // The current index of the cursor
            int current = 0;
    
            // The next line break index
            int lineBreak = -1;
    
            // The space after line break
            int nextSpace = -1;
    
            while (hasMore)
            {
               //Find the line break
               while (true)
               {
                   lineBreak = nextSpace;
                   if (lineBreak == text.length() - 1)
                   {
                       // We have reached the last line
                       hasMore = false;
                       break;
                   }
                   else
                   {
                       nextSpace = text.indexOf(' ', lineBreak+1);
                       if (nextSpace == -1)
                          nextSpace = text.length() -1;
                       int linewidth = this.getFont().getAdvance(text,current, nextSpace-current);
                       // If too long, break out of the find loop
                       if (linewidth > width)
                          break;
                   }
              }
              String line = text.substring(current, lineBreak + 1);
    
              graphics.drawText(line, x, y, 0,350 );
              y=y+15;
    
              result.addElement(line);
              result.addElement(new String("\n"));
              current = lineBreak + 1;
         }
         return result;
        }
    
        protected boolean navigationClick(int status, int time)
        {
            fieldChangeNotify(1);
            return super.navigationClick(status, time);
        }
    
        protected void fieldChangeNotify(int context)
        {
            super.fieldChangeNotify(context);
        }
    }
    

    also my images look like this

    When I click on the individual images, the dialog box should appear. I tried a lot of things. give me a code. for screen touch for example jde4.7 and jde4.5

    Hi peter - what did I want to add the listener on the image above and manipulate. and the picture above, I created using the graphics object. so this is the question that I am able to get the listener?

  • How to display the date and time for the date fields in SQL Workshop

    The workshop of the Apex SQL always truncates the time of date fields. Is it possible to change the default displayed date format / time fields?

    I would not advise to make direct updates to the table wwv_flows or any other object of the apex.

    Change here Home > Application Builder > Application XXX > shared components > change attributes if necessary globalization.

    See you soon

    Ben
    http://www.munkyben.WordPress.com
    Don't forget to mark the answers useful or correct ;)

  • Please wait for the customer to political group - stop questions

    Hello

    I have problems with the closing of a machine. When the machine is connected to the corporate network, everything works fine. However, if the computer is connected to the VPN (1 hour or more) it is always suspended when it stops. First step in the shutdown process is:

    Please wait for the system event Notification service.

    This change after 3 minutes exactly. Next step:

    Please wait for Group Policy client windows 7

    is never exceeded (even after a few hours). Machine never off.

    Under newspapers there are always these 4 events when the machine stops in vain:

    1. 6005: the winlogon notification subscriber takes a long time to handle the notification event (Logoff).
    2. 4627: the event COM + a system expired attempt to fire the method of logging on the event {D5978650-5B9F-11D1-8DD2-00AA004ABD5E} class for the Publisher and the Subscriber.  The Subscriber has not responded within 180 seconds. The full name of the subscription is "ISensLogon2". The HRESULT is 80010002
    3. 6006: the winlogon notification subscriber took 180 second (s) to handle the notification event (Logoff).
    4. 6005: the winlogon notification subscriber takes a long time to handle the notification event (Logoff).

    Sense has expired after 3 minutes while there is no event 6006 for GPClient and machine is stuck there for centuries (Please wait for the customer to group policy). I noticed in the system logs that before the machine hangs during the shutdown process there are these errors and warnings:

    • 5783: the session configuration for the Windows NT or Windows 2000 Domain Controller \\server for the domain X is not admissible.  The current CPP of Netlogon call on \\machine to \\server was canceled.
    • 1014: name resolution for the name of the server has expired after none of the configured DNS servers answered.
    • 131: NtpClient could not set a domain peer to use as a source of time due to the DNS resolution error on ". NtpClient will try again in 3473457 minutes and double the reattempt interval thereafter. The error was: the requested name is valid, but no data of the requested type was found. (0x80072AFC).

    There is more than 1014 events for different servers and some 131. 5783 is always alone.

    I did a group policy log, because I thought that I will be able to see where the machine stuck. Below you can see the part of the newspaper GPSVC when the machine stops in vain:

    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: incoming with the event 0xe58
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: cancellation pending appeals
    GPSVC (2d4.1cfc) 21:31:24:327 Client_CompleteNotificationCall: failed with 0x71a
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: cancelled waiting for calls
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: dating dwStatus = 0 x 0
    GPSVC (438.1a04) 21:31:24:327 waiting for user group wire political end.
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: incoming with the event 0xe10
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: cancellation pending appeals
    GPSVC (218.C88) 21:31:24:327 Client_CompleteNotificationCall: failed with 0 x 525
    GPSVC (2d4.1cfc) 21:31:24:327 Client_CompleteNotificationCall: failed with 0x71a
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: cancelled waiting for calls
    GPSVC (2d4.9C8) 21:31:24:327 CGPNotify::OnNotificationTriggered: Completenotification failed with 1317
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: incoming with the event 0xdcc
    GPSVC (218.1054) 21:31:24:327 CGPNotify::UnregisterNotification: incoming with the event 0x20cc
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (2d4.9C8) 21:31:24:327 CGPNotify::OnNotificationTriggered: Completenotification failed with 1317
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: incoming with the event 0xd90
    GPSVC (218.1054) 21:31:24:327 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (2d4.1cfc) 21:31:24:342 CGPNotify::UnregisterNotification: dating dwStatus = 0 x 0
    GPSVC (218.D48) 21:31:24:342 Client_CompleteNotificationCall: failed with 0 x 525
    GPSVC (218.D48) 21:31:24:342 CGPNotify::OnNotificationTriggered: Completenotification failed with 1317
    GPSVC (218.1c04) 21:31:24:327 Client_CompleteNotificationCall: failed with 0 x 525
    GPSVC (218.1c04) 21:31:24:342 CGPNotify::OnNotificationTriggered: Completenotification failed with 1317
    GPSVC (218.1054) 21:31:24:342 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (218.1054) 21:31:24:342 CGPNotify::UnregisterNotification: dating dwStatus = 0 x 0
    GPSVC (218.1054) 21:31:24:342 CGPNotify::UnregisterNotification: entering with the event 0 x 2100
    GPSVC (218.1054) 21:31:24:342 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (218.1054) 21:31:24:342 CGPNotify::UnregisterNotification: dating dwStatus = 0 x 0
    GPSVC (218.1054) 21:31:24:342 CGPNotify::UnregisterNotification: entering with the event 0 x 1264
    GPSVC (218.1054) 21:31:24:342 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (218.1054) 21:31:24:342 CGPNotify::UnregisterNotification: dating dwStatus = 0 x 0

    I excluded 1 GP machine and left on the VPN for a few hours, several times. He always stopped correctly.

    However I tried with the VPN disconnection before turning off the machine, I even turned off WiFi but machine still hanging. If I tried to get GP results it takes ages before stopping the machine and he's stuck in the step "to get the user name. Gpupdate/force will never update policy (it stops at policy update...). I tired with the installation of different patches that has not solved the problem.

    I think that there is that DNS issues while the machine is on VPN which led the GP cannot be applied. When the machine tries to close it is always somehow connected. There is no problem with the connection, no GP application script when the user disconnects, not roaming profiles.

    Does anyone have the same problems? All machines are Dell with Juniper NC (VPN).

    Thank you

    Hello

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the TechNet Forums.

    TechNet forum: For Windows 7 

    Hope this information helps.

  • Anyone know if there is no CC or BC apps or other alternatives that allow a way to create an online survey consisting of 3 questions for the participants to a trade appear to fill out and submit for the purposes of data collection?  Offlin data collection

    Anyone know if there is no CC or BC apps or other alternatives that allow a way to create an online survey consisting of 3 questions for the participants to a trade appear to fill out and submit for the purposes of data collection?  Offline data collection is a must. Ability to export data to Excel would be an added bonus. Thanks for the tips.

    Hi Nathan,

    This link might help: Create PDF fillable, creative forms of PDF form. Adobe Acrobat DC

    Kind regards

    Sheena

  • Urgent - Custom authentication and authorization for the application of the ADF

    Hi friends,

    Custom implementation for authentication and authorization for the application of the ADF

    My project to use the OID , authentication and authorization, we will need to support both OAM and DB tables ( according to the preferences of the client during the installation ).

    I am new to this and do not have a clue about the same.

    Please guide me how to set up both in JDeveloper 11 g + ADF

    Thanks in advance.

    The answers you got up to present every point in the right direction. ADF security see the authentication of WLS, even for business authorization with respect to user roles defined on the WLS server. During the deployment, ADF security defined application roles are mapped to the user enterprise groups

    Application developed using Jdeveloper ADF +.

    This would use WLS for authentication

    Users of authentication - LDAP (OID) - are stored in LDAP

    Use the OID authentication provider in WLS

    Authorization - OAM or database (authorization details are stored in the DB or OAM tables)

    You can't allow users without authentication. If you need create authentication providers additional if they exist for OAM and RDBMS (there is a supplier of existing RDBMA, that you can use to identify users and to assign membership user groups). Then, you set the optional flag so that when authentication fails for additional providers you can always start the application.

    When running Admin users - create users from roles to create and assign permission privileges to the role (for pages and workflows)
    assign (or remove) the roles to/to leave users.

    ADF security uses JAAS to permissions that you can change using Enterprise Manager when running. Permissions are granted to the application roles and application roles are granted to business roles that which then has users become members of the. If you want to change the status of user account, then you don't do this the ADF or EM, but use a direct access to the provider of the user (for example, access OID, RDBMS access etc.) There is no unified administration API available that would allow you to do this via WLS (which uses OPSS).

    If your question is in the context of the ADF, the documentation, with that you should follow is OPSS and WLS authentication providers.

    Frank

  • trying to cancel my plan, how do hard, would facilitate respect for the customer, it is a parody

    trying to cancel my plan, how do hard, would facilitate respect for the customer, it is a parody

    Hello

    Please contact support by calling/chat for cancellation requests and billing queries:

    Contact the customer service

    * Be sure to stay connected with your Adobe ID before accessing the link above *.

    You can also check the help below document:

    https://helpx.Adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html

    Please go through the Adobe - General conditions of subscription as well.

    Kind regards

    Sheena

  • What is the best way to create a form on my page layout of Muse for an event where the person is able to register and pay for the event using Business Catalyst?

    I need to create a Web site for a conference and I need to be able to have participants at the same time register you for the event on the website, but also paid for the event.  What is the best way to do it?  I am brand new to Business Catalyst and of course the customer must site upward and yesterday running.  So, if I could find quick assistance to implement it quickly, I would be very happy!

    Thank you!

    Hello

    Please take a look at these tutorials,

    Customizations made for the events module

    Let the site visitors sign up for an event

    Once configured, you can add modules in Muse and publish business catalyst. As shown in this article

    Add features of Business Catalyst to your Muse sites

    Easily add Business Catalyst modules to your Adobe Muse Web sites.

    Let me know if you have any question.

  • In the middle of my teens adding devices, and registration for the apple's music, security issues have been changed and now nobody seems to remember the answers.  How can you bypass those to change your settings?

    In the middle of my teens adding devices, and registration for the apple's music, security issues have been changed and now nobody seems to remember the answers.  How can you bypass those to change your settings?

    You must ask security team account Apple to reset your security questions. To contact them, click here and choose a method; If this page does not list one for your country or if you are unable to call, complete and submit this form.


    (140233)

  • I bought adobe illustrator and waiting for the e-mail so I can download it but it does not appear

    I bought adobe illustrator and waiting for the e-mail so I can download it but it does not appear

    Hello

    I don't see no active membership/registration under the Adobe Id on the forums.

    Please confirm if there is any other Adobe Id in which you may have subscribed.

    Kind regards

    Sheena

  • I had a problem with my Mac, and I have to reinstall Adobe Photoshop CS4, I have on a CD. I put the serial number I have on the cover, it takes it. another window opens and ask for the serial number. again, I put the same number and he said to me: not val

    I had a problem with my Mac, and I have to reinstall Adobe Photoshop CS4, I have on a CD. I put the serial number I have on the cover, it takes it. another window opens and ask for the serial number. again, I put the same number and it says: invalid.

    where will be the second serial number?

    Help me please.

    Thanks, Abe

    Hi,

    Please see error "serial number is not valid for this product". Creative Suite and serial number incorrect error

    Kind regards

    Sheena

  • Adobe CC will not update my Photoshop and Lightroom for the new 2015 CC, it fails at 43% every time and gives an error code of 50

    Adobe CC will not update my Photoshop and Lightroom for the new 2015 CC, it fails at 43% every time and gives an error code 50.

    Hi Gregory,

    Please refer to the threads below to resolve the error code 50:

    Which is updated CC 50 error Code?

    Setup error - code error 50 creative cloud.

    You can also try to download the app from the link below:

    Direct download links of Adobe CC 2015: 2015 creative cloud release | ProDesignTools

    * Be sure to read the important Instructions before downloading *.

    Kind regards

    Sheena

Maybe you are looking for

  • How do I undisable my iphone

    I entered my password several times and its disabled what do I do

  • connect to download the update

    We were invited several times to update our software Firefox (19.02). When you click Update, a screen informs you that the download is in progress, but other than rotating striped blue and white, nothing happens. It can run for several minutes, and n

  • What do you do with old products you have left when they expire?

    What happens to the packages you have left after the expiration date?

  • 10% battery standby time of cell?

    Hello. I have a ThinkPad slate tablet (model 1838 - 2DG with an Ericsson F5521gw inside, no SIM card installed). Battery only lasts six hours on Wi - Fi (without CPU intensive tasks running on it, middle of the display brightness). There is not much

  • Unterschied zwischen Vlan VTP Mode Client und Server

    Hello colleagues, habe viel im Internet search must aber keine richtig verstandliche Anleitung found. Kann mir einer verständlich imagine was the server mode exactly der Unterschied rumwuseln VTP Client und ist, danke im vorraus. Bitte nach keinen li