Change width BasicEditField

How can I change the width of the BasicEditField, which, by default, puts on the screen.

Thank you

Arturo

First of all, the getPreferredWidth will not help with BasicEditField. ButtonField, for example, uses during its layout(); Don't bother editing fields. getPreferredWidth/getPreferredHeight are mostly calls with permission and are generally ignored during the presentation of the screen.

Second, your attempt with setExtent is a valid concept - you simply forgot to call super.layout in your replacement of page layout.  In fact, the simplest approach would be to calculate your required width (let's call it myWidth) and use it like this:

protected void layout(int width, int height) {
  // calculate myWidth here or in constructor / setLabel / etc.
  // then invoke the following:
  super.layout(Math.min(width, myWidth), height);
}

If you're wondering how to calculate the necessary width, take a look at Font.getAdvance () methods. Add advance your label in advance of the wider character (say, 'W') multiplied by the desired number of characters.

If you are never going to use setLabel on your areas of custom edition, do not forget to replace setLabel. Something like this should be enough:

public void setLabel(String newLabel) {
  super.setLabel(newLabel);
  // calculate your new myWidth here unless you do it
  // inside your layout() override
  // then force re-layout using this:
  updateLayout();
}

Tags: BlackBerry Developers

Similar Questions

  • Set the width BasicEditField - noob

    I'm trying to creat a textbox, I use a BasicEditField where I am creating a border, but I can't seem to set the width that it currently occupies the width of the entire screen.

    found answer

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800345/...

  • Scale complex illustrations/change width tool

    Why my vector illustration is get distorted when I scale down - that is to say card holders size about 40-50%? Seems that when I change the paths by using the width tool, they are all out of whack when scaled down. ????

    wdmnmets,

    You have checked Strokes & effects of scale (palette/Panel transformation or general preferences)? If Yes, check.

    You checked snap to grid of pixels (CS5, Panel processing)? If so, uncheck the box.

  • width scoreboard

    Is it possible to automatically size the width of a string array based on the maximum length of the strings in all items?

    Hi id,.

    for me, the table string indicator changes width when I set the width of the string element!

    Show your VI to spot the problem...

  • Label BasicEditField

    How can I change the BasicEditField so that the label displays on a separate above the value line?

    By default displays the right of the label next to the value.

    Thank you

    It is not possible. Only the quick fix is add LabelField for purpose of label and then BasicEditField. Are not all labels in BasicEditField. Add these two domains to the vertical field manager.

    It will be useful.

  • Width of the stroke distorts shape of path

    When I try to adjust the width of the line on a closed shape by increments of a point at a time it distorts the shape a little more each time that I add more width. But if I use the drop down menu, the storke change width without changing the shape of the closed path. What the hell is happening?

    Whats here the shape resembles barred 1pt.

    Screen Shot 2015-01-23 at 2.46.48 PM.png

    And that's what it looks like after that I have set the race with 386pt by clicking and now the up arrow to adjust a point at a time:

    Screen Shot 2015-01-23 at 2.55.21 PM.png

    I would almost never use such a thick line, but I wanted to increase the amount of the original shape is lost.

    Any ideas?

    You have a problem with snap to grid of pixels:

    Illustrator: Problems with snap to grid of pixels

  • Resize canvas as a percentage of the width of a layer?

    Hello

    Is it possible to resize a canvas so that it is exactly 120% the area of selection? Or maybe 120% of the width of a layer?

    We have a lot of .psd files that have significant margins. I need to reduce them so that they have 10% of the height of the content as the margins on all sides, but each document is different width and height. So I need to select the content of the document, increase this area selected by 20% vertical (somehow) and then change width/height the title of the document so that only 10% of margin all around.

    Thank you

    Here is a clean script.  This script works only with version newer than CS2 Photoshop so that it uses the app.activeDocument.suspendHistory () method. to suspend the States in the history of Photoshop.  This method has been added to Photoshop scripts after CS2.  The script can be run with CS2 by simply using main();  It take time to learn how Photoshop works and how changes over time as updates are always added.  Know how Photoshop will allow you to record best actions and writing script that work well.

    if (documents.length < 1) alert("No Open Document!");
    else app.activeDocument.suspendHistory('Add Border', 'main()');
    
    function main(){
      var startRulerUnits = app.preferences.rulerUnits;
      app.preferences.rulerUnits = Units.PIXELS;
      var borderSize = (Math.max(app.activeDocument.height,app.activeDocument.width)/100) * 10;
      app.activeDocument.resizeCanvas((app.activeDocument.width + (borderSize*2)), (app.activeDocument.height + (borderSize*2)), AnchorPosition.MIDDLECENTER);
      app.preferences.rulerUnits = startRulerUnits;
    }
    

    Photoshop is a complex application and because of it how this script will work depends on layers in the active document and the current background color in Photoshop.   Photoshop supports a special layer called the background layer.  A document is not required to have a background layer.   Only the background layer in the layer stack can be a the "Background" layer for any of the layers can be underneath.  'Background' of Photoshop layer supports transparency its still partially locked for all pixels in a background opacity is 100% and the layer is the same size as the canvas size documents.  If you change a document the size of the canvas and the document contains a background layer that layer background size will also change.  The background can be cropped and enlarged.  When developed the added pixels will be the current background color in Photoshop.  So the added border can be any color or empty pixels. For documents are not required to have a background layer.  Other layer types support transparency as well as their size will not be changed. Basemap layers not can be any size and have a report l / h and have an alignment onto canvas documents. Him are anchored the outlines and the acts of canvas size as a clipping to the composite image mask.   When the new canvas is added to that alignment of the canvas can change this controlled anchor position is used for the canvas resize operation.  A border that is added to a document can not be empty or a solid color for the old canvas size might have pixels of clipping in some layers that are now is more cut and show in the composite.

  • Set the width of the table for TableView

    I create a new TableView with a few columns and I am trying to set the width of the entire table. I searched the API, but it only gives me setMaxWidth. I tried but it didn't work. Can anyone suggest me how to set the width of the tables.

    I do this:

    private TableView < XYZ > table = new TableView < XYZ > ();

    table.setMaxWidth (600);
    table.setLayoutX (15);
    table. Resize (40, 40);

    But nothing has really changed width of the entire table.

    Thank you.

    Column resizing policy is what you are looking for.

  • How can I find the width of my button at run time?

    In my application, button labels change at run time and they are changing width, I usually know what the new width of the button when his label was changed, how can I get it?

    This method works. It seems that until creationComplete width is not accessible.

    
    
      
        
      
      
      
    
    
  • Variable width Flash

    How can I make my Flash application change width as the width of browser changes? I see this on a lot of other Web sites, but it's not immediately clear how to make this happen. I want to show a large part of our visualization, if anyone has a larger browser window or is resized accordingly.

    I think you are looking for the stadium and Stage.stageWidth/Stage.stageHeight resize event. For example, this would create a background MovieClip to fill the entire screen:

    stage.addEventListener (Event.RESIZE, stageResize);
    function stageResize(event:Event):void {}
    background_mc. Width = stage.stageWidth;
    background_mc. Height = stage.stageHeight;
    }

    You should also look into the Stage.align property and the Stage.scaleMode property. Typically these are set to the defaults at the top left and noScale, respectively, when simulating the application such as resizing behavior:

    internship. Align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;

  • WRT 1900ac NAT flow performance.

    Hello all, when I connect my PC directly to a cable modem, I get a download speed of 180 Mbps.

    However, if I connect the 1900ac (internet port) to the modem, then connect my PC to the routher (ethernet port), then I get only 40 MB/s download speed.

    I was hoping someone might be able to provide information that will help me understand what is happening. I did some research and if I had to guess I would say that the 1900ac can't handle 180 Mbps from the perspective of a NAT flow.

    I just checked and this router is equipped with 14 on devices: 9 cables, wireless 5.

    I checked the report of internet usage and it shows that only a few devices are actively moving data thorugh the router:

    Xbox: 1.61 Mbps

    My Pc: 0.04 Mbps

    Smart TV: 0.01 Mbps

    Any help would be greatly appreciated.

    Best regards, Louis.

    Optimum settings:

    1. Enable the prioritization of media with the value downstream bandwidth wired www.speedtest.net * 1024
    2. Activate the Support WMM (default)
    3. Mixture of 5 GHz wireless protocol
    4. Auto width for the 5 GHz wireless channel
    5. 2.4 wireless protocol "b\g\n only".
    6. Auto width for 2.4 Ghz wireless channel
    7. The 5 GHz and 2.4 Ghz Wireless Security "WPA2 Personal" unmixed

    The trick is that MP must be properly configured on and off once. After that, you can decide if MP is necessary. This initializes correctly the QOS system.

    If you want an additional 3db of the signal on the 2.4 GHz change width 2,4 Ghz to 20 Mhz.

  • 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).

  • Tap the calligraphy brush Illustrator, questions?

    Hello!

    I am quite new to adobe illustrator. I currently use a tablet with a pressure sensitive pen. But I want to know if it is possible to change the width of my brush profile so that I use to draw.
    When I use the stylus to draw, the way I draw is set to be 'touch calligraphy brush' with the 'Basic' default width profile.
    What I want to do is to be able to use the brush sensitive pressure with a different width than 'Basic' profile, while I draw.
    I tried to use a calligraphy brush to get a trait that was consistent with my pressure and was not 'touch calligraphy', but from what I understand I can't change width of calligraphic profile.

    If in the end, the question is this:

    How can I draw on illustrator using pen and make sure the trait of my road has a different width from that is the default profile?

    You cannot use a width with a calligraphy brush profile at all.

    If you want to apply a width profile, drawing with the pencil tool. If you want to determine the width by pressure profiles, you must use the dynamic Sketch plugin.

  • How to treat an alignment problem?

    I really appreciate how much help I received from you experts out there to Muse - support...

    My client needs a web presence for its last restaurant so I realized a fixed width 960 px fast just to get him started.

    My overall plan is eventually convert all its sites to be reactive Muse. (Almost completed)

    My current problem is in areas and bodies moving fixed width site.  I checked the master page but cannot establish why it appears as a narrow strip?

    I attach the four pictures showing the problem. I tried to pinning, unpinning, changing width of full browser to zero and all the variations, but I just can't solve it.

    I can send a copy of the file if necessary Muse.  Top images below: (a) master page set to 'none' (): b) mode, (c) creation: Preview the view. (d): display of the browser (chrome).Master page (set to 960px).PNG

    alignment design view.PNGalignment in preview.PNGalign in browser.PNG

    Hi Bill,

    I just received your file via [email protected]. Your site has two breakpoints on A-master and drinks (960 and 985) page. What you see is the expected behavior. Your screenshots show:

    (a) breakpoint 960

    breakpoint b) 960

    (c) breakpoint 985 (because the window is bigger than 960 px)

    (d) breakpoint 985 (because the window is bigger than 960 px)

    Here's the breakpoint 985 in mode Design of Muse that corresponds to what you see in the preview.

    Maybe you have unintentionally added the breakpoint to 985? Or if it was intentional, then you can simply clean available breakpoint 985 on the page of drinks. I hope this helps!

    Best,

    Anna

  • Why CC 15 is so difficult to use now and other pet peeves...

    I'm a lot of difficulties drawing the way I used to in Illustrator. When I choose a form, like an eclipse (mostly unfilled a little), there are so many handles and bounding boxes and even when zoomed to 12750% I can hardly move the shape because all these handles are in the way. And zoom in and out constantly just so I can grab and move a form becomes very irritating. Is there a hot key to disable all bounding handles so I can simply move a form?

    And why Adobe continue to add features, while the rest of the application not be improved?  I can write a novel about the things that I would have liked to see improved, as...

    • Navigator sees art outside the boards of art.
    • Lock turn all the functionality.
    • capacity of adjustment of color etc. inside the Illustrator images.
    • image auto pixelation.
    • Divide the shape by number points.
    • more random options (generative art).
    • Possibility to tilt the photos and add gradients.
    • Triangle shape tool for crying out loud.
    • Double click on the label next to the settings button will return by default... like kicking back to 1 point.  Margins of return to 0.
    • Based decimal of further adjustments to the race weight.
    • Hyphenation of text was not the default.
    • Gradually change width of line with the arrow keys. (no need to select the palette of stoke.
    • An edit mode of boards of Art more accessible, it's just but the button on the bar!
    • The type interval jump like you can in flash, in steps.
    • Rotate the perspective grid.  That is, or a better way to align the grid of perspective to a photo, as in photoshop.
    • Forms of Meta, wind, gravity, etc., tools of physics.
    • Needs better tools of computer graphics.
    • perspective and puppet wrap in illustrator.
    • lock centers registration, so I can build characters and animate.
    • button for setting the elements outside of the art Commission.
    • Distort free to have a Preview checkbox.
    • Transformation of each to get a lock for the horiz. Green sliders. %.
    • tool of balls, similar to indesign and muse.

    • Recording of points that put... stay several check points.

    • Panel Recolor responds to / agree to cancel.

    • More advanced options, with control of the blend color.
    • Means more advanced to divide the lines evenly or coefficently.
    • Command-Shift-paste will paste the text without style.
    • Copy and paste in place outside boards of art.
    • Shit key order for export.
    • return the type of animation book tools.
    • being able to convert the refills sold on multiple selections, not one at a time.
    • possibility to change the brush with the help of the Middle sizes, click and drag.
    • best ways to cut and segment shape and shots together.
    • line tool tip that can bend on dragging after the two main points are applied.
    • A much better way to organize brushes and group them for projects as you can in Manga studio.
    • ability to export tables of art in the form of .eps .ai files!
    • possibility to export a test map that shows all the hex colors used in the document.
    • align on the page for the browser panel feature.

    • incorporate images of the save dialogue.

    • A tool like Replicator of Apple's Motion.

    • Library used to be simple and awesome, but now too complex and boring.

    • Preferences to keep the same color selection line.

    • a small button on the manipulator of text box which allows you to remove stray returns the space below.

    • and what happened to feature redefine?... He only desaturates etc on a color not all, even when locked.

    You can ignore the wish list of features.  What I need is a way to disable all handles etc. dressing a form when it is select. I thought that would hide corner Widget, but it is something else. Nevermind, I figured it. You must hold down the command key down to see the shape without all the handle etc.

Maybe you are looking for

  • How to disable the blue glow of the App tabs feature?

    I have Gmail and Facebook pinned like App Tabs, but I'm trying to limit the number of times I check them in order to increase the productivity of my work. How can I disable the "blue glow" function so that I'm not constantly distracted all working?

  • I repeatedly get update error...

    I am running Windows 7 on a HP Pavilion laptop... I can't update my software driver (HP advisor resets without having to install), my mozilla firefox (seems to think there are other versions of the open program) and I can not install the next update

  • VIXIA hf r400

    Greetings, My wife has a hf r400.  I would like to get the clip turn off the camcorder and on my computer (win xp sp3).  I thought to use the wifi capability, but I use mac address filtering and do not know where to find the mac address of the camcor

  • work load Oracle data

    HelloI load the data from one table to another.table. as table source is having huge data we want to load past 3 months 5 days of target.every data source data, we expect to move from source to the target. I need a procedure which calls oracle work o

  • Project will not export, I keep getting errors in software rendering

    I just finished a project and I made her completely, including all nested sequences, but it will not be exported. I keep getting "Errors of software rendering" any format that I use. I used the H.264 format that did not work, and I also tried AVI unc