Hi All,
I’m trying to implement an editable list ctrl and i looked at the example in wxpython docs and demos.
i copied the part of the code for editing, but, when i push the left mouse button twice, the edit deletes
the line and leave it empty (i can write something, but, the original text is gone).
I think it has something to do with the fact that i’m also using the EVT_LIST_ITEM_SELECTED.
this is what i do under this event:
def OnItemSelected(self, event):
self.ParamsTextCtrl.Clear()
index = event.GetIndex()
item = event.GetItem()
any suggestions?
Thanks,
Roy.
···
Express yourself instantly with MSN Messenger! MSN Messenger
Hi,
Attached is the file + txt file that i load into the gui.
the problem occurs when i try to edit the line,
the platform is windows XP with the latest wxpython (2.8)
in the attached txt file, only the first row works fine.
Thanks,
Roy.
for_debug.py (8.76 KB)
Captured_1.txt (4.72 KB)
···
Date: Thu, 10 Jan 2008 11:57:47 -0800
From: robin@alldunn.com
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] wx.ListCtrl edit question
ROY ZINN wrote:
Hi All,
I’m trying to implement an editable list ctrl and i looked at the
example in wxpython docs and demos.
i copied the part of the code for editing, but, when i push the left
mouse button twice, the edit deletes
the line and leave it empty (i can write something, but, the original
text is gone).
I think it has something to do with the fact that i’m also using the
EVT_LIST_ITEM_SELECTED.
this is what i do under this event:
def OnItemSelected(self, event):
self.ParamsTextCtrl.Clear()
index = event.GetIndex()
item = event.GetItem()
&
gt; >
Please create a small runnable sample that reproduces the problem. If
you don’t figure out the cause while you are doing that then send it
here. Also be sure to mention the platform and version you are using.
–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Express yourself instantly with MSN Messenger! MSN Messenger
Hi Again
Thanks for the reply, it’s been very helpful (especially the second part with the find…)
I suspected that the problem was with the CR, how can i remove/ignore it?
Thanks,
Roy.
···
Date: Mon, 14 Jan 2008 12:39:41 -0800
From: robin@alldunn.com
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] wx.ListCtrl edit question
ROY ZINN wrote:
Hi,
Attached is the file + txt file that i load into the gui.
the problem occurs when i try to edit the line,
the platform is windows XP with the latest wxpython (2.8)
in the attached txt file, only the first row works fine.
Take a closer look at your data file, and also the text you are loading
into the ListCtrl. All but the first line have an extra CR at the
beginning of the line, probably because the CR/LF for each line are
reversed. So you end up loading strings into the ListCtrl that have
that leading CR and even though the ListCtrl ignores them okay, when
that string is passed to the TextCtrl used by th
e TextEditMixin class
then it messes up the value in that widget because it is a single line
control.
def regHotKey(self):
“”"
This function registers the hotkey CTRL-F with id=100
“”"
self.hotKeyId = 1000
self.RegisterHotKey(self.hotKeyId, win32con.MOD_CONTROL, ord(‘F’))
def handleHotKey(self,evt):
data = wx.FindReplaceData()
dlg = wx.FindReplaceDialog(self, data, “Find”)
dlg.data = data # save a reference to it…
dlg.Show(True)
BTW, you probably don’t want to use RegisterHotKey here, as it will make
that key open the FindReplaceDialog in this app no matter which
application is in the foreground (as long as it doesn’t have its own
Ctrl-F accelerator.) You probably want to use a wx.AcceleratorTable
instead, or just define a me
nu item with that key in its label.
–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Express yourself instantly with MSN Messenger! MSN Messenger