Search on a Xbrowse

Re: Search on a Xbrowse

Postby Marc Venken » Fri Feb 25, 2022 10:51 am

C5 is a external class ?
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1425
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Search on a Xbrowse

Postby Silvio.Falconi » Fri Feb 25, 2022 11:28 am

yes
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: Search on a Xbrowse

Postby Silvio.Falconi » 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: Select all  Expand view




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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: Search on a Xbrowse

Postby Marc Venken » 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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1425
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Search on a Xbrowse

Postby Marc Venken » 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: Select all  Expand view
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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1425
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 80 guests

cron