1. RE: Phil Russell -- EuGrid Redraw problem?
- Posted by Andy Serpa <renegade at earthling.net> Aug 26, 2002
- 388 views
Derek Parnell wrote: > Have you tried refreshWindow(theGrid)? I'm not sure if it'll work, but > its > worth a shot. > That doesn't work. repaintWindow(MainWindow) works, but with a bit of a flicker. I think it needs to be addressed in the EuGrid code -- it doesn't seem to be getting a redraw message. > ---------------- > cheers, > Derek Parnell > ----- Original Message ----- > From: "Andy Serpa" <renegade at earthling.net> > To: "EUforum" <EUforum at topica.com> > Sent: Monday, August 26, 2002 2:50 PM > Subject: Phil Russell -- EuGrid Redraw problem? > > > > First of all, let me just say what a lifesaver your EuGrid control is. > > You definitely have some Eu bucks coming your way. [$3 in fake money for > > a year of work -- not bad :) ] > > > > Anyway, here's my issue: > > > > I've made a program that uses a grid more or less as a display with no > > user interaction. Every so many seconds, a timer causes it to do some > > internal stuff (grabs stuff from internet in the background and > > processes it) and then update the grid. (The data can change rather > > radically on an update, so I just delete all the rows, then LoadData > > with the modified dataset on each update. It also uses an event handler > > to change cell colors, etc.) All that works fine, BUT the grid doesn't > > actually update itself visually unless something "happens", like a > > change of focus (specifically loss of focus of the main window, but not > > vice-versa), mouse click on the grid, etc. > > > > Problem is, the program is designed to just be "watched" (it is sort of > > like a stock-ticker), not interacted with. If you don't touch anything, > > the grid never updates, but then if you click the mouse on it or > > something, suddenly it redraws and everything is there as it should be. > > > > How can I get it to redraw automatically when the underlying data > > changes? > > > >
2. RE: Phil Russell -- EuGrid Redraw problem?
- Posted by Phil Russell <pg_russell at lineone.net> Aug 27, 2002
- 387 views
Andy, Try using repaintWindow( theGrid ) after you reload your dataset. As you have surmised, the grid is drawn differently from other windows controls - it is actually an owner-draw button, which persuades win32lib to treat it as a child control. This type of control responds to a WM_DRAWITEM rather than a WM_PAINT. If I ever get the time I was going to make a few suggestions to Derek et al to allow this sort of control to be defined more easily in win32lib, rather than down at the API level. That aside, the grid is a fully paid up win32lib control and should (hopefully) respond to the win32lib commands to redraw, resize, show, hide etc. I don't think that I made this clear in the documentation - I will remedy this in the next release. Let me know if this doesn't work. Regards, Phil PS 3 bucks is still 3 bucks more than the zero I was expecting - Thanks! Andy Serpa wrote: > > Derek Parnell wrote: > > Have you tried refreshWindow(theGrid)? I'm not sure if it'll work, but > > its > > worth a shot. > > > > That doesn't work. repaintWindow(MainWindow) works, but with a bit of a > > flicker. I think it needs to be addressed in the EuGrid code -- it > doesn't seem to be getting a redraw message. > > > > ---------------- > > cheers, > > Derek Parnell > > ----- Original Message ----- > > From: "Andy Serpa" <renegade at earthling.net> > > To: "EUforum" <EUforum at topica.com> > > Sent: Monday, August 26, 2002 2:50 PM > > Subject: Phil Russell -- EuGrid Redraw problem? > > > > > > > First of all, let me just say what a lifesaver your EuGrid control is. > > > You definitely have some Eu bucks coming your way. [$3 in fake money for > > > a year of work -- not bad :) ] > > > > > > Anyway, here's my issue: > > > > > > I've made a program that uses a grid more or less as a display with no > > > user interaction. Every so many seconds, a timer causes it to do some > > > internal stuff (grabs stuff from internet in the background and > > > processes it) and then update the grid. (The data can change rather > > > radically on an update, so I just delete all the rows, then LoadData > > > with the modified dataset on each update. It also uses an event handler > > > to change cell colors, etc.) All that works fine, BUT the grid doesn't > > > actually update itself visually unless something "happens", like a > > > change of focus (specifically loss of focus of the main window, but not > > > vice-versa), mouse click on the grid, etc. > > > > > > Problem is, the program is designed to just be "watched" (it is sort of > > > like a stock-ticker), not interacted with. If you don't touch anything, > > > the grid never updates, but then if you click the mouse on it or > > > something, suddenly it redraws and everything is there as it should be. > > > > > > How can I get it to redraw automatically when the underlying data > > > changes? > > > > > >
3. RE: Phil Russell -- EuGrid Redraw problem?
- Posted by Andy Serpa <renegade at earthling.net> Aug 27, 2002
- 391 views
Phil Russell wrote: > Andy, > > Try using repaintWindow( theGrid ) after you reload your dataset. > Yeah, that's what I ended up doing and it works ok. Just was waiting to hear what you had to say. > > PS 3 bucks is still 3 bucks more than the zero I was expecting - Thanks! > I think this control is a major contribution. I may even give you next month's bucks too...