gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
20楼#
发布于:2003-09-22 10:24
我来试试。
在程序里找了几段程序,大家看看吧,撤消和恢复编辑操作的实现,
大家仔细看后面那几个主要的操作函数啦,应该有点帮助!
Private Sub MO_MENU_UNDO_Click()
Mod_IF.EditUnDo
End Sub

'//////撤消/////
Public Function EditUnDo()
CalculateSetSel -1, -1, -1
If clsMapT.CanUndo Then
    clsMapT.Undo frmMain.Map1, 1
End If
frmMain.Map1.Refresh
End Function
注意程序是截取下来的,所以模块的划分大家可以不理会,主要看看思路了。
Function CanUndo() As Boolean
CanUndo = False
CanUndo = undoNow - undoTimesBegin
End Function



Private Function UUAddLine(map As MapObjects2.map) 'undo
On Error GoTo exit1
Dim typea, layerNum As Long
 typea = popType
 layerNum = popInt
 popObject
 
Dim recs As MapObjects2.Recordset
 Set recs = map.Layers(layerNum).Records
 'recs.Edit
 
 recs.MoveFirst
 
 GetRecsCount recs
 
 recs.Edit
 
 Dim aae As Long
 For aae = 1 To recs.count - 1
 recs.MoveNext
 Next
 'recs.Edit
 recs.Delete

 'recs.Update
 recs.StopEditing
 Refresh map
exit1:
End Function

Private Function UUAddPoint(map As MapObjects2.map) 'undo
On Error GoTo exit1
Dim typea, layerNum As Long
 typea = popType
 layerNum = popInt
 popObject
 
Dim recs As MapObjects2.Recordset
 Set recs = map.Layers(layerNum).Records
 
 
 GetRecsCount recs
 
 recs.MoveFirst
 recs.Edit
 
 Dim aae As Long
 For aae = 1 To recs.count - 1
 recs.MoveNext
 Next
 recs.Delete
 'recs.Edit

' recs.Update
 recs.StopEditing
 
 Refresh map
exit1:
End Function


Private Function UUAddShape(map As MapObjects2.map) 'undo
On Error GoTo exit1
Dim typea, layerNum As Long
 typea = popType
 layerNum = popInt
 popObject
 
 Dim recs As MapObjects2.Recordset
 Set recs = map.Layers(layerNum).Records
 
 
 GetRecsCount recs
 
 recs.MoveFirst
 recs.Edit
 
 Dim aae As Long
 For aae = 1 To recs.count - 1
 recs.MoveNext
 Next
 
 recs.Delete
' recs.Edit

' recs.Update
 recs.StopEditing
 
 Refresh map
exit1:
End Function



[此贴子已经被作者于2003-9-22 10:26:42编辑过]
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
tim
tim
路人甲
路人甲
  • 注册日期2003-07-31
  • 发帖数37
  • QQ
  • 铜币200枚
  • 威望0点
  • 贡献值0点
  • 银元0个
21楼#
发布于:2003-09-18 16:43
mo没有这方面的功能,只能靠自己编了,很复杂。希望你早日实现并给我们共享一下!
举报 回复(0) 喜欢(0)     评分
上一页 下一页
游客

返回顶部