How to set the height and width of the field control?

Hello

I created a ButtonField I need to set the height and the width of the field fixed. When the offset application from one device to another device about the size of the buttons vary and also content in the field of the key also retractable. I want to put fixed every time I moved my request to the other device, the display of the button must be set. How to reach this give me some code examples. I'm new to blackberry.

ButtonField subclass and override the method getPreferredWidth().

class FixedWidthButtonField extends ButtonField{
    private int width;

    FixedWidthButtonField( String label, int Width){
        super( label);
        width = Width;
    }

    public int getPreferredWidth(){
        return width;
    }
}

(code by Jonathan Fisher)

Tags: BlackBerry Developers

Similar Questions

  • How to set the field "default" of a quick dashboard to yesterday?

    Hello world

    I have a dashboard the guest on a date (full name Date.Date and type Date).
    I also have a simple report with two columns: Date.Date and a measure (whatever the name).

    I've managed to filter the day before the current date in the report by adding an advanced SQL filter:
    Date.Date = Cast (TimestampAdd(SQL_TSI_DAY,-1,@{system.currentTime}) as Date)

    Now, I would like to invite him to select the day before the current date by default.
    The filter on Date.Date would be "invited" or more.

    How to set the field "Default" from the command prompt?

    Thanks in advance

    Hello

    go to the command prompt...
    Select SQL results of as default: drop-down list.
    here... you have to write your SQL logic...
    who uses by default the previous date
    something like that...

    * Select case when 1 = 0 then anydate column of another timestampadd (sql_tsi_day-1, CURRENT_DATE) of the end SubjectArea name*.

    write like this... and report back...

    Thank you & best regards
    Kishore Guggilla

  • How to set the field date as required field on UI - urgent

    Hello

    I got how set the date as field demands presented on the page.

    Below is the code I used, but giving it as class cast exception.


    MO OAMessageTextInputBean = (OAMessageTextInputBean).webBean.findChildRecursive ("dateFiled");
    mb.setRequired ("yes");

    Please help on this. for the other beans messagechoice it works fine. but only for the data type DATE gives classcast exception

    Try this

    MO OAMessageDateFieldBean = (OAMessageDateFieldBean) webBean.findChildRecursive ("dateFiled");
    mb.setRequired ("yes");

    Thank you
    Shree

  • Documaker: How to set the field of the 2D matrix

    Hello

    I created a matrix 2D field, but is not a 2D matrix...
    You may notice that it is false?

    Policy ID: Data Matrix for Documaker (dm___.ttf)
    Type: Bar Code
    Length: 32
    Format: Data matrix
    Symbol size: 18 * 18
    Scale: 1
    Rule: XDD
    Source name: xxxxxxx

    Example of XML is as follows.

    < code >
    < xxxxxx > 12345678901234567890123456789012 < / xxxxxxx >
    < / bar code >

    In the test, this field is output as follows...

    AIHPBMGKHJENFPFKDK
    AHFMCKOBPOEONLALIK
    ALJLFFJMANLMMJAEBK
    AGFCPMJOBELOEIKFCK
    DDLDDDDDLLLLDLDDDL

    I can output the barcode with the "1:1:2:2 Code 39".
    Please help me.

    Thank you

    If you are talking about the screen, you also have to install TTF fonts to let Windows know to to use. The location in the fonts directory, would only affect that print them in PDF format when you download fonts.

    Find the. TTF file on disk, right-click on it and choose Install. If you do not see the offer to install in your version of Windows, you may need to go to the control panel and choose fonts. Check the list to see if Data Matrix for Documaker has been installed. If you don't see it in the list, then check the offerred help by Windows, how to install a font on your system.

  • How to set the field as password type entry

    Hello

    In display determination Oracle Web interview, I want to Setup text entry as type of password is entered text should be displayed in the form of points/stars. Please tell me how can this be achieved?

    Thank you
    Sri

    Create a custom control that have a tag html input type is password.

  • How to set the size (height and width) 100% swf

    Hi all

    Here, I want to put my SWF height and width to 100%.

    If I want to increase my height by hanging out on my corner SWF then automatically the width should change.

    If the two should be 100% in all cases. How to get there.

    In the browser? Flash can not set the size of itself - its size is defined in the HTML code. You must use JavaScript to set the Flash object width and height on window resize event.

  • How to set the height and width of dvt:piechart?

    Hello

    After upgrading to 10.1.3 jdev the new PIE is < dvt:pieChart >.

    I need to set the width and height or if not possible set the height and width of the container and let the repeating table using the container.

    Thanks in advance

    Emile BITAR

    Change this by using the attribute "inlineStyle". Set inlineStyle = "width: 200px;" height: 300px; »

  • How to set the height width for an Image field in a web App?

    I have a webApp to save the image of user with description, title. But when I display all items pictures are great, I want to know how to set the height and width for images?

    Hello

    To do this properly, you need to resize the image. Prefably before you put it in British Colombia. While you can to scale the image in CSS, you don't want to do. Why? Because the images are still very large and probably not optimized properly for the web.

    This means that the page with these images will take a long time to load for people, and people will not be happy on the display of your site.

    You must use a software such as photoshop, if you or iphoto on a mac for example for editing, crop and size of the images before uploading. If you do everything you can use free web based tools such as this one:
    http://Pixlr.com/editor/

    You can also do in British Colombia itself in the file manager. If you click on the image you can see options to resize. The downside to this is's done it by pure mathematics. He doesn't know what is in the picture and the results can make the image etc. shrivelled.

  • How to change the runtime of height and width of the front panel

    How to change the front height and width during execution. Basically, I want to decide height or width according to some parameters that I'm in the moment of execution.

    Ed johnsold was first

  • How can I control the monitor photo height and width with XP?

    Having 24 ' ASUS monitor.  There are no controls for the height and width of the image.  Operating system is Windows XP.  How can I change picture height and width?

    Hello

    You can try to change the resolution of the monitor screen and check if that helps.

    To change your screen resolution

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/display_change_screen_resolution.mspx?mfr=true

    If you want to change the position and other options that are provided as an option on the screen of the monitor you can see the manual provided by the manufacturer or contact the manufacturer for more information about the options provided in the monitor to change the position of the screen.

  • How keep the anchor in the Middle during the change of height and width for extendscript model?

    When I try to change my composition height and width using extendScript, it works but with anchor point at the upper left corner. How to maintain it in the Center?

    My code:

    COMP. Width = 4000;

    COMP. Height = 4000;

    result:

    result.jpg

    expected:

    expected.jpg

    Thank you

    OK, here is therefore the function for resizing of the model code. I tested several times with anchor points are offset on layers and centered, even with layers that are not yet within the limits of the Model Viewer. I'm sure there will be some users who eventually find something that will break it, but for now it seems to work perfectly.

    app.beginUndoGroup("CompResize");
      var myComp = app.project.activeItem;
      resizeComp(myComp, 500, 500);
    app.endUndoGroup();
    /* TESTING ABOVE */
    
    function resizeComp(compObj, newWidth, newHeight){
      if(typeof newWidth == "number" && typeof newHeight == "number"){
      if(compObj instanceof CompItem){
      var locData, allLayers, allLayersLen, curLayer, clAP, clPos, xShift, yShift, oldCW, oldCH, clH, clW, xOff, yOff;
      pData = new Array();
      cWidth = newWidth;
      cHeight = newHeight;
      allLayers = compObj.layers;
      allLayersLen = allLayers.length;
      oldCW = compObj.width;
      oldCH = compObj.height;
      compObj.width = cWidth;
      compObj.height = cHeight;
      for(var i=1; i<=allLayersLen; i++){
      curLayer = allLayers[i];
      clW = curLayer.width;
      clH = curLayer.height;
      clPos = curLayer.transform.position.value;
      clAP = curLayer.transform.anchorPoint.value;
      xShift = (oldCW - cWidth)/2;
      yShift = (oldCH - cHeight)/2;
      curLayer.transform.position.setValue([clPos[0] - xShift, clPos[1] - yShift]);
      }
      }else{
      alert("Invalid argument(1):\nComp Object required.");
      }
      }else{
      alert("Invalid argument(2/3):\nInteger required for Width and Height.");
      }
    }
    
  • How to display the height and width of an image that I adjust them

    How display the height and width in pixels of an image that I adjust them until I actually have to crop the image?

    You can make the Panel visible Info and see dimensions in various operations.

    It is often useful to define the rules to read in Pixels (in the section units and rules of preferences).

    -Christmas

  • Set the height and width of pop-up window.

    Hi friends,

    I have a button Add a new element on the page no 1.i have 3 not on page no 2 as ITEM_CODE, nom_element AND STATUS.
    I want when I click on add new item on the page no 1, and then open the page not 2 like a window popup with the height and width 500 700 and after press submit value insert into the table and pop-up window must be close.
    I take model Popup

    How can I adjust height n weidth of page 2 of the popup.


    Thank you

    Hello

    You must be a mistake. Process of Close popup works very well in Apex 3.2.

    Remove all branches of page 20 and check that you have not any condition the process Close popup

    Kind regards
    Jari

  • show the height and width of the screen

    Is it possible to display the height and width of the screen in a labelfield?

    Yes. To do this, ask yourself two questions:

    (1) is it possible to display a string that I want in a LabelField? (The answer is Yes)

    (2) is it possible to set the height and width of the screen in a string? (The answer is Yes)

    (3) is it possible to find the height and width of the screen? (The answer is Yes)

    Now, just try to find how to do it ask these three questions. #1 is right there in the documentation for class, LabelField . #2 is trivial if all goes well. # 3, take a look in the view class.

  • How to set the height of cfinput text

    How to set the height of a "text box" in ColdFusion? When I look at this in dreamweaver, the box is multiline, but when it appears in the browser, is only a single line.

    < cfinput type = "text" name = "Comments" size = "40" height = "500" width = "150" >

    Hmmm... just changed to

    and it works... didn't even worry Pass Through.

  • Get the height and width of an image

    I have therefore some images in my program that I'm loading. These images are much longer than the size of the screen. So I put in a ScrollView. My question is how can I get the height and width of an image. The image.width and image.height doesn't return the correct values.

    //add the image
    private function addImage():Container {
        var sp1:Container = new Container();
        sp1.sizeUnit = SizeUnit.PIXELS;
        sp1.debugColor = 0xFFFFFF;
        sp1.margins = Vector.([1,0,0,0]);
        sp1.align =ContainerAlign.NEAR;
        //sp1.setSize(650, 800);
    
        var myPattern:RegExp = / /g;
        var fileName:String = "./com/swiz/img1.png";
        var icon:Image = new Image();
        icon.setImage(File.applicationDirectory.resolvePath(fileName).url);
        //icon.setPosition(0,0);
        //icon.setSize(320,800);
        sp1.addChild(icon);
        sp1.setSize(650, icon.height);
    
        return sp1;
    }
    

    and my code scrollview is

    //add to the scrollView
    var scroller:ScrollPane = new ScrollPane();
    scroller.width = 650;
    scroller.height = 505;
    scroller.y = 0;
    scroller.addScrollContent(addImage());
    addChild(scroller);
    

    Thanks in advance!

    Hey shethab,

    in order to retrieve the height and width of your image, you must use use the an event listener on your image and check for the Event.COMPLETE event. What is happening because the image you upload is not built, it takes time to load into your application using the setImage() method. and when you check the width height after the setImage method, the image was not loaded and has no height and width to this second. If you use the event listener, you can retrieve the height and width as it was finally loaded.

    Try the following code:

    import flash.events.Event;
    
    //add the image
    private function addImage():Container {
        var sp1:Container = new Container();
        sp1.sizeUnit = SizeUnit.PIXELS;
        sp1.debugColor = 0xFFFFFF;
        sp1.margins = Vector.([1,0,0,0]);
        sp1.align =ContainerAlign.NEAR;
        //sp1.setSize(650, 800);
    
        var myPattern:RegExp = / /g;
        var fileName:String = "./com/swiz/img1.png";
        var icon:Image = new Image();
        icon.setImage(File.applicationDirectory.resolvePath(fileName).url);
        icon.addEventListener(Event.COMPLETE, onImageLoaded);
        //icon.setPosition(0,0);
        //icon.setSize(320,800);
        sp1.addChild(icon);
        sp1.setSize(650, icon.height);
    
        return sp1;
    }
    
    private function onImageLoaded(e:Event):void
    {
        trace("image height: " + e.target.height + " image width: " + e.target.width);
    }
    

    hope that somethings brightened. Good luck!

Maybe you are looking for