I started in that prject using the CellClick Event to edit the clicked Cell.
Then, I commented out the code and add the DoubleCLick Event, then put the code below.
EditMode is a Boolean set / unset by a MenuItem
At last, I am happy (nearly) with that, but the delay between the two clicks is long, very long, can be minutes
Whats your experience ?
[code]Sub DoubleClick()
Dim row As Integer
Dim column As Integer
// From the Language Reference
row = Me.RowFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - Self.Top)
column = Me.ColumnFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - Self.Top)
If EditMode Then
LB.CellType(row,column) = ListBox.TypeEditableTextField
LB.EditCell(row,column)
Else
LB.CellType(row,column) = ListBox.TypeNormal
End If
End Sub[/code]
I just checked with 2014r3 and get the same results.
I discovers that after a click to select a Row and I was feeling thirsty After the drink (water with minth syrup), I issued a second click i the already selected line and have the Cell ready to be edited
On 2015R2.2 (Windows 7 64bit) I am not seeing the problem. The double click timeout is no more that what see in any other app. Besides, I believe that the double click timeout is set by the system, not Xojo (correct me if I’m wrong here) so perhaps it is something in your system’s settings. Are you sure you completely eliminated all of the code in the CellClick event, including the return value?
If it not returning until minutes later, something else is going on. Likely something with the Return value as Dale mention. I had a similar issue with MouseDown, this solved it:
the last test Ive done, with 2015r3, I only run the project in the IDE, load a test file, click in a Row, wait a bit of time, click a second time in the same Row and got the last clicked Cell set as Editable (ready to be edited).
the last test Ive done, with 2015r3, I only run the project in the IDE, load a test file, click in a Row, wait a bit of time, click a second time in the same Row and got the last clicked Cell set as Editable (ready to be edited).[/quote]
[quote=224368:@Emile Schwarz]I started in that prject using the CellClick Event to edit the clicked Cell.
Then, I commented out the code and add the DoubleCLick Event, then put the code below.
EditMode is a Boolean set / unset by a MenuItem
At last, I am happy (nearly) with that, but the delay between the two clicks is long, very long, can be minutes
Whats your experience ?
[code]Sub DoubleClick()
Dim row As Integer
Dim column As Integer
// From the Language Reference
row = Me.RowFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - Self.Top)
column = Me.ColumnFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - Self.Top)
If EditMode Then
LB.CellType(row,column) = ListBox.TypeEditableTextField
LB.EditCell(row,column)
Else
LB.CellType(row,column) = ListBox.TypeNormal
End If
End Sub[/code]
I just checked with 2014r3 and get the same results.
I discovers that after a click to select a Row and I was feeling thirsty After the drink (water with minth syrup), I issued a second click i the already selected line and have the Cell ready to be edited [/quote]
I created a simple project with just a LB ListBox and your code into its doubleclick event. It does not do what you describe. There must be something else in your code that does what you describe.
Would be constructive if you posted a sample project demonstrating what you see.
I way not be crystal clear. So I will restate the trouble:
I implemented the shared code in an added DoubleClick Event in a ListBox. That seems clear.
Then, while using teh application, I noticed that sometimes, I click in an already selected Row and fall into Edit Mode. In no way, this was a double click. Two clicks were done in the same Row, but with a long delay between them, far more than what anyone can call a double click.
Michel suggest it, I will (try to) do itas soon as I can get some minutes to do that.
The delay is not as long as it can be on my real project, but it can be around 1 second long
You may run the standalone with the trouble from here. OS X only (sorry for the WIndows only people)
Drop a Tab + Return text file or a csv (double quoted fields + comma) on the main window,
then click to select one Row,
ctrl-E to set the Edit Mode On,
then click in the already selected Row will let you Edit the clicked Cell.
Nota: rough application (beta stage) who works fine with me, but it is with me [ ;- ]. Some features are not implemented, others works only during the application run, etc.
So as I go around double clicking cells to edit, they get changed to auto-edit and thereafter simply clicking it once when selected will start editing.
Doesn’t Axels code solve it?
[quote=224507:@Axel Schneider]why not simple?
If EditMode Then
LB.EditCell(row,column)
Else
return
End If[/quote]
I tried your TestProject, I can not notice any delay in DoubleClick
(what I always do in OS X, is to disable the focus ring in a ListBox)
and I think
If EditMode Then
LB.EditCell(row,column)
End If
is enough
from LR:
The values of CellType > 0 (Default) override ColumnType.
For example, if ColumnType is 2, but a cell in the column has CellType set to 1, the cell will be normal.
I will try the application after I boot on El Capitan (from an external HD) later today.
Remember: what I called delay between two clicks is can be a click to select the Row, then seconds to minutes later, a second click (in the same Row) will enable the Cell Editing.
Also, the project latency between the two clicks is far less, but can be around 1 second (0.75 ?). That is why I uploaded a stand alone of the application (OS X only).