[Gambas-user] close the FileDialog with a DBClick on a file

Gianluigi bagonergi at gmail.com
Tue Dec 14 15:08:37 CET 2021


Il giorno mar 14 dic 2021 alle ore 10:36 Charlie Reinl <
Karl.Reinl at fen-net.de> ha scritto:

> Am Montag, dem 13.12.2021 um 19:32 -0500 schrieb T Lee Davidson:
> > FileChooser. FileDialog, to my knowledge, does not exist.
>
> Salut Lee,
>
> you right FFileDialog.* ist the Sourcecode for FileChooser.
> I lookt there to find out where the message comes from.
>
> But in fchChoose_Activate() I found the message part commented out.
>     ' If Not fchChoose.ReadOnly Then
>     '   If Exist(sPath) Then
>     '     If Message.Warning(("This file already exists.\n\nDo you want
> to overwrite it?"), ("&Overwrite"), ("Cancel")) = 2 Then Return
>     '   Endif
>     ' Endif
>
> So I wonder where the message comes from
> --
> Amicalement
> Charlie
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>

You can see it in gb.form here:

File/Chooser/FDirChooser.class(893):

Private Sub CheckFile() As Boolean ' FIXME: If 'As Boolean' is forgotten,
and 'Return True' is removed, we can get an interpreter crash

  Dim sPath As String
  Dim sFile As String

  If Not txtFile.Visible Then Return
  If txtFile.ReadOnly Then Return
  If GetMulti() Then Return

  sFile = txtFile.Text
  If Not sFile Then Return True

  If InStr(sPath, "/") Then
    txtFile.Text = File.Name(sPath)
    SetDir(File.Dir(sPath))
    Return True
  Endif

  If Exist(dvwChoose.Current &/ sFile) Then
    If Message.Warning(("This file already exists.\n\nDo you want to
overwrite it?"), ("&Overwrite"), ("Cancel")) = 2 Then Return True
  Endif

End

Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20211214/0e930a51/attachment.htm>


More information about the User mailing list