Aquabutton - size

Hi Andrea,

When I don't have an appropriate item I pass wx.NullBitmap to Aquabutton.

However this creates a button which is a bit higher then others.

This is due to the code in DoGetBestSize:

         bmpWidth = bmpHeight = 0
         constant = 30
         if self._bitmap:
             bmpWidth, bmpHeight = self._bitmap.GetWidth()+10, self._bitmap.GetHeight()
             retWidth += bmpWidth
             retHeight = max(bmpHeight, retHeight)
             constant = 24

I suggest to change it to:

         bmpWidth = bmpHeight = 0
         constant = 24
         if self._bitmap:
             bmpWidth, bmpHeight = self._bitmap.GetWidth()+10, self._bitmap.GetHeight()
             retWidth += bmpWidth
             retHeight = max(bmpHeight, retHeight)

Werner

Hi Werner,

···

On 9 November 2011 11:57, werner wrote:

Hi Andrea,

When I don’t have an appropriate item I pass wx.NullBitmap to Aquabutton.

However this creates a button which is a bit higher then others.

This is due to the code in DoGetBestSize:

    bmpWidth = bmpHeight = 0

    constant = 30

    if self._bitmap:

        bmpWidth, bmpHeight = self._bitmap.GetWidth()+10, self._bitmap.GetHeight()

        retWidth += bmpWidth

        retHeight = max(bmpHeight, retHeight)

        constant = 24

I suggest to change it to:

    bmpWidth = bmpHeight = 0

    constant = 24

    if self._bitmap:

        bmpWidth, bmpHeight = self._bitmap.GetWidth()+10, self._bitmap.GetHeight()

        retWidth += bmpWidth

        retHeight = max(bmpHeight, retHeight)

Good catch, I’ll apply it when I get back home this evening.

Thank you!

Andrea.

“Imagination Is The Only Weapon In The War Against Reality.”

http://xoomer.alice.it/infinity77/

Thank you!

Werner
···

On 11/09/2011 12:27 PM, Andrea Gavana wrote:

Hi Werner,

On 9 November 2011 11:57, werner wrote:

Hi Andrea,

      When I don't have an appropriate item I pass wx.NullBitmap to

Aquabutton.

      However this creates a button which is a bit higher then

others.

      This is due to the code in DoGetBestSize:



             bmpWidth = bmpHeight = 0

             constant = 30

             if self._bitmap:

                 bmpWidth, bmpHeight = self._bitmap.GetWidth()+10,

self._bitmap.GetHeight()

                 retWidth += bmpWidth

                 retHeight = max(bmpHeight, retHeight)

                 constant = 24



      I suggest to change it to:



             bmpWidth = bmpHeight = 0

             constant = 24

             if self._bitmap:

                 bmpWidth, bmpHeight = self._bitmap.GetWidth()+10,

self._bitmap.GetHeight()

                 retWidth += bmpWidth

                 retHeight = max(bmpHeight, retHeight)
      Good catch, I'll apply it when I get back home this

evening.

Thank you!

Hi Werner,

···

On 9 November 2011 14:10, werner wrote:

On 11/09/2011 12:27 PM, Andrea Gavana wrote:

Hi Werner,

On 9 November 2011 11:57, werner wrote:

Hi Andrea,

      When I don't have an appropriate item I pass wx.NullBitmap to

Aquabutton.

      However this creates a button which is a bit higher then

others.

      This is due to the code in DoGetBestSize:



             bmpWidth = bmpHeight = 0

             constant = 30

             if self._bitmap:

                 bmpWidth, bmpHeight = self._bitmap.GetWidth()+10,

self._bitmap.GetHeight()

                 retWidth += bmpWidth

                 retHeight = max(bmpHeight, retHeight)

                 constant = 24



      I suggest to change it to:



             bmpWidth = bmpHeight = 0

             constant = 24

             if self._bitmap:

                 bmpWidth, bmpHeight = self._bitmap.GetWidth()+10,

self._bitmap.GetHeight()

                 retWidth += bmpWidth

                 retHeight = max(bmpHeight, retHeight)
      Good catch, I'll apply it when I get back home this

evening.

Thank you!

Thank you!

Done, updated in SVN.

Andrea.

“Imagination Is The Only Weapon In The War Against Reality.”

http://xoomer.alice.it/infinity77/