×

Discussion Board

Results 1 to 2 of 2

Hybrid View

  1. #1
    Registered User
    Join Date
    Jan 2013
    Posts
    1

    Possible bug in "Series 40 UI Component Demos" example code with Button height

    Hello,

    I am going through the example code here:

    https://projects.developer.nokia.com/s40uivisualisation

    and cannot seem to get the buttons in com.nokia.uihelpers\Button.java to resize properly for height. It works fine for width, but putting in different initial values in this constructor for height doesn't seem have any affect at all:
    public Button(String label, int x, int y, int width, int height, int type) {

    It seems that the public void render(Graphics g, int index, int count) method does not take into account height. The button clickable area seems to be ok, but the actual button image is not expanded for height. I am guessing it is a problem with this code here, in which it seems to take width into account when drawing button but not height.

    g.drawImage(leftImage, 0, 0, Graphics.TOP | Graphics.LEFT);
    for (int i = leftImage.getWidth(); i <= width - rightImage.getWidth(); i++) {
    g.drawImage(centerImage, i, 0, Graphics.TOP | Graphics.LEFT);
    }
    g.drawImage(rightImage, width, 0, Graphics.TOP | Graphics.RIGHT);

    I am running on the latest Nokia SDK 2.0 for Java, Nokia IDE for Java ME v1.

    Please let me know if you can think of a fix for this sample code, as I am using it as an example for my own code. Thanks!

  2. #2
    Registered User
    Join Date
    Oct 2012
    Posts
    1

    Re: Possible bug in "Series 40 UI Component Demos" example code with Button height

    you need make the button with canvas

Similar Threads

  1. Cannot Update "Nokia Series 40 Web Tools Component"
    By ossi1967 in forum Nokia Asha Web Apps
    Replies: 3
    Last Post: 2012-04-11, 15:17
  2. How to "freeze" code execution in "onClicked" slot?
    By evgeny_123 in forum [Archived] Qt Quick
    Replies: 7
    Last Post: 2011-02-24, 12:06
  3. how to change text of "select" and "cancel" button of menu system
    By bigboy0918 in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-11-21, 06:44
  4. the "Ok" button on Series 60
    By white_dragon in forum Symbian
    Replies: 1
    Last Post: 2004-08-15, 17:44

Posting Permissions

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