/*
		
				If ( nMsg == WM_MOUSELEAVE )  .and. (   ::lTracking412  ) .and. (1 == 2)
					 DoEvents()
					 GetCursorPos (@nCol1, @nRow1)			 
					 
					 //msginfo('lp')
					 
		
					::lModeTecla:=.f. 			
					//DoEvents()
					
					
		
		
					If  ( Abs(::nLinhaDrop) > 0) .And. (nRow1 >= ::nLinhaDrop) .and. (Abs( nRow1 - Abs(::nLinhaDrop)) >= 15) 
							//(nRow1 <= (Abs(::nLinhaDrop)+GetProperty( ::cMenuSub2 , 'Height') + ::nitemSubHeight + 15  ))
						
					
						If !::lSubMenu					
							::ExitMenu1()						
						Else			
						
							
							DoEvents()
							
							//msginfo('here')
							
							::nMaInSel := 0							
							::nItemx1  := 0					
							BT_ClientAreaInvalidateAll(  ::cMenuSub1 )
							::yDCMenu2()
							::xLimpSetas( .t. )					
							
							
							If !_isWindowDefined(::cMenuSub1)
								  ::nIt5 := 0						 	
							End If
							
							
		
							DoEvents()
						
							
						End If
						
						
						::lTracking412 := .t.				
		
					Else
		
						If _isWindowDefined(  ::cMenuSub1   )
							::xLimpSetas( .t. )
							::xLimpSubIt()
						End If				
		
		
						If Empty( Alltrim(::cOpMainSel)   )
							If ::nClearSel > 0
								::nMainSel := 0
								::nClearSel := 0
								::cOpMainSel := ''
								::nItemx1 := 0							
								BT_ClientAreaInvalidateAll( nHWnd  )					
							End If
						Else
						
		
							::nMainSel := 0
							::nClearSel := 0
							
							
							::xLimpSub(  ::cJanPrin1  , ::nItemMenuAnt ,  ::nItemMenuAnt ,  ::nHeightDrop )													
							DoEvents()				
							
							
		
							If _isWindowDefined(   ::cMenuSub1   )					
								If ::lSetasDown					
									::yDCM2Row( (  (::nItemMenuAnt - 1) * ::nItemSubHeight) + (GetProperty( ::cMenuSub1 , 'Height' )) + 40 , ::nItemSubHeight )
								Else 					
									::yDCM2Row( (  (::nItemMenuAnt - 1) * ::nItemSubHeight) + (GetProperty(::cMenuSub1  , 'Height' ))  , ::nItemSubHeight )
								End If 																						
												
								::xLimpSetas( .t. )												
							
							End If 				
							
		
							::lTracking412 := .f.					
							DoEvents()
							
		
							Return
						End If		
						::xClearSel()
						
						Return
		
					End If
					
					
					
					 
		
				End If
		
		   
				If (nMsg == WM_LBUTTONDOWN)
		
					DoEvents()
					GetCursorPos (@nCol1, @nRow1)			
				
		
		
					nLinDrop   := (::nItemDrop1 * ::nItemSubHeight)			
					::nLinhaDrop := nLinDrop
		
					aR12 := ::GetPos_ScreenToClient( GetFormHandle( ::cJanPrin1  ) , nRow1 , nCol1 )
					nLine1 := Ar12[1]
		
					If  (::nLinhaDrop > 0) .And. (nLine1 >= ::nLinhaDrop) .and. (Abs( nLine1 - ::nLinhaDrop) >= 0) .And. ;
							(nLine1 <= (::nLinhaDrop+GetProperty( ::cMenuSub2  , 'Height')   ))
		
						If nWParam != 90 			
							::nIt5 := ::xOpSelPos(  ::cMenuSub1  , 0 , Len(::aOpx1) , 0 )
						End If 
		
						If (::nIt5 <= Len(::aOpX1))
		
							If !::aOpx1[::nIt5][3]
								SetWindowCursor( nHWnd , IDC_ARROW)
								//yAviso("Opo Indisponivel." , .f. )
								Return
							End If
						
		
							If (::aOpx1[::nIt5][4] != Nil )
								Eval( ::aOpx1[::nIt5][4]  ,  ::nIt5 )
							End If
		
						End If
		
					Else
		
						//DoEvents()				
						nRow1 := -(GetProperty(  ::cJanPrin1   , "VscrollBar" , "Value"))
		
						If (::lSetasDown) .AND. (nWParam != 90)
							If (::nLinhaAtual == 0)
								::nLinhaAtual := Int(::nTamSubMenuConsulta / ::nItemSubHeight)
							End If
		
							nContItens := Len(::aOpx1)
		
							If (::nMainSel = 1000)						
		
								::ScrollMenu( 2 , GetProperty( ::cMenuSub1   , 'Handle' ) , @::nScrLin , @::nLinhaAtual , nContItens , @::l_Http , @::l_Httb , ::nItemDrop1 , ;
									::cJanPrin1 , GetProperty(::cMenuSub1 , 'Height' )  )
								l_Http := .f.
								Return
							End If
		
							If (::nMainSel = 2000)
		
								::ScrollMenu( 1 , GetProperty(::cMenuSub1 , 'Handle' ), @::nScrLin , @::nLinhaAtual , nContItens , @::l_Http , @::l_Httb , ::nItemDrop1 , ;
									::cJanPrin1 , GetProperty(::cMenuSub1 , 'Height' )  )
								::l_Httb := .f.
								Return
							End If
							DoEvents()
		
						End If
		
		
						DoEvents()
		
						If ::nMaInSel == 0
							nMaInSel := ::xOpSelPos( ::cJanPrin1  , ::nHeightDrop , Len(::aOpcoes) , ::nItemDrop1 )
							::nItemMenuAnt := nMaInSel						
							::nClearSel := ::nMaInSel					
						End If 								
						
						
						//BT_DELAY_EXECUTION_WITH_DOEVENTS(30)		
		
						If (::nItemDrop1 > 0) 					
							
							::cOpMainSel  := ''
							::xCloseSub()		
							
							
							If ::nMaInSel != ::nOpSel				
							
										nQCont := 0
										
										::nItemDrop1 := ::nMaInSel
									
										Aeval(::aItens , { | a | Iif( Left(a[1],1) == Alltrim(Str(::nMaInSel)) , nQCont++ , Nil ) } )
										
										If nQCont > 0					
					 						 ::xDropIt(  ::nMaInSel )					
					 					Else 
					 						 msginfo('No itens Found For This Submenu ' + Str(::nMaInSel) + '  ' +  Str( ::nPos9 )  )
					 					
					 					End If 
								
								
								
							End If 
							
						
							DoEvents()
							
							Return 
		
						Else				
						
						
							DoEvents()									
							
							nQCont := 0
							
							Aeval(::aItens , { | a | Iif( Left(a[1],1) == Alltrim(Str(::nMainSel)) , nQCont++ , Nil ) } )
							If nQCont > 0					
			 						::xDropIt(  ::nMainSel )					
			 				Else 
			 						msginfo('No itens Found For This Submenu')
			 					
			 				End If 
			 				
							DoEvents()
						
							
							
							
							Return 			  
		
						End If
		
					End If			
		
				End If
		
		
				If ( nMsg == WM_MOUSEMOVE ) .And. (::lTracking412) 	
				
					
					 
					// msginfo('z2')
				
				
					If ::lEnabled2	
							SetWindowCursor( GetFormHandle(  ::cJanPrin2  ) , "CURSORHAND1"  )			
					End If 
					
					DoEvents()
								
					
				 
					GetCursorPos (@nCol1, @nRow1)
					lSuby := .f.		
					
					nH1 := WindowFromPoint( @nCol1, @nRow1   )
					
					cFormname := ''
					
					GetFormNameByHandle( nH1 , @cFormName )
					
					
					If cFormName == ::cMenuSub2
			//			 msginfo(cFormName)
					End If 
					
					//msginfo(cFormName)
					
					
		
					lCondicao := .f. 
		
					aR1 := ::GetPos_ScreenToClient( GetFormHandle(  ::cJanPrin1  ) , nRow1 , nCol1 )
					nLinDrop := (::nItemDrop1 * ::nItemSubHeight)			
					
					
					If nWParam = 90 		
						lCondicao := .t.				
					End If 
		
					If ::nItemDrop1 == 0
						lCondicao := .f. 
					Else 
						
						nRowY := Ar1[1]
						lCondicao := ( Abs(nLinDrop) > 0) .And. (nRowY >= Abs(nLinDrop)) .and. (Abs( nRowY - Abs(nLinDrop)) >= 0) ;
							.And. (nRowY <= ( Abs(nLinDrop)+GetProperty( ::cMenuSub2 , 'Height')      ))				
		
						DoEvents()
						
					End If 			
		
					If (lCondicao)							
					
					
							n1 :=  Abs(nLinDrop)+GetProperty( ::cMenuSub2 , 'Height')  + (::nItemSubHeight * 2)
							
						//	msginfo(Str(n1))
					
							
		
						If _isWindowDefined( ::cMenuSub1 )				
						
						
		
							If nWParam != 90 					
								 ::nPos91 := ::xOpSelPos( ::cMenuSub1 , 0 , Len(::aOpx1) , 0 )						
								 //::nPos9 := ::xOpSelPos( ::cMenuSub1 , 0 , Len(::aOpx1) , 0 )						
							End If 
		
							If ::nPos91 >= 1000
								Return 
							End If 
		
							::nSetaSel := 0
							::xDelMain()					
							
							//msginfo('g2  ' + Str( ::nPos9 ) + ' ' + Str(::nIt5) )
							::lTracking412  := (::nPos91 == ::nIt5)
							lSuby := .t.					
							::xLimpSetas( .t. )				
		
		
							If !::lTracking412
								If (::nPos91 > 0) .And. (::nPos91 <= Len(::aOpX1))
									If !::aOpx1[::nPos91][3]							   
									   	::lTracking412  := .t. 							   	
										Return .f.
									End If
								End If
								
								
							Else 
							    //msginfo('lp2')	
							End If					
		
						End If
		
					Else
					
						
						
						If nWParam != 90 
						//	 msginfo('lp')
							::nPos9 := ::xOpSelPos( ::cJanPrin1  , ::nHeightDrop , Len(::aOpcoes) , ::nItemDrop1 )
							
					
							
							if ::npos9 >= 19
									//msginfo('ok22')
							
							end if 
							
						End If 
		
						::lTracking412 := .f. 			
		
		
		
						If (::nPos9 == ::nMaInSel) .And. (nWParam != 90 ) 					
						 	 ::lTracking412 := .t. 																    				 	 				 	 
						End If 
								
		
						//DoEvents()
		
						If !::lTracking412		
							If (::nPos9 > 0) .And. (::nPos9 <= Len(::aOpcoes))
								If !::aOpcoes[::nPos9][3]
									::lTracking412 := .t. 
									Return .f.
								End If
							End If
						End If
		
					End If
		
		
					::lTracking714  := TrackMouseEvent(nHWnd)
					
					//lTRk1 := TrackMouseEvent(nHWnd)
					//DoEvents()
		
				End If
		
		
		
				If ( nMsg == WM_MOUSEMOVE ) .And. (!::lTracking412 ) 		    
				
						::lTracking412 := .t.									
						//msginfo(Str(  ::nItemx1  ))
					
					//DoEvents()
					//DoEvents()
					
		
					If (lSuby )					
					
						
						::nIt5 := ::nPos91		
						::nItemx1 := ::nPos91											
				
						
						::xSel_Item()			
						
						If ::nItemx1 > 0					
							::nItemClr := ::nItemx1				
						End If
						::lSubMenu := .t.					
						::nIt5 := ::nPos91						
						
						//msginfo(Str(  ::nItemx1  ))
						
		
					Else
		
						
						nOpBk      := ::nPos9
						::nMaInSel := ::nPos9
						
						
						BT_ClientAreaInvalidateAll( ::cJanPrin1 )
						DoEvents()
						::yDCMenu1()		
						
						
						yP1 			 := ::nItemx1			
						
						//msginfo(Str( ::nMaInSel     ) + ' ' + Str( yP1 ))
						
						
		
						If (::nMainSel >= 1) .And. (::nMainSel <= Len(::aOpcoes)) .And. (::nItemMenuAnt != ::nMainSel)				
							::nItemMenuAnt := ::nMainSel
						End If
		
		/*
						If (::lSubOpen)
							If (::nIdMenu1 != ::nMainSel)
								If _isWindowDefined('MenuY1')
									::xFechaMen()
									::nIdMenu1 := 0
									::lSubOpen := .f.
								End If
							End If					
						End If
				
		
		
						If ::lSetasDown					
							If ::nItemMenuAnt > 0 
								i := ::nMaInSel						
								::xLimpSetas( .t. )
								::nMaInSel := i					
								DoEvents()						
							Else 
							
							End If				
						End If
					
						
		         /*
						If (::nMainSel = 1000) .or. (::nMainSel = 2000)					
							
		
							::nSetaSel := 1
						
							If (::nMainSel = 2000)
								::nSetaSel := 2
							End If				
		
							//xLimpSubIt( .t.  )	
							::nItemx1  := 0
							BT_ClientAreaInvalidateAll(  ::cMenuSub1 )
							::yDCMenu2()
							
							::xAtuLinhas(  ( ::nItemMenuAnt *  ::nItemSubHeight) + ::nHeightDrop - ::nItemSubHeight  ,   ::nItemSubHeight ,     -1    )
							DoEvents()
							
							
							If (::nSetaSel == 1)
		
								If (!::l_Httb)
									BT_ClientAreaInvalidateRect( ::cJanPrin1 ,  (::nOpSel * ::nItemSubHeight) + (GetProperty( ::cMenuSub1   , 'Height' ))   , 0  , ::nColTamMenu      ,  (::nItemSubHeight * 1)  )
									//DoEvents()
									::yDCM2Row( (::nOpSel * ::nItemSubHeight) + (GetProperty(::cMenuSub1, 'Height' ))  , ::nItemSubHeight )
								Else
									//SetWindowCursor( nHWnd , 'NAOPODE' )
								End If
		
							Else
		
								If !::l_Http
									BT_ClientAreaInvalidateRect( ::cJanPrin1 ,  (::nOpSel * ::nItemSubHeight) + (GetProperty( ::cMenuSub1  , 'Height' )) + ::nItemSubHeight  , 0  , ::nColTamMenu      ,     (::nItemSubHeight * 1)  )				
									::yDCM2Row( (::nOpSel * ::nItemSubHeight) + (GetProperty( ::cMenuSub1 , 'Height' )) + ::nItemSubHeight  , ::nItemSubHeight )
								Else
						
								End If
		
							End If	
						End If
				
						
						
					
		
						If (::nMainSel > Len(::aOpcoes)) .And.  (::nMaInSel < 1000)
							If Empty( Alltrim(::cOpMainSel)   )
		
								If ::nClearSel > 0
									::nClearSel := 0
									::nMainSel := 0							
									::nItemDrop1 := 0
									BT_ClientAreaInvalidateAll( ::cJanPrin1  )
									DoEvents()
									::yDCMenu1()
									DoEvents()		
									//msginfo('g1')
								End If
		
							Else
		
								If (::nClearSel > 0)
									::xLimpSub(  ::cJanPrin1  , ::nClearSel ,  ::nMainSel , ::nHeightDrop  )
								End If
		
							End If
		
							::nClearSel := 0
							//xHideHint()
							Return
		
						End If
		
						If  (::nMaInSel >= 1000)					
							::lTracking412  := .t. 
							Return
						End If
						
						
						
						nsel1 := ::nClearSel
						If ( ::nClearSel > 0)
							::xLimpSub(  ::cJanPrin1 , ::nClearSel ,  ::nMainSel , Iif( ::nClearSel > ::nItemDrop1   , Iif(::lSetasDown ,::nHeightDrop   , ::nHeightDrop  )    , 0    ) )
						End If
		
		
						If ::nMainSel > 0
							::nClearSel := ::nMainSel
						Else
							Return
						End If
		
		
						cOpcao := alltrim(  Right( ::aOpcoes[::nMainSel][1]  , Len( ::aOpcoes[::nMainSel][1] ) - 2  ) )
						
						If (::nClearSel > 0) .And. (::nClearSel <= Len(::aOpcoes))
							//cUltOpcaoSel := Alltrim(  Right( aOpcoes[nClearSel][1]  , Len( aOpcoes[nClearSel][1] ) - 2  ) )
						Else				
							Return
						End If
						
		
						nRow1 := -(GetProperty(  ::cJanPrin1  , "VscrollBar" , "Value"))
						//cUltOpcaoSel :=  Alltrim(cOpcao)
		
		
						If ::nMainSel > 0
		
							If !::aOpcoes[::nMainSel][3]						
								//xHideHint()
								Return
							End If
		
							If ::nItemDrop1 > 0					
								::xAtuMain( )
								DoEvents()
								Return
							End If
		
						End If
		
						//// Mode teclas , No exibe Hint.
		
		         /*
						If (nWParam != 90)
							
							If !Empty(    Alltrim(  ::aOpcoes[nMainSel][2]  )   )
								cTp1 := Alltrim(  ::aOpcoes[nMainSel][2]  )  + '  ' + Alltrim(Str(nsel1)) + '    ' +  Alltrim(Str( ::nMainSel  ))
							End If
		
							i := ::nMaInSel
		
		
							If (!Empty(Alltrim(cTp1)))
		
								ny2:=  ::nRowSub+(::nMainSel * ::nItemSubHeight)
								aRt := ::GetPos_ScreenToClient(  ::HandleParent  ,  nY2   , ::nColSub1 )						
		
								//xShowHintM( Alltrim(cTp1) ,  ::cJanPrin1 , aRt[1] , aRt[2] + GetProperty( 'Win_MenuPrincipal', 'Width')+50 ) 
							Else
								//xHideHint()	
							End If
		
							nMaInSel := i				
		
						End If							
		
						
		
						BT_ClientAreaInvalidateAll( ::cJanPrin1 )
						DoEvents()
						::yDCMenu1()		
						::nMainSel := nOpBk
						::nOpSel   := nOpBk
						//msginfo('z 1   ' + Str(::nMainSel) + ' ' + Str( nOpBk ))
						
					
						
				
					End If
		
				End If
				
				*/
		
			//End If
			
			
			/*
								  SysWait(.2)								  								  
								  BT_ClientAreaInvalidateAll( ::cMenuSub1 )									  
								  ::yDcToDc(  ::cMenuSub1, ::cMenuSub2)									  
								  BringToTop(     GetFormHandle(  ::cMenuSub2 ) )	
								  */
								  
								  
								  
								  
								  
								//	DoEvents()								 	
									
									
								//	//::nMainsel := 0						 						
								//	BT_ClientAreaInvalidateAll( ::cJanPrin1 )														 
									 	
									
									
									//msginfo(' eerrt ' + Str(  n1  ) + ' ' + Str( ::nPos91)   )
							
									
							
							
							
									
									/*
													
									msginfo('l1 ' + Str(n1)  + ' '  + Str( 	::nPos91  ) )
									
																
									DoEvents()
									
									xCloseHint()
							
									//DoEvents()							
									
								//	::lTracking872 := .t. 
									SetWindowCursor( GetFormHandle(  ::cMenuSub2  ) , CURSORHAND  )																						 	
								 	::nPos91  := n1						 	
								 	::nItemX1 := n1								 	
								 	 ::xSel_Item()											 	 
								 	 DoEvents()
												
									If ::nItemx1 > 0					
											::nItemClr := ::nItemx1				
									End If
									
													
													
									//msginfo('l2 ' + Str(n1)  + ' '  + Str( 	::nPos91  ) )
									
									//DoEvents()
																
									
									::lSubMenu := .t.					
								//	::yDcToDc(  ::cMenuSub1, ::cMenuSub2)		
									
									If (n1 <= Len(::aOpx1)) .And. (::aOpx1[n1][2] != Nil) .And. (nWParam != 90)																	
										 ::ShowHint( ::aOpx1[n1][2]  , n1 ,2 )
										 
									End If							 
									
									DoEvents()
									
									::nMainsel := 0						 						
								//	BT_ClientAreaInvalidateAll( ::cJanPrin1 )														 
						    	DoEvents()							 						
									
									If (_isWindowDefined(::cMenuSub2)) .And. (  GetFormIndex( ::cMenuSub2 ) > 0)
										 ::xCleanJanDrop()							 										 
								  End If 
									DoEvents()								 	
									
									
									msginfo('l2 ' + Str(n1)  + ' '  + Str( 	::nPos91  ) )
									
									//msginfo('l2111 ' + Str(n1)  + ' '  + Str( 	::nPos91  ) )
									
									*/
								