From: hwphillips <bu...@ya...> - 2006-10-20 22:46:21
|
In pythoncard, I created a window with various widgets. Then I add a wx.grid.Grid control using CreateGrid(). The grid appears on the window with the rest of the widgets, I can put values in the cells. However, the scroll bars do not work. Also, I can not select any cell with the mouse. Help please and thanks. |
From: hwphillips <bu...@ya...> - 2006-10-21 14:50:04
|
hwphillips wrote: > In pythoncard, I created a window with various widgets. Then I add a > wx.grid.Grid control using CreateGrid(). The grid appears on the window > with the rest of the widgets, I can put values in the cells. However, > the scroll bars do not work. Also, I can not select any cell with the > mouse. Help please and thanks. > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 I used the grid in pyCard and everything works ok. I missed the sample for it at first. Still, the problem above exists, not sure why. |
From: Jussi S. <jus...@pp...> - 2006-10-22 15:54:37
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> hwphillips wrote: <blockquote cite="midehdc27$v3p$1...@se..." type="cite"> <pre wrap="">hwphillips wrote: </pre> <blockquote type="cite"> <pre wrap="">In pythoncard, I created a window with various widgets. Then I add a wx.grid.Grid control using CreateGrid(). The grid appears on the window with the rest of the widgets, I can put values in the cells. However, the scroll bars do not work. Also, I can not select any cell with the mouse. Help please and thanks. ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo <a class="moz-txt-link-freetext" href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642</a> </pre> </blockquote> <pre wrap=""><!----> I used the grid in pyCard and everything works ok. I missed the sample for it at first. Still, the problem above exists, not sure why. </pre> </blockquote> I don't quite get it when you at first say that 'everything works ok' and then say that 'the problem above exists'. Could you be more specific please:<br> <br> 1. Could your problems be environment/version related? The application in<br> <a class="moz-txt-link-freetext" href="http://personal.inet.fi/cool/operator/BPMDownload.html">http://personal.inet.fi/cool/operator/BPMDownload.html</a><br> uses the grid succesfully. BPM runs on Windows XP Home SP2 using Python 2.4.3, wxPython 2.6.3 and PythonCard 0.8.2. <br> <br> 2. If you mean that the simpleGrid demo works but your program doesn't, you should compare them to find the differencies. There's bound to be something because in this case the environment and versions are the same for simpleGrid and your program.<br> <br> 3. "the scroll bars do not work"<br> In what way? Are they not visible. Are they visible but do not react when you click the arrows or the empty space of the scroll bar. Can you drag the 'thumb'?<br> <br> 4. "I can not select any cell with the mouse"<br> When I click a cell once the rectangle showing the focused cell goes to that cell. When I now click that cell again the text in that cell is selected i.e. is shown with a different background color emphasizing the fact that the next keyboard operation modifies the whole text. If I hit delete, the text is deleted. If I enter new text it replaces the selection. Doesn't your program behave like this?<br> <br> If you mean that you want the cell value to be selected and copied somewhere when you click the cell, you need to do something like this:<br> <br> def on_ansGrid_leftClick(self, event):<br> print 'ansGrid leftClick'<br> r = event.GetRow()<br> c = event.GetCol()<br> print 'r, c', r, c<br> aCM1 = self.fr.test.items[self.fr.currItm].ansCount - 1<br> last = aCM1 / self.columns<br> if r > last:<br> print 'r>last', r, last<br> elif r == last:<br> last = aCM1 % self.columns<br> if c > last:<br> print 'c>last', c, last<br> else:<br> print 'set text'<br> self.components.ansField.text = self.components.ansGrid.GetCellValue(r, c)<br> self.components.ansField.SetFocus()<br> #event.Skip() <br> <br> <br> Cheers,<br> <br> Jussi<br> <br> <pre class="moz-signature" cols="72">-- Jussi Salmela <a class="moz-txt-link-freetext" href="http://personal.inet.fi/cool/operator/">http://personal.inet.fi/cool/operator/</a> </pre> </body> </html> |
From: Jussi S. <jus...@pp...> - 2006-10-23 20:19:36
|
I repost my answer because I first sent it using HTML causing it to get garbled in the archives. Sorry! hwphillips wrote: > hwphillips wrote: > >> In pythoncard, I created a window with various widgets. Then I add a >> wx.grid.Grid control using CreateGrid(). The grid appears on the window >> with the rest of the widgets, I can put values in the cells. However, >> the scroll bars do not work. Also, I can not select any cell with the >> mouse. Help please and thanks. >> >> >> ------------------------------------------------------------------------- >> Using Tomcat but need to do more? Need to support web services, security? >> Get stuff done quickly with pre-integrated technology to make your job easier >> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >> > > I used the grid in pyCard and everything works ok. I missed the sample > for it at first. Still, the problem above exists, not sure why. > > I don't quite get it when you at first say that 'everything works ok' and then say that 'the problem above exists'. Could you be more specific please: 1. Could your problems be environment/version related? The application in http://personal.inet.fi/cool/operator/BPMDownload.html uses the grid successfully. BPM runs on Windows XP Home SP2 using Python 2.4.3, wxPython 2.6.3 and PythonCard 0.8.2. 2. If you mean that the simpleGrid demo works but your program doesn't, you should compare them to find the differences. There's bound to be something because in this case the environment and versions are the same for simpleGrid and your program. 3. "the scroll bars do not work" In what way? Are they not visible. Are they visible but do not react when you click the arrows or the empty space of the scroll bar. Can you drag the 'thumb'? 4. "I can not select any cell with the mouse" When I click a cell once the rectangle showing the focused cell goes to that cell. When I now click that cell again the text in that cell is selected i.e. is shown with a different background color emphasizing the fact that the next keyboard operation modifies the whole text. If I hit delete, the text is deleted. If I enter new text it replaces the selection. Doesn't your program behave like this? If you mean that you want the cell value to be selected and copied somewhere when you click the cell, you need to do something like this: def on_ansGrid_leftClick(self, event): print 'ansGrid leftClick' r = event.GetRow() c = event.GetCol() print 'r, c', r, c aCM1 = self.fr.test.items[self.fr.currItm].ansCount - 1 last = aCM1 / self.columns if r > last: print 'r>last', r, last elif r == last: last = aCM1 % self.columns if c > last: print 'c>last', c, last else: print 'set text' self.components.ansField.text = self.components.ansGrid.GetCellValue(r, c) self.components.ansField.SetFocus() #event.Skip() Cheers, Jussi -- Jussi Salmela http://personal.inet.fi/cool/operator/ |
From: hwphillips <bu...@ya...> - 2006-10-24 22:37:49
|
Jussi Salmela wrote: > I repost my answer because I first sent it using HTML causing it to get > garbled in the archives. > > Sorry! > > hwphillips wrote: > >>hwphillips wrote: >> >> >>>In pythoncard, I created a window with various widgets. Then I add a >>>wx.grid.Grid control using CreateGrid(). The grid appears on the window >>>with the rest of the widgets, I can put values in the cells. However, >>>the scroll bars do not work. Also, I can not select any cell with the >>>mouse. Help please and thanks. >>> >>> >>>------------------------------------------------------------------------- >>>Using Tomcat but need to do more? Need to support web services, security? >>>Get stuff done quickly with pre-integrated technology to make your job easier >>>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >>>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >>> >> >>I used the grid in pyCard and everything works ok. I missed the sample >>for it at first. Still, the problem above exists, not sure why. >> >> > > > I don't quite get it when you at first say that 'everything works ok' > and then say that 'the problem above exists'. Could you be more specific > please: > > 1. Could your problems be environment/version related? The application in > http://personal.inet.fi/cool/operator/BPMDownload.html > uses the grid successfully. BPM runs on Windows XP Home SP2 using Python > 2.4.3, wxPython 2.6.3 and PythonCard 0.8.2. I meant that when I add a grid outside of python card, not in pythoncard > > 2. If you mean that the simpleGrid demo works but your program doesn't, > you should compare them to find the differences. There's bound to be > something because in this case the environment and versions are the same > for simpleGrid and your program. The demo does not refer to a grid created outside of pythoncard > > 3. "the scroll bars do not work" > In what way? Are they not visible. Are they visible but do not react > when you click the arrows or the empty space of the scroll bar. Can you > drag the 'thumb'? The grid is there completely, but I couldnot select cells or move the scroll bars. > > 4. "I can not select any cell with the mouse" > When I click a cell once the rectangle showing the focused cell goes to > that cell. When I now click that cell again the text in that cell is > selected i.e. is shown with a different background color emphasizing the > fact that the next keyboard operation modifies the whole text. If I hit > delete, the text is deleted. If I enter new text it replaces the > selection. Doesn't your program behave like this? no > > If you mean that you want the cell value to be selected and copied > somewhere when you click the cell, you need to do something like this: > > def on_ansGrid_leftClick(self, event): > print 'ansGrid leftClick' > r = event.GetRow() > c = event.GetCol() > print 'r, c', r, c > aCM1 = self.fr.test.items[self.fr.currItm].ansCount - 1 > last = aCM1 / self.columns > if r > last: > print 'r>last', r, last > elif r == last: > last = aCM1 % self.columns > if c > last: > print 'c>last', c, last > else: > print 'set text' > self.components.ansField.text = > self.components.ansGrid.GetCellValue(r, c) > self.components.ansField.SetFocus() > #event.Skip() > > > Cheers, > > Jussi > I suppose this really was a wxwidgets question since the pycard grid works perfectly, but the grid I created outside of pythoncard did not. Thanks |