【轉】請教個思路關于用wx.Grid操作數據庫
要求可以再Grid上修改數據,修改后可以保存到數據庫
有沒有個操作數據庫的實際例子
謝謝
==============
使用wx.grid.PyGridTableBase, 然后自己定義SetValue, 在里面實現你的數據庫操作, 就可以在修改grid的時候, 同時更新數據庫.
添加和刪除行需要自己定義事件, 事件的觸發可以是button或者是contextmenu.
例子在wxPython2.8 Docs and Demos\demo目錄下有(以Grid開頭的文件).
=============
Home | Trees | Index | Help |
|
---|
Package wx :: Module grid :: Class PyGridTableBase |
|
Type PyGridTableBase
object
--+ |Object
--+ |GridTableBase
--+ | PyGridTableBase
Proxy of C++ PyGridTableBase class
Method Summary | |
---|---|
PyGridTableBase | __init__(self) |
Please use PyGridTableBase.AppendCols instead. |
|
Please use PyGridTableBase.AppendRows instead. |
|
Please use PyGridTableBase.CanGetValueAs instead. |
|
Please use PyGridTableBase.CanHaveAttributes instead. |
|
Please use PyGridTableBase.CanSetValueAs instead. |
|
Please use PyGridTableBase.Clear instead. |
|
Please use PyGridTableBase.DeleteCols instead. |
|
Please use PyGridTableBase.DeleteRows instead. |
|
Please use PyGridTableBase.GetAttr instead. |
|
Please use PyGridTableBase.GetColLabelValue instead. |
|
Please use PyGridTableBase.GetRowLabelValue instead. |
|
Please use PyGridTableBase.GetTypeName instead. |
|
Please use PyGridTableBase.InsertCols instead. |
|
Please use PyGridTableBase.InsertRows instead. |
|
Please use PyGridTableBase.SetAttr instead. |
|
Please use PyGridTableBase.SetColAttr instead. |
|
Please use PyGridTableBase.SetColLabelValue instead. |
|
Please use PyGridTableBase.SetRowAttr instead. |
|
Please use PyGridTableBase.SetRowLabelValue instead. |
|
Deletes the C++ object this Python object is a proxy for. |
Property Summary | |
---|---|
thisown : The membership flag |
Method Details |
---|
base_AppendCols(*args, **kwargs)Please use PyGridTableBase.AppendCols instead. |
base_AppendRows(*args, **kwargs)Please use PyGridTableBase.AppendRows instead. |
base_CanGetValueAs(*args, **kwargs)Please use PyGridTableBase.CanGetValueAs instead. |
base_CanHaveAttributes(*args, **kwargs)Please use PyGridTableBase.CanHaveAttributes instead. |
base_CanSetValueAs(*args, **kwargs)Please use PyGridTableBase.CanSetValueAs instead. |
base_Clear(*args, **kwargs)Please use PyGridTableBase.Clear instead. |
base_DeleteCols(*args, **kwargs)Please use PyGridTableBase.DeleteCols instead. |
base_DeleteRows(*args, **kwargs)Please use PyGridTableBase.DeleteRows instead. |
base_GetAttr(*args, **kwargs)Please use PyGridTableBase.GetAttr instead. |
base_GetColLabelValue(*args, **kwargs)Please use PyGridTableBase.GetColLabelValue instead. |
base_GetRowLabelValue(*args, **kwargs)Please use PyGridTableBase.GetRowLabelValue instead. |
base_GetTypeName(*args, **kwargs)Please use PyGridTableBase.GetTypeName instead. |
base_InsertCols(*args, **kwargs)Please use PyGridTableBase.InsertCols instead. |
base_InsertRows(*args, **kwargs)Please use PyGridTableBase.InsertRows instead. |
base_SetAttr(*args, **kwargs)Please use PyGridTableBase.SetAttr instead. |
base_SetColAttr(*args, **kwargs)Please use PyGridTableBase.SetColAttr instead. |
base_SetColLabelValue(*args, **kwargs)Please use PyGridTableBase.SetColLabelValue instead. |
base_SetRowAttr(*args, **kwargs)Please use PyGridTableBase.SetRowAttr instead. |
base_SetRowLabelValue(*args, **kwargs)Please use PyGridTableBase.SetRowLabelValue instead. |
Destroy(self)Deletes the C++ object this Python object is a proxy for.
|
Property Details |
---|
thisownThe membership flag
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:52:14 2009 | http://epydoc.sf.net |
posted on 2010-08-23 13:16 小默 閱讀(1255) 評論(0) 編輯 收藏 引用 所屬分類: Language