From 2e103b2b289b49963bd77826efc42c49007eb625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sun, 19 Apr 2015 15:18:02 +0000 Subject: [PATCH] [GB.FORM] * BUG: TabPanel: Take object locking recursitivity into account. git-svn-id: svn://localhost/gambas/trunk@7046 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.form/.src/Completion.class | 2 -- comp/src/gb.form/.src/TabPanel/TabPanel.class | 14 +++++++++----- comp/src/gb.form/.src/ValueBox.class | 1 - 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/comp/src/gb.form/.src/Completion.class b/comp/src/gb.form/.src/Completion.class index 3d75302a0..2a9365561 100644 --- a/comp/src/gb.form/.src/Completion.class +++ b/comp/src/gb.form/.src/Completion.class @@ -150,8 +150,6 @@ Public Sub Timer_Timer() Dim aList As String[] Dim hCtrl As TextBox - Dim H, Y As Integer - Dim X As Integer Dim hPanel As Panel $hTimer.Stop diff --git a/comp/src/gb.form/.src/TabPanel/TabPanel.class b/comp/src/gb.form/.src/TabPanel/TabPanel.class index 23a388ebc..f0511e95f 100644 --- a/comp/src/gb.form/.src/TabPanel/TabPanel.class +++ b/comp/src/gb.form/.src/TabPanel/TabPanel.class @@ -355,13 +355,15 @@ Private Sub Count_Write(iCount As Integer) Dim hTab As _TabPanelContainer Dim hButton As _TabPanelButton Dim iCurrent As Integer + Dim bLocked As Boolean If iCount < 1 Then Error.Raise("Bad argument") If iCount = $aCont.Count Then Return iCurrent = $iCurrent - - Object.Lock(Me) + + bLocked = Object.IsLocked(Me) + If Not bLocked Then Object.Lock(Me) If iCount < $aCont.Count Then @@ -397,7 +399,7 @@ Private Sub Count_Write(iCount As Integer) $iCurrent = -1 If iCurrent < 0 Then iCurrent = $aCont.Max - Object.Unlock(Me) + If Not bLocked Then Object.Unlock(Me) Try Index_Write(iCurrent) @@ -831,10 +833,12 @@ Public Sub _MoveTab(hSrc As _TabPanelButton, hDst As _TabPanelButton, bAfter As Dim S, T As Integer Dim hSrcPanel As Control + Dim bLocked As Boolean If hSrc = hDst Then Return - Object.Lock(Me) + bLocked = Object.IsLocked(Me) + If Not bLocked Then Object.Lock(Me) S = _GetIndex(hSrc) $aButton.Remove(S) @@ -848,7 +852,7 @@ Public Sub _MoveTab(hSrc As _TabPanelButton, hDst As _TabPanelButton, bAfter As UpdateLayout - Object.Unlock(Me) + If Not bLocked Then Object.Unlock(Me) Raise Move(S, T) diff --git a/comp/src/gb.form/.src/ValueBox.class b/comp/src/gb.form/.src/ValueBox.class index 80feaf2d9..018626cc2 100644 --- a/comp/src/gb.form/.src/ValueBox.class +++ b/comp/src/gb.form/.src/ValueBox.class @@ -171,7 +171,6 @@ Public Sub NumberBox_Change() Dim iPos As Integer = $hTextBox.Pos Dim sText As String = $hTextBox.Text Dim bNeg As Boolean - Dim bRaiseChange As Boolean If Left(sText) = "-" Then bNeg = True