Commit 8cf76955 authored by Benoît Minisini's avatar Benoît Minisini
Browse files

Form editor: Do not crash if a control in "_Similar" does not exist, and fix...

Form editor: Do not crash if a control in "_Similar" does not exist, and fix the coherency test on "_DrawWith" property.

[DEVELOPMENT ENVIRONMENT]
* BUG: Form editor: Do not crash if a control in "_Similar" does not exist.
* BUG: Form editor: Fix the coherency test on "_DrawWith" property.
parent 0bf8f99f
Pipeline #309434628 passed with stage
in 22 minutes and 26 seconds
......@@ -438,6 +438,7 @@ Public Sub GetSimilars() As String[]
For Each sSimilar In cSimilar
hClass = Project.Documentation.Classes[cSimilar.Key]
If Not hClass Then Continue
If hClass.IsDeprecated() And If Not FToolBox.IsDeprecatedVisible() Then Continue
aSimilar.Add(cSimilar.Key)
Next
......
......@@ -142,6 +142,15 @@ Static Public Sub GetIcon(sClass As String, sComp As String, Optional iSize As I
End
Private Sub IsContainerClass(hClass As Class) As Boolean
If hClass.Name = "Container" Then Return True
If Not hClass.Parent Then Return
Return IsContainerClass(hClass.Parent)
End
Private Function CreateControl(sName As String, sClass As String, hParent As Object) As Object
Dim hCtrl As Object
......@@ -164,11 +173,18 @@ Private Function CreateControl(sName As String, sClass As String, hParent As Obj
Endif
NoParent = Not hClass.ConstructorNeedParent()
hClassDraw = Project.Documentation.Classes[sClass]
If IsMultiContainer() Then
If Not hClassDraw.MultiContainer Then sClass = "TabPanel"
If sClass <> "TabPanel" And If sClass <> "TabStrip" Then
hClassDraw = Project.Documentation.Classes[sClass]
If Not hClassDraw Or If Not hClassDraw.MultiContainer Then sClass = "TabPanel"
Endif
Else If IsContainer() Then
If Not hClassDraw.Container Then sClass = "Panel"
If Class.IsLoaded(sClass) Then
If Not IsContainerClass(Classes[sClass]) Then sClass = "Panel"
Else
hClassDraw = Project.Documentation.Classes[sClass]
If Not hClassDraw Or If Not hClassDraw.Container Then sClass = "Panel"
Endif
Endif
Select Case LCase(sClass)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment