Detecting Double-Click Event on List View

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Detecting Double-Click Event on List View

Runar Jordahl-2
I am using EditableListView v1.10 (http://www.solutionsoft.co.uk/widgets/)
from Solutions Software. For one of the columns I want to bring up a dialog
(to select the appropriate item) for the selected cell. What action causes
the dialog to appear is not that important. A double click on the cell, or a
double click on the row, would be fine. Another, and perhaps better
solution, would be if the cell contained a button, which upon clicking would
trigger the event to get the dialog. Has anyone done anything like this in
Dolphin Smalltalk?



I note that a column can contain EmbeddedCheckBox, and I could modify this
class, or create my own EmbeddedPushButton.



This EditableListView widget seems to inherit from the default list view, so
maybe there is a solution to this also using the standard widgets.



Runar Jordahl

http://www.epigent.com/


Reply | Threaded
Open this post in threaded view
|

Re: Detecting Double-Click Event on List View

Christopher J. Demers
"Runar Jordahl" <[hidden email]> wrote in message
news:42360b00$[hidden email]...
>I am using EditableListView v1.10 (http://www.solutionsoft.co.uk/widgets/)
>from Solutions Software. For one of the columns I want to bring up a dialog
>(to select the appropriate item) for the selected cell. What action causes
>the dialog to appear is not that important. A double click on the cell, or
>a double click on the row, would be fine. Another, and perhaps better
>solution, would be if the cell contained a button, which upon clicking
>would trigger the event to get the dialog. Has anyone done anything like
>this in Dolphin Smalltalk?
...

If double clicking on a row is enough then you can use the actionPerformed
event in the createSchematicWiring method. ex:

listPresenter when: #actionPerformed send: #cmdOpenEditDialog to: self.

This will send the cmdOpenEditDialog message when the row is double clicked.

Chris


Reply | Threaded
Open this post in threaded view
|

Re: Detecting Double-Click Event on List View

Chris Uppal-3
Christopher J. Demers wrote:

> If double clicking on a row is enough then you can use the actionPerformed
> event in the createSchematicWiring method. ex:

Though that only works (as far as I can see) if you double-click the row icon,
or on a column that is not #isEditable (or the same for hitting <return>).
Which may be perfectly adequate for Runar's purposes; if not then it looks like
creating an EmbeddedPushButton is the way to go -- not something that /I'd/
want to have to code...

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Detecting Double-Click Event on List View

John Aspinall-5
Chris Uppal wrote

> Though that only works (as far as I can see) if you double-click the row icon,
> or on a column that is not #isEditable (or the same for hitting <return>).
> Which may be perfectly adequate for Runar's purposes; if not then it looks
like
> creating an EmbeddedPushButton is the way to go -- not something that /I'd/
> want to have to code...

...(un?)fortunately I've already had to!

I've pulled the relevant changes out of my dev environment and parcelled them up
as a bolt-on to the 1.10 version of EditableListView; you can grab them here:

http://www.solutionsoft.co.uk/widgets/ELVButtons.zip

The most important thing to note is that the getContentsBlock of the column
controls whether the button is enabled, on a line-by-line basis (it's evaluated
with the contents of each line). If you need the button to always be enabled,
you need to set the getContentsBlock to something like

MessageSend receiver: true selector: #yourself

Both approaches are demo'd in the the two demo views.

Best regards,

John Aspinall
Solutions Software
http://www.solutionsoft.co.uk/restore
http://www.solutionsoft.co.uk/toolsplus