Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #1615 > unrolled thread

bBrowser search and retrieve

Started byGrant <grantd@dunsmoreinfo.com>
First post2011-07-06 14:47 -0700
Last post2011-07-09 03:53 -0700
Articles 10 — 5 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  bBrowser search and retrieve Grant <grantd@dunsmoreinfo.com> - 2011-07-06 14:47 -0700
    Re: bBrowser search and retrieve "Gerhard Bunzel" <g.bunzel@domonet.de> - 2011-07-07 02:40 +0200
      Re: bBrowser search and retrieve Grant <grantd@dunsmoreinfo.com> - 2011-07-07 16:00 -0700
        Re: bBrowser search and retrieve "Stephen Quinn" <stevejqNO@bigpondSPAM.net.au> - 2011-07-08 10:52 +1000
          Re: bBrowser search and retrieve Grant <grantd@dunsmoreinfo.com> - 2011-07-08 10:57 -0700
            Re: bBrowser search and retrieve "Jamal" <vodotnet_nospam@yahoo.com> - 2011-07-08 15:34 -0400
            Re: bBrowser search and retrieve "Gerhard Bunzel" <g.bunzel@domonet.de> - 2011-07-08 22:04 +0200
              Re: bBrowser search and retrieve Grant <grantd@dunsmoreinfo.com> - 2011-07-08 14:56 -0700
            Re: bBrowser search and retrieve "Stephen Quinn" <stevejqNO@bigpondSPAM.net.au> - 2011-07-09 11:29 +1000
              Re: bBrowser search and retrieve "richard.townsendrose" <richard.townsendrose@gmail.com> - 2011-07-09 03:53 -0700

#1615 — bBrowser search and retrieve

FromGrant <grantd@dunsmoreinfo.com>
Date2011-07-06 14:47 -0700
SubjectbBrowser search and retrieve
Message-ID<f3bb48b4-4bcb-4c00-851f-c03dc5b15644@v12g2000vby.googlegroups.com>
I have a bBrowser and I want to enter data by typing the target data
in a cell and have the app search for the target data in small master
tables. I thought it could be like using an EditChange/EditFocusChange
methods for an sle cell in a standard VO window that will search after
each charactor is entered. Can I do this within a browser? Maybe
FocusChange but I haven't got it to work?
I have used the browser's CellEdit method to bring up a table and then
the user has to choose the data and click on it with the mouse. I want
to go directly to a search in the field when the user starts to type
characters and return a value from the popup table which doesen't have
to display unless the search fails.
I haven't been able to find this process in any samples and my own
attempts haven't been successful.
I may be overcomplicating a simple process in my own mind but any
suggestions might help me get moving again.
Thank you.

[toc] | [next] | [standalone]


#1616

From"Gerhard Bunzel" <g.bunzel@domonet.de>
Date2011-07-07 02:40 +0200
Message-ID<iv2vad$b13$1@news-1.m-online.net>
In reply to#1615
Grant,

Register your own EventHandler for the bBrowser in Init() or PostInit() of 
your Browserwindow:

