Midp2.0 ItemImage and ItemString text right on the same line?

Y at - there a trick to this on the Blackberry Pearl.

I want an Image and text to the right of the image, then the first line

in a configuration form. I am trying to support the Pearl 8110 and so on

He just puts the Image on a line by itself any combinations of layout

I use

try {}
Image image=Toolkit.createImage("/tivoli.png");
ImageItem it = new ImageItem ("", image, Item.LAYOUT_2 |) Item.LAYOUT_SHRINK | Item.LAYOUT_LEFT,"");
SF. Append (IT);
} catch (Exception e) {}
}
StringItem tr = new StringItem ("", "a" + tbsmNLS.get ("label - conf") + "\n");
si.setFont (Font.getFont (Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
si.setLayout (Item.LAYOUT_2);

The WTK emulator works well for every combo I seem to think would work

and I'm tired of construction and train to test on the

real device to work. The image and the string very easilly can fit on a line.

This works also very well a Nokia E60

Just surrendered and wrote my own label

package com.ibm.tivoli.midp;
Javax.microedition.midlet import. *;
Javax.microedition.lcdui import. *;

public class ImageString extends CustomItem {}
Image img;
String st;
Do police;

public ImageString (Image image, String title) {}
Super("");
make = make .getFont (Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_MEDIUM);
IMG = image;
St = title;
}

protected int getMinContentHeight() {}
Return img.getHeight ();
}

protected int getMinContentWidth() {}
Return img.getWidth () + font.stringWidth (st) + 5;
}

protected int getPrefContentHeight (int width) {}
Return img.getHeight ();
}

protected int getPrefContentWidth (int height) {}
Return img.getWidth () + font.stringWidth (st) + 5;
}

protected void paint (Graphics g, int w, int h) {}
g.drawImage (img, 0, 0, Graphics.LEFT |) Graphics.TOP);
g.setFont (do);
g.drawString (st, img.getWidth (), img.getHeight () - do .getHeight (),)
Graphics.LEFT | Graphics.TOP);
}

protected boolean crosses (int, int viewportWidth, viewportHeight int dir,
{int [] visRect_inout)
Returns true;
}

Protected Sub sizeChanged (int w, int h) {}
}
}

Tags: BlackBerry Developers

