Label, change the field and the button on the problem of a line

Hi all

I was pulling my hair out on this and could really do with some tips. I'm putting a label, a text field and a button of bitmapfield on the same line, but for the life of me I can't work that way round. If I put the front button to the text box field, it works.

        // TEST 3 CONTROLS ON A ROW

        final Bitmap imgCalc = Bitmap.getBitmapResource("bgCalc.png");

        LabelField lb = new LabelField("0.00");
        EditField ef = new EditField();
        BitmapField  bf = new BitmapField(imgCalc, BitmapField.FOCUSABLE){
            protected void paint(Graphics g) {
                // Draw text on button image
                super.paint(g);
                g.setColor(Color.WHITE);
                int x = (40 - Font.getDefault().getAdvance("Go"))/2;
                int y = (imgCalc.getHeight() - Font.getDefault().getHeight())/2;
                g.drawText("Go", x, y);
            }

            public int getPreferredWidth(){
                return 40;
            }
        };

        HorizontalFieldManager row0 = new HorizontalFieldManager();

        row0.add(lb);
        row0.add(ef);
        row0.add(bf);

Excuse the code, but it's test code to make it work. As mentioned above, if I add that Label, Edit, Bitmap controls it only shows the label field and edit. If I swap the text field and the field bitmap around so that the text field is the last one, it works.

What I am doing wrong?

Thanks for looking

Paul

EditField always takes all of the width available to it.

You must override its layout (width, height) and pass below the width values to leave space for the BitmapField. Something like

protected void layout(int width, int height)
    {
        super.layout(width * 60 / 100, height);
        // sets width of this field to 60% of the total available width
    }

would do.

Tags: BlackBerry Developers

