Page 1 of 1
xbrowse multisel
Posted: Mon Feb 17, 2025 12:54 am
by wartiaga
Hi,
How the best way to use multisel in xbrowse? I would not like to use a logical field in the dbf to select or unmark the record as there may be other users using the same record.
Thanks in advance!
Re: xbrowse multisel
Posted: Wed Feb 19, 2025 1:55 am
by ShumingWang
::nMarqueeStyle := MARQSTYLE_HIGHLROWMS
::select(1)
::seleect(2)
...
::aseleted stores Eval( ::bBookMark) //nrow
::select(0) clear selected rows ,::aselected:={}
Shuming Wang
Re: xbrowse multisel
Posted: Wed Feb 19, 2025 9:27 am
by Silvio.Falconi
wartiaga wrote: Mon Feb 17, 2025 12:54 am
Hi,
How the best way to use multisel in xbrowse? I would not like to use a logical field in the dbf to select or unmark the record as there may be other users using the same record.
Thanks in advance!
You must not also use a field on your archive

Re: xbrowse multisel
Posted: Wed Feb 19, 2025 10:38 am
by Otto
Respect and congratulations – I like the design.
Re: xbrowse multisel
Posted: Wed Feb 19, 2025 12:33 pm
by Silvio.Falconi
Otto wrote: Wed Feb 19, 2025 10:38 am
Respect and congratulations – I like the design.
Thanks
Otto, I created my applications with some C5 classes also used by a gentleman on this forum, to avoid being reported for plagiarism I had to change my applications and return to the old tables.
For a sample If I wish not set at init :SetMultiSelectCol() and then I wish select a record from menupopup the procedure can make it but before must insert :SetMultiSelectCol() I ask this to Rao last year and he not answered never for this topic
pratically I asked if I can insert on line the possibility to have :SetMultiSelectCol() into xbrowse
this is one of the many things I never got an answer to
Re: xbrowse multisel
Posted: Wed Feb 19, 2025 2:22 pm
by karinha
wartiaga, see if it helps:
Code: Select all | Expand
// C:\FWH\SAMPLES\MULTSEL.PRG by mister Rao.
#include "FiveWin.Ch"
#include "ord.ch"
#include "xbrowse.ch"
#include "hbcompat.ch"
REQUEST DBFCDX
FUNCTION Main()
LOCAL oDlg, oBrw, oFont
XbrNumFormat( 'A', .T. )
USE CUSTOMER NEW ALIAS "CUST" SHARED VIA "DBFCDX"
DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 14 BOLD
DEFINE DIALOG oDlg SIZE 700, 400 PIXEL FONT oFont
oDlg:lHelpIcon := .F.
@ 10, 10 XBROWSE oBrw SIZE - 10, - 10 PIXEL OF oDlg ;
DATASOURCE "CUST" ;
COLUMNS "FIRST", "CITY", "AGE", "SALARY" ;
CELL LINES NOBORDER
WITH OBJECT oBrw:InsCol( 1 )
:bEditValue := {|| AScan( oBrw:aSelected, oBrw:BookMark ) > 0 }
:SetCheck()
:nHeadBmpNo := {|| If( Len( oBrw:aSelected ) == oBrw:nLen, 1, 2 ) }
END
WITH OBJECT oBrw
:nMarqueeStyle := MARQSTYLE_HIGHLROWMS // multisel does the job
// :nMarqueeStyle := MARQSTYLE_HIGHLROW
:lMultiSelect := .F.
:bClrSelFocus := {|| { CLR_BLACK, CLR_HGRAY } }
:nStretchCol := 3
:aCols[ 1 ]:bClrSelFocus := {|| { CLR_BLACK, CLR_WHITE } }
:bLClicked := {| r, c, f, oBrw | If( oBrw:MouseColPos( c ) == 1, ;
If( ( f := AScan( oBrw:aSelected, oBrw:BookMark ) ) == 0, ;
AAdd( oBrw:aSelected, oBrw:BookMark ), ;
ADel( oBrw:aSelected, f, .T. ) ), NIL ), ;
oBrw:RefreshCurrent() }
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
RETURN NIL
// FIN / END
Regards, saludos.
Re: xbrowse multisel
Posted: Wed Feb 19, 2025 2:27 pm
by karinha
Re: xbrowse multisel
Posted: Thu Feb 20, 2025 5:52 pm
by wartiaga
ShumingWang wrote: Wed Feb 19, 2025 1:55 am
::nMarqueeStyle := MARQSTYLE_HIGHLROWMS
::select(1)
::seleect(2)
...
::aseleted stores Eval( ::bBookMark) //nrow
::select(0) clear selected rows ,::aselected:={}
Shuming Wang
Thank You!
Re: xbrowse multisel
Posted: Thu Feb 20, 2025 5:53 pm
by wartiaga
Silvio.Falconi wrote: Wed Feb 19, 2025 9:27 am
wartiaga wrote: Mon Feb 17, 2025 12:54 am
Hi,
How the best way to use multisel in xbrowse? I would not like to use a logical field in the dbf to select or unmark the record as there may be other users using the same record.
Thanks in advance!
You must not also use a field on your archive
Thank You for the tip Silvio!
Re: xbrowse multisel
Posted: Thu Feb 20, 2025 6:02 pm
by wartiaga
karinha wrote: Wed Feb 19, 2025 2:22 pm
wartiaga, see if it helps:
Code: Select all | Expand
// C:\FWH\SAMPLES\MULTSEL.PRG by mister Rao.
#include "FiveWin.Ch"
#include "ord.ch"
#include "xbrowse.ch"
#include "hbcompat.ch"
REQUEST DBFCDX
FUNCTION Main()
LOCAL oDlg, oBrw, oFont
XbrNumFormat( 'A', .T. )
USE CUSTOMER NEW ALIAS "CUST" SHARED VIA "DBFCDX"
DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 14 BOLD
DEFINE DIALOG oDlg SIZE 700, 400 PIXEL FONT oFont
oDlg:lHelpIcon := .F.
@ 10, 10 XBROWSE oBrw SIZE - 10, - 10 PIXEL OF oDlg ;
DATASOURCE "CUST" ;
COLUMNS "FIRST", "CITY", "AGE", "SALARY" ;
CELL LINES NOBORDER
WITH OBJECT oBrw:InsCol( 1 )
:bEditValue := {|| AScan( oBrw:aSelected, oBrw:BookMark ) > 0 }
:SetCheck()
:nHeadBmpNo := {|| If( Len( oBrw:aSelected ) == oBrw:nLen, 1, 2 ) }
END
WITH OBJECT oBrw
:nMarqueeStyle := MARQSTYLE_HIGHLROWMS // multisel does the job
// :nMarqueeStyle := MARQSTYLE_HIGHLROW
:lMultiSelect := .F.
:bClrSelFocus := {|| { CLR_BLACK, CLR_HGRAY } }
:nStretchCol := 3
:aCols[ 1 ]:bClrSelFocus := {|| { CLR_BLACK, CLR_WHITE } }
:bLClicked := {| r, c, f, oBrw | If( oBrw:MouseColPos( c ) == 1, ;
If( ( f := AScan( oBrw:aSelected, oBrw:BookMark ) ) == 0, ;
AAdd( oBrw:aSelected, oBrw:BookMark ), ;
ADel( oBrw:aSelected, f, .T. ) ), NIL ), ;
oBrw:RefreshCurrent() }
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
RETURN NIL
// FIN / END
Regards, saludos.
Thank You Karinha, works great!