Change oBrw:aSelected outsite xbrowse

Change oBrw:aSelected outsite xbrowse

Postby Marc Venken » Fri Mar 19, 2021 3:58 pm

Can we change the status of aSelected?

The idea is that I call several functions (one by one) with a different ordscope() selection. The result records of that selection should be set to .t. in de aSelected
Next again a ordscope with other results, but these also need to be set .t. in aselected.
etc...

Finaly all selections are made and oBrw:aSelected contains all record from different searches/selections.

redraw of xbrowse should show all the records in aSelected.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1357
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Change oBrw:aSelected outsite xbrowse

Postby nageswaragunupudi » Fri Mar 19, 2021 7:07 pm

Purpose of oBrw:aSelected is totally different.
What you want is you prepare an array of record numbers, which you want to show in xbrowse.

In this sample, aRecs represent the array aSelected you are referring to:

Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oDlg, oFont, oBrw
   local aRecs    := { 3, 10, 20 }

   USE STATES
   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 400,300 PIXEL TRUEPIXEL FONT oFont ;
      TITLE "FILTER BY ARRAY"

   @ 80,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE "STATES" ;
      COLUMNS "RECNO()", "CODE", "NAME" ;
      HEADERS "REC" PICTURES "999" ;
      CELL LINES NOBORDER ;
      ROWS aRecs

   oBrw:CreateFromCode()

   @ 20,20 BUTTON "CHANGE RECORDS" SIZE 200,40 PIXEL OF oDlg ;
      ACTION ( oBrw:aArrayData := { 3, 10, 20, 7, 23, 47 }, oBrw:Refresh() )

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
 


Image
Regards

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

Re: Change oBrw:aSelected outsite xbrowse

Postby Marc Venken » Sat Mar 20, 2021 10:02 am

Thanks for sending me in the correct direction !!

In every lookup function (afther selection)
I will add records to the array with a dbeval(....aadd()..)
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1357
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 38 guests