Similar Questions

  • Align the text field and a button.

    Hi all

    I use Oracle APEX 5.0.1.

    I tried to create a search page that contain a text field and a button.

    But I can't align the text field and button, so they can have the same top position.

    Could someone please help me solve this problem?

    APEX-ARE-Search.jpg

    Thank you and best regards,

    Troy.

    Hello.

    Have you tried to add a css attribute to the button? like: style = "top: 4px;

    Concerning

  • How many fields have horizontally with a label at the beginning of each line

    jdev12c

    I'm trying to implement search criteria screen myself.

    When I select a lookup field in a drop-down list, this field is added to the screen. It has a label, a text field and a selectOneChoice of the operator (with value of begin, end, especially, between the two, etc.).

    When to choose another field of research in the list, a new line is added to the screen.

    I want all tags must be aligned to the right, text boxes are aligned and the selectOneChoice is just after the text box.

    I tried to generate PanelFormLayout for each line, with lines of property = 1 and argument maxcolumns = 3.

    The problem I have with this approach is: labels for each line don't align. Also, I have data recovery problem within each PanelFormLayout. The mother of PanelFormLayouts, he sees several PanelFormLayout. But the returned value of the first PanelFormLayout.

    Please advice what kind of layout that I use. Thank you.

    You can do this using af: panelLabelAndMessage,.

    just surround all your filed with the horizontal band layout and simple true set for all fields, then surround group layout with an element of label and message board

    Source XMl-

    
    
                       
    
                            
    
                            
    
                           
    
                                                        
    
                      
    
                    
    

    It will look like this - https://drive.google.com/file/d/0B0Usl2n1Wz8vUEtPdnVtUC1mcjA/edit?usp=sharing

    See - http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_panelLabelAndMessage.html

    -Ashish

  • How to resolve the IP address automatically changing the problem?

    My Oracle database 10g (10.2.0) is on the Windows XP platform and the IP address of the system often changes automatically. This leads to problems with my Oracle database. How to deal with this problem? How to stop the IP change the problem?

    change your windows networking to dhcp to a static ip address. Just google it or follow [this link | http://www.hotcomm.com/FAQ/FAQ_staticIPXP.asp]

  • Text find and change the problem CS3 and CS4 scripts

    I use the script below to find text and turn them into others.

    There is one thing the script can't do it for me.

    Example:


    (g) management

    (1) that no law that is adopted in the Cayman Islands, a tax to collect profits, income, gains or satisfaction does apply to the company or its activities; and

    (2) that the above-mentioned tax or any tax in the form of rights of succession or inheritance tax is payable in respect of shares, debentures or other obligations of the company.

    Example: (end)

    I had a lot of subjects or points in the passage. And I want to change the space between '(g)' and 'Management' in a tab character. So I revised the plain text file 1texte.

    PS: 1text.txt is filled with what to change.

    text {findWhat: "^ p(^?)" ' "} {changeTo: "^ p(^?)"} ^ t "} {includeMasterPages:true, includeHiddenLayers:true, includeFootnotes:true, wholeWord:false} search all space-dash-space and replace it with an en dash."

    The result is:

    (^?) ^ tManagement

    (^?) ^ tthat any law that is passed in the Cayman Islands, imposing a tax on profits, income, not capital gains or satisfaction applies to the company or its activities. and

    (^?) ^ tthat the above-mentioned tax or any tax in the form of rights of succession or inheritance tax is payable in respect of shares, debentures or other obligations of the company.

    PS: ^ t is a tab character.

    result (END)

    This is not what I want.

    It should be"(g) ^ tManagement'.

    PS: ^ t is a tab character.

    Please someboady help me out revised the script below to change the text in what I want. Thank you very much.

    Here's the script.

    FindChangeByList.jsx
    An InDesign CS4 JavaScript
    /*
    @@BUILDINFO @ "FindChangeByList.jsx" 2.0.0.0 January 10, 2008
    */
    Loads a series of strings delimited by tab characters from a text file, and then executes a series
    Find/replace operations based on the lines read from the file.
    //
    The data file is delimited by tabs, returns to cart that separates records.
    //
    The format of each record in the file is:
    findType < tab > findProperties < tab > changeProperties < tab > findChangeOptions < tab > description
    //
    Where:
    < tab > is a tab character
    findType is 'text', 'grep' or 'glyph' (this sets the find/replace operation type to use).
    findProperties is a recording of properties (text) search preferences.
    changeProperties is a recording of properties (text) of the change preferences.
    findChangeOptions is a recording of properties (text) of the options find/replace.
    Description is a description of the search/replace operation
    //
    Very simple example:
    text {findWhat: "-"} {changeTo: "^ _"} {includeMasterPages:true, includeHiddenLayers:true, includeFootnotes:true, wholeWord:false} find all double hyphens and replace by an em dash.
    //
    More complex example:
    text {findWhat: ' ^ 9 ^ 9.} {' ^ 9 ^ 9 '} {appliedCharacterStyle: 'price'} {include notes: true, include master pages: true include hidden layers: true, any word: false} find $ 10.00 to $ 99.99 and apply the character style 'price '.
    //
    All metacharacters search InDesign are allowed in the properties 'findWhat' and 'changeTo"findTextPreferences and changeTextPreferences.
    //
    If you enter the backslashes in the object findGrepPreferences findWhat property, they must be "escaped".
    as shown in the example below:
    //
    {"findWhat: '"\\s+ "}
    //
    To learn more about InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    or visit the InDesign Scripting user to http://www.adobeforums.com users forum
    //
    main();
    main() {} function
    var myObject;
    Ensure that the interaction of the user (dialog boxes display, etc.) is turned on.
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    If (app.documents.length > 0) {}
    If (app.selection.length > 0) {}
    {Switch(App.Selection[0].constructor.) Name)}
    case 'PointInsertion ':
    'character ': case
    case "word":
    case 'TextStyleRange ':
    case "line":
    stops of the "Point":
    case "TextColumn":
    case 'text ':
    case "cell":
    case "column":
    case 'Row ':
    case 'Table ':
    myDisplayDialog();
    break;
    by default:
    An option has been selected, but it was not a text object, so look for in the document.
    myFindChangeByList (app.documents.item (0));
    }
    }
    else {}
    Nothing has been selected, then just search for the document.
    myFindChangeByList (app.documents.item (0));
    }
    }
    else {}
    Alert ("no document is open. Please open a document and try again. ») ;
    }
    }
    function myDisplayDialog() {}
    var myObject;
    var myDialog = app.dialogs.add({name:"FindChangeByList"});)
    {with (MyDialog.dialogColumns.Add ())}
    {with (dialogRows.Add ())}
    {with (dialogColumns.Add ())}
    staticTexts.add ({staticLabel: "beach of research :"});})
    }
    var myRangeButtons = radiobuttonGroups.add ();
    {with (myRangeButtons)}
    radiobuttonControls.add ({staticLabel: "Document", checkedState:true});})
    radiobuttonControls.add ({staticLabel: "Selected Story"});
    If (app.selection [0] .silence! = "") {}
    radiobuttonControls.add ({staticLabel: "Sélection", checkedState:true});})
    }
    }
    }
    }
    Ditto var = myDialog.show ();
    if(myResult == true) {}
    {Switch (myRangeButtons.selectedButton)}
    case 0:
    myObject = app.documents.item (0);
    break;
    case 1:
    myObject = app.selection [0] .parentStory;
    break;
    case 2:
    myObject = app.selection [0];
    break;
    }
    myDialog.destroy ();
    myFindChangeByList (myObject);
    }
    else {}
    myDialog.destroy ();
    }
    }
    function myFindChangeByList (myObject) {}
    var myScriptFileName, myFindChangeFile, myFindChangeFileName, myScriptFile, ditto;
    var myFindChangeArray, myFindPreferences, myChangePreferences, myFindLimit, monarticle;
    var myStartCharacter, myEndCharacter;
    var myFindChangeFile = myFindFile("/FindChangeSupport/1test.txt")
    If (myFindChangeFile! = null) {}
    myFindChangeFile = File (myFindChangeFile);
    Ditto var = myFindChangeFile.open ("r", not defined, undefined);
    if(myResult == true) {}
    Loop in find/replace operations.
    {}
    myLine = myFindChangeFile.readln ();
    Ignore blank lines and comment lines.
    If ((myLine.Substring (0.4) == "Text") |) (myLine.substring (0.4) == "grep"). (myLine.substring (0, 5) is "glyph")) {
    myFindChangeArray = myLine.split ("\t");
    The first field in the line is the findType chain.
    myFindType = myFindChangeArray [0];
    The second field in the line is the FindPreferences channel.
    myFindPreferences = myFindChangeArray [1];
    The second field in the line is the ChangePreferences channel.
    myChangePreferences = myFindChangeArray [2];
    The fourth field is the range - used only text find/replace.
    myFindChangeOptions = myFindChangeArray [3];
    {Switch (myFindType)}
    case 'text ':
    myFindText (myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
    break;
    case "grep":
    myFindGrep (myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
    break;
    case 'glyph ':
    myFindGlyph (myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
    break;
    }
    }
    } while(myFindChangeFile.eof == false);
    myFindChangeFile.close ();
    }
    }
    }
    function myFindText (myObject, myFindPreferences, myChangePreferences, myFindChangeOptions) {}
    Reset the preferences of find/replace before each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    var myString = "app.findTextPreferences.properties =" + myFindPreferences + «;"»»» » ;
    myString += "app.changeTextPreferences.properties =" + myChangePreferences + ";". " » ;
    myString += "app.findChangeTextOptions.properties =" + myFindChangeOptions + ";". " » ;
    app.doScript (myString, ScriptLanguage.javascript);
    myFoundItems = myObject.changeText ();
    Reset the find/change preferences after each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    }
    function myFindGrep (myObject, myFindPreferences, myChangePreferences, myFindChangeOptions) {}
    Reset the find/change grep preferences before each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    var myString = "app.findGrepPreferences.properties =" + myFindPreferences + «;"»»» » ;
    myString += "app.changeGrepPreferences.properties =" + myChangePreferences + ";". " » ;
    myString += "app.findChangeGrepOptions.properties =" + myFindChangeOptions + ";". " » ;
    app.doScript (myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGrep ();
    Reset grep find/change preferences after each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    }
    function myFindGlyph (myObject, myFindPreferences, myChangePreferences, myFindChangeOptions) {}
    Reset the preferences of glyph in find/replace before each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    var myString = "app.findGlyphPreferences.properties =" + myFindPreferences + «;"»»» » ;
    myString += "app.changeGlyphPreferences.properties =" + myChangePreferences + ";". " » ;
    myString += "app.findChangeGlyphOptions.properties =" + myFindChangeOptions + ";". " » ;
    app.doScript (myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGlyph ();
    Reset glyph in find/change preferences after each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    }
    function myFindFile (myFilePath) {}
    var myScriptFile = myGetScriptPath();
    var myScriptFile = File (myScriptFile);
    var myScriptFolder = myScriptFile.path;
    CheminMonFichier = myScriptFolder + CheminMonFichier;
    If (queue (CheminMonFichier) .exists == false) {}
    Display a dialog box.
    CheminMonFichier is File.openDialog ("choose the file containing your list find/replace");.
    }
    Return CheminMonFichier;
    }
    function myGetScriptPath() {}
    try {}
    myFile = app.activeScript;
    }
    {catch (MyError)}
    myFile = myError.fileName;
    }
    return myFile;
    }

    I'm not a writer, but I'll take a stab and try to make a difference here.

    The main problem, in my opinion, is that you use a plain text instead of GREP search. Text gross has no provision to replace the text found by itself, for example, rather than using the codes you entered a literal string. Your search text of ' ^ p(^?) ' means find any character in brackets that occurs after a paragraph break. I would use in GREP ^ \s+ (\(.+?\)) which translates to find an opening parenthesis at the beginning of a paragraph (so he'll find if it happens to be the first character in th in a story) followed by a number any characters up to the first parenthesis (in the case where you have double the figures or double entries letter) followed by ANY white space (in the case where it is not an ordinary space or multiple spaces). Replace $1\t which means the text found in the first set of parentheses in query search followed by a tab.

    Parentheses are special in GREP, they surround groups of terms you want to re-use the text found, so looking for the actual characters you need to 'escape' with the-prefix, so \(.+\) will find a paren open followed by all the characters up to the end last paren in the paragraph. Addition of the? After the + makes research stop at the first closing paren met, although there are several sets in the paragraph.

  • Right click and change the problem

    How can I change the right-click and change association then a jpg opens for editing in CS6 instead of CS5 in Windows 7? I like to keep the two programs installed and Windows no longer offers the possibility to change the association of 'change '.

    See you soon,.

    Here is a solution to the problem.

    http://www.NirSoft.NET/utils/file_types_manager.html

    See you soon,.

  • Labels for form fields and calculations

    Help, please!  I use Acrobat XI. I have 2 buttons that the user needs to check and I can't seam to label. I would like more than a label of reversal. My research is said to go to properties > Options and label here as a label and a name are different. Labelling is not an option for me here. I have two choices: stye and Radio button selection button.   Help, please!  Also, I tried to said the tax rate of NC of 6.75% for the resident of NC button and we found that I have to add a java script in the actions of a field AND an export value to check the properties of the area, is that correct? Could someone explain PLEASE.  Essentially, I have a subtotal box and to add sales tax (a different - when box checked) and come with the order total.  Thanks a lot for your help. Best regards, titi

    The last line should be:

    If (taxable! = "Off") {event.value = subtotal * tax_rate ;}} else {event.value = ' ' ;}}

  • How to change the image of a line when you click on it from the waterfall cookbook sample application

    Hi, I have a few sql data. And I'm showing them with qlistdatamodel. I used the ListItemProvider and implementing customControl for each line in the sample application cascade cookbook. Which can be found in here. I want to change an image of the line when it is selected. I modified the method 'select' of 'recipeItem.cpp'

    void RecipeItem::select(bool select)
    {
      // When an item is selected, show the colored highlight Container
      if (select)
      {
    
          mHighlighContainer->setOpacity(0.9f);
          mItemImage->setImage(Image(QString("app/native/assets/btn_a.png")));
    
      }
      else
      {
        mHighlighContainer->setOpacity(0.0f);
    
      }
    }
    

    It should have changed the image btn_a.png. But what it does is removes the image and the text remains. Thank you.

    I just found out another of my post that my uri of the image is incorrect. The format of the url I was using was valid only in a Beta SDK. It should be like "asset:///btn_a.png". Now it works perfectly

  • Change the background color of line based on a column value

    Hello

    in a report, I want to change the record to the red background color if the value of a specific column is 'NO' in the folder. Please help me.

    Thank you.

    Try this

    I had this same problem and found that by using the following only highlighted the background of the text and not the entire cell

    
    

    I then swapped the use of div (as below) and this has solved my problem

    select test_table.column1 as "yes_no",
          CASE WHEN column2='NO'
             THEN '
    '||column2||'
    ' ELSE column2 END "column2" from test_table

    This has been tested in 3.2.1 - should work with other versions so

    Gareth

  • How can I change the background color of lines / odd in a panelCollection

    Hello world.

    I use a panelCollection and I need to change the color backgroung odd/even rows in the table,
    How can I do this using a style sheet, is there a special selector or property for that?

    globalResultCollection (object UIPanelCollection), is a collection of Our elements, and it works fine.
    I just want to change the background color by default for the lines.


    Thank you

    < af:panelCollection id = "GLOBAL_RESULT_COLLECTION".
    Binding = "#{admin." View.globalResultCollection}.
    styleClass = "globalResultCollectionRegion."
    clientComponent = "true" >

    < f: facet = 'menu' name >
    < af:menu id = "GLOBAL_OPERATION_MENU".
    Binding = "#{admin." View.globalOperationMenu}"/ >
    < / f: facet >

    < f: facet name = "toolbar" >
    < af:toolbar inlineStyle = "width: 100%".
    Binding = "#{admin." View.globalOperationToolbar}.
    ID = "OPERATION_TOOLBAR" / >
    < / f: facet >

    < / af:panelCollection >

    Hello

    Use this:
    AF | : the table-row af data | : the column cell data {background-color: #CCCCFF ;}}
    AF | : the table-row af data | column: banded-data-cell {background-color: #FFCCCC ;}}

    Kind regards
    s o v i e t

  • Change the background color of line indicator

    I'm doing an indicator of string with a black background or make it to which the channel indicator is transparent

    Thank you

    You can change the background color of the control a chain using the paint tool. Choose View > Tool Palette.

    Select the icon below a brush.

    Right-click on the background area of your control of the chain.

    A color mixer will appear - select a color block or the T in the upper right corner to transparent.

  • How can I change the length of a line-particle in Particle World settings?

    I did a world of particles with the line of the particle type, but I want to change the individual length of particles (the lines) is this possible somehow?

    Thanks to respect.

    Nope.

    Mylenium

  • Change of motherboard and processor with XP Professional - problems?

    I'm about to upgrade my motherboard and CPU on my computer running windows xp professional with service pack 3 installed. Should I wait for all the problems of the operating system because it's not the original equipment that I have installed windows on?

    http://www.michaelstevenstech.com/moving_xp.html - to change the motherboard

    http://www.michaelstevenstech.com/XPrepairinstall.htm - repair install how-to

    http://michaelstevenstech.com/cleanxpinstall.html - Clean install - how-to

    http://www.elephantboycomputers.com/page2.html#Reinstalling_Windows - what you will need at hand

    You may need to do a clean install. In all cases, be wise and back up your data before doing anything else. MS - MVP - Elephant Boy computers - don't panic!

  • Signature field and submit button does not

    I've recently upgraded to LiveCycle Designer ES2 and problems with certain features.  I created a form with 3 fields of signature and a send button for the final signatory to email on the back of the form.  None of the signature fields works; or not the submit button.  I did everything the same as I had in the previous version of the software.  However, it seems that there are a few changes that I know.  I read about locking objects, but got a little confused.  Can someone tell me (in very lay terms) what I need to do to get these functions work?

    I don't see a screenshot. If you have tried to contact by e-mail, that it won't work, you need to use the interface of the forum.

    In any case, to enable a document depends on which version of Acrobat you are using:

    Acrobat 8: Advanced > enable usage rights in Adobe Reader

    Acrobat 9: Advanced > extend features in Adobe Reader

    Acrobat 10: File > save as > Reader Extended PDF > activate additional features

    Acrobat 11: File > save as other > Reader Extended PDF > activate tools plus (includes filling form & save)

  • Change the problem of direction of the cursor with new 2nd monitor

    original title: problem of direction of the cursor with new 2nd monitor

    I just added a 2nd monitor to my computer. The 2nd monitor is left of my laptop but I have to move the cursor to the right in order to get on the new monitor. How can I change so I can just move my cursor to the left and get it on my new 2nd monitor?

    Right-click on the desktop and then clicking display settings by clicking Customize to open the display settings. In the display settings box, click and drag the image to the monitor 2 to the left of the screen 1. Click on the button apply, then check. Click Ok to exit.

Maybe you are looking for

  • S50-B-15N satellite screen problem

    The laptop above is not completely in three months. Yesterday when I tried to turn on the laptop the button turns on but the screen remains black. I removed the power wire, closed the laptop and up computing to study under the search for the battery.

  • Y at - it a "partial SafeMode?

    I'm trying to solve a problem already posted here: https://support.Mozilla.com/en-us/questions/825665 If I restart Firefox in "safe mode", the problem goes away. So now I want to refine the search, but the only one I can find 'partial safe mode' opti

  • Is it okay for Satellite A100-SP2022 PSAA5U BIOS?

    I want to update the bios of my Satellite A100-SP2022 (PSAA5U-02G00G) with windows XP SP2 Spanish, because I m install windows Vista (dual boot XP/Vista). The question is, if this BIOS file is correct for the update in my notebook? sa100a5v53.exe Tit

  • How to enable multicast on airport extreme

    Hello I have trouble using a bridge streaming with an ac 802.11 Airport extreme. According to the manufacturer of the bridge continuously, I have to activate "multicast" on the airport. Does anyone know how to do? Thank you.

  • Lost calendar information

    Please HELP my computer is updated nightly and restarted my computer when I loged in and went to my palm desktop all my info calendar was gone, everything is still there. I tried to restore my computer to an earlier date and who does not. How can I g