This example sets column D to number-only entry. (this should work without updating to the latest code)
SuperStrict
Framework wx.wxApp
Import wx.wxSheet
Import wx.wxFrame
New GridApp.run()
Type GridApp Extends wxApp
Method OnInit:Int()
Local frame:GridFrame = GridFrame(New GridFrame.Create(Null, -1, "wxSheet example"))
frame.SetSize(800, 600)
frame.show()
Return True
End Method
End Type
Type GridFrame Extends wxFrame
Field grid:wxSheet
Method OnInit()
grid = New wxSheet.Create( Self, -1, 0, 0)
grid.CreateGrid( 0, 0 )
grid.AppendRows(20)
grid.AppendCols(20)
Local attr:wxSheetCellAttr = New wxSheetCellAttr.Create(True)
attr.SetEditor(New wxSheetCellEditor.Create(New wxSheetCellNumberEditorRefData.Create()))
attr.SetRenderer(New wxSheetCellRenderer.Create(New wxSheetCellNumberRendererRefData.Create()))
grid.SetGridColAttr(3, attr)
End Method
End Type
The key appears to be passing in True to wxSheetCellAttr.Create(). So, I've also updated the module to default the parameter as True rather than False. Internally, using True, appears to initialise some internal refdata. But since the documentation is extremely lacking, I can't really give you much more information that what I see in the source...
|