Making ProgressDialog adapt its size to the message

I'm using ProgressDialog but when the message I update is bigger than the original dialog size it overflows the area and gets cut. If I call progress.Fit() then it will jump quickly with each update, but I want to make it bigger only.

On top of that, the call to Fit() seems to mess up the space around the time estimation texts. What can I do to make it look ok?

···

--
Rastertech España S.A.
  Grzegorz Adam Hankiewicz
/Jefe de Producto TeraVial/

C/ Perfumería 21. Nave I. Polígono industrial La Mina
28770 Colmenar Viejo. Madrid (España)
Tel. +34 918 467 390 (Ext.17) *·* Fax +34 918 457 889
ghankiewicz@rastertech.es *·* www.rastertech.es <http://www.rastertech.es/>

Grzegorz Adam Hankiewicz wrote:

I'm using ProgressDialog but when the message I update is bigger than the original dialog size it overflows the area and gets cut. If I call progress.Fit() then it will jump quickly with each update, but I want to make it bigger only.

Before calling Fit you can use GetBestSize() and see if it is larger than the current size.

On top of that, the call to Fit() seems to mess up the space around the time estimation texts. What can I do to make it look ok?

In what way is it messed up?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Grzegorz Adam Hankiewicz wrote:

On top of that, the call to Fit() seems to mess up the space around the time estimation texts. What can I do to make it look ok?

In what way is it messed up?

Attached screenshots. I made the process call Fit() only after a few files so I could capture the differences. The bad one shows the time texts moving too far to the left, and Fit() doesn't seem to take into account the size of the filename, which ends in .jpg but is cut and only .jp is seen.

It seems that the main idea for the dialog size is to take the progress bar and add about 10/15 pixels left right for spacing. Well, the texts don't respect that spacing, something is broken with them. This is with 2.8.4.0 MSW.

My expectations for the width of the dialog would be:

   min(progress_bar_min_size, max([text_length1, text_length2, ...]))
     + border left + border right.

Right know it looks like:

   border left + border right + progress_bar_min_size

The progress bar in the demo looks much better, I wonder if that is because the cancel button is made visible.

···

--
     Rastertech España S.A.
  Grzegorz Adam Hankiewicz
/Jefe de Producto TeraVial/

C/ Perfumería 21. Nave I. Polígono industrial La Mina
28770 Colmenar Viejo. Madrid (España)
Tel. +34 918 467 390 (Ext.17) *·* Fax +34 918 457 889
ghankiewicz@rastertech.es *·* www.rastertech.es
<http://www.rastertech.es/&gt;

Grzegorz Adam Hankiewicz wrote:

Robin Dunn wrote:

Grzegorz Adam Hankiewicz wrote:

On top of that, the call to Fit() seems to mess up the space around the time estimation texts. What can I do to make it look ok?

In what way is it messed up?

Attached screenshots. I made the process call Fit() only after a few files so I could capture the differences. The bad one shows the time texts moving too far to the left, and Fit() doesn't seem to take into account the size of the filename, which ends in .jpg but is cut and only .jp is seen.

It seems that the main idea for the dialog size is to take the progress bar and add about 10/15 pixels left right for spacing. Well, the texts don't respect that spacing, something is broken with them. This is with 2.8.4.0 MSW.

My expectations for the width of the dialog would be:

  min(progress_bar_min_size, max([text_length1, text_length2, ...]))
    + border left + border right.

Right know it looks like:

  border left + border right + progress_bar_min_size

The progress bar in the demo looks much better, I wonder if that is because the cancel button is made visible.

I have seen this too in earlier releases (also on MSW). I just cheat by using a long text when initializing the dialog, not ideal but it does the trick.

Werner

Grzegorz Adam Hankiewicz wrote:

My expectations for the width of the dialog would be:

   min(progress_bar_min_size, max([text_length1, text_length2, ...]))
     + border left + border right.

Sorry, it should be max(progress_bar_min_size, ...), otherwise zero length texts would make the dialog have zero width.

Also, I added a cancel button and it doesn't help at all, texts still get wrong.

···

--
     Rastertech España S.A.
  Grzegorz Adam Hankiewicz
/Jefe de Producto TeraVial/

C/ Perfumería 21. Nave I. Polígono industrial La Mina
28770 Colmenar Viejo. Madrid (España)
Tel. +34 918 467 390 (Ext.17) *·* Fax +34 918 457 889
ghankiewicz@rastertech.es *·* www.rastertech.es
<http://www.rastertech.es/&gt;