From 7a2a1bdace16c14264f772873c608b0a269446e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Tue, 1 Mar 2016 00:36:59 +0000 Subject: [PATCH] [GB.FORM] * BUG: MessageView: Successive messages work correctly now. git-svn-id: svn://localhost/gambas/trunk@7616 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- .../gb.form/.src/Message/MessageView.class | 51 +++++++++++-------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/comp/src/gb.form/.src/Message/MessageView.class b/comp/src/gb.form/.src/Message/MessageView.class index d96d2e0ce..c94955b7e 100644 --- a/comp/src/gb.form/.src/Message/MessageView.class +++ b/comp/src/gb.form/.src/Message/MessageView.class @@ -53,10 +53,36 @@ Private Sub UpdateButton() End -Public Sub Open(Text As String, Optional Icon As Picture) +Private Sub DoOpen() Dim fTime As Float + UpdateButton + Me.H = 1 + Me.Show + + $H = Max($hIcon.H + Desktop.Scale * 2, Me.Font.RichTextHeight($sText, Me.Parent.ClientW - Desktop.Scale * 4 - $hIcon.W) + Desktop.Scale * 4) + + If $bAnimate Then + + fTime = Timer + + While Me.H < $H + Me.H = $H * Min(1, (Timer - fTime) * 8) + Wait + Wend + + Endif + + Me.H = $H + + Raise Open + +End + + +Public Sub Open(Text As String, Optional Icon As Picture) + If $sText = Text Then Return If Me.Visible Then @@ -75,26 +101,7 @@ Public Sub Open(Text As String, Optional Icon As Picture) If Error Then $hIcon = Picture["img/32/warning.png"] Endif - UpdateButton - Me.H = 1 - Me.Show - - $H = Max($hIcon.H + Desktop.Scale * 2, Me.Font.RichTextHeight(Text, Me.Parent.ClientW - Desktop.Scale * 4 - $hIcon.W) + Desktop.Scale * 4) - - If $bAnimate Then - - fTime = Timer - - While Me.H < $H - Me.H = $H * Min(1, (Timer - fTime) * 8) - Wait - Wend - - Endif - - Me.H = $H - - Raise Open + DoOpen End @@ -123,7 +130,7 @@ Public Sub Close() $hIcon = $aIcon[0] $aText.Remove(0) $aIcon.Remove(0) - Open($sText, $hIcon) + DoOpen Else $sText = "" $hIcon = Null