×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    9

    Smile Theme is not getting refelected on the form

    Hi

    Iam developing the Midlet Mobile application on S60 platfrom,
    The scenario is when we increase the height of the form through the code dynamically the theme is not getting refelected on the form when we scrolle down.

    Thanks in advance for the souliton.

    Regards
    Shankar.K

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: Theme is not getting refelected on the form

    Quote Originally Posted by shankars60 View Post
    Hi

    when we increase the height of the form through the code dynamically
    Hi,
    Please can you tell us how you are increasing the height dynamically...Can you put the code here..

    As far as I know first way to create the form..
    public Form(String title)
    and another is
    public Form(String title,Item[] items).

    What I know you can only increase the size of the form by keep on adding the items..thats all..please tell me how you are creating the dynamic form
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    9

    Re: Theme is not getting refelected on the form

    Hi

    We are using the custom item in the form, so we are drawing the form with items. Theme is not refelcitng for exceeding height while the item exceeds the prefered form height.

    Regards
    Shankar.k
    package com.arteriatech.coil.nokia;


    import java.io.IOException;
    import javax.microedition.lcdui.Canvas;
    import javax.microedition.lcdui.CustomItem;
    import javax.microedition.lcdui.Font;
    import javax.microedition.lcdui.Form;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;

    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */


    public class Item_CUI extends CustomItem{

    Form f = new Form("");
    Font font1 = Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM);
    Font font2 = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL);
    Image logo, title_img;
    String[][] detail =null;
    String hdr_label=null;

    public Item_CUI(String[][] details,Image img,String hdr_label) {
    super("");
    try {
    this.logo = Image.createImage("/test6.gif");
    this.title_img = img;
    this.hdr_label=hdr_label;
    this.detail=details;
    } catch (Exception ex) {
    System.out.println(" Exception in CUI Image");
    }
    }

    protected int getMinContentWidth() {
    return f.getWidth();
    }

    protected int getMinContentHeight() {
    System.out.println(" MIn content height :"+f.getHeight());

    int height=logo.getHeight()+title_img.getHeight()+(detail.length*28)+10;
    return height;
    }

    protected int getPrefContentWidth(int arg0) {
    System.out.println(" pref content length :"+f.getWidth());
    return f.getWidth();
    }

    protected int getPrefContentHeight(int arg0) {
    System.out.println(" pref content height :"+f.getHeight());
    return f.getHeight();
    }

    public boolean traverse(int dir, int vw, int vh, int[] risrect) {
    if(dir == Canvas.DOWN)
    yy = 20;
    if(dir == Canvas.UP)
    yy = 50;

    repaint();
    return false;
    }

    public void traverseOut() {
    repaint();
    System.out.println("traverse out");
    }
    public static int max(int[] t) {
    int maximum = t[0]; // start with the first value
    for (int i=1; i<t.length; i++) {
    if (t[i] > maximum) {
    maximum = t[i]; // new maximum
    }
    }
    return maximum;
    }

    private int yy = 20;

    protected void paint(Graphics g, int w, int h) {

    int[] arr=new int[detail.length];
    for(int i=0;i<detail.length;i++){
    arr[i]= font1.stringWidth(detail[i][0]);
    }
    int maxlength=max(arr);

    yy = 20;
    g.drawImage(logo, 0, 0, 0);


    g.setFont(font1);
    g.drawString(hdr_label , title_img.getWidth()+5, yy, g.LEFT|g.TOP);

    y+=font1.getHeight()+2;
    }

    }
    }

Similar Threads

  1. second form not getting key events
    By krsunil in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-12-10, 10:29
  2. Form troubles
    By matdodgson in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-12-06, 10:49
  3. Theme Template for Nokia E61?
    By czoth in forum Streaming and Video
    Replies: 22
    Last Post: 2007-03-01, 13:22
  4. Theme Studio 3 and n90 / n70 Problems
    By Ezz666 in forum Streaming and Video
    Replies: 0
    Last Post: 2006-02-04, 13:18

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×