04140155.txt 14-Apr-00


CellDoubleClick() Tip

When editing a database in a browser, I like to call up a
dialog window to make changes by double clicking on the
record I want to edit.

I have noticed different suggestions for implementing
CellDoubleClick since the method changed in VO2.5.  I am
dong it a different way.  I put the following method in my
App Global Module to get the action I want for a specific
datawindow.

METHOD CellDoubleClick()CLASS DataBrowser
DO CASE

  CASE ClassName(SELF:Owner:Owner) == #_WrkCntrDW
    SELF:Owner:Owner:EditPB()

  CASE ClaseName(SELF:Owner:Owner) == #_A_DifferentDW
    Self:Owner:Owner:DoSomethingElse()

ENDCASE
RETURN NIL


Anyone else doing it this way or have any comments about why
I shouldn't?

Regards;

Don Bjortomt


Don,

> Anyone else doing it this way or have any comments about
why I shouldn't?

Well, I wouldn't do it that way as it's a totally non-
generic, non-object oriented approach. You have to modify
your CASE statement for every new type of window you add.
Why not just do:

METHOD CellDoubleClick() CLASS DataBrowser

  IF IsMethod(self:owner:owner, #BrowseCellDoubleClick)
       self:owner:owner:BrowseCellDoubleClick(self:owner)
  ENDIF

Then all you need to do is give your container window a
method with the correct name and it's called automatically.
I'd pass self:owner to the method in case there's more than
one browser subwindow on your datawindow.

Mike

Mike,

Thanks for the comments.  I will give your approach a try.
Looks like it would be easier to follow.

--
Don Bjortomt