From 967989bf0004c306d69b68bf36d486a6e6cec324 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 22 Aug 2015 13:53:28 +0000 Subject: [PATCH] =?UTF-8?q?TestEIn=201.6h4=20:=20-=20possibilit=C3=A0=20di?= =?UTF-8?q?=20escludere=20presa=20di=20fuoco=20su=20scena=20con=20solo=20m?= =?UTF-8?q?ouse=20move.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- My Project/AssemblyInfo.vb | 4 ++-- Scene.vb | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index e8619ee..71c2f49 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -46,5 +46,5 @@ Imports System.Runtime.InteropServices ' utilizzando l'asterisco (*) come descritto di seguito: ' - - + + diff --git a/Scene.vb b/Scene.vb index 5d98d40..8dbb069 100644 --- a/Scene.vb +++ b/Scene.vb @@ -224,8 +224,14 @@ Public Class Scene Public Event OnChangedSnapPointType(ByVal sender As Object, ByVal nSpType As SP, ByVal bForced As Boolean) '---- Mouse ----------- + Private m_bSetFocusOnMove As Boolean = True + ' Per correggere un problema con hot spot cursore, nei file cur รจ stato spostato di 4 pixel in Y+ (in basso) + Public Sub SetFocusOnMove(ByVal bVal As Boolean) + m_bSetFocusOnMove = bVal + End Sub + Protected Overrides Sub OnMouseDown(e As System.Windows.Forms.MouseEventArgs) ' Imposto il contesto della scena come corrente EgtSetCurrentContext(m_nGseContext) @@ -486,10 +492,12 @@ Public Class Scene EgtSetCurrentContext(m_nGseContext) End If ' Se sono abbastanza all'interno della scena (10% della dimensione), imposto il focus - Const BordPu As Double = 0.10000000000000001 - If e.Location.X > BordPu * Size.Width AndAlso e.Location.X < (1 - BordPu) * Size.Width AndAlso - e.Location.Y > BordPu * Size.Height AndAlso e.Location.Y < (1 - BordPu) * Size.Height Then - Focus() + If m_bSetFocusOnMove Then + Const BordPu As Double = 0.1 + If e.Location.X > BordPu * Size.Width AndAlso e.Location.X < (1 - BordPu) * Size.Width AndAlso + e.Location.Y > BordPu * Size.Height AndAlso e.Location.Y < (1 - BordPu) * Size.Height Then + Focus() + End If End If ' Visualizzo le coordinate del mouse ShowCursorPos(e.Location)