diff --git a/app/src/gambas3/.src/Dialog/FColorChooser.class b/app/src/gambas3/.src/Dialog/FColorChooser.class index dcc17aca9..e4263ee2b 100644 --- a/app/src/gambas3/.src/Dialog/FColorChooser.class +++ b/app/src/gambas3/.src/Dialog/FColorChooser.class @@ -4,6 +4,7 @@ Static Public (Color) As String Static Public Value As Integer Static Public Pattern As String +Static Private $bInsert As Boolean Static Private $sColor As String Static Private $bAlpha As Boolean 'Static Private $aDefaultColors As String[] = ["Background", "Foreground", "SelectedBackground", "SelectedForeground", "LightBackground", "LightForeground", "TextBackground", "TextForeground", "ButtonBackground", "ButtonForeground", "TooltipBackground", "TooltipForeground", "LinkForeground", "VisitedForeground"] @@ -48,6 +49,7 @@ End Static Public Function Run(Optional sColor As String, Optional bAlpha As Boolean, Optional sTitle As String, Optional aPrefix As String[]) As Boolean + $bInsert = False $sColor = sColor $bAlpha = bAlpha $sTitle = sTitle @@ -57,6 +59,19 @@ Static Public Function Run(Optional sColor As String, Optional bAlpha As Boolean End +Static Public Sub Insert(bAlpha As Boolean, sTitle As String, aPrefix As String[]) As Boolean + + $bInsert = True + $sColor = "" + $bAlpha = bAlpha + $sTitle = sTitle + $aPattern = aPrefix + + Return Not FColorChooser.ShowModal() + +End + + Public Sub btnOK_Click() @@ -140,7 +155,7 @@ Public Sub Form_Open() tabColor[0].Visible = False Endif - tabColor.Index = iIndex + If Not $bInsert Then tabColor.Index = iIndex dlgColor.ShowAlpha = $bAlpha diff --git a/app/src/gambas3/.src/Editor/CInsertColor.class b/app/src/gambas3/.src/Editor/CInsertColor.class index 216a8c554..a1ab663ca 100644 --- a/app/src/gambas3/.src/Editor/CInsertColor.class +++ b/app/src/gambas3/.src/Editor/CInsertColor.class @@ -235,7 +235,7 @@ End Public Sub Button_Click() - If FColorChooser.Run("", False, ("Insert color"), $aPattern) Then Return + If FColorChooser.Insert(False, ("Insert color"), $aPattern) Then Return With GetEditor() .Insert(FColorChooser.Pattern)