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

📄 menu 的各种样例.mb

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

Define x *4
Define y *8

Declare Sub main
Declare Sub alter_menus
Declare Sub new_command_handler
Declare Sub note_sub
Declare Sub print_sub
Declare Sub enable_menu
Declare Sub disable_menu
Declare Sub create_new_menu
Declare Sub start
Declare Sub end_program
Declare Sub hello

'***********************************************************************************

Sub Main
	Call alter_menus        '*** Changes existing menus
	Call create_new_menu    '*** Creates a new menu called 'Menu Demo'
End Sub

Sub create_new_menu
	Create Menu "Nested Sub Menu" As                     
	  "Enable the 'About' Command"  calling enable_menu,
	  "Disable the 'About' Command" calling disable_menu

	Create menu "&Menu Demo" As 
	  "&About This Program" calling hello,
	  "(-",
	  "Note Statement"      calling note_sub,	
	  "Print Statement"     calling print_sub,
	  "&Nested Sub Menu" as "Nested Sub Menu",
	  "&End Program" 		calling end_program

	Alter Menu Bar remove "帮助[&H]"   
	Alter Menu Bar add    "Menu Demo"
	Alter Menu Bar add    "帮助[&H]"
End sub

Sub alter_menus
	Alter Menu "文件[&F]" add "New Command" calling new_command_handler
	Alter Menu "维护[&W]" remove 409, "紧缩表[&P]..."
	Alter Menu Bar Remove "对象[&O]"
End Sub

Sub note_sub
	Note "Hello!"
End Sub

Sub print_sub
	Print "The 'Print' statement puts a message or instructions in the"
	Print "Message window."
End Sub

Sub new_command_handler
	Note "Hello,New menu command!"
End Sub

Sub enable_menu
  Alter Menu Item hello Enable
End Sub

Sub disable_menu
  Alter menu item hello disable
End Sub

Sub hello
	Dialog
	  Title "About This Program"
	  Width 56x
	  Height 21y
	Control StaticText
	  Title "This program demonstrates programming menu commands in"  
	  Position 2x,2y
	Control OKButton
	  Position 43x, 18y
End Sub

Sub end_program  '*** Restore the menu bar and end the program.
  	Create Menu Bar as Default
  	Close Window Message
  	End Program
End Sub

⌨️ 快捷键说明

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