When I double click a file in the file chooser I get the following message.
This appears before the 'Activate' process instigates.
When you click on 'Overwrite' the process then continues as normal.
Any suggestions ?
Note# this is not specific to any one project. I get this in all instances where the FileChooser component is being used.
Is there anyway to disable it ?FileChooser Message on Double click
- Quincunxian
- Posts: 175
- Joined: Sunday 25th June 2017 12:14am
- Location: Western Australia
FileChooser Message on Double click
Cheers - Quin.
I code therefore I am
I code therefore I am
- BruceSteers
- Posts: 1599
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: FileChooser Message on Double click
if you set the FileChoosers ReadOnly property it does not msg but you can still select items
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- cogier
- Site Admin
- Posts: 1129
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: FileChooser Message on Double click
This seems to be a bug. I can't find a way to capture the _DblClick() event. I even tried adding an Observer without success. The problem seems to have something to do with the FileChooser_Uncompress() routine which is in the FDirChooser.Class. Part of the code is below: -
I have come up with a workaround, try the following code: -
Select Case File.Name(fvwChoose.Current)
Case Like "*.tar.gz", "*.tar.bz2", "*.tgz", "*.tar"
Shell "cd " & Shell(fvwChoose.Dir) & ";tar tf " & Shell$(fvwChoose.Current) To sOutput
For Each sOutput In Split(Trim(sOutput), "\n")
If Right(sOutput) = "/" Then
sOutput = Left$(sOutput, -1)
If Not sShow Then sShow = sOutput
Endif
sPath = fvwChoose.Dir &/ sOutput
If Exist(sPath) Then
If iMsg <> 1 Then
Application.Busy = 0
iMsg = Message.Warning("<b>" & sOutput & "</b><p>" & ("This file or directory already exists."), ("Overwrite all"), ("Overwrite"), ("Cancel"))
If iMsg = 3 Then Return
Inc Application.Busy
Endif
Shell "rm -rf " & Shell$(fvwChoose.Dir &/ sOutput) Wait
Endif
Next
I have come up with a workaround, try the following code: -
Splitter1 As Splitter
DirView1 As DirView
FileView1 As FileView
Public Sub Form_Open()
With Me
.Height = 500
.Width = 800
.Padding = 5
.Arrangement = Arrange.Vertical
.Center
End With
Splitter1 = New Splitter(Me) As "Splitter1"
Splitter1.Expand = True
DirView1 = New DirView(Splitter1) As "DirView1"
DirView1.Expand = True
FileView1 = New FileView(Splitter1) As "FileView1"
FileView1.Expand = True
End
Public Sub Form_Arrange()
Splitter1.Layout = [30, 70]
End
Public Sub DirView1_Click()
FileView1.Dir = DirView1.Current
End
Public Sub FileView1_DblClick()
Message.Info("<h3>You double clicked on the file named: -\n<h1>" & FileView1.Current, "OK")
End
- BruceSteers
- Posts: 1599
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: FileChooser Message on Double click
Yeah FileChooser _DblCick does not do anything (there's some other controls have the same behaviour). The _Activate event fires on _DblClick instead for some reason? :-\cogier wrote: ↑Thursday 4th November 2021 3:24pm This seems to be a bug. I can't find a way to capture the _DblClick() event. I even tried adding an Observer without success. The problem seems to have something to do with the FileChooser_Uncompress() routine which is in the FDirChooser.Class. Part of the code is below: -
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- Quincunxian
- Posts: 175
- Joined: Sunday 25th June 2017 12:14am
- Location: Western Australia
Re: FileChooser Message on Double click
That fixed it.
Changing the FileChooser property ReadOnly to True stopped the pop-up message.
This has annoyed me for such a long time - thanks guys !
I use the Activate event to process a file selection on double click.
Edit: The reason that the Activate event is used, 'may' be that when you have a standard control like FileChooser, where it is made up of two controls;
Which control is being double clicked? I imagine that under the covers, there are two distinct double click events that are merged into an Activate event.
This is a guess but should not be too far from the truth.
Changing the FileChooser property ReadOnly to True stopped the pop-up message.
This has annoyed me for such a long time - thanks guys !
I use the Activate event to process a file selection on double click.
Edit: The reason that the Activate event is used, 'may' be that when you have a standard control like FileChooser, where it is made up of two controls;
Which control is being double clicked? I imagine that under the covers, there are two distinct double click events that are merged into an Activate event.
This is a guess but should not be too far from the truth.
Cheers - Quin.
I code therefore I am
I code therefore I am