Incremental search in the MessageBar

Incremental search in the MessageBar

Postby frose » Tue Jun 02, 2009 11:42 am

Hello,

I want to place the SAY of oBrw:cSeek (incremental search in a TXBrowse) in the MessageBar, but don't know how!

Can guide me someone?

TIA
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg

Re: Incremental search in the MessageBar

Postby betoncu » Tue Jun 02, 2009 7:53 pm

I am using statusbar for this purpose as described below.
I didn't try, but may be you can use the same solution for message bar.

Birol Betoncu

Code: Select all  Expand view
DEFINE STATUSBAR oStBar OF oWnd PROMPT ""

   @ 1, 1 SAY oSay VAR cSay ;
          SIZE oStBar:nWidth-2, oStBar:nHeight-2 ;
          COLOR CLR_BLACK, GetSysColor(15) ;
          OF oStBar ;
          FONT oFont ;
          PIXEL

oLbx:oSeek := oSay
Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 19.05, BCC7
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)

Re: Incremental search in the MessageBar

Postby frose » Wed Jun 03, 2009 9:37 am

Birol,

yes, it's working fine with the message bar, thank you very much.

I've already tried it in this way:
Code: Select all  Expand view
...
   DEFINE MSGITEM oMsgBarcSeek OF oDlg:oMsgBar PROMPT "Inremental search" SIZE 150 COLOR "R+/W"
...
FUNCTION My_Search( oBrw, cSeek )
    LOCAL lReturn := .F.
   IF Customer->( DbSeek( cSeek ) )
    lReturn := .T.
    oBrw:cSeek := cSeek
    // Show the search string in the message bar
       oMsgBarcSeek:SetText( cSeek )
   ENDIF
RETURN lReturn
 

But the disadvantage is, that the search string is still displayed after <cSeek> is killed by the TXBrowse object.
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg

Re: Incremental search in the MessageBar

Postby nageswaragunupudi » Wed Jun 03, 2009 12:44 pm

Mr Frose

Please implement your msgitem logic this way:

Code: Select all  Expand view
 
DEFINE MSGITEM oBrw:oSeek OF oDlg:oMsgBar ;
      PROMPT "Inremental search" ;
      SIZE 150 COLOR "R+/W"
 


Delete My_Search(..) function.

No more code is needed. My_Search function is not needed. Rather, it should be avoided. The builtin logic of xBrowse of setting text and deleting the text works perfectly and better than our own functions.

Best way to use XBrowse is to write less code in our program and rely more on xBrowse's built in logic.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Incremental search in the MessageBar

Postby frose » Wed Jun 03, 2009 1:17 pm

Rao,

working perfectly, thank you very much.
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: wartiaga and 91 guests