Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ButtonItem setIconWidth()/setIconHeight() Doesn't Work

    SmartClient Version: v8.2p_2012-04-26/PowerEdition Deployment (built 2012-04-26)

    I'm not sure why, but setting icon width/height in the following code snip does not work.

    Code:
    ButtonItem button = new ButtonItem();
                button.setWidth(50);
                button.setHeight(50);
                button.setTitle("");
                button.setPrompt("Stuff");
                button.setIcon("/path/to/my/image.png");
                button.setIconWidth(48);
                button.setIconHeight(48);
    The images I'm using are 48x48 pix.
    Attached Files
    Last edited by ls3674; 4 May 2012, 13:37.

    #2
    This API is inherited from FormItem and affects the size of FormItemIcons. Use setButtonProperties to affect the size of the button's icon.

    Comment


      #3
      For example....

      Docs don't give much depth on this.

      Comment


        #4
        setButtonProperties takes a Button. API calls on that Button instance are essentially calls on the automatically created button (same as all other similarly-named *Properties) methods.

        Comment


          #5
          So for example......................................

          Code:
          ButtonItem buttonItem = new ButtonItem();
                      buttonItem.setWidth(size);
                      buttonItem.setHeight(size);
                      buttonItem.setTitle("");
                      Button b = new Button();
                      b.setIconHeight(35);
                      b.setIconWidth(35);
                      buttonItem.setButtonProperties(b);
          For those of you out there with the same problem.

          It's confusing with that inheritance model.
          Last edited by ls3674; 4 May 2012, 14:51.

          Comment


            #6
            Is it one Button per ButtonItem? Reuse causes an exception.

            Comment


              #7
              What kind of exception are you seeing? Setting ID for instance would not be allowed..

              Comment

              Working...
              X