# copyright= 'Huynh Duong Phuong Vi @ 2013-2015'
# suforyou.vn@gmail.com
module S4U
	@s4u_menu=UI.menu("Plugins").add_submenu("Suforyou") if !@s4u_menu
	module S4u_Linetool        
		Sketchup::require 'sketchup.rb'     
		Sketchup::require "s4u_linetool/s4u_linetool_code" 
		if(not file_loaded?(__FILE__))   
			toolbar = UI::Toolbar.new("s4u-" + Strings.GetString("Line Tool"))
			names=[ [Strings.GetString("Line Tool"),"linetool_large.png","linetool_small.png",Strings.GetString("Select 2 points")]
			]
			menu=S4U.instance_variable_get :@s4u_menu
			#@submenu=menu.add_submenu(Strings.GetString("Line Tool")) 
			(0..names.length-1).each{|i|
				cmd=UI::Command.new(names[i][0]){ S4U::S4u_Linetool.main }
				cmd.large_icon = names[i][1] 
				cmd.small_icon = names[i][2]
				cmd.status_bar_text = names[i][3] 
				cmd.tooltip= names[i][0] 
				cmd.menu_text = names[i][0]
				toolbar=toolbar.add_item cmd
				menu.add_item cmd
			}
			toolbar.show if toolbar.get_last_state.abs == 1
		end
	end
end
