lSeekBar

Re: lSeekBar

Postby Silvio.Falconi » Mon Jan 02, 2017 10:09 am

Found solution
but not run ok

Code: Select all  Expand view

#include 'fivewin.ch'
#include 'xbrowse.ch'

FUNCTION MAIN()
local oDlg, oBrw, oFont, oBold
local aRowGrad, aSelGrad, aStdGrad
local n := RGB( 157, 248, 255 )

REQUEST DBFCDX
RDDSETDEFAULT ( "DBFCDX" )
SETBALLOON( .T. )

XbrNumFormat( 'E', .t. )

aRowGrad := { { .5, RGB( 232, 241, 252 ), RGB(  232, 241, 252 ) }, ;
                 { .5, RGB( 210, 225, 244 ), RGB(  235, 243, 253 ) } }

aSelGrad := { { .5, RGB( 255, 255, 251 ), RGB( 255, 237, 178 ) }, ;
                 { .5, RGB( 255, 218, 103 ), RGB( 255, 233, 162 ) } }

USE CUSTOMER
ORDCREATE( ,"CUST1","UPPER(FIRST)", {|| UPPER(FIRST) } , .F. )
ORDCREATE( ,"CUST2","UPPER(LAST)", {|| UPPER(LAST) } , .F. )

DEFINE FONT oFont NAME 'Tahoma' SIZE 0,-14
DEFINE FONT oBold NAME "TAHOMA" SIZE 0,-12 BOLD


DEFINE DIALOG oDlg SIZE 780,440 PIXEL ;
FONT oFont TITLE 'XBrowse Gradient Rows FWH 9.12'

DBSETORDER("CUST1")

@ 10,10 XBROWSE oBrw OF oDlg ;
      SIZE 380,180 PIXEL ;
      COLUMNS 'FIRST', "LAST", 'HIREDATE', 'MARRIED', 'SALARY' ;
      ALIAS 'CUSTOMER'  NOBORDER AUTOSORT  //LINES

oBrw:Married:SetCheck()  // Default FWH Bitmap is Alpha

WITH OBJECT oBrw:First
      :AddBitmap( '\fwh\bitmaps\open2.bmp' ) // non-alpha bitmap
      :bBmpData   := { || 1 }
END

WITH OBJECT oBrw:HireDate
      :AddBitmap( '\fwh\bitmaps\Alphabmp\task.bmp' )  // alpha
      :bBmpData   := { || 1 }
END



// Relevant Code
   for n := 1 to Len( oBrw:aCols )
      WITH OBJECT oBrw:aCols[ n ]
         if FieldType( n ) != 'L'
            :uBarGetVal    := uValBlank( fieldGet( n ) )
            if FieldType( n ) == 'N'
               :cBarGetPic := NumPict( FieldLen( n ), FieldDec( n ) )
            endif
         endif
      END
   next
   oBrw:lGetBar   := .t.
   // End of Relevant Code



WITH OBJECT oBrw
    :nStretchCol   := 1
    :nMarqueeStyle := 4
    :bClrSelFocus  := { || { CLR_BLACK, aSelGrad } }
    :bClrRowFocus  := { || { CLR_BLACK, aRowGrad } }


      :nHeaderHeight    := 40 // optional
      :oHeaderFonts     := oBold
      :bClrEdits        := { || { CLR_BLACK, CLR_YELLOW } }
      :AutoFit()
      //
      :CreateFromCode()
   END








 @ 200,12 BTNBMP  PROMPT { || If( oBrw:lGetBar, "Hide GetBar", "ShowGetBar" ) }  size 90,20 PIXEL OF oDlg FLAT  ACTION ( oBrw:lGetBar := ! oBrw:lGetBar, oBrw:Refresh() )

 @ 200,112 BTNBMP PROMPT "Set Filter"  size 50,20 PIXEL OF oDlg FLAT ACTION ( ( oBrw:cAlias )->( SetFilter( oBrw ) ))

 @ 200,192 BTNBMP PROMPT "Clear Filter"  size 50,20 PIXEL OF oDlg FLAT ACTION  ((  oBrw:cAlias )->( DBCLEARFILTER(),  oBrw:Refresh(), oBrw:SetFocus() ))











ACTIVATE DIALOG oDlg CENTERED

CLOSE CUSTOMER
RELEASE FONT oFont

RETURN NIL



static function SetFilter( oBrw )

   local cFilter := ""
   local n, oCol, uVal, cType

   for n := 1 to Len( oBrw:aCols )
      oCol  := oBrw:aCols[ n ]
      if ! Empty( uVal := oCol:uBarGetVal )
         if !Empty( cFilter )
            cFilter  += " .AND. "
         endif
         cType    := ValType( uVal )

         do case
         case cType == 'C'
            uVal     := Upper( AllTrim( uVal ) )
            cFilter += '"' + uVal + '" $ UPPER( ' + FieldName( n ) + " )"
         otherwise
            cFilter  += FieldName( n ) + " == " + cValToChar( uVal )
         endcase
      endif

   next

   if Empty( cFilter )
      if ! Empty( DBFILTER() )
         DBCLEARFILTER()
         oBrw:Refresh()
      endif
   else
      if !( DBFILTER() == cFilter )
         SET FILTER TO &cFilter
         GO TOP
         oBrw:Refresh()
      endif
   endif

   oBrw:SetFocus()

return nil

 


before show the getbar
you digit a name "Gary" and the set the filter and it show only Gary customer
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: 6826
Joined: Thu Oct 18, 2012 7:17 pm

Re: lSeekBar

Postby Silvio.Falconi » Tue Jan 03, 2017 8:47 pm

Now it seem run ok

Only there is one thing I not Know how resolve

to showthe browse I use these commands

Code: Select all  Expand view
aBrowse   := { { { || CU->FIRST }, i18n("First"), 150, 0 },;
                  { { || CU->LAST  }, i18n("Last"), 150, 0 },;
                  { { || CU->STREET}, i18n("Street"), 150, 0 },;
                  { { || CU->CITY } , i18n("City"), 150, 0 } }


   FOR i := 1 TO Len(aBrowse)
      oCol := oApp():oGrid:AddCol()
     * oCol:bStrData := aBrowse[ i, 1 ]
       oCol:bEditValue := aBrowse[ i, 1 ]
      oCol:cHeader  := aBrowse[ i, 2 ]
      oCol:nWidth   := aBrowse[ i, 3 ]
      oCol:nDataStrAlign := aBrowse[ i, 4 ]
      oCol:nHeadStrAlign := aBrowse[ i, 4 ]
   NEXT


I insert also these lines ( only with these lines the getsearch seem run ok)

Code: Select all  Expand view
for n := 1 to Len( oApp():oGrid:aCols )
      WITH OBJECT oApp():oGrid:aCols[ n ]
       if FieldType( n ) != 'L'
            :uBarGetVal    := uValBlank( fieldGet( n ) )
            if FieldType( n ) == 'N'
             :cBarGetPic := NumPict( FieldLen( n ), FieldDec( n ) )
            endif
         endif
      END
   next



then create the object oApp:oGrdi

oApp():oGrid:lGetBar := .F.
oApp():oGrid:lAutoSort := .t.
oApp():oGrid:bClrEdits:= { || { CLR_BLACK, CLR_YELLOW } }
oApp():oGrid:SetRDD()
oApp():oGrid:CreateFromCode()


Image


the problem is I not see the bitmap (lupa) on getsearch any solution please
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: 6826
Joined: Thu Oct 18, 2012 7:17 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 23 guests