ryx32
路人甲
路人甲
  • 注册日期2003-08-05
  • 发帖数457
  • QQ
  • 铜币4046枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1778回复:2

mo-undo

楼主#
更多 发布于:2004-07-30 10:44
<P>我想在mo中实现undo功能大家有什么建议?</P><img src="images/post/smile/dvbbs/em01.gif" />
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15945
  • QQ554730525
  • 铜币25337枚
  • 威望15352点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2004-08-02 10:24
<P>做过点,要做好,内容还不少,没个类型的实体undo都不太一样,下面给出一个函数,简单了,可能用处不大</P><P>Private Function UUMoveLine(map As MapObjects2.map) 'undo
 On Error GoTo exit1
 Dim x As Double, y As Double
 Dim layerNum As Long, m_selLine As Long
 Dim typea As Long
 
 Dim lineNew As New MapObjects2.Line
 typea = popType
 m_selLine = popInt
 layerNum = popInt
 y = popDouble
 x = popDouble
 x = -x
 y = -y
 popEnd
 
 Dim recs As MapObjects2.Recordset
 Set recs = map.Layers(layerNum).Records
 recs.MoveFirst
 recs.Edit
 
 Dim i As Long
 For i = 0 To m_selLine - 1
 recs.MoveNext
 Next
 
 recs.Edit
 
 Dim Line As MapObjects2.Line
 Set Line = recs.Fields("Shape").Value
 CopyLinePan lineNew, Line, x, y
 Set recs.Fields("Shape").Value = lineNew
 Set lineNew = Nothing
 
 recs.Update
 Refresh map
exit1:
End Function</P>
举报 回复(0) 喜欢(0)     评分
ryx32
路人甲
路人甲
  • 注册日期2003-08-05
  • 发帖数457
  • QQ
  • 铜币4046枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2004-08-02 12:23
<b><FONT color=#990000>gis </FONT></b><img src="images/post/smile/dvbbs/em12.gif" />
举报 回复(0) 喜欢(0)     评分
游客

返回顶部