代码名称:mapbasic中的双击事件

作者/收集者:zixing

开发环境:MapBasic

代码:

include "mapbasic.def"
include "menu.def"
include "icons.def"
declare sub main
declare sub custom_tool_routine

global mouse_click as smallint
global x,y,x1,y1 as float
dim flag as logical

sub main
alter buttonpad id 1
add
separator
toolbutton
icon mi_cursor_arrow
helpmsg "make a select without a message dialog"
cursor mi_cursor_arrow
drawmode dm_custom_point
calling custom_tool_routine
show
end sub

sub custom_tool_routine
flag=false
if mouse_click<2 then
mouse_click=mouse_click+1
x=commandinfo(cmd_info_x)
y=commandinfo(cmd_info_y)
set map
center(x,y)
else mouse_click=0
end if
end sub
这是我自己编的小例子给大家看看!