Dynamically sizing a group of textfields based on font size

Hi,
I have made a UI control which contains a bunch of TextFields representing the members of an Array. I draw these un a list like in a combo box's drop down. Currently I hard code the height of the TextFields, iterate through the Array and position the TextFields by adding the hard coded height each time. Simple enough.
But now I would like to put the control in another place where I must use smaller text. So I would like to make the thing general so I can resuse it whenever I want, simply by applying a new TextFormat. My problem is that I want to still be able to position the TextFields accurately regardless of the font size used in the TextFormat. I have tried just creating the TextField, applying the TextFormat, setting the text, and then trying to read the TextField's height, but alas this does not work.
Can anyone please tell me what the best way is to find each TextField's height so that I can build my list?
Thanks!

You can check to see if the (maxscroll >1)== true (text extends beyond visible area), and if it is, then set size smaller,

Similar Messages

  • How to group the output based on DAYS field

    Hi
    I am modifying the predefined ALV report "RFTMBL01" .I had added the days field to that report output and I have to group the output based on the DAYS field
    Records within 0-10 days in one group
    Records within 10-30 days in one group
    Records above 30 days should be  one group
    No of days may repeat that means with no of days 10 .many records will be there
    There is also a field by name "AMOUNT" in my output.
    I have to calculate SUBTOTALs at the end of every group and at the end of the report i should caluculate GRAND TOTAL.
    Please remember that i should not use any any BLOCKED ALVs and for Totals i should not use the SYMBOLS provided in the application toolbar of the report
    Thanks in Advance

    <b>>>>The file has to be routed based on the Company Code</b>
    check with xpaths.
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    /people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
    <b>>>>different file should have different file name again based on the company code.</b>
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii

  • Group the files based on their extensions

    Hi,
    I am traversing a dir and listing all the files under that directory. Now i want to group the files based on the extension and just print the number of files with each extension.
    ex:
    Extension No.of Files Size of the files
    .java 10 23455 bytes
    .html 2 1000 bytes
    I am able to get the extension of the files. I would like to know how to proceed after that.
    Any sample code will be helpful.
    Regards
    Kutty

    I have used a method to list all the files in the directory. After adding files with same extension to the HashMap. i am printing files after reading file by file. I need to print the files once i complete reading all the files in the directory.
    Any suggestions?
    private void listingFiles(File f )
              Map extensionMap = null;
              File[] files = f.listFiles();
              for( int i = 0; i < files.length; i++ )
                   File file1 = files;
                   Dprop.size += files[i].length();
                   if (file1.isFile())
                        fcount = fcount +1;     
                        if (extensionMap == null)
                             extensionMap = new HashMap();
                             // Group files by extension
                             for(int idx = 0; idx < files.length; idx++)
                                  if (files[idx].isFile() && files[idx] != null)
                                       String ext = getExtension(files[idx]); // get the extension
                                       ext = ext.toLowerCase();
                                       List fileList = (List)extensionMap.get(ext);
                                       if(fileList == null)
                                       fileList = new ArrayList();
                                       extensionMap.put(ext, fileList);
                                       fileList.add(files[idx]);
                        // Access all the files by extension
                             for(Iterator extensionIterator = extensionMap.keySet().iterator(); extensionIterator.hasNext(); )
                                  String ext = (String)extensionIterator.next();
                                  List fileList = (List)extensionMap.get(ext);
                                  System.out.println("\n\nNo of Files "+fileList.size()+" with extension '"+ext+"' in '"+f+ "' Directory");
                                  for(Iterator fileIterator = fileList.iterator(); fileIterator.hasNext(); )
                                       File file = (File)fileIterator.next();
                                  System.out.println("File Name "+file+" File Size "+file.length());
                   else
                        dcount = dcount +1;
                        listingFiles( file1 );
    Thanks in advance
    Kutty

  • Dynamic sizing of a component to fit the content

    Hi All,
    How can I make my component so that it will be dynamically sized to fit the content height?  I would like to create a component that will have a variable height.  It has a serious of user input controls.  Depending on the answers given, more input from the user may be necessary--specifically, they will have to provide an explanation in a textbox.
    So, my thinking is that I don't want to display the textbox unless they answer "yes" to any questions that require additional explanation.  If they do, then I want display the TextArea control along with instructions to enter an additional explanation here.
    However, when I do that, it will cause my component's height to grow.  I don't want to reserve space for that textbox in the component's dimensions--I would prefer it simply grow (pushing anything below it further down) if and when the textbox appears.
    How would I go about doing this?
      -Josh

    I think the standard JSF solution would be not to do the create/delete of inputs on the client side, but to do it on the server side.
    If that is not your cup of tea, I think that the standard components will not be sufficient. So you are looking at either not binding the inputs to a component and just getting the values via the request parameters or creating a custom component capable of dealing with this.

  • Setting column count dynamically for a Group

    Hi Experts,
    i want to set the column count dynamically for a group.
    Thnks,
    Ramani.

    You probably mean you want to change the colCount value for a GridLayout (assigned to a Group), right?
    To change this property from a view controller method, you can
    - create a boolean context attribute "changeColCount" and set it to true in the controller method
    - check this flag in method wdDoModifyView(), access the GridLayout instance and change the colCount value
    - reset the flag afterwards
    Armin

  • Group a report based on a hierarchy level

    Hi,
    I'm struggling with a query that I'd like to group a report based on the selection of a hierarchy level.
    Here's the situation: I've got a table with a "normal" hierarchy, say the EMP table from SCOTT with its EMPNO and MGR columns. What I'd like to have is a report that gives me the sum of the SAL column group by all members on a given hierarchy level. So fi, if I choose LEVEL = 1, Id like to see the overall total, if I choose LEVEL = 2, I'd like to see the sum of salary of all employees managed by this respective manager etc.
    I know that there are possibilities to denormalize the table first and try to solve it from there, but what I'd like to know is whether anybody is aware of a more generic way to achieve that? What I could accept is a hard coded limitation of the number of nested levels, as this seems to be very hard to achieve in SQL.
    In the real scenario, I'm using only balanced trees, so from that point of view, the reports will be consistent.
    Any ideas?
    Thanks, Jürgen

    select l, sum(salary) from (SELECT last_name, employee_id, manager_id, salary, LEVEL l
    FROM employees
    START WITH employee_id = 100
    CONNECT BY PRIOR employee_id = manager_id) where l > :input_level
    group by l;

  • Creating dynamic sized arrays and filling them automatically on speedy 33

    hi all,
    I am trying to create dynamic sized arrays on Speedy-33. Specifically, depending on the user input, I want to be able to create
    arrays with 128 or 256 elements and fill them automatically. However,
    array constant element is fixed for Speedy 33; thus I have to manually set the
    size of the array with the mouse and enter the values in to the array by
    myself. I want to make this tedious process automatic. Would this be possible? thanks so much for comments!
    ~casiopea

    Casiopea,
    There is a really great article on using arrays with LabVIEW DSC which can be found here:
    How Can I Be Successful With Arrays In the LabVIEW DSP Module?
    One of the biggest things that should be noted about DSP is that there is no dynamic memory allocation.  Your array size must be fixed, and thus, your array needs to be initialized by using a constant. 
    An easy way to initialize an array constant that has many elements that are all the same is to simply create a numeric constant that has the value that you want.  Then, create a new blank array constant and drag the numeric into it.  In the index input for the array constant, type in the index of the last element that you want to be initialized.  Then type in the value in the element that is displayed and all of the elements before it will be initialized to the default value of the numeric constant that you dropped into the array constant.  I hope this helps.  I would really recommend reading through that article, as it has a lot of great information about using arrays with DSC.
    Brian Coalson
    Software Engineer
    National Instruments

  • Populate TextField based on DropDownList selection

    Hello guys,
    I want to fill a textfield based on a menu selection, for example the database has two fields agent_name and agent_number.
    agent_name | agent_number
        Scott         |          1
        Dave         |          2
        Matt          |           3
    I created a dropdown unsing Dreamweaver CS5, and I fill the values using a database (MySQL), there is a readonly text field called agent_number like the database field, basically I want to put the agent number based on the name selection, if you select Scott, this will autopopulate the number 1.
    Can I do this automatically using dreamweaver? Or Do I need to do it using JavaScript?
    Regards,

    pelonms7 wrote:
    I want to show the agent number based on the agent selection from the drop down.
    Well, if you really prefer a javascript based solution over achieving the same result with standard SQL methods, you can do it this way:
    a) put this javascript function in the document HEAD:
    <script type="text/javascript">
    <!--
    function transfer_agentid () {
    for (var i=0;i<document.form.agente.options.length;i++)
    if (document.form.agente.options[i].selected==true)
    document.form.agente_numero.value=document.form.agente.options[i].value;
    // -->
    </script>
    b) add an onchange event handler to the SELECT tag, example:
    select name="agente" id="agente" onchange="transfer_agentid ()"
    However I´d like to remind you that any javascript based approach is not reliable, because you don´t know whether some visitor will have javascript enabled in his/her browser.

  • Dynamic AD Security Groups (a la Exchange)

    Has the Active Directory team ever thought of making Dynamic AD Security groups like the ones in Exchange? i think it would be a good idea for the release or the next version.

    In Exchange 2013, the only groups that you can enable for mail distribution (using Exchange Management Shell - Enable-DistributionGroup cmdlet) must be configured as Universal group. They can be created in Active Directory as a security group or distribution
    group, but scope must be set to universal.
    Then use
    http://technet.microsoft.com/en-us/library/aa998916(v=exchg.150).aspx to allow it to receive email from Exchange 2013 recipients. Once you run the enable-distributiongroup against that group, all of the appropriate fields should be automatically added to
    the group.

  • Dynamic sizing of buttons

    I am working on a flex application where I want the button
    sizes to appear based on the size of the browser window and the
    resolution of the screen so I don't want to hard code the width of
    the buttons.
    <mx:Button id="submitButton" label="SQL"
    styleName="navButtonSkin"
    width="80" textAlign="center"/>
    <mx:Button id="submitButton1" label="SQL1"
    styleName="navButtonSkin"
    width="80" textAlign="center"/>
    But when I change it to:-
    <mx:Button id="submitButton" label="SQL"
    styleName="navButtonSkin"
    width="20%" textAlign="center"/>
    <mx:Button id="submitButton1" label="SQL1"
    styleName="navButtonSkin"
    width="820%" textAlign="center"/>
    It doesnt seem to work.
    Now if I change it to
    <mx:Button id="submitButton" label="SQL"
    width="{getButtonWidth()}" textAlign="center"/>
    and have a function:-
    private function getButtonWidth():int{
    var w:int = 15/100*summaryPanel.width;
    return w;
    where summaryPanel is a container holding the buttons, thats
    failing as well since in this case the summaryPanel.width always
    turns out to be zero at the time when the button sizes are
    calculated. What else can I do and how can I work around it?

    Try doing the calcualations in-line. getButtonWidth() is a
    function, and thus hard to bind to.
    <mx:Button id="submitButton" label="SQL"
    width="{15/100*summaryPanel.width}" textAlign="center"/>
    Since summaryPanel.width is reference directly in the
    binding, the compiler will automatically adjust the button's width
    for you whenever summaryPanel's width changes.

  • Photo Gallery w/ Images adjusting size based on Browser size.

    I'm new to web design but I'm trying to create a photo gallery with images that dynamically size based on the size of the browser window. Similar to this http://pageduke.com/#/Residential/Colonial%20Revival-Nashville1/1. I know th is a flsh site, but is there a way yo do it in HTML in Dreamweaver, maybe using Spry. I don't know Jquery, but is it possible that way.
    Thanks

    Nancy,
    Woo is not a gallery. It's just a slider - a panel widget, which should
    be adaptive/responsive by default. The problem is that for years, the
    typical jQuery plugin writer simply copies stuff done by others so
    someone finally realized you don't have to fix a width and a height if
    you know how to write a stub script
    Galleries are totally different. To do a responsive gallery is not so
    easy and the only ones that come remotely close - using open source
    scripts - do require an initial width. They will not scale both up and down.
    I gusess it depends on what the original poster wants and/or cares about
    in terms of efficiencies and functionality.
    [External commercial link removed]
    Message was edited by: Sudarshan Thiagarajan. Please refrain from posting external links advertising/ promoting products & services.

  • Change the "Font size" in a TLF Textfield with actionscript?

    I could not realize how should I resize my TLF Textfiels in flash cs6 with actionscript??
    None of these worked:
    if (....)
         myTLFText.textSize++;
         myTLFText.fontSize++;
    Error: Access of possibly undefined property size through a reference with static type fl.text:TLFTextField.
    I appreciate your kind help please??

    Here is the part of code I am using to resize the textfield (and other elements).
    /******SET POSITION**********/
    function setPosition():void
          //Position appBG
          appBG.height = stage.stageHeight;
          appBG.width = appBG.height;
          //Fit the appTXT in middle of screen  (AppTXT is a MovieClip contains sourceText - RTLTextField)
          appTXT.sourceText.width = stage.stageWidth * 0.9;
          appTXT.sourceText.x = stage.stageWidth * 0.05;
          appTXT.sourceText.y = stage.stageHeight * 0.1;
          //Fit the maskText layer on top of text;
          maskText.width = appTXT.sourceText.width;
          maskText.height = stage.stageHeight * 0.8;
          maskText.x = stage.stageWidth * 0.05;
          maskText.y = stage.stageHeight * 0.1;
          //Set buttons in their proper position
          if (stage.stageWidth > stage.stageHeight)
                appBG.width = stage.stageWidth;
                appBG.height = appBG.width;
          appBG.x = stage.stageWidth / 2;
          appBG.y = stage.stageHeight / 2;
    Everything works fine, but when I install the apk on my Google nexus (800x1280), the font size looks VERY SMALL and I can hardly read it!
    If I increase the Font size pt (Red Arrow in above PrntScr) to 40. then it reads perfect on phones with 800x1280 screen size. Ok?  But then any OTHER smaller screen cell phones will see the font TOO BIG!
    So I need to set the Font size pt by CODE based on a percent of stageWidth to could solve this. thx.

  • Set font size based on component size

    Hi everybody,
    This is kind of a duplicate, kind of new, because my original post is buried and I figured out a more helpful and general way to ask this question. Does anyone know if there is a way to set the size of a string as large as possible on a component, but still be able to have the whole string visible, if you're using a font other than default?
    For example:
    public static void main( String args[] ){
    try {
              JFrame frame = new JFrame( "Title" );
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              int guiWidth = width / 2;
              int guiHeight = height / 2;
              frame.setSize( guiWidth, guiHeight );
              Container pane = frame.getContentPane();
              // Create main label
              String labelString = "Test";
              JLabel label = new JLabel( labelString );
              label.setBackground( new Color( 179, 0, 0 ) );
              label.setForeground( new Color( 235, 191, 16 ) );
              label.setHorizontalAlignment( CENTER );
              label.setOpaque( true );
              label.setFont( new Font( �Old English Text MT�, 0, 48 ) );
              pane.add( label, BorderLayout.NORTH );
              frame.setLocationRelativeTo( null );
              frame.setVisible( true );
    } catch( Exception e) {
    e.printStackTrace();
         }As you can see, right now the font needs to be hard coded. I'd like it to be dynamic, based on the size of the screen the user has.
    Sorry if the partial double post annoys anybody; I figured it would be less annoying than resurrecting my old post.
    Any help on this would be great, and thank you!
    Jezzica85
    Message was edited by:
    jezzica85
    Message was edited by:
    jezzica85

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import java.awt.geom.AffineTransform;
    import javax.swing.*;
    public class DynamicFont {
        private JLabel getNorth() {
            // Create main label
            String labelString = "Test";
            final JLabel label = new JLabel( labelString ) {
                public void paint(Graphics g) {
                    ((Graphics2D)g).setRenderingHint(
                            RenderingHints.KEY_TEXT_ANTIALIASING,
                            RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
                    super.paint(g);
            label.setBackground( new Color( 179, 0, 0 ) );
            label.setForeground( new Color( 235, 191, 16 ) );
            label.setHorizontalAlignment( JLabel.CENTER );
            label.setOpaque( true );
            label.setFont( new Font( "Old English Text MT", 0, 48 ) );
            label.addComponentListener(new ComponentAdapter() {
                Font font = label.getFont();
                public void componentResized(ComponentEvent e) {
                    int w = label.getWidth();
                    int sw = label.getFontMetrics(font).stringWidth(label.getText());
                    double scale = (double)w/sw;
                    AffineTransform at = AffineTransform.getScaleInstance(scale, 1.0);
                    label.setFont(font.deriveFont(at));
                    label.repaint();
            return label;
        public static void main( String[] args ) {
            JFrame frame = new JFrame( "Title" );
            frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
            Container pane = frame.getContentPane();
            pane.add( new DynamicFont().getNorth(), BorderLayout.NORTH );
            frame.setSize( 400, 100);
            frame.setLocationRelativeTo( null );
            frame.setVisible( true );
    }

  • Trying to figure out how to get font sizes in textfield to show up right

    This is a flash question it just gets a little complicated.
    Running into a cross platform problem.
    I have a microsoft .NET application that I created to draw graphics. I put the properties of the drawn object into a database.
    I then read the properties into flash and dynamically build the objects that were drawn in microsoft.net with actionscript.
    The problem I'm running into is I'm using the Microsoft gdi+ model to draw text in my development environment with a specific font size in points.
    When I translate that over into flash, my runtime environment the font size appears smaller.
    Note:
         I'm using a textfield object and setting the htmltext property to create the text.  Then I'm using the bitmapdata object to convert
    the textfield into a bitmap.  I do this for a couple of reasons.
    I can get the fonts to match closely If I multiply the font size of the textfield by 1.50.
    For example
    var fontsize:number = DatabaseFontsize * 1.50;
    this gets my fontsize close for the textfield.
    However with certain fonts this does not work.   Any help would be appreciated
    Am I posting this in the wrong place??

    I'm having very similar issues to LarryET above. I followed the directions from TominqueBo_VZW, but I could uninstall the updates only. Even uninstalling those and reinstalling them, I have no improvement. My greatest issue is the lack of pictures from the contacts. Some show, others don't with no discernable common thread.

  • Scale grouped objects with preserving font size

    Hallo!
      I wonder whether this is possible. I would like to have two objects grouped - a square and a text, let's say at the top left corner within the square. Now i would like to "lock" the font size to 12pt. Whenever I scale and move the square, the font size remains at 12pt and is located at the top left corner within the square. Can I do this?
    Thanks,
      Ralph

    ALWAYS state WHAT VERSION of Illustrator you are using.
    Illustrator still does not provide any kind of dynamic object-connection features (connector lines, callouts, dimensions, etc.) like most decent drawing programs have for many years.
    If the rectangle and text were truly all you wanted, you could do that by simply making the text object a so-called AreaType object, and giving its frame path the stroke/fill desired. You could then simply set the AreaType Options to control placement of the text inside its frame path and scale the object at will by its bounding box handles.
    But I assume you really want more than that: You want the text object to be contained within any arbitrary multi-object group, and be able to scale the group without also scaling the text, yet retain the text object's alignment relative to a corner of the rest of the group. You could devise an awkward workaround for that, using so-called Isolation Mode. The following assumes a version recent enough to have Isolation Mode:
    1. Assume a Group containing a Rectangle, a triangle, and a text object. The Rectangle's bounds define the Group's bounds at the corner to which you want to maintain relative positioning of the text object when scaling the Group.
    1. DoubleClick the Group to put it in Isolation Mode.
    2. Select All. Deselect the text object.
    3. Group. Send to Back. Now you have a Group nested inside another Group. The outer Group contains the inner Group and the textFrame. The textFrame is not part of the inner Group.
    4. DoubleClick outside the artwork to exit Isolation Mode.
    5. Now assume you want to scale everything other than the text, and you want to maintain the position of the text relative to the upper-left corner.
    6. DoubleClick the Group to put it in Isolation Mode.
    7. Scale the inner Group by dragging (or ShiftDragging) its lower right bounding box handle.
    8. DoubleClick outside the artwork to exit Isolation Mode.
    In pre-Isolation Mode versions, the same thing can be done by using the cumbersome Group Selection Tool to "drill up" to the inner group's level.
    JET

Maybe you are looking for

  • Macbook Pro 13'' Early 2011 Power Button not responding properly after spilled drink.

    Hi Everyone I've spilled beer on my old macbook last december. I've reassembled pretty much the whole mac, cleaned the motherboard with Servisol (isopropyl alcohol) and applied new thermal compound. The mac is working (if turned on from the motherboa

  • How do I get Preview Slideshow to appear in external monitor/projector

    In Preview in Snow Leopard, I could set up a slideshow and use it for presentations through an external monitor or on a screen using a projector. I did this by dragging the Preview window onto the external monitor and then clicking on View/Slideshow.

  • WBS Field Required in T-Code F-49

    Hi All Is it Possible to Appear WBS Fileld in the Line Item of T-Code F-49 . Manoj

  • DO I NEED TO HAVE ORACLE 11G INSTALLED?

    Hi, I have never used Oracle before. I have a very basic doubt. I have a Peoplesoft Id and password. I wish to know if I need to have Oracle 11g installed on my laptop to be able to use Peoplesoft Code to create applications using an online database?

  • Report server engine (9.0.2.0.3)

    Hi all, I would like to know whether the Report server Engine is multitasking or not. I installed Oracle application server 9.0.2.03 on a NT2000 environment, and I have two server engine running. If I have 4 or more user requests and if the first rep