projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
forgot to commit some regenerated files
[wxWidgets.git]
/
wxPython
/
demo
/
GridCustEditor.py
diff --git
a/wxPython/demo/GridCustEditor.py
b/wxPython/demo/GridCustEditor.py
index 668dbdc4282470d20d9f2333ee601bb082568864..50101e4b60a8c63fe70405a3246487fb02736c2e 100644
(file)
--- a/
wxPython/demo/GridCustEditor.py
+++ b/
wxPython/demo/GridCustEditor.py
@@
-1,8
+1,8
@@
-#!/usr/bin/env python
from wxPython.wx import *
from wxPython.grid import *
from wxPython.wx import *
from wxPython.grid import *
+import string
#---------------------------------------------------------------------------
class MyCellEditor(wxPyGridCellEditor):
"""
#---------------------------------------------------------------------------
class MyCellEditor(wxPyGridCellEditor):
"""
@@
-46,7
+46,8
@@
class MyCellEditor(wxPyGridCellEditor):
PaintBackground and do something meaningful there.
"""
self.log.write("MyCellEditor: SetSize %s\n" % rect)
PaintBackground and do something meaningful there.
"""
self.log.write("MyCellEditor: SetSize %s\n" % rect)
- self._tc.SetDimensions(rect.x, rect.y, rect.width+2, rect.height+2)
+ self._tc.SetDimensions(rect.x, rect.y, rect.width+2, rect.height+2,
+ wxSIZE_ALLOW_MINUS_ONE)
def Show(self, show, attr):
def Show(self, show, attr):
@@
-86,16
+87,16
@@
class MyCellEditor(wxPyGridCellEditor):
def EndEdit(self, row, col, grid):
"""
def EndEdit(self, row, col, grid):
"""
- Complete the editing of the current cell. Returns
t
rue if the value
+ Complete the editing of the current cell. Returns
T
rue if the value
has changed. If necessary, the control may be destroyed.
*Must Override*
"""
self.log.write("MyCellEditor: EndEdit (%d,%d)\n" % (row, col))
has changed. If necessary, the control may be destroyed.
*Must Override*
"""
self.log.write("MyCellEditor: EndEdit (%d,%d)\n" % (row, col))
- changed =
f
alse
+ changed =
F
alse
val = self._tc.GetValue()
if val != self.startValue:
val = self._tc.GetValue()
if val != self.startValue:
- changed =
t
rue
+ changed =
T
rue
grid.GetTable().SetValue(row, col, val) # update the table
self.startValue = ''
grid.GetTable().SetValue(row, col, val) # update the table
self.startValue = ''
@@
-115,7
+116,7
@@
class MyCellEditor(wxPyGridCellEditor):
def IsAcceptedKey(self, evt):
"""
def IsAcceptedKey(self, evt):
"""
- Return T
RUE
to allow the given key to start editing: the base class
+ Return T
rue
to allow the given key to start editing: the base class
version only checks that the event has no modifiers. F2 is special
and will always start the editor.
"""
version only checks that the event has no modifiers. F2 is special
and will always start the editor.
"""
@@
-143,12
+144,13
@@
class MyCellEditor(wxPyGridCellEditor):
elif key < 256 and key >= 0 and chr(key) in string.printable:
ch = chr(key)
if not evt.ShiftDown():
elif key < 256 and key >= 0 and chr(key) in string.printable:
ch = chr(key)
if not evt.ShiftDown():
- ch =
string.lower(ch
)
+ ch =
ch.lower(
)
if ch is not None:
# For this example, replace the text. Normally we would append it.
#self._tc.AppendText(ch)
self._tc.SetValue(ch)
if ch is not None:
# For this example, replace the text. Normally we would append it.
#self._tc.AppendText(ch)
self._tc.SetValue(ch)
+ self._tc.SetInsertionPointEnd()
else:
evt.Skip()
else:
evt.Skip()
@@
-211,6
+213,7
@@
class GridEditorTest(wxGrid):
self.SetColSize(1, 150)
self.SetColSize(2, 150)
self.SetColSize(1, 150)
self.SetColSize(2, 150)
+
#---------------------------------------------------------------------------
class TestFrame(wxFrame):
#---------------------------------------------------------------------------
class TestFrame(wxFrame):
@@
-225,7
+228,7
@@
if __name__ == '__main__':
import sys
app = wxPySimpleApp()
frame = TestFrame(None, sys.stdout)
import sys
app = wxPySimpleApp()
frame = TestFrame(None, sys.stdout)
- frame.Show(
t
rue)
+ frame.Show(
T
rue)
app.MainLoop()
app.MainLoop()