# copyright= 'Huynh Duong Phuong Vi @ 2013-2015'
# suforyou.vn@gmail.com
module S4U::S4u_Select    
		Sketchup::require 'sketchup.rb' 
		Sketchup::require 'langhandler.rb'
		Sketchup::require File.join(NAME,(NAME + "_code"))
		if(not file_loaded?(__FILE__))   
			S4U.instance_variable_set(:@s4u_menu,UI.menu("Plugins").add_submenu("Suforyou")) if !S4U.instance_variable_defined?(:@s4u_menu)
			menu=S4U.instance_variable_get :@s4u_menu
			submenu=menu.add_submenu(Strings.GetString(TOOL)) 
			toolbar = UI::Toolbar.new("s4u-"+Strings.GetString(TOOL)) 
			names=[ [Strings.GetString("Select vertical edges"),"edgevertical_large.png","edgevertical_small.png",Strings.GetString("Select vertical edges(all or in seletions)")],
					[Strings.GetString("Select horizontal edges"),"edgehorizontal_large.png","edgehorizontal_small.png",Strings.GetString("Select horizontal edges(all or in seletions)")],
					[Strings.GetString("Select slope edges"),"edgeslope_large.png","edgeslope_small.png",Strings.GetString("Edge and Axis")],
					[Strings.GetString("Select length edge"),"edgelength_large.png","edgelength_small.png",Strings.GetString("Select edges by length")],
					[Strings.GetString("Select vertical faces"),"facevertical_large.png","facevertical_small.png",Strings.GetString("Select vertical faces(all or in seletions)")],
					[Strings.GetString("Select horizontal faces"),"facehorizontal_large.png","facehorizontal_small.png",Strings.GetString("Select horizontal faces(all or in seletions)")],
					[Strings.GetString("Select slope faces"),"faceslope_large.png","faceslope_small.png",Strings.GetString("Vector normal's face and Axis")],
					[Strings.GetString("Select numver faces"),"facenumver_large.png","facenumver_small.png",Strings.GetString("Select face by number vertex")],
					[Strings.GetString("Select area faces"),"face_area_large.png","face_area_small.png",Strings.GetString("Select face by area faces")],
                    [Strings.GetString("Select same length"), "samelength_large.png","samelength_small.png",Strings.GetString("Select first edge")],
					[Strings.GetString("Select same area"),"same_area_large.png","same_area_small.png",Strings.GetString("Select first face")],
					[Strings.GetString("Select parallel faces"),"parallel_face_large.png","parallel_face_small.png",Strings.GetString("Select first face")],
					[Strings.GetString("Select Step faces"),"select_step_large.png","select_step_small.png",Strings.GetString("Select first face or faces")]
			]
			(0..12).each{|i|
				cmd=UI::Command.new(names[i][0]){ self.main(i) }
				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
				toolbar.add_separator if i==3 || i==8
				submenu.add_item cmd
			}
			toolbar.show if toolbar.get_last_state.abs == 1 
		end
end