Similar Questions

  • different text color in the same line for staticText ScriptUI?

    is it possible to have different text color in the same line for staticText ScriptUI?

    for example, I don't want red color for the word 'RED' text below in the SAME line.

    var l is new window ('dialog', 'Sélection');.

    var s = w.add ('statictext', undefined, "It's a RED pen");
    w.Show ();

    Thank you!!

    Simple,

    var w = new Window ("dialog","Selection"),
         g = w.add('group'),
         s1 = g.add('statictext', undefined,"This is a"),
         s2 = g.add('statictext', undefined,"RED"),
         s3 = g.add('statictext', undefined,"pen");
    g.spacing = 4;
    s2.graphics.foregroundColor = w.graphics.newPen(w.graphics.PenType.SOLID_COLOR,[1,0,0],  1);
    w.show();
    

    I'm sure that's the answer makes sense "only".

    Trevor

  • left and right justify the same line of RitchTextField

    Hello

    How to justify to the left and to the right the same line of text...

    There is no way to do currently - DrawStyle.HFULL is listed as "not yet implemented" (I wonder about this 'yet' - there is no more BB OS versions after 7.0, is there?)

    If you want to achieve, you will have to be implemented by program (not too hard, but not trivial either).

  • 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

  • How can I keep right-aligned to left and paragraphs together on the same line?

    I am currently composing a menu. Basically, I want the title of dish to be aligned to the left and aligned price right, but on the same line. I can achieve the effect by typing in a shift + tab after the text of the title of the dish and then insert the price, but I'd rather have two styles of separate paragraphs, so that I can adjust the world to see what looks good. can I get the effect by adjusting the character of price from the price database and move it to the top, but then if I need to make changes in price, I find it a pain when trying to get the cursor in the right place in situations where a base line is significantly changed.

    Back in time (to Ventura!), I could just remove the line break after the style 'Dish title' and the 'price' would be upwards to the same line, but I can't seem to be able to do this to the CS6.

    Any ideas?

    You can use a table, but I think that a single paragraph with a character style nested to manage the different formatting for the price is more flexible.

  • Is it possible to convert the standard numbered list to the list that appears on the same line a right after another? As indicated in 1. Text goes here, 2. Text goes here, 3. Insert text here

    Is it possible to convert the standard numbered list to the list that appears on the same line a right after another?

    Instead

    1. Insert text here
    2. Insert text here
    3. Insert text here

    This

    1 text goes here, 2. Text goes here, 3. The text here.

    This revised list can take multiple lines.

    I use InDesign CC2014 - if that makes a difference.

    the only way is to convert numbered in the text (select numbered list > ctrl (or right click) > bulleted & numbered lists > convert numbered text).

    Then, with search - replace, you can change the paragraph returns in space (or in space by commas as in your example)

  • The been lots of updates, but the effects, transitions and the text tool are the same. Why?

    The been lots of updates, but the effects, transitions and the text tool are the same and in some cases, we lost a few of them. Add more damage upgrade

    a couple of things that are not relevant. And promise a quick editing and improved timeline and more, but the program still crash and work almost the same thing.

    While welcoming the technical team, it will be useful to improve the effects and titration module too

    Hi Bisa Goma,.

    While welcoming the technical team, it will be useful to improve the effects and titration module too

    You can create a feature here: http://adobe.ly/feature_request

    Thank you

    Kevin

  • Me and my dad is from the same Apple ID and I want to set up his own, but how it will get all his contacts, photos etc from my Apple ID? Or he will lose all? or I could keep them saved for him and send more via an application any?

    Me and my dad is from the same Apple ID and I want to set up his own, but how it will get all his contacts, photos etc from my Apple ID? Or he will lose all? or I could keep them saved for him and send more via an application any? I don't know how to resolve this issue, if someone could point me in the right direction.

    Have him create a id Apple here- create and start using a Apple - Apple Support ID, and then both you can create an album-photo sharing Photo Sharing - Apple Support iCloud

  • Write a string and an integer and a table all in the same file?

    Hello

    I am currently it several different types of values with LabView.

    I have a shot, a few numbers and several paintings.

    Thus, for example, I have a timestamp of the chain, several values of "integer" amplitude of the signal for example, RMS value, frequency and I have several paintings - table of signal, the FFT (PIC and location) values.

    Basically, I'm trying to find a way to write all the values in a single file. I can write all the individual types to separate files (so I can write the RMS, amplitude and frequency to a single file, some of the tables in the other)
    but is it possible to write a string and an integer and a table all in the same file?

    Pointers would be much appreciated,

    Thank you

    Paula

    Your file will be all text... any format in a table of text, to build as a single table, "table chain worksheet", to write to the file.

    (I'm sure this has been on the forums before... a search it would have thrown upward)

  • IN NOTEPAD CAN IT HAVE DIFFERENT 2 OR 3 TEXT SIZES ON THE SAME PAGE?

    I try to create the letter head in Notepad and want to have the fonts of upper header of the police of 'field '. is it possible and if so, how?

    Hello

    To answer your question: no, you can't have different text in Notepad. This is because Notepad is designed to create and edit text files using the basic of formatting text. I recommend using Microsoft Word (which is part of Microsoft Office) to have different text etc. styles (if you don't have Microsoft Word and don't want to buy it, you can use a trial version. In addition, ago a productivity suite open and free, similar to Microsoft Office and provided by another company, called OpenOffice, which allows you to have different text styles).

    Although, I would recommend to get Microsoft Office, there is a program called WordPad (or TextPad, depending on your operating system), which is designed to create and edit text with complex formatting. It should be in the accessories (in the same place as Notepad).

    Related links

    I hope this helps and good luck.

    If this does not work and / or is not useful, just reply to this, and I'll see if I can revisit the issue to provide more useful advice.

    Spartan-837

  • EditField and checkboxfield on the same line

    public CheckFileScreen()
        {
            vfm = new VerticalFieldManager();
            left = new HorizontalFieldManager( Field.FIELD_LEFT);
            right = new HorizontalFieldManager( Field.FIELD_RIGHT);
            _Id = new EditField("Id : ", "", 6, EditField.FILTER_NUMERIC);
            _check = new CheckboxField("check", false);
                    left.add(_Id);
            right.add(_check);
            vfm.add(left);
            vfm.add(right);
            add(vfm);
            add(new SeparatorField());
        }
    

    on my above code tries to _id and _check on the same line, but the screen has been mess up

    +---------------

    | ID:

    | # check

    +----------------

    I want to create has been

    +----------------------

    | ID: # check

    +-----------------------

    could someone help me with this?

    This is the first time make app with GUI

    Gentlemen.

    slow down, please!

    Absolutely, totally useless any Manager available personalized for that! In order to organize two or more fields in a 'line', you just all of them to the same HorizontalFieldManager! The manager then places them from left to right in the order that you add them.

    That said - you have a slight problem in your EditField. EditField is "width-hungry" - it consumes the entire width, it is given, do not leave anything for the rest fields. To combat that, to deceive him into thinking he's got less space. We will give him what he needs to label 6 larger figures (s '8' or '9's, not '1') and a space for the padding. We will then have something like:

    _Id = new EditField("Id : ", "", 6, EditField.FILTER_NUMERIC) {
      protected void layout(int width, int height) {
        Font myFont = getFont();
        int myWidth = myFont.getAdvance(getLabel()) + myFont.getAdvance("8") * 6 + myFont.getAdvance(" ");
        super.layout(Math.min(myWidth, width), height);
      }
    };
    _check = new CheckboxField("check", false);
    HorizontalFieldManager hfm = new HorizontalFieldManager();
    hfm.add(_Id);
    hfm.add(_check);
    add(hfm);
    

    Enjoy!

  • How to apply different fonts to text (words) in the same field

    Please help, how to apply different fonts to text (words) in the same field. I want to select text and apply the font, size and color on the selected text in the field, this code below, the setFont method changes all the text in a field (message) of a select statement to the police. Help, please

            message = new AutoTextEditField("","",maxNumChars,editableStyle)
            {
                protected void layout(int width, int height)
                {
                    super.layout(width, height);
                    this.setExtent(550, 250);
                }
            };
            message.setBorder(border);
            message.setMargin(xyEdgeForMargin);
            message.setPadding(xyEdgeForPadding);
            message.setFont(_menuFont);
    

    Just write your edit as field

    SerializableAttribute public class RichEditField extends BasicEditFields

    {

    int [] offsets = null;

    Are police [] = null;

    String text = null;

    RichEditField (label As String, String text, int [] offsets, make police [])

    {

    Super (label, text);

    This.Text = Text;

    This.Label = Label;

    Offsets = this.offsets;

    This.font = do;

    Add validation for offsets and text here

    }

    RichEditField (label As String, String text)

    {

    Super (label, text);

    This.Text = Text;

    This.Label = Label;

    This.offsets = {0};

    This.font = {g.getDefaultFont ()};

    Add validation for offsets and text here

    }

    / * Here is a method to add customization of fonts as

    setFont (offset, length);

    setFont (offset);

    public void paint (Graphics g)

    {

    g, Clear ();

    for (int i = 0; i)<>

    {

    calculate it according to x, y using offset

    int length = 0;

    g.setFont (do [i]);

    If (i<>

    length = offset [i + 1] - offset [i];

    on the other

    Length = Text.length () - offset [i];

    g.drawText (text.substring (0, length), x, y);

    Super.Paint (g);

    }

    }

    This method is not compiled may have errors and may have many features according to your needs.

  • Keep the text perpendicular to the base line when you use the string.

    Is there a way to keep the text perpendicular to the base line when using the warp function?  I'm trying to reproduce a decal with curved text.  When I use the string to get the text that is curved like the original, the letters are slightly tilted.

    You could try to make each letter on a separate text layer, then use Image > transform > free transform to adapt the letters in place.

    A lot more control over the placement of the letter and size that warp text offers.

  • I'm creating a Web site and I want the objects to be on the same line, how would I do?

    I'm trying are we on the same line as the bar of navigation and put text in the empty box, can anyone help on how to do it please? I tried for days and nothing works...2016-04-04.png

    Assuming you have floated the container elements and you have the correct width to fit the main component/container, then you might want to take a look at Box Sizing | CSS-Tricks

    If this does not resolve your problem, please view the code.

  • If I click on "PIN to the browser" the sensitive axis is unselected and vice versa. I need object "PIN at the top of the browser" and 'sensitive pine' work at the same time. Any suggestions?

    In the latest version of muse to adobe, I have me against "PIN at the top of the browser" and 'sensitive pine' work at the same time.

    Now if I choose an object and the axis 'browser', "sensitive pine" is unselected and vice versa.

    The need is for the header with the logo and menu bar to be pinned to the top of the browser, so that the page scrolls in the header bar.

    Now when I click on the sensitive left axis for the logo and the sensitive right pin for the navigation bar, the "pin at the top of the browser" gets deselected.

    Any suggestions or workarounds will be appreciated.

    Kind regards

    Vijay

    Hi all

    Thanks for that bring to our attention. We will consider adding this feature in the future.

    RyanDoyle - it's an interesting hack you have found! Unfortunately, I wouldn't count on that it works like this in the future, as a bug which is to operate. If you drag the screen to change the width of the browser as a Muse, you'll see that the behavior of the elements in the status button (a menu, for example) is different from when exported. However, if you make a small change to your hack, so it should always work: set button "width sensitive" State instead. In addition, I don't see why all parts must be in separate to this job state buttons, but I've only tried a simple example myself.

    An another workaround I used is to create another, more breakpoint. For example, if I have a menu that is pinned to the top left of the browser in the dots stop, then in a breakpoint, I would pin in the center top of the browser. Normally, I wouldn't add more breakpoints, but there is a way that I found to work around the problem. Ryan workaround is perhaps the best way to go if you take my advice and use a status button sensitive width instead of the width of the browser.

    Hope this helps,

    Anna

Maybe you are looking for