xbrowse multisel

Post Reply
wartiaga
Posts: 219
Joined: Wed May 25, 2016 1:04 am

xbrowse multisel

Post 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!
ShumingWang
Posts: 467
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China
Contact:

Re: xbrowse multisel

Post by ShumingWang »

::nMarqueeStyle := MARQSTYLE_HIGHLROWMS
::select(1)
::seleect(2)
...
::aseleted stores Eval( ::bBookMark) //nrow

::select(0) clear selected rows ,::aselected:={}

Shuming Wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
User avatar
Silvio.Falconi
Posts: 7141
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: xbrowse multisel

Post 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

Code: Select all | Expand

WITH OBJECT oBrw
                    :SetMultiSelectCol()

Image
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
Otto
Posts: 6404
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 25 times
Been thanked: 2 times
Contact:

Re: xbrowse multisel

Post by Otto »

Respect and congratulations – I like the design.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Silvio.Falconi
Posts: 7141
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: xbrowse multisel

Post 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
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
karinha
Posts: 7942
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: xbrowse multisel

Post 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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
Posts: 7942
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: xbrowse multisel

Post by karinha »

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
wartiaga
Posts: 219
Joined: Wed May 25, 2016 1:04 am

Re: xbrowse multisel

Post 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!
wartiaga
Posts: 219
Joined: Wed May 25, 2016 1:04 am

Re: xbrowse multisel

Post 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

Code: Select all | Expand

WITH OBJECT oBrw
                    :SetMultiSelectCol()

Image
Thank You for the tip Silvio!
wartiaga
Posts: 219
Joined: Wed May 25, 2016 1:04 am

Re: xbrowse multisel

Post 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!
Post Reply