Seek/get with headers in Xbrowse

Seek/get with headers in Xbrowse

Postby Marc Venken » 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: Select all  Expand view

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

Re: Seek/get with headers in Xbrowse

Postby nageswaragunupudi » Fri Dec 09, 2016 2:19 am

Please try this
Code: Select all  Expand view
  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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Seek/get with headers in Xbrowse

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

Re: Seek/get with headers in Xbrowse

Postby nageswaragunupudi » Mon Dec 12, 2016 1:24 pm

It could also be that i use i wrongly


Yes
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Seek/get with headers in Xbrowse

Postby Marc Venken » Mon Dec 12, 2016 1: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: Select all  Expand view

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Carles and 108 guests