[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,11 +80,21 @@ Public Sub Form_Open()
Dim hClass As CClassInfo Dim hClass As CClassInfo
Dim hSym As CSymbolInfo Dim hSym As CSymbolInfo
Dim sColor As String Dim sColor As String
Dim iIndex As Integer
Settings.Read(Me) Settings.Read(Me)
cmbPrefix.List = $aPrefix
If $aPrefix Then
cmbPrefix.Show
Else
cmbPrefix.Hide
Endif
$aColorName = New String[] $aColorName = New String[]
hClass = CComponent.Classes["Color"] hClass = CComponent.Classes["Color"]
If hClass Then
For Each hSym In hClass.Symbols For Each hSym In hClass.Symbols
sColor = hSym.Name sColor = hSym.Name
@ -104,26 +114,28 @@ Public Sub Form_Open()
gvwColor.Columns[0].Alignment = Align.Center gvwColor.Columns[0].Alignment = Align.Center
gvwColor.Rows.Count = $aColorName.Count + 1 gvwColor.Rows.Count = $aColorName.Count + 1
cmbPrefix.List = $aPrefix
If $aPrefix Then
cmbPrefix.Show
Else
cmbPrefix.Hide
Endif Endif
If Not IsNull(Val($sColor)) Then If Not IsNull(Val($sColor)) Then
gvwColor.Row = 0 gvwColor.Row = 0
dlgColor.SelectedColor = Val($sColor) dlgColor.SelectedColor = Val($sColor)
tabColor.Index = 1 iIndex = 1
Else Else
If $sColor Then If $sColor Then
gvwColor.Row = $aColorName.Find($sColor) + 1 gvwColor.Row = $aColorName.Find($sColor) + 1
Else Else
gvwColor.Row = 0 gvwColor.Row = 0
Endif Endif
tabColor.Index = 0 iIndex = 0
Endif Endif
If Not hClass Then
iIndex = 1
tabColor[0].Visible = False
Endif
tabColor.Index = iIndex
dlgColor.ShowAlpha = $bAlpha dlgColor.ShowAlpha = $bAlpha
If $sTitle Then If $sTitle Then