Commit 6e5930ff authored by Benoît Minisini's avatar Benoît Minisini
Browse files

Form editor: Group property is now associated with a combo-box containing a...

Form editor: Group property is now associated with a combo-box containing a list of already used group names.

[DEVELOPMENT ENVIRONMENT]
* NEW: Form editor: Group property is now associated with a combo-box containing a list of already used group names.
parent c9196328
Pipeline #361926846 passed with stage
in 26 minutes and 18 seconds
......@@ -357,8 +357,8 @@ Private Sub WriteMenu() As Boolean
Return True
Endif
If CControl.CheckName(txtGroup.Text) Then
ShowWarning(("Bad group name !"), txtGroup)
If CControl.CheckName(cmbGroup.Text) Then
ShowWarning(("Bad group name !"), cmbGroup)
Return True
Endif
......@@ -372,7 +372,7 @@ Private Sub WriteMenu() As Boolean
.Caption = Trim(txtCaption.Text)
.Action = Trim(txtAction.Text)
.Group = Trim(txtGroup.Text)
.Group = Trim(cmbGroup.Text)
.Visible = chkVisible.Value
.Enabled = chkEnabled.Value
.Checked = chkChecked.Value
......@@ -414,7 +414,7 @@ Private Sub ReadMenu()
txtName.Text = .Name
txtCaption.Text = .Caption
txtAction.Text = .Action
txtGroup.Text = .Group
cmbGroup.Text = .Group
chkVisible.Value = .Visible
chkEnabled.Value = .Enabled
chkChecked.Value = .Checked
......@@ -1304,10 +1304,10 @@ Public Sub txtTag_Change()
End
Public Sub txtGroup_Change()
Public Sub cmbGroup_Change()
If WriteMenu() Then Return
ApplyToSelection("Group", Trim(txtGroup.Text))
ApplyToSelection("Group", Trim(cmbGroup.Text))
End
......@@ -1326,3 +1326,28 @@ Public Sub dwgShortcut_Draw()
Style.PaintBox(0, 0, Paint.W, Paint.H)
End
Private Sub GetGroupList() As String[]
Dim aGroup As New String[]
Dim sGroup As String
Dim hMenu As CMenu
For Each hMenu In $aMenu
sGroup = hMenu.Group
If Not sGroup Then Continue
If aGroup.ExistSorted(sGroup) Then Continue
aGroup.Add(sGroup)
aGroup.Sort()
Next
aGroup.Add("", 0)
Return aGroup
End
Public Sub cmbGroup_GotFocus()
cmbGroup.List = GetGroupList()
End
......@@ -148,11 +148,9 @@
#Translate = False
Text = "Group"
}
{ txtGroup ButtonBox
{ cmbGroup ComboBox
MoveScaled(13,4,35,4)
Expand = True
Button = False
ClearButton = True
}
{ Label2 Label
MoveScaled(0,8,13,4)
......
......@@ -568,20 +568,6 @@ Private Sub InitComboWith(aList As String[], Optional sVoid As String)
If Not IsMissing(sVoid) Then aList.Add(sVoid, 0)
cmbProperty.List = aList
' Dim hMenu As Menu
' Dim sVal As String
'
' mnuProperty.Children.Clear
'
' If sVoid Then
' hMenu = New Menu(mnuProperty) As "mnuProperty"
' hMenu.Text = sVoid
' Endif
' For Each sVal In aList
' hMenu = New Menu(mnuProperty) As "mnuProperty"
' hMenu.Text = sVal
' Next
End
Private Sub ShowProperty(Optional sFocus As String)
......@@ -705,8 +691,8 @@ Private Sub ShowProperty(Optional sFocus As String)
Select Case $sType
Case "i", "l", "f", "d", "v", "Name", "Group" ', "EventName"
Case "i", "l", "f", "d", "v", "Name"
Case "s"
If hProp.ConstantList Then
hEditor = cmbProperty
......@@ -808,6 +794,12 @@ Private Sub ShowProperty(Optional sFocus As String)
Case "Angle"
hEditor = txtAngle
Case "Group"
hEditor = cmbProperty
cmbProperty.ReadOnly = False
InitComboWith(GetGroupList())
Case Else 'object
hEditor = cmbProperty
......@@ -1369,3 +1361,23 @@ Public Sub btnSortProperties_Click()
RefreshAll
End
Private Sub GetGroupList() As String[]
Dim hCCtrl As CControl
Dim aGroup As New String[]
Dim sGroup As String
For Each hCCtrl In $hForm.Control
If hCCtrl.Kind = "Menu" Then Continue
sGroup = hCCtrl.GetProperty(CPropertyInfo.EVENT_NAME)
If Not sGroup Then Continue
If aGroup.ExistSorted(sGroup) Then Continue
aGroup.Add(sGroup)
aGroup.Sort()
Next
aGroup.Add("", 0)
Return aGroup
End
......@@ -107,7 +107,7 @@ End
Public Sub Welcome()
frmWelcome.Show
'frmWelcome.SetFocus
dwgWelcome.Refresh
End
......
......@@ -1155,7 +1155,7 @@
Picture = Picture["icon:/small/internet"]
}
{ ToolButton17 ToolButton
MoveScaled(3,4,4,4)
MoveScaled(4,4,4,4)
Visible = False
ToolTip = ("Software farm")
Action = "farm"
......
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