enthought/enaml — pull request #25 by rkern (2011-11-14 15:36:37+00:00)
Title: Progress bar

Here is a ProgressBar. It's pretty basic for the moment; only horizontal, no particular styling to speak of. There are a couple of issues we should work out first:

* wx.Gauge controls don't allow a changeable minimum. This is surprisingly fairly sensible (no one is actually going to set a minimum, I don't think), so we may want to follow wx's example here. Currently, I just followed Qt's API allowing one to set both a minimum and the maximum.

* We could add the vertical orientation, too. Do we want Qt's inverted mode too (right-to-left or top-to-bottom, depending on the orientation)? Or is that more flexibility than we really need right now?

* Progress bars on OS X never include text as part of the widget itself. Windows and various styles on Linux do their own percentage computation and show "X%" either on the widget or to the side. I have not customized this at all. I lean towards turning this off on all styles and letting people do their own Labels. Not least, the percentage computed by the widget may differ in rounding from the .percentage trait I expose on the component itself. I do special rounding for values that are 99.% such that it never says that it is 100% until it is actually completely finished. Allowing one to set custom text from Enaml would be tricky. Qt uses templates with its own format codes, like "%p" for percentage but no special escaping for raw "%" characters, that would be difficult to deal with. You cannot just set some text, unfortunately.

* And that special rounding is also up for discussion.