FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Search on a Xbrowse
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM

Re: Search on a Xbrowse

Posted: Fri Feb 25, 2022 10:51 AM

C5 is a external class ?

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: Search on a Xbrowse

Posted: Fri Feb 25, 2022 11:28 AM

yes

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: Search on a Xbrowse

Posted: Sat Feb 26, 2022 11:08 AM
Marc Venken wrote:C5 is a external class ?


to no Use c5, Perhaps with a pocket class ?

oToolbar:=TMyControl():New( oBrw:ntop-10,oBrw:nwidth,oBrw:oWnd , , ,, , , oBrw:nWidth, 20,, )

obtn[1] := oToolbar:AddItem("test", bAction, "top2.bmp")


Code (fw): Select all Collapse
CLASS TMyControl FROM TControl

       CLASSDATA lRegistered AS LOGICAL

       DATA oBrw
       DATA nClrHover       INIT RGB( 66, 142, 255 )
       DATA aItems


       METHOD New( nTop, nLeft, oWnd, nPos, nClrFore,;
                   nClrBack, lPixel, lDesign, nWidth, nHeight,;
                   cMsg, lVertical ) CONSTRUCTOR

       METHOD ReDefine( nId, oWnd ) CONSTRUCTOR


       METHOD AddItem(cPrompt, bAction, cBitmap)

       METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0

    ENDCLASS

    //----------------------------------------------------------------------------//

    METHOD New( nTop, nLeft, oWnd, nPos, nClrFore, nClrBack, lPixel,;
                lDesign, nWidth, nHeight, cMsg, lVertical ) CLASS TMyControl

       DEFAULT nTop     := 0, nLeft := 0,;
               oWnd     := GetWndDefault(),;
               nClrFore := oWnd:nClrText,;
               nClrBack := GetSysColor( 15 ),;
               lPixel   := .f.,;
               lDesign  := .f.,;
               nWidth   := 200, nHeight := 21,;
               lVertical := .f.

       ::nStyle    = nOR( WS_CHILD, WS_VISIBLE, WS_TABSTOP )
       ::nId       = ::GetNewId()
       ::oWnd      = oWnd
       ::cMsg      = cMsg
       ::nTop      = If( lPixel, nTop, nTop * SAY_CHARPIX_H )
       ::nLeft     = If( lPixel, nLeft, nLeft * SAY_CHARPIX_W )
       ::nBottom   = ::nTop + nHeight - 1
       ::nRight    = ::nLeft + nWidth - 1
       ::lDrag     = lDesign
       ::lCaptured = .f.
       ::nClrText  = nClrFore
       ::nClrPane  = nClrBack

       ::Register()

       if ! Empty( oWnd:hWnd )
          ::Create()
          ::Default()
          oWnd:AddControl( Self )
       else
          oWnd:DefControl( Self )
       endif

       if lDesign
          ::CheckDots()
       endif

            SetWndDefault( Self )
    return Self

    //----------------------------------------------------------------------------//

    METHOD ReDefine( nId, oWnd ) CLASS TMyControl

       DEFAULT oWnd := GetWndDefault()

       ::nId  = nId
       ::oWnd = oWnd

       ::Register()

       oWnd:DefControl( Self )

    return Self

    //----------------------------------------------------------------------------//

METHOD AddItem(cPrompt, bAction, cBitmap)   CLASS TMyControl
           local oItem
           local nPos


          oItem =TBtnBmp():New( 1, 1,, ::nHeight-4,,, cBitmap, cBitmap,bAction, self, cPrompt )


       *  AAdd( ::aItems, oItem )

   return nil
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM

Re: Search on a Xbrowse

Posted: Sat Feb 26, 2022 12:28 PM

For FW-Team : Can we use a get and combo on the toolbar like we are trying to do, or not ?
Maybe we are simply doing it wrong. Personaly I would likt to stick only with standard FW programming with no 3 party libs..

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM

Re: Search on a Xbrowse

Posted: Sun Dec 25, 2022 10:55 AM
We can have a combobox insite the bar of xbrowse where we can select the index.

@ 15,1690 COMBOBOX oBrw:oSortCbx VAR oBrw:cSortOrder SIZE 100,400 PIXEL OF oBrw

I also want a second combo where I can put predefined filters to select from, but that does not work. I see the combo, but no data.

Local oFilters
local aFilters:={ "Filter1","Filter2" }

@ 15,1400 COMBOBOX oFilters VAR aFilters SIZE 250,150 PIXEL OF oBrw // I see the combo but no data

Finaly I want to select from a 2 items array, but first try with one )))
aFilters:= { {"Filter 1","UPPER('NAME')"} , {Filter 2", "upper('address')"} } // something like this where the filters will come from a dbf

Code (fw): Select all Collapse
function XbrSetupBar( oBrw ,cData)
   local cSeek := space(100)
   Local oBtnClear, oFilters
   Local aExelcol1 := {"Id","Benaming","Pag","Reflev","Merk"}
   local aFilters:={ "Filter1","Filter2" }
   default cData:=""

   oBrw:nTopBarHeight := 70
   oBrw:bOnAdjust := <||
      local oBtn
      @ 05,10 BTNBMP oBtn PROMPT "New" RESOURCE "ADD" SIZE 60,60 PIXEL OF oBrw NOBORDER ;
        ACTION (xBrsetupbuttons(oBrw,cData),oBrw:refresh()) TOOLTIP "Add New Record"
      @ 05,100 BTNBMP oBtn PROMPT "Edit" RESOURCE "EDIT" SIZE 60,60 PIXEL OF oBrw NOBORDER ;
        ACTION (oBrw:EditSource(),oBrw:refresh()) TOOLTIP "Edit this record"
      // ....

      @ 15,1400 COMBOBOX oFilters VAR aFilters SIZE 250,150 PIXEL OF oBrw
      @ 15,1690 COMBOBOX oBrw:oSortCbx VAR oBrw:cSortOrder SIZE 100,400 PIXEL OF oBrw

      return nil
      >

return nil
Marc Venken

Using: FWH 23.08 with Harbour

Continue the discussion