xsharp.eu • What's the trick to CellDoubleClick() in bBrowser?
Page 1 of 1

What's the trick to CellDoubleClick() in bBrowser?

Posted: Tue May 28, 2019 6:18 am
by Anonymous
Hi all.

I have this code working brilliantly in a "standard VO" Browse View:
METHOD CellDoubleClick() CLASS DataBrowser
LOCAL MyEditWindow as JobNoRep
Local nRecNo
nRecNo := RECNO()
self:oDataServer:GoTo(nRecNo)
self:oDataServer:FIELDGET(#JobDate)
MyEditWindow := JobNoRep{,,self:oDataServer,nRecNo}
MyEditWindow:SERVER:GoTo(nRecNo)
MyEditWindow:Show(SHOWCENTERED)
self:owner:owner:Endwindow()

RETURN nil

How do I achieve the exact same result (same screen called etc) in bBrowser please? All I mostly get is the attached message, which really tells me bugger all. I read in the "old" vo forum a few things about a known issue but haven't found any solution as yet. Hitting "Debug" locks VO up completely...

Thanks again.

Jeff

What's the trick to CellDoubleClick() in bBrowser?

Posted: Tue May 28, 2019 6:45 am
by wriedmann
Hi Jeff,

you have to use the Recno() method of the bBrowsers server, open up a new server instance and move on this record.
Probably closing the bBrowser window closes also the related server.
And please don't forget that the bBrowser server can be also the server of the window itself, but in many cases it will not be.
I'm using similar code:

Code: Select all

method CellDoubleClick( oEvent ) class MAuftragSubEdit7
     local oEdit			as MAufKostDialog

 	if oDCMAufKostGrid:Server != null_object .and. oDCMAufKostGrid:Server:EOF == false  
 		oEdit				:= MAufKostDialog{ self:Owner:Owner, oDCMAufKostGrid:Server }
 		oEdit:Show( SHOWCENTERED )
 	endif

	return nil
But this code is not closing the browser window (and I do this never, but let it open or hide it temporarily).

Wolfgang

What's the trick to CellDoubleClick() in bBrowser?

Posted: Tue May 28, 2019 7:01 am
by MathiasHakansson
Hi Jeff,

If you are doing it like this (bBrowser as a replacement browser in datawindow BrowseView)

https://groups.google.com/forum/?hl=sv& ... 6PaB_ZqiMJ

you can use the CellDoubleClick Event in the datawindow like Wolfgang showed you. If you have an inherited bBrowser class you can do something like;

method MouseButtonDoubleClick(oMouseEvent) class bInheritedBrowser
local oP as Point
local oC as bCell
local oCol as bDataColumn

if self:lInProcess
return ISEXECUTED
endif

if oMouseEvent:IsLeftButton
oP := Point{LoWord(oMouseEvent:LParam),HiWord(oMouseEvent:LParam)}
oC := self:GetCellToPoint(oP)
oCol := self:GetOpenColumn(oC:column)

if !Empty(oCol) .and. InList(oCol:fieldsym,#IDEL,#PDEL,#BDEL)
self:owner:DoSomething() // On the datawindow owner

self:EventReturnValue := ISEXECUTED

return self:EventReturnValue
endif
endif

return super:MouseButtonDoubleClick(oMouseEvent)

//Mathias

What's the trick to CellDoubleClick() in bBrowser?

Posted: Tue May 28, 2019 8:46 am
by BiggyRat
Brilliant! Thanks very much Mathias and Wolfgang! Very much appreciated..... again!