FileView: 'ShowDetailed' is now deprecated. Update documentation

[GB.FORM]
* BUG: FileView: Setting 'ShowDetailed' to TRUE has now the same effect as setting 'View' to 'Detailed'.
* NEW: FileView: 'ShowDetailed' is now deprecated.
* BUG: Fix runtime deprecation messages.
* NEW: Update documentation.
This commit is contained in:
Benoît Minisini 2023-11-04 21:32:27 +01:00
parent 97e9ae0749
commit fd8781cae4
8 changed files with 73 additions and 20 deletions

View file

@ -1,6 +1,6 @@
# Gambas Project File 3.0
Title=More controls for graphical components
Startup=FTestTabPanel
Startup=FTestFileChooser
Icon=.hidden/icon.png
Version=3.18.90
VersionFile=1

View file

@ -41,7 +41,7 @@ Private Sub Animated_Write((Value) As Boolean)
Static bWarn As Boolean
If bWarn Then Return
Error "gb.form: warning: SwitchButton.Animated is deprecated."
Error "gb.form: warning: 'SwitchButton.Animated' is deprecated."
bWarn = True
End

View file

@ -143,12 +143,14 @@ End
Private Function ShowDetailed_Read() As Boolean
Error "gb.form: warning: 'FileView.ShowDetailed' is deprecated. Use 'FileView.View' instead."
Return frmChooser.GetShowDetailed()
End
Private Sub ShowDetailed_Write(bShowDetailed As Boolean)
Error "gb.form: warning: 'FileView.ShowDetailed' is deprecated. Use 'FileView.View' instead."
frmChooser.SetShowDetailed(bShowDetailed)
End

View file

@ -896,17 +896,17 @@ End
Private Function ShowDetailed_Read() As Boolean
Return $hColumnView.Visible
Return View_Read() = Detailed
End
Private Sub ShowDetailed_Write(bDetailed As Boolean)
Private Sub ShowColumnView(bShow As Boolean)
Dim hOld As Control
If bDetailed = ShowDetailed_Read() Then Return
If bShow = $hColumnView.Visible Then Return
If bDetailed Then
If bShow Then
hOld = $hIconView
$hColumnView.Show
@ -928,6 +928,17 @@ Private Sub ShowDetailed_Write(bDetailed As Boolean)
End
Private Sub ShowDetailed_Write(bDetailed As Boolean)
If bDetailed Then
View_Write(Detailed)
Else
View_Write(Normal)
Endif
End
Public Sub View_Select()
Raise {Select}
@ -1661,24 +1672,58 @@ Private Sub View_Write(Value As Integer)
If Value = View_Read() Then Return
ShowPreview_Write(False)
If Value = Detailed Then
ShowDetailed_Write(True)
Else
iIconSize = GetIconSize()
ShowDetailed_Write(False)
If Value = Compact Then
$hIconView.Orientation = Arrange.Horizontal
Else
Select Case Value
Case Normal
ShowPreview_Write(False)
iIconSize = GetIconSize()
ShowColumnView(False)
$hIconView.Orientation = Arrange.Vertical
If Value = Preview Then ShowPreview_Write(True)
Endif
Case Compact
ShowPreview_Write(False)
iIconSize = GetIconSize()
ShowColumnView(False)
$hIconView.Orientation = Arrange.Horizontal
Case Detailed
ShowPreview_Write(False)
ShowColumnView(True)
Case Preview
ShowPreview_Write(False)
iIconSize = GetIconSize()
ShowColumnView(False)
$hIconView.Orientation = Arrange.Vertical
ShowPreview_Write(True)
End Select
If Value <> Detailed Then
UpdateIconView
If iIconSize <> GetIconSize() Then
RefreshViewLater(True)
Endif
Endif
' ShowPreview_Write(False)
' If Value = Detailed Then
' ShowColumnView(True)
' Else
' iIconSize = GetIconSize()
' ShowColumnView(False)
' If Value = Compact Then
' $hIconView.Orientation = Arrange.Horizontal
' Else
' $hIconView.Orientation = Arrange.Vertical
' If Value = Preview Then ShowPreview_Write(True)
' Endif
' UpdateIconView
' If iIconSize <> GetIconSize() Then
' RefreshViewLater(True)
' Endif
' Endif
End
Private Sub UpdateIconView()

View file

@ -16,7 +16,7 @@ Property Value As String
Property FixedOnly As Boolean
Property ShowStyle As Boolean
Property ShowPreview As Boolean
Property ShowLabel As Boolean '' Deprecated
Property ShowLabel As Boolean
Property ShowRelative As Boolean
'' Return or set if font preview is displayed
@ -123,12 +123,14 @@ End
Private Function ShowLabel_Read() As Boolean
Error "gb.form: warning: 'FontChooser.ShowLabel' is deprecated."
Return frmChooser.IsShowLabel()
End
Private Sub ShowLabel_Write(Value As Boolean)
Error "gb.form: warning: 'FontChooser.ShowLabel' is deprecated."
frmChooser.SetShowLabel(Value)
End

View file

@ -710,7 +710,7 @@ End
Static Private Function List_Read() As String[]
Error "gb.form: warning: Stock.List is deprecated. Use Stock.Icons instead"
Error "gb.form: warning: 'Stock.List' is deprecated. Use 'Stock.Icons' instead"
Return Icons_Read()
End

View file

@ -405,6 +405,10 @@ Public Sub SelectAll()
End
'' @{since 3.19}
''
'' Unselect the editor contents.
Public Sub Unselect()
Dim hCtrl As Object = $hCtrl

View file

@ -434,7 +434,7 @@ End
Private Sub Animated_Write((Value) As Boolean)
If $bDeprecated Then Return
Error "gb.form: Wizard.Animated is deprecated"
Error "gb.form: 'Wizard.Animated' is deprecated."
$bDeprecated = True
End