FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Seek/get with headers in Xbrowse
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Seek/get with headers in Xbrowse
Posted: Tue Dec 06, 2016 11:19 PM
Hey,

I'm working with a sample prg, where i want to have a get/seek field in Xbrowse.

The sample works ok when all fields are used, and the field folow the database structure

My code will use some fields of the database, but not all.

In the browse column 6 is field 9 (Char Type) , but the browse will take field 9 (num data) and put a '0' in the field, because he thinks it is a fieldnum field.

The code is using fieldget(n), but I think it should take the fieldname of the 6th colom ?

Code (fw): Select all Collapse
   @ 450,870 XBROWSE oBrw4 SIZE 550,250 ;
      PIXEL OF oWnd font oFont3;
      DATASOURCE "MASTER";
      COLUMNS "code","naam","fab_naam","fab_ref","pagina","picture" ;
      HEADERS 'Code', 'Naam', 'Fabrik',"Ref.Lev","Pag","Foto";
      COLSIZES 60,200,50,70,30,90 ;
      CELL LINES NOBORDER



   // Relevant Code
   for n := 1 to Len( oBrw4:aCols )
      WITH OBJECT oBrw4:aCols[ n ]
         //msginfo(Fieldname( n )+ Fieldtype( n ) )

         if FieldType( n ) != 'L'
            :uBarGetVal    := uValBlank( fieldGet( n ) )
            if FieldType( n ) == 'N'
               :cBarGetPic := NumPict( FieldLen( n ), FieldDec( n ) )
            endif
         endif
      END
   next
   oBrw4:lGetBar   := .t.


I also try to clear all the gets when I push the clear filter button. The button in the sample is

oBrw4:seek("") Will not work with this new get/filter system.


@ 410,1200 BTNBMP PROMPT "Clear Filter" ;
SIZE 100,40 PIXEL OF oWnd FLAT ;
ACTION ( oBrw4:cAlias )->( DBCLEARFILTER(), oBrw4:Refresh(), oBrw4:SetFocus() )
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Seek/get with headers in Xbrowse
Posted: Fri Dec 09, 2016 02:19 AM
Please try this
Code (fw): Select all Collapse
   for n := 1 to Len( oBrw:aCols )
      WITH OBJECT oBrw:aCols[ n ]
         if :cDataType != 'L'
            :uBarGetVal    := uValBlank( :Value )
            :cBarGetPic    := :cEditPicture
         endif
      END
   next
Regards



G. N. Rao.

Hyderabad, India
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Seek/get with headers in Xbrowse
Posted: Mon Dec 12, 2016 11:40 AM

Thanks. the fieldlenght's are correctly filled, but afther reading some more I saw that it is up to us to create code to do more with the data.

I suppose that in the future some more functionality will be integrated like :

Fieldnr's use in the browse : 1,2,6,8,10,12,22 that there will be a parameter that will see the correct fieldnr to fieldnames.

Now Xbrowse allways uses : 1,2,3,4,5,6,7 and a seek will faile, since the data is not the same colomn.

Ok, It could also be that i use i wrongly :wink: I look further....

Marc

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Seek/get with headers in Xbrowse
Posted: Mon Dec 12, 2016 01:24 PM
It could also be that i use i wrongly


Yes
Regards



G. N. Rao.

Hyderabad, India
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Seek/get with headers in Xbrowse
Posted: Mon Dec 12, 2016 01:45 PM
The Value -n- is from 1-6 in this sample, but the fields are ex. 2,6,9,12,13,19

Then there must be a other value than the -n- to tell XBrowse with kolom of the browse is related to with colom of the database ?

The original sample has also the -N- from 1 to 6 as parameter

Len( oBrw:aCols ) will give the value : 6 (count of fields)

What i'm missing then ?


Code (fw): Select all Collapse
  for n := 1 to Len( oBrw:aCols )
      WITH OBJECT oBrw:aCols[ n ]
         if :cDataType != 'L'
            :uBarGetVal    := uValBlank( :Value )
            :cBarGetPic    := :cEditPicture
         endif
      END
   next
Marc Venken

Using: FWH 23.08 with Harbour

Continue the discussion