FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Incremental search in the MessageBar
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Incremental search in the MessageBar
Posted: 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
Posts: 130
Joined: Sat Oct 08, 2005 09:38 PM
Re: Incremental search in the MessageBar
Posted: Tue Jun 02, 2009 07: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 (fw): Select all Collapse
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
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: Incremental search in the MessageBar
Posted: Wed Jun 03, 2009 09: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 (fw): Select all Collapse
...
   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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Incremental search in the MessageBar
Posted: Wed Jun 03, 2009 12:44 PM
Mr Frose

Please implement your msgitem logic this way:

Code (fw): Select all Collapse
   
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
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: Incremental search in the MessageBar
Posted: Wed Jun 03, 2009 01: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

Continue the discussion