Discussion:
[Bitpim-devel] diff for status bar
Richard Seymour
2004-02-02 16:19:11 UTC
Permalink
I noticed on the latest CVS (and earlier) that the status bar was a bit
messed up. Poking around, I saw that rect=self.GetFieldRect() wasn't
returning the proper field widths for variable width fields. It seemed
to in fact be providing the -int. It would be cool if it came back with
-actualwidth, but it doesn't. So I just moved the variable width fields
all the way to the right and voila. Anyway, here is the diff to
guiwidgets.py:

Index: guiwidgets.py
===================================================================
RCS file: /cvsroot/bitpim/bitpim/guiwidgets.py,v
retrieving revision 1.123
diff -r1.123 guiwidgets.py
988c988
< self.SetStatusWidths( [200, -5, 180, -20] )
---
self.SetStatusWidths( [200, 180, -1, -4] ) # 20/5 ...
1005,1006c1005,1006
< rect=self.GetFieldRect(2)
< self.gauge.SetPosition(wxPoint(rect.x+2, rect.y+2))
---
rect=self.GetFieldRect(1)
self.gauge.SetPosition(wxPoint(rect.x+2, rect.y+4)) # +4
looks better?
1021c1021
< self.SetStatusText(str,1)
---
self.SetStatusText(str,2)
-Rich
(sorry if this double posts, I accidentally sent from the wrong email
address at first)
Roger Binns
2004-02-03 00:59:59 UTC
Permalink
Post by Richard Seymour
messed up. Poking around, I saw that rect=self.GetFieldRect() wasn't
returning the proper field widths for variable width fields.
Which platform? It is fine for Windows. It does look like Linux is
somewhat screwed up. It didn't used to be. That code is based on
the wxStatusBar in the demo.
Post by Richard Seymour
So I just moved the variable width fields all the way to the right
and voila.
It does confuse things though (actually it confuses them more :-) )

There are two forms of progress, referred to as progressmajor and
progressminor in the code. (Sometimes I actually need another
level as well to be accurate).

Major tracks big picture stuff. eg when you do getdata, the boxes
you tick are major items. The progress for that is shown using
digits (eg 2/3 Wallpaper).

The minor stuff tracks small things. For example it shows the
progress in retrieving an individual file. You can already
see how it is all confused. I have a major sequence
(phonebook, calendar, wallpaper, ringtones ... more to come in the
future such as call log, sms etc). We have a minor sequence
(eg if retrieving wallpapers, there may be 15 files we are getting).
There is another sequence (eg progress in getting an individual
wallpaper file).

The display in the statusbar tries to put them in order. Your patch
disrupts the order, but it was somewhat screwy anyway.

I am welcome to suggestions. The only constraint is that the first
field has to be pretty large and is where the menus display their
help text. You cannot change which field they do it in.

Roger
Richard Seymour
2004-02-03 15:11:54 UTC
Permalink
Post by Roger Binns
Post by Richard Seymour
messed up. Poking around, I saw that rect=self.GetFieldRect() wasn't
returning the proper field widths for variable width fields.
Which platform? It is fine for Windows. It does look like Linux is
somewhat screwed up. It didn't used to be. That code is based on
the wxStatusBar in the demo.
I would bet it is a Linux only problem. I'm using wxPython 2.4.2.4 and
python 2.3.3. I have a feeling that it is returning useful information
with the rect=self.GetFieldRect(1) on windows, but not on Linux. Maybe
linux is returning the scaling value which you then multiply times the
window width... I don't really know.

-Rich

Loading...