⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 旋转文本.mb

📁 很多的MAPINFO的常见问题下载后可以学习很有帮助
💻 MB
字号:
include "mapbasic.def"

declare sub main
declare sub mnu_textangle
declare sub rotate_text

global tabname() as string
global angle as float

sub main
	create menu "改变文本角度" as 
		"文本角度" calling mnu_textangle
	alter menu bar add "改变文本角度"
end sub

sub mnu_textangle
	 dim i as integer
	 dim tablenums as integer
	 tablenums = numtables()
	 For i = 1 To tablenums
	      redim tabname(i)
		tabname(i) = tableinfo(i,TAB_INFO_NAME)
       Next 

	dialog title "请从中选择一个表,进行处理……"
		Control statictext 
			title "请选择一个表:" 
			position 5,5
		Control listbox Position 5, 20
			ID 1111
			width 105 height 50
			title from variable tabname
			value 1
		control statictext 
			title "转角" 
			position 5,75
		control edittext into angle id 2222 value 90 position 35,75		
		control okbutton Position 12,90 calling rotate_text
		control cancelbutton position 65,90
end sub

sub rotate_text
	dim j as integer
	dim tablename as string
	dim objalias as alias
	dim myobj as object

      angle=readcontrolvalue(2222)
	tablename = tabname(readcontrolvalue(1111))
note tablename
	fetch first from tablename
	for j=1 to tableinfo(tablename,tab_info_nrows)
		objalias = tablename & ".obj"
		if objectinfo(objalias,obj_info_type) = OBJ_TYPE_TEXT then
			myobj = objalias
			alter object myobj Geography OBJ_GEO_TEXTANGLE,angle
			update tablename set obj=myobj where rowid =j
		end if
		fetch next from tablename
	next
end sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -