I have just noticed that in Xojo 2013 r3.1, when I set a listbox column to editable, I need to do 2 slow clicks to edit the column - is that expected behaviour?
If I double click at normal speed - nothing happens.
If I click, pause, click - it becomes editable.
I even tried putting my code Me.ColumnType(1) = ListBox.TypeEditable inside a DoubleClick event handler - but I still need to perform 2 slooooooow clicks in order for it to become editable.
I presume this must be the usual behaviour when editing a column inline, but thought I would double check here.
Thank you all in advance.
Are you saying you WANT the user to double click to edit your column? A double click should not normally be required. Me.ColumnType(1) = ListBox.TypeEditable should go in the open event of your lb. then in the cell click event just
Me.editcell(row, column) will allow the edit.
No - I was simply asking if it was usual behaviour to need to click twice slowly, in order for a listbox row to become editable?
Wow - that seems sooooo sluggish
I don’t remember how “natively” Xojo does it, since I haven’t used its ListBox for a long time. But you can see the behavior you described for example in Finder when you rename files.
It is much more sluggish than renaming a file in the finder
If you don’t want to require a double click, did you try the code I posted?
Roger - I was already using the same code, and it was then that I realised just how slow this is.
I will have to look for an alternative method
Just tried Roger code. It is instant. Have you added
Me.ColumnType(1) = ListBox.TypeEditable
in the open event and
in CellClick ?
I have tried numerous ways - will try that again in a moment.
As Michel indicated, using just a single click with code in the cellClick event is instantaneous. Not sure what you are seeing.
[quote=123508:@Richard Summers]I even tried putting my code Me.ColumnType(1) = ListBox.TypeEditable inside a DoubleClick event handler - but I still need to perform 2 slooooooow clicks in order for it to become editable.
First that won’t help… it should be set BEFORe any clicking…
Secondly the default behavior is that a row needs to be selected before a click on a cell will edit it… So if a row is not selected you need to click twice… The first time to select the row, the second to edit
If you want to edit a cell on the first click regardless of the selection state of the row, then in you want to edit the clicked on cell, then CellClick:
'if this is a cell you want to edit
BTW the docs on Listbox.EditCell are misleading. The way they are written it sounds like the cell or column type has to be set to TypeEditable, TypeEditableTextField or TypeEditableTextArea to use Listbox.EditCell…
That has NEVER been the case. You can call ListBox.EditCell for any cell regardless of the type… (even if it is set to checkbox)
If it’s type is not set to one of the editable types it defaults to behaving as if it was set to typeEditable or TypeEditableTextField. To edit with TextArea you have set the type.