METHIOD PostInit() CLASS MyBrowserWindow
.....
bRegisterByEventHandler(SELF:oDCbBrowser, SELF, #EventHandler, TRUE)


Now use that EventHandler to catch the typed characters:

METHOD EventHandler (oEvent) CLASS MyBrowserWindow

 IF oEvent:uMsg == WM_CHAR
   IF oEvent:Window == SELF:oDCbBrowser .AND. oEvent:wParam >=32
    ...
    build your Search-String:
    cSearch += Upper(CHR(oEvent:wParam))
    .....
    Now you can do your search and display some search-infos



Unregister your EventHandler:
METHOD Destroy () CLASS MyBrowserWindow

 bUnregisterByEventHandler(SELF:oDCbBrowser, SELF)

RETURN SUPER:Destroy()



HTH


Gerhard



"Grant" <grantd@dunsmoreinfo.com> schrieb im Newsbeitrag 
news:f3bb48b4-4bcb-4c00-851f-c03dc5b15644@v12g2000vby.googlegroups.com...
>I have a bBrowser and I want to enter data by typing the target data
> in a cell and have the app search for the target data in small master
> tables. I thought it could be like using an EditChange/EditFocusChange
> methods for an sle cell in a standard VO window that will search after
> each charactor is entered. Can I do this within a browser? Maybe
> FocusChange but I haven't got it to work?
> I have used the browser's CellEdit method to bring up a table and then
> the user has to choose the data and click on it with the mouse. I want
> to go directly to a search in the field when the user starts to type
> characters and return a value from the popup table which doesen't have
> to display unless the search fails.
> I haven't been able to find this process in any samples and my own
> attempts haven't been successful.
> I may be overcomplicating a simple process in my own mind but any
> suggestions might help me get moving again.
> Thank you. 

[toc] | [prev] | [next] | [standalone]


#1641

FromGrant <grantd@dunsmoreinfo.com>
Date2011-07-07 16:00 -0700
Message-ID<2facc909-d29a-47d0-87fb-189a991a99ad@h12g2000vbx.googlegroups.com>
In reply to#1616
Thank you for your comments Gerhard
I made and registered an EventHandler as you outlines but I had
trouble building a search string within the eventhandler method. It
takes the first character entered but I couldn't get the next ones to
append to build the search string. I will experiment more though.
I have created my own CellEdit method where I can deal with browser
events on a Edit_Mode and column level and it is partially working. I
will experiment with your eventhandler and my celledit and see if I
can get a working result.

On Jul 6, 5:40 pm, "Gerhard Bunzel" <g.bun...@domonet.de> wrote:
> Grant,
>
> Register your own EventHandler for the bBrowser in Init() or PostInit() of
> your Browserwindow:
>
> METHIOD PostInit() CLASS MyBrowserWindow
> .....
> bRegisterByEventHandler(SELF:oDCbBrowser, SELF, #EventHandler, TRUE)
>
> Now use that EventHandler to catch the typed characters:
>
> METHOD EventHandler (oEvent) CLASS MyBrowserWindow
>
>  IF oEvent:uMsg == WM_CHAR
>    IF oEvent:Window == SELF:oDCbBrowser .AND. oEvent:wParam >=32
>     ...
>     build your Search-String:
>     cSearch += Upper(CHR(oEvent:wParam))
>     .....
>     Now you can do your search and display some search-infos
>
> Unregister your EventHandler:
> METHOD Destroy () CLASS MyBrowserWindow
>
>  bUnregisterByEventHandler(SELF:oDCbBrowser, SELF)
>
> RETURN SUPER:Destroy()
>
> HTH
>
> Gerhard
>
> "Grant" <gra...@dunsmoreinfo.com> schrieb im Newsbeitragnews:f3bb48b4-4bcb-4c00-851f-c03dc5b15644@v12g2000vby.googlegroups.com...
>
>
>
> >I have a bBrowser and I want to enter data by typing the target data
> > in a cell and have the app search for the target data in small master
> > tables. I thought it could be like using an EditChange/EditFocusChange
> > methods for an sle cell in a standard VO window that will search after
> > each charactor is entered. Can I do this within a browser? Maybe
> > FocusChange but I haven't got it to work?
> > I have used the browser's CellEdit method to bring up a table and then
> > the user has to choose the data and click on it with the mouse. I want
> > to go directly to a search in the field when the user starts to type
> > characters and return a value from the popup table which doesen't have
> > to display unless the search fails.
> > I haven't been able to find this process in any samples and my own
> > attempts haven't been successful.
> > I may be overcomplicating a simple process in my own mind but any
> > suggestions might help me get moving again.
> > Thank you.- Hide quoted text -
>
> - Show quoted text -

[toc] | [prev] | [next] | [standalone]


#1643

From"Stephen Quinn" <stevejqNO@bigpondSPAM.net.au>
Date2011-07-08 10:52 +1000
Message-ID<yxsRp.8137$aH5.3735@viwinnwfe02.internal.bigpond.com>
In reply to#1641
Grant

>>
I made and registered an EventHandler as you outlines but I had
trouble building a search string within the eventhandler method. It
takes the first character entered but I couldn't get the next ones to
append to build the search string.
<<

Are you setting focus to the SLE after getting the first character??
If so that's your problem as the Browser no longer has focus, so the 
following test fails.
    > IF oEvent:Window == SELF:oDCbBrowser .AND. oEvent:wParam >=32

CYA
Steve

[toc] | [prev] | [next] | [standalone]


#1652

FromGrant <grantd@dunsmoreinfo.com>
Date2011-07-08 10:57 -0700
Message-ID<ae33b783-9b4e-4c69-8f0b-567b0a51bb6b@g2g2000vbl.googlegroups.com>
In reply to#1643
On Jul 7, 5:52 pm, "Stephen Quinn" <stevej...@bigpondSPAM.net.au>
wrote:
> Grant
>
>
>
> I made and registered an EventHandler as you outlines but I had
> trouble building a search string within the eventhandler method. It
> takes the first character entered but I couldn't get the next ones to
> append to build the search string.
> <<
>
> Are you setting focus to the SLE after getting the first character??
> If so that's your problem as the Browser no longer has focus, so the
> following test fails.
>     > IF oEvent:Window == SELF:oDCbBrowser .AND. oEvent:wParam >=32
>
> CYA
> Steve

Hi Steve

Your probably right but I don't know how to control the focus. If I
type a series of characters in the cell of the browser the first one
registers with the EventHandler method but subsequent ones don't. The
cell still has focus to enter data but to get the EventHandler to
accept a character at the cSearch level I have to change to the next
cell and then again it only sees the first one so I can't build a
search string there. Here is what I tried:
    	IF oEvent:uMsg == WM_CHAR
		IF oEvent:Window == self:oDCbBrowser1 .and. oEvent:wParam >= 32
			?	cSearch += Upper(CHR(oEvent:wParam))
			self:SetFocus(oDCbBrowser1)
		ENDIF
	ENDIF
cSearch is global and I was displaying the cSearch result which only
builds by changing cells/columns in the browser.

[toc] | [prev] | [next] | [standalone]


#1653

From"Jamal" <vodotnet_nospam@yahoo.com>
Date2011-07-08 15:34 -0400
Message-ID<iv7m44$7rt$1@dont-email.me>
In reply to#1652
Look at the bBrowser sample namely bSample - Edit.
Then see how to create your edit control, etc. in dtwExpandingMLE (Window) 
module. It involves the CellEdit( ) method and creating a subclass to handle 
and dispatch.

Jamal


"Grant"  wrote in message 
news:ae33b783-9b4e-4c69-8f0b-567b0a51bb6b@g2g2000vbl.googlegroups.com...

On Jul 7, 5:52 pm, "Stephen Quinn" <stevej...@bigpondSPAM.net.au>
wrote:
> Grant
>
>
>
> I made and registered an EventHandler as you outlines but I had
> trouble building a search string within the eventhandler method. It
> takes the first character entered but I couldn't get the next ones to
> append to build the search string.
> <<
>
> Are you setting focus to the SLE after getting the first character??
> If so that's your problem as the Browser no longer has focus, so the
> following test fails.
>     > IF oEvent:Window == SELF:oDCbBrowser .AND. oEvent:wParam >=32
>
> CYA
> Steve

Hi Steve

Your probably right but I don't know how to control the focus. If I
type a series of characters in the cell of the browser the first one
registers with the EventHandler method but subsequent ones don't. The
cell still has focus to enter data but to get the EventHandler to
accept a character at the cSearch level I have to change to the next
cell and then again it only sees the first one so I can't build a
search string there. Here is what I tried:
    IF oEvent:uMsg == WM_CHAR
IF oEvent:Window == self:oDCbBrowser1 .and. oEvent:wParam >= 32
? cSearch += Upper(CHR(oEvent:wParam))
self:SetFocus(oDCbBrowser1)
ENDIF
ENDIF
cSearch is global and I was displaying the cSearch result which only
builds by changing cells/columns in the browser. 

[toc] | [prev] | [next] | [standalone]


#1654

From"Gerhard Bunzel" <g.bunzel@domonet.de>
Date2011-07-08 22:04 +0200
Message-ID<iv7nra$7m1$1@news-1.m-online.net>
In reply to#1652
Grant,

you do not need any CellEdit for that search. Is your bBrowser in 
AutoEdit-Mode?

>cSearch is global and I was displaying the cSearch result which only
>builds by changing cells/columns in the browser.
Use cSearch as a PROTECT in the bBrowser owner window. Show your search 
string in a SLE of that owner window.
With KEYBACKSPACE you can clear cSearch for your next search:

IF oEvt:Window == SELF:oDCbBrowser .AND. oEvt:wParam >=32
...
ELSEIF oEvt:Window == SELF:oDCbBrowser .AND. SELF:lSearchActiv .AND. 
oEvt:wParam == KEYBACKSPACE
    SELF:SearchClose()
....


You you have a smal testapp? You can send me that app and I will have a 
look.

HTH

Gerhard



"Grant" <grantd@dunsmoreinfo.com> schrieb im Newsbeitrag 
news:ae33b783-9b4e-4c69-8f0b-567b0a51bb6b@g2g2000vbl.googlegroups.com...
On Jul 7, 5:52 pm, "Stephen Quinn" <stevej...@bigpondSPAM.net.au>
wrote:
> Grant
>
>
>
> I made and registered an EventHandler as you outlines but I had
> trouble building a search string within the eventhandler method. It
> takes the first character entered but I couldn't get the next ones to
> append to build the search string.
> <<
>
> Are you setting focus to the SLE after getting the first character??
> If so that's your problem as the Browser no longer has focus, so the
> following test fails.
> > IF oEvent:Window == SELF:oDCbBrowser .AND. oEvent:wParam >=32
>
> CYA
> Steve

Hi Steve

Your probably right but I don't know how to control the focus. If I
type a series of characters in the cell of the browser the first one
registers with the EventHandler method but subsequent ones don't. The
cell still has focus to enter data but to get the EventHandler to
accept a character at the cSearch level I have to change to the next
cell and then again it only sees the first one so I can't build a
search string there. Here is what I tried:
    IF oEvent:uMsg == WM_CHAR
IF oEvent:Window == self:oDCbBrowser1 .and. oEvent:wParam >= 32
? cSearch += Upper(CHR(oEvent:wParam))
self:SetFocus(oDCbBrowser1)
ENDIF
ENDIF
cSearch is global and I was displaying the cSearch result which only
builds by changing cells/columns in the browser. 

[toc] | [prev] | [next] | [standalone]


#1655

FromGrant <grantd@dunsmoreinfo.com>
Date2011-07-08 14:56 -0700
Message-ID<99b2a365-9ea7-4b33-af5a-6c69dba18b59@v12g2000vby.googlegroups.com>
In reply to#1654
On Jul 8, 1:04 pm, "Gerhard Bunzel" <g.bun...@domonet.de> wrote:
> Grant,
>
> you do not need any CellEdit for that search. Is your bBrowser in
> AutoEdit-Mode?
>
> >cSearch is global and I was displaying the cSearch result which only
> >builds by changing cells/columns in the browser.
>
> Use cSearch as a PROTECT in the bBrowser owner window. Show your search
> string in a SLE of that owner window.
> With KEYBACKSPACE you can clear cSearch for your next search:
>
> IF oEvt:Window == SELF:oDCbBrowser .AND. oEvt:wParam >=32
> ...
> ELSEIF oEvt:Window == SELF:oDCbBrowser .AND. SELF:lSearchActiv .AND.
> oEvt:wParam == KEYBACKSPACE
>     SELF:SearchClose()
> ....
>
> You you have a smal testapp? You can send me that app and I will have a
> look.
>
> HTH
>
> Gerhard
>
> "Grant" <gra...@dunsmoreinfo.com> schrieb im Newsbeitragnews:ae33b783-9b4e-4c69-8f0b-567b0a51bb6b@g2g2000vbl.googlegroups.com...
> On Jul 7, 5:52 pm, "Stephen Quinn" <stevej...@bigpondSPAM.net.au>
> wrote:
>
>
>
>
>
> > Grant
>
> > I made and registered an EventHandler as you outlines but I had
> > trouble building a search string within the eventhandler method. It
> > takes the first character entered but I couldn't get the next ones to
> > append to build the search string.
> > <<
>
> > Are you setting focus to the SLE after getting the first character??
> > If so that's your problem as the Browser no longer has focus, so the
> > following test fails.
> > > IF oEvent:Window == SELF:oDCbBrowser .AND. oEvent:wParam >=32
>
> > CYA
> > Steve
>
> Hi Steve
>
> Your probably right but I don't know how to control the focus. If I
> type a series of characters in the cell of the browser the first one
> registers with the EventHandler method but subsequent ones don't. The
> cell still has focus to enter data but to get the EventHandler to
> accept a character at the cSearch level I have to change to the next
> cell and then again it only sees the first one so I can't build a
> search string there. Here is what I tried:
>     IF oEvent:uMsg == WM_CHAR
> IF oEvent:Window == self:oDCbBrowser1 .and. oEvent:wParam >= 32
> ? cSearch += Upper(CHR(oEvent:wParam))
> self:SetFocus(oDCbBrowser1)
> ENDIF
> ENDIF
> cSearch is global and I was displaying the cSearch result which only
> builds by changing cells/columns in the browser.- Hide quoted text -
>
> - Show quoted text -

Thank you for your replies but I have to leave this topic and work for
a few days. I will continue as soon as I return.
Best regards
Grant

[toc] | [prev] | [next] | [standalone]


#1656

From"Stephen Quinn" <stevejqNO@bigpondSPAM.net.au>
Date2011-07-09 11:29 +1000
Message-ID<taORp.8195$aH5.7304@viwinnwfe02.internal.bigpond.com>
In reply to#1652
Grant

Use PostMessage() to send the captured characters to the SLE, no need to 
give it focus at all.

You should also tell the system that you've handled the event to your 
satisfaction, that way no focus change is required.

Eg something like
    IF oEvent:uMsg == WM_CHAR
        IF oEvent:Window == self:oDCbBrowser1 .and. oEvent:wParam >= 32
            cSearch += Upper(CHR(oEvent:wParam))
            oServer:Seek( cSeach ) or oServer:SetScope( cSearch)
            PostMessage()
            self:SetFocus(oDCbBrowser1)
            RETURN SUCCESS
        ENDIF
    ENDIF

You should also make cSearch a protected variable in your window class - no 
need for GLOBALs at all IMO.

CYA
Steve 

[toc] | [prev] | [next] | [standalone]


#1657

From"richard.townsendrose" <richard.townsendrose@gmail.com>
Date2011-07-09 03:53 -0700
Message-ID<45aa84a9-569f-4700-8a29-c6db834c5476@g2g2000vbl.googlegroups.com>
In reply to#1656
Grant

please visit http://www.tdocplus.co.uk/tdoc_manual/
select - using tdoc basic functions
select The TDOC Browse.

its a complex design. the paragraph you need is "Searching"

the myseekbbrowser class was written for me by Dr Paolo Calzi.

when you type on the keyboard the Window owning the browse receives
the characters and performs as SEEK or a LOCATE on the data within the
browse ... showing results as you go. CTRL up and down arrows find
previous find and next find.

BUT the key fact is that the browse and window must communicate with
each other and if the browse is on a page of a tab then that the tabs
owner is the one to do the controlling.

if you would like our libraries and some instructions, please get in
touch.

to download a copy of tdoc with data to see how it all works visit
wp.tdocplus.co.uk

regards

richard

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web