[DEVELOPMENT ENVIRONMENT]

* BUG: Color chooser does not crash anymore when the project does not use
  any GUI component.


git-svn-id: svn://localhost/gambas/trunk@7243 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2015-08-26 22:24:42 +00:00
parent d46004d1fe
commit e05dffd530

View file

@ -80,30 +80,10 @@ Public Sub Form_Open()
Dim hClass As CClassInfo
Dim hSym As CSymbolInfo
Dim sColor As String
Dim iIndex As Integer
Settings.Read(Me)
$aColorName = New String[]
hClass = CComponent.Classes["Color"]
For Each hSym In hClass.Symbols
sColor = hSym.Name
If sColor = "Default" Then Continue
If InStr("RC", hSym.Kind) And If hSym.Type = "i" And If Not $aColorName.Exist(sColor) Then
$aColorName.Add(sColor)
Endif
Next
$aColorName.Sort()
$aPict = New Picture[$aColorName.Count]
gvwColor.Columns.Count = 2
gvwColor.Mode = Select.Single
gvwColor.Columns[0].W = 24
gvwColor.Columns[0].Alignment = Align.Center
gvwColor.Rows.Count = $aColorName.Count + 1
cmbPrefix.List = $aPrefix
If $aPrefix Then
cmbPrefix.Show
@ -111,19 +91,51 @@ Public Sub Form_Open()
cmbPrefix.Hide
Endif
$aColorName = New String[]
hClass = CComponent.Classes["Color"]
If hClass Then
For Each hSym In hClass.Symbols
sColor = hSym.Name
If sColor = "Default" Then Continue
If InStr("RC", hSym.Kind) And If hSym.Type = "i" And If Not $aColorName.Exist(sColor) Then
$aColorName.Add(sColor)
Endif
Next
$aColorName.Sort()
$aPict = New Picture[$aColorName.Count]
gvwColor.Columns.Count = 2
gvwColor.Mode = Select.Single
gvwColor.Columns[0].W = 24
gvwColor.Columns[0].Alignment = Align.Center
gvwColor.Rows.Count = $aColorName.Count + 1
Endif
If Not IsNull(Val($sColor)) Then
gvwColor.Row = 0
dlgColor.SelectedColor = Val($sColor)
tabColor.Index = 1
iIndex = 1
Else
If $sColor Then
gvwColor.Row = $aColorName.Find($sColor) + 1
Else
gvwColor.Row = 0
Endif
tabColor.Index = 0
iIndex = 0
Endif
If Not hClass Then
iIndex = 1
tabColor[0].Visible = False
Endif
tabColor.Index = iIndex
dlgColor.ShowAlpha = $bAlpha
If $sTitle Then