04140010.txt 14-Apr-00
Browser in DialogWindow
I'm trying to put a DataBrowser on a DialogWindow without
success. It's just a little higher then what I know. Can
someone help me because I can't get it showing. Supposed I
have everything wrong.
--
Jean-Marie Berthiaume
To add to this:
Even if the Help file says:
"The DataListView control uses internally a virtual list
view, which means that its speed is independent of the total
number of records in your database."
I find that untrue. An incremental search from an SLE is
dependant of the size of the database or is it because I'm
using an indexed database. With a browser the result is
instantaneous, with a datalistview it's eternity.
Jean-Marie Berthiaume
Use a DataDialog - that's your only option with databrowsers
really.
Nope, this won't give me some special features I'm trying to
get.
Jean-Marie Berthiaume
Jean-Marie,
Stephane offered a good summary a while back of how to do
this. See below.
The trick is simply to offer the browser the same messages
and resources it relies on from a datawindow. I must admit,
though, fine tuning it is a little difficult without the SDK
because you can just look up a particular message to see
what the datawindow does with it and then copy that into the
dialogwindow. Anyway, this works, although it is a long time
since I played with this.
Geoff
---------------------------------------------------
Richard,
No I'm not using GridPro
Ok, here's how:
First, subclass the DataBrowser:
--------------------
Class DB inherit DataBrowser
Method Init(oOwner,nID,oPoint) class DB
Super:Init(oOwner,nID,oPoint,oOwner:Size)
Method Validate() class DB
Return true
---------------------
Then, in a DialogWindow:-----------------------
class BrowseContDLG inherit DIALOGWINDOW
protect oDB as DB
protect oServer as DBServer
Method Notify(kNotifyName) class BrowseContDLG
return kNotifyName
Method Dispatch(oEvent) class BrowseContDLG
do case
case oEvent:Message=WM_CLOSE
self:oServer:UnRegisterClient(self:oDB,false)
self:oDB:Destroy()
self:oServer:=null_object
endcase
Return super:Dispatch(oEvent)
Method PostInit() class BrowseContDLG
sefl:oServer:=MyServer{}
self:oDB:=DB{self,-1,Point{0,0}}
self:oDB:Use(self:oServer)
self:oDB:Show()
-------------------------------------
That's a simple way of doing it.
Stephane
Thank you Geoff.
With your help and Stephane's suggestion you mention I
finally create what I wanted: a SingleLineEdit in a window
creates a floating ToolWindow containing a browsed field in
which the SLE:Value is searched. The ToolWindow is always on
top of the app. With a MouseDoubleClick you can hide/show
the ToolWindow or if in a cell of the ToolWindow update de
SLE:Value. If someone want to take a look at it I will be
happy to get some feedback and improvements. I find it quite
faster then a DataListView but I don't have a big database
maybe that's make a difference.
Jean-Marie Berthiaume
Jean-Marie,
I would be very interested to see what you have done. And if
it is of any use I can plug a 300,000 record DBF into it for
you. Depending on how it works (ie your comments on speed)
it may be yet another alternate for pop-up lists where combo
boxes are just too slow.
Geoff
Jean-Marie,
I have recieved your demo and tested it out. I have sent you
a private reply on this but the guts of the matter is that
it works just as fast with 100,000 or more records. Its
speed is independent of DBF size.
Geoff
               (
geocities.com/n_s_wong/vo)                   (
geocities.com/n_s_wong)