Hello!
I have a table with some rows and cells (code at the end), and created
a function which searches for text inside the cells and returns the
row number where the text is (to simplify the example, only English
Name is working). Then, it should set the grid cursor focus to that
row (I want to use the wx.grid.Grid.SelectRows style when created the
wx.Grid, but to reduce the number of variables I don't use it in the
example). To set the cursor focus, I am using
def OnSearch(self, event):
CommonName = self.CommonNameTXT.GetValue()
if CommonName != '':
ind = self.parent.EnglishNameList.index(CommonName)
self.parent.SpeciesGrid.SetGridCursor(ind, 0)
self.parent.SpeciesGrid.MakeCellVisible(ind,0)
Theoretically, it should work using only the SetGridCursor method,
however somewhere I have read that it will not work unless you also
use the MaceCellVisible method as well. Anyway, it does not work at
all. Can anyone help?
Hello!
Can anyone help, please? This is a very important feature for my application ...
Thank you so much!
Dani
···
On 09/22/2010 08:45 PM, acrocephalus wrote:
Hello!
I have a table with some rows and cells (code at the end), and created
a function which searches for text inside the cells and returns the
row number where the text is (to simplify the example, only English
Name is working). Then, it should set the grid cursor focus to that
row (I want to use the wx.grid.Grid.SelectRows style when created the
wx.Grid, but to reduce the number of variables I don't use it in the
example). To set the cursor focus, I am using
def OnSearch(self, event):
CommonName = self.CommonNameTXT.GetValue()
if CommonName != '':
ind = self.parent.EnglishNameList.index(CommonName)
self.parent.SpeciesGrid.SetGridCursor(ind, 0)
self.parent.SpeciesGrid.MakeCellVisible(ind,0)
Theoretically, it should work using only the SetGridCursor method,
however somewhere I have read that it will not work unless you also
use the MaceCellVisible method as well. Anyway, it does not work at
all. Can anyone help?
Si no �s del tot necessari, no imprimeixis aquest missatge. Si ho fas utilitza paper 100% reciclat i blanquejat sense clor. D'aquesta manera ajudar�s a estalviar aigua, energia i recursos forestals. GR�CIES!
Do not print this message unless it is absolutely necessary. If you must print it, please use 100% recycled paper whitened without chlorine. By doing so, you will save water, energy and forest resources. THANK YOU!
It's working for me. What platform and version are you using? Please make a small runnable sample that demonstrates the problem. MakingSampleApps - wxPyWiki
···
On 9/23/10 3:15 PM, Dani Valverde wrote:
Hello!
Can anyone help, please? This is a very important feature for my
application ...
Thank you so much!
Dani
On 09/22/2010 08:45 PM, acrocephalus wrote:
Hello!
I have a table with some rows and cells (code at the end), and created
a function which searches for text inside the cells and returns the
row number where the text is (to simplify the example, only English
Name is working). Then, it should set the grid cursor focus to that
row (I want to use the wx.grid.Grid.SelectRows style when created the
wx.Grid, but to reduce the number of variables I don't use it in the
example). To set the cursor focus, I am using
def OnSearch(self, event):
CommonName = self.CommonNameTXT.GetValue()
if CommonName != '':
ind = self.parent.EnglishNameList.index(CommonName)
self.parent.SpeciesGrid.SetGridCursor(ind, 0)
self.parent.SpeciesGrid.MakeCellVisible(ind,0)
Theoretically, it should work using only the SetGridCursor method,
however somewhere I have read that it will not work unless you also
use the MaceCellVisible method as well. Anyway, it does not work at
all. Can anyone help?
Oops! I forgot to attach the runnable example. Sorry, find it attached. Please, note that only the English Name control is working. It returns the correct row number to the terminal, but it doesn't set the cursor focus to any row. I am using Linux Ubuntu Lucid Lynx, Python 2.6.5 and wx.python 2.8.11. I hope it helps.
Cheers!
Hello!
Can anyone help, please? This is a very important feature for my
application ...
Thank you so much!
Dani
On 09/22/2010 08:45 PM, acrocephalus wrote:
Hello!
I have a table with some rows and cells (code at the end), and created
a function which searches for text inside the cells and returns the
row number where the text is (to simplify the example, only English
Name is working). Then, it should set the grid cursor focus to that
row (I want to use the wx.grid.Grid.SelectRows style when created the
wx.Grid, but to reduce the number of variables I don't use it in the
example). To set the cursor focus, I am using
def OnSearch(self, event):
CommonName = self.CommonNameTXT.GetValue()
if CommonName != '':
ind = self.parent.EnglishNameList.index(CommonName)
self.parent.SpeciesGrid.SetGridCursor(ind, 0)
self.parent.SpeciesGrid.MakeCellVisible(ind,0)
Theoretically, it should work using only the SetGridCursor method,
however somewhere I have read that it will not work unless you also
use the MaceCellVisible method as well. Anyway, it does not work at
all. Can anyone help?
It's working for me. What platform and version are you using? Please make a small runnable sample that demonstrates the problem. MakingSampleApps - wxPyWiki
Si no �s del tot necessari, no imprimeixis aquest missatge. Si ho fas utilitza paper 100% reciclat i blanquejat sense clor. D'aquesta manera ajudar�s a estalviar aigua, energia i recursos forestals. GR�CIES!
Do not print this message unless it is absolutely necessary. If you must print it, please use 100% recycled paper whitened without chlorine. By doing so, you will save water, energy and forest resources. THANK YOU!
Hello!
Can anyone help, please? This is a very important feature for my
application ...
Thank you so much!
Dani
On 09/22/2010 08:45 PM, acrocephalus wrote:
Hello!
I have a table with some rows and cells (code at the end), and created
a function which searches for text inside the cells and returns the
row number where the text is (to simplify the example, only English
Name is working). Then, it should set the grid cursor focus to that
row (I want to use the wx.grid.Grid.SelectRows style when created the
wx.Grid, but to reduce the number of variables I don't use it in the
example). To set the cursor focus, I am using
def OnSearch(self, event):
CommonName = self.CommonNameTXT.GetValue()
if CommonName != '':
ind = self.parent.EnglishNameList.index(CommonName)
self.parent.SpeciesGrid.SetGridCursor(ind, 0)
self.parent.SpeciesGrid.MakeCellVisible(ind,0)
Theoretically, it should work using only the SetGridCursor method,
however somewhere I have read that it will not work unless you also
use the MaceCellVisible method as well. Anyway, it does not work at
all. Can anyone help?
It's working for me. What platform and version are you using? Please make a small runnable sample that demonstrates the problem. MakingSampleApps - wxPyWiki
Oops! I forgot to attach the runnable example. Sorry, find it attached. Please, note that only the English Name control is working. It returns the correct row number to the terminal, but it doesn't set the cursor focus to any row. I am using Linux Ubuntu Lucid Lynx, Python 2.6.5 and wx.python 2.8.11. I hope it helps.
Cheers!
Si no �s del tot necessari, no imprimeixis aquest missatge. Si ho fas utilitza paper 100% reciclat i blanquejat sense clor. D'aquesta manera ajudar�s a estalviar aigua, energia i recursos forestals. GR�CIES!
Do not print this message unless it is absolutely necessary. If you must print it, please use 100% recycled paper whitened without chlorine. By doing so, you will save water, energy and forest resources. THANK YOU!
Ah, you didn't mention that you are using row selection mode...
SetGridCursor is moving the cursor (the thicker lines around the current cell) just as the code is telling it to, it just isn't moving the row selection. And since the grid does not have the focus (the Search button does) you can't see the cursor moving because it is only drawn when the grid has the focus. Adding this to your OnSelectCell method will make it work more like what you are expecting:
self.SpeciesGrid.SelectRow(self.row)
···
On 9/23/10 5:21 PM, Dani Valverde wrote:
On 09/24/2010 12:47 AM, Robin Dunn wrote:
On 9/23/10 3:15 PM, Dani Valverde wrote:
Hello!
Can anyone help, please? This is a very important feature for my
application ...
Thank you so much!
Dani
On 09/22/2010 08:45 PM, acrocephalus wrote:
Hello!
I have a table with some rows and cells (code at the end), and created
a function which searches for text inside the cells and returns the
row number where the text is (to simplify the example, only English
Name is working). Then, it should set the grid cursor focus to that
row (I want to use the wx.grid.Grid.SelectRows style when created the
wx.Grid, but to reduce the number of variables I don't use it in the
example). To set the cursor focus, I am using
def OnSearch(self, event):
CommonName = self.CommonNameTXT.GetValue()
if CommonName != '':
ind = self.parent.EnglishNameList.index(CommonName)
self.parent.SpeciesGrid.SetGridCursor(ind, 0)
self.parent.SpeciesGrid.MakeCellVisible(ind,0)
Theoretically, it should work using only the SetGridCursor method,
however somewhere I have read that it will not work unless you also
use the MaceCellVisible method as well. Anyway, it does not work at
all. Can anyone help?
It's working for me. What platform and version are you using? Please
make a small runnable sample that demonstrates the problem. MakingSampleApps - wxPyWiki
Oops! I forgot to attach the runnable example. Sorry, find it attached.
Please, note that only the English Name control is working. It returns
the correct row number to the terminal, but it doesn't set the cursor
focus to any row. I am using Linux Ubuntu Lucid Lynx, Python 2.6.5 and
wx.python 2.8.11. I hope it helps.
Thank you so much. Not it sets the cursor focus properly. However, if the searched string is outside the visible region, it does not scroll the grid to this row. For example, in the new example I provide, if you search for the "Killdeer", which is outside the visible area, it focuses the focus on the row of interest but it does not scroll the grid to make it visible, you have to do it manually. It it possible to make the grid behave like this?
Cheers!
Hello!
Can anyone help, please? This is a very important feature for my
application ...
Thank you so much!
Dani
On 09/22/2010 08:45 PM, acrocephalus wrote:
Hello!
I have a table with some rows and cells (code at the end), and created
a function which searches for text inside the cells and returns the
row number where the text is (to simplify the example, only English
Name is working). Then, it should set the grid cursor focus to that
row (I want to use the wx.grid.Grid.SelectRows style when created the
wx.Grid, but to reduce the number of variables I don't use it in the
example). To set the cursor focus, I am using
def OnSearch(self, event):
CommonName = self.CommonNameTXT.GetValue()
if CommonName != '':
ind = self.parent.EnglishNameList.index(CommonName)
self.parent.SpeciesGrid.SetGridCursor(ind, 0)
self.parent.SpeciesGrid.MakeCellVisible(ind,0)
Theoretically, it should work using only the SetGridCursor method,
however somewhere I have read that it will not work unless you also
use the MaceCellVisible method as well. Anyway, it does not work at
all. Can anyone help?
It's working for me. What platform and version are you using? Please
make a small runnable sample that demonstrates the problem. MakingSampleApps - wxPyWiki
Oops! I forgot to attach the runnable example. Sorry, find it attached.
Please, note that only the English Name control is working. It returns
the correct row number to the terminal, but it doesn't set the cursor
focus to any row. I am using Linux Ubuntu Lucid Lynx, Python 2.6.5 and
wx.python 2.8.11. I hope it helps.
Ah, you didn't mention that you are using row selection mode...
SetGridCursor is moving the cursor (the thicker lines around the current cell) just as the code is telling it to, it just isn't moving the row selection. And since the grid does not have the focus (the Search button does) you can't see the cursor moving because it is only drawn when the grid has the focus. Adding this to your OnSelectCell method will make it work more like what you are expecting:
Si no �s del tot necessari, no imprimeixis aquest missatge. Si ho fas utilitza paper 100% reciclat i blanquejat sense clor. D'aquesta manera ajudar�s a estalviar aigua, energia i recursos forestals. GR�CIES!
Do not print this message unless it is absolutely necessary. If you must print it, please use 100% recycled paper whitened without chlorine. By doing so, you will save water, energy and forest resources. THANK YOU!
Hello!
Can anyone help, please? This is a very important feature for my
application ...
Thank you so much!
Dani
On 09/22/2010 08:45 PM, acrocephalus wrote:
Hello!
I have a table with some rows and cells (code at the end), and created
a function which searches for text inside the cells and returns the
row number where the text is (to simplify the example, only English
Name is working). Then, it should set the grid cursor focus to that
row (I want to use the wx.grid.Grid.SelectRows style when created the
wx.Grid, but to reduce the number of variables I don't use it in the
example). To set the cursor focus, I am using
def OnSearch(self, event):
CommonName = self.CommonNameTXT.GetValue()
if CommonName != '':
ind = self.parent.EnglishNameList.index(CommonName)
self.parent.SpeciesGrid.SetGridCursor(ind, 0)
self.parent.SpeciesGrid.MakeCellVisible(ind,0)
Theoretically, it should work using only the SetGridCursor method,
however somewhere I have read that it will not work unless you also
use the MaceCellVisible method as well. Anyway, it does not work at
all. Can anyone help?
It's working for me. What platform and version are you using? Please
make a small runnable sample that demonstrates the problem. MakingSampleApps - wxPyWiki
Oops! I forgot to attach the runnable example. Sorry, find it attached.
Please, note that only the English Name control is working. It returns
the correct row number to the terminal, but it doesn't set the cursor
focus to any row. I am using Linux Ubuntu Lucid Lynx, Python 2.6.5 and
wx.python 2.8.11. I hope it helps.
Ah, you didn't mention that you are using row selection mode...
SetGridCursor is moving the cursor (the thicker lines around the current cell) just as the code is telling it to, it just isn't moving the row selection. And since the grid does not have the focus (the Search button does) you can't see the cursor moving because it is only drawn when the grid has the focus. Adding this to your OnSelectCell method will make it work more like what you are expecting:
self.SpeciesGrid.SelectRow(self.row)
Thank you so much. Not it sets the cursor focus properly. However, if the searched string is outside the visible region, it does not scroll the grid to this row. For example, in the new example I provide, if you search for the "Killdeer", which is outside the visible area, it focuses the focus on the row of interest but it does not scroll the grid to make it visible, you have to do it manually. It it possible to make the grid behave like this?
Cheers!