[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:
parent
d46004d1fe
commit
e05dffd530
1 changed files with 35 additions and 23 deletions
|
@ -80,30 +80,10 @@ 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)
|
||||||
|
|
||||||
$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
|
cmbPrefix.List = $aPrefix
|
||||||
If $aPrefix Then
|
If $aPrefix Then
|
||||||
cmbPrefix.Show
|
cmbPrefix.Show
|
||||||
|
@ -111,19 +91,51 @@ Public Sub Form_Open()
|
||||||
cmbPrefix.Hide
|
cmbPrefix.Hide
|
||||||
Endif
|
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
|
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
|
||||||
|
|
Loading…
Reference in a new issue