Frustration of the alignment of text

It seems impossible to align easily all the text in a LabelField.

I add two fields to a simple HFM, and the left one is left aligned just like I want, but I want the 2nd right-aligned field.

So I could better see what was going on, I put some color in an object, and it's the inner class of right field:

   private static class MovesField extends LabelField {
        MovesField( String n ) {
            super( n, LabelField.FIELD_RIGHT );
        }

        public int getPreferredWidth() {
            return 60;
        }

        public void paint( Graphics g ) {
            g.setColor( Color.DARKGOLDENROD );
            g.fillRect( 0, 0, this.getWidth( ), this.getHeight( ) );
            g.setColor( Color.BLACK );
            super.paint( g );
        }
    }

RED is the first LabelField and goldenrod, the second I want to be propped right.  The text in the field is only 2-3 charaters long, so 60 pixels works very well, but the text is left aligned!

It's really annoying.  The API says that it is a valid style, then why my text does not match?

You can override sublayout in the HFM and right align the field manually. HFM width needs to be greater than the sum, and then the two fields to be worth it.

protected void sublayout( int width, int height ) {

    super.sublayout( width, height );

    width = getWidth();
    height = getHeight();

    Field field = getSomeField();
    if (field != null && equals(field.getManager())) {

        int x = width - field.getWidth();
        int y = (int)(height * 0.50);
        setPositionChild( field, x, y );
    }
}

Tags: BlackBerry Developers

Similar Questions

  • Problem with the alignment of text and numbers

    I have problem to align the number and text... It separates the number of the actual sentence... How can I fix?

    Untitled.png

    http://forums.Adobe.com/message/4653327#4653327

  • Help please with the alignment of text

    I have tried adjust the text on the tabs all the morning and just can't do it! Is it possible to position precisely because the tabs are not in a straight line. I want to make them as links.

    Please see attached and link http://www.greenpatchwebsites.com/new/index.html

    V thanks a lot in advance.

    It is not just that the tabs are not on the same horizontal line, you try to use HTML/CSS to get the words to hover over an image.  It is difficult because the image is fixed, while the text is dynamic, which means that it will be resized and moved differently on each browser and monitor resolution.

    To get the text to insert in the tabs and NOT move against them, you must do one of two things.  Either design "tabs" using CSS (or Javascript or a combination of both), or put the text you want in the tab image and use a map image to the links clickable tabs.

  • How to change the default alignment of text in the cells in a table on the demand for numbers?

    I'm new to Mac. I own a MacBook pro MF839HN/A and currently using the 3.6.2 release NUMBERS (2577). I want to know if I can change the default alignment of text in the cell in a table of NUMBERS application? Also, when I select all the cells in a table to change their alignment, I can only change the horizontal alignment of the text and not the vertical alignment. To change the vertical alignment of the text in a cell, I have to select them individually. Help me with two questions.

    The only way I know is to create a table that is set up as you like, then save the empty document as a template customized by using the menu item "file > save as template:

  • Alignment of text for the QNX dialogue

    Hello

    Any ideas how to align left text dialogue QNX? i.e.

    var alert:qnx.dialog.AlertDialog = new qnx.dialog.AlertDialog ();
    Alert.title = 'my astonishing title ';
    Alert.message = "1. Bonjour\n"+"2. How are you\n"+"3. and have a REALLY good morning today;

    I want it to appear as:

    1 Hello

    2. How are you

    3 and have a VERY good morning today

    But now, it appears that:

    1 Hello

    2. How are you

    3 and have a VERY good morning today

    I also tried the messageHtml no etc. nada no alignment.

    Thank you!!

    UDI

    Hey udik,.

    try running the following program and see its output:

    package
    {
        import flash.display.Sprite;
        import flash.display.StageAlign;
        import flash.display.StageScaleMode;
    
        import qnx.dialog.AlertDialog;
        import qnx.dialog.DialogAlign;
        import qnx.dialog.DialogSize;
    
        public class DialogTest extends Sprite
        {
            private var myAlert:AlertDialog;
    
            public function DialogTest()
            {
                super();
    
                // support autoOrients
                stage.align = StageAlign.TOP_LEFT;
                stage.scaleMode = StageScaleMode.NO_SCALE;
    
                myAlert = new AlertDialog();
                myAlert.title = "myAlertDialog";
                myAlert.align = DialogAlign.CENTER;
                myAlert.messageHtml =   "

    " + "1. Something goes here
    " + "2. Something else here too
    " + "3. And a last thing to go here." + "

    "; myAlert.addButton("OK"); myAlert.addButton("CANCEL"); myAlert.dialogSize = DialogSize.SIZE_MEDIUM; myAlert.show(); } } }

    So basically you had the right idea except when you try to align to the left use the

    tag and when to put in line breaks use
    instead of \n in case it is a question too. Let me know how it turns out. Good luck!

  • When I Center the text, I can't get back to the aligned left for the rest of the text in WordPad.

    * Original title: centering in Word Pad

    I don't know how to Center in Word Pad; However, when I Center the text, I can't get back to the aligned left for the rest of the text.  Everything I typed after that a title is also centered.  If I've left this text, the title goes back to the left margin.  Any info out there?

    Hello

    -Is confined to a specific document?

    This problem may be due to the rule of pointer.

    I suggest you to drag the rule of pointer to the left and see if it helps.

    Keep us informed on the status of the issue.

  • File IDML opening with vertical alignment of text in the box set "Center".

    I got a batch of files, asking me to review. They were saved as files CC as well as .idml. I have used .idml since the sender used plugins files that are not included in the package. Using the .idml, I do not get the warning about the missing plugins. However, when I open the idml files that all text boxes are the vertical value Center instead of top. Very tedious. CC files opened correctly (with the exception of the warning about the missing plugins).

    Is it possible to open the idmls and get the vertical alignment to open as "top"? Or should I use the CC files and ignore the warning on the plugins?

    Thank you!

    Tim

    Guess I'm stuck with opening the idml docs and manually change each vertical alignment of text box.

    With Find\Change you can:

    Find/replace > object tab

    Tye: Blocks of text

    Change object Format: click on specify the attributes to modify > text frame general Options > vertical Justification > Align > Top

    Then find and change or change all

  • Photoshop CS6 rotates 90 degrees to the right alignment of text characters istead vertically?

    Photoshop CS6 rotates 90 degrees to the right alignment of text characters istead vertically?

    I have the same exact problem as this thread.

    The solution is change option East Asia and rearmament of the preferences, but mine is still typing horizontally at a 90 degree angle. Anyone know of any other way?

    Have you tried to reset the text tool and reset the characters available in ground #1.

    Kind regards

    Mohit

  • With a withdrawal of the chip and text alignment problem

    I need to right align a text with a ball (numbered) AND to have a left indent.

    The text block is pointed out to the center of the double-page (so I can't use a smaller text without any left indent block).

    Withdrawal left avoid that double the text to the left of the flow to the center of the page.

    However, it seems that bullets don't like that much of withdrawals of paragraph:

    GfTpC.png

    So, I tried to use a transparent block with a text wrapping.

    The balls follow the text wrapping, but are aligned to the left:

    3tWiu.png

    How could I solve this problem?

    Use a net of paragraph that may extend outside the text frame. So you can make the text smaller block.

  • The Widget Menu text alignment

    Widget menu: Is it possible to align text centered in the top - Menu and pages to the left in the Menu of subpages?

    There is not a lot of controls (everything) for where the submenu is positioned, but you can align the text in submenus using text alignment in text on the menu Board is defined for the uniform Site. If the menu is set to uniform spacing you must be more creative and double-click until a submenu item is selected, use the space Panel (unlock the chain icon) to increase the right padding value so that the text appears on the left, aligned.

  • I need to select all the blocks of text in a document and align text blocks in the back pages left frame margin and the text in the pages front to the right margin.

    Hello

    Am new to Java script.

    Can someone help me out here, I need to select all the blocks of text in a document and align text blocks in the pages back to the left margin frames and text in pages recto at the right margin.

    Thank you
    Harish

    Hi Harish,

    Try this.

    var doc =app.activeDocument,
        _pages = doc.pages;
    doc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
    for(var i =0;i<_pages.length;i++)
    {
            txfms = _pages[i].textFrames.everyItem().getElements();
            for(var j =0;j
    

    Kind regards

    Cognet

  • Align the value apex_item.text

    How can I align the value apex_item.text on the right?
    The default value is left.
    I tried to set the alignment of the column as rigth without success.

    Use the p_attributes for apex_item.text parameter to create a style attribute:

    style="text-align: right;"
    
  • Change the alignment of the text in the Center.

    FO some reason, the forum search returns 0 results for me no matter what I enter.  I'm sure this has been asked before, but how to change the alignment of the text of point to Center?

    Even if it's at a point, he treated the same as text in the box. The following books

    var docRef = app.activeDocument;
    
    var textRef = docRef.textFrames[0];
    
    //textRef.textRange.characterAttributes.size = 28;
    
    var paraAttr_0 = textRef.paragraphs[0].paragraphAttributes;
    
    paraAttr_0.justification = Justification.CENTER;
    
  • The basic menu text alignment

    I redesigned the menu bar to the restaurant I work as an accountant. I have a knowledge base of InDesign (CS2 worm) and now that I'm trying to set up the final draft for the menu, I fight with perfect spacing that I made previously as a draft simply using Visual guidelines. I'll not be myself the impression these on my printer (only 25 copies) so no worried of commercial printing. I'll attach a file of the layout and hope it works.


    My goal is to have uniform spacing between the name of the element Script fonts and the description of the object police Minion and the spacing between the elements. I have searched for a text alignment and met a lot of information that talks about paragraphs and no seizure of returns and alignment using baseline or document grids grids. All pretty overwhelming to try to understand. I created text using individual text boxes and the characteristics of the alignment.

    I would be happy to the easiest way to create this menu that would be visually nice and consistent.

    Thank you

    Patty

    Hi Patty,.

    Sorry for the delay in response, it was one of those days hehe.

    I'll give a creation step by step on just the first text box, and (for the most part)

    1. create the text box and put the copy in the box

    -Create the box big enough so that if you were to copy and paste all of the text in another document, it will fit.  (personally I set the margins of the entire page and create the text box to the margin, only height adjustment to compensate for the red bar header you have to go at the top). But let me ask you this question.  You have all the elements of the menu on a WORD document (or something similar)?  If so, you can copy and paste everything at once.

    -Anyway it doesn't really matter how to get everything that he, just put all the appetizers in a framed with here descriptions and prices, obviously placing them in the order you want to read.  For example

    Fried Ravioli7.959.95

    Item description goes on the next line.

    Crab Cakes7.959.95

    Item description goes on the next line.

    etc...

    (Make sure you have none between the two additional lines each element is important...) You will become too overwhelmed by the desire to use the space bar or the tab key to setting the price of space, are not!  Laughing out loud... Notice how I have no space between the element name and pricing... "This is how you want.)

    QUESTION IMPORTANT, you want the police to pricing be identical to the order of the day?  I'll assume that you do

    2. terms of organization of the first element (fried dumplings)

    -Set up the first line (Fried Ravioli7.959.95) with the size of the exact font, font family and color you want all of the elements to search for.

    -Now place your cursor inbetween fried ravioli and 7.95 and press the tab key, then place the cursor between 7.95 and 9.95 and press the tab key.  Should look like this now

    Dumplings fried 7.95-9.95

    Item description goes on the next line.

    Crab Cakes7.959.95

    Item description goes on the next line.

    etc...

    -Press Shift + Ctrl + T... This opens the ruler above the text box tab (it's kind of like the ruler of MS WORD at the top of the page only you can move).  Notice in the area, above the rule, there are more arrows, one pointing to the left, middle, right, middle.  Click the right arrow (which means the text will align to the right) with the right arrow selected, click on the rule and drag the marker to the tab where you want to than the first price to display (by dragging, you will notice prices moving with it, it's good) now place another faucet brand, once again, by clicking on the rule , just this one you want to drag all the way to the right, until it is just at the end of the text box.  Your first line should now look like this:

    Dumplings fried 7.95-9.95

    Item description goes on the next line.

    Crab Cakes7.959.95

    Item description goes on the next line.

    etc...

    3. format Description

    -Once format description of the exact font family, font-size and color you want all descriptions look.

    4. create the style of paragraph for elements (ok, let's go with the paragraph styles)

    -Open the palette paragraph styles.

    -Then place your cursor anywhere on the first line.

    -While pressing the Alt key, click on the "create the new paragraph style" icon at the bottom of the Palette (it will look like a small piece of paper, next to a small trash can) paragraph styles, you will notice that a box opens, it's the settings in paragraph Styles box.  (but because you held ALT key while clicking on the icon of new style, all styles have been generated automatically.)  So all you need to do is type a name (at the top of the box), and then click ok.  Name it "Items".

    5. create the style of paragraph for description

    -Repeat step 4, only this time you will first of all place your cursor anywhere on the description line.  And appointing decription

    6. apply styles to paragraph for the rest of the elements

    OK, I won't tell you created styles in a loop, to get in shape all copy at a time, which would take too long to write... hehe...

    But now that you have your two paragraphs created styles you can click format all other elements, that he takes no time

    -Place your cursor on the first line of the order of the day, and the right mouse button click on the paragraph style "Items", in the paragraph style palette... In the menu, select the choice: apply style "Items" + clear overrides and character styles obvious (this will ensure that the line is formatted for the paragraph style you set exact)

    Now you should have this properly set line-shaped... But uh oh, there is still no space between the two elements. I'm glad you noticed. Open the "Items" paragraph style settings, you will notice on the left there are tabs.  Click on the tab 'line spacing '.  Find the text box that says: "a space before" and enter a value (this will be the distance inbetween each element, so according to the units you are using, picas, inches, etc. assign a reasonable space.)  I would have put in. a.125.    If you have clicked on the box preview (located on the lower left corner of the settings box) you will immediately see your items should be spaced.  Click ok to exit the settings box.

    -Repeat the previous step with the descriptions.  You won't have to worry about spacing here

    -Now, repeat the previous two steps until all items are formatted.

    7 make the blue Happy Hour price

    Just real quick

    Highlight the first price you want blue.  change the font color of blue, now in the Toolbox, select the "eyedropper" (you can't miss it, it resembles a dropper... lol) with the eyedropper tool, click the text highlighted in blue, but now empy changes look full.

    A bit like the format in word, this pipette brush is now the exact formatting of the blue pricing.

    -Now with the complete pipette, highlight each prize to the bottom of the list that is supposed to be blue.  Each item you want will change from black to blue.

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

    OK, so there you have it... This should take care of it, I hope I don't miss anything, even if it is long and I'm little tired, I wouldn't be surprised... Laughing out loud...

    Hope this helps

  • The Spry Menu text alignment

    I wonder if there is a way to have the text centered in the main menu bar but align to the left of the text the in the submenus. I tried, but any alignment that I apply in the CSS seems to affect all the text.

    I just made this page someone else example:
    http://www.Projectseven.com/testing/customers/Adobe/Fubar/

    Maybe this will help. The spry menu is the second.

    --
    Al Sparber - PVII
    http://www.Projectseven.com
    The finest Menus Dreamweaver | Galleries | Widgets
    http://www.Projectseven.com/go/pop
    The ultimate DW menu system

    "efredian" wrote in message
    News:gnnq9i$3BU$1@forums. Macromedia.com...
    > I wonder if there is a way to have the mainly centered text
    > bar menu but align the text left the in the submenus. I tried, but all
    > alignment I apply in the CSS seems to affect all the text.

Maybe you are looking for

  • When I open Firefox, I have a unwanted Bing toolbar

    For the last month, when I open Firefox I get an unwanted Bing toolbar. Also when I open Internet Explorer, I get a newspaper additional Firefox in the screen. IE is prepackaged in my PC. The re-booting, I can't get the last system restore. Firefox i

  • How to remove a group of contacts iCloud

    Hello I have one child (sharing family) with an iPad and an iPhone who, for some reason, sharing all my contacts.  How to remove a group/folder of its aircraft within the section iCloud "Groups" under "Contacts"? Thanks much for any help! Brad

  • Is anyone having problems with the Times and the Sunday Times App

    Im having problems loading from the Times and the Sunday Times app. Before I launch into a major description (I have Parkinson's disease, and typing is slow) is there a known issue with the application at the present time

  • Missing ethernet controller driver.

    Nice day I reinstalled my system and know that the controller ethernet was not installed immediately so you have a little problem. Research (almost) all over the internet but coulden can't find ethernet controller driver. My computer: Compaq presario

  • Windows mail 0x800CCC78 error code

    Just started not to be able to send e-mail, can receive very well. I get this message and the error code: The message could not be sent. The authentication setting are may not be wrong for your e-mail [SMTP] Server outgoing. To resolve this issue, go