FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour problem wth SetMultiSelectCol
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
problem wth SetMultiSelectCol
Posted: Sat Apr 29, 2023 01:49 PM
I have this dialog with a buttonbar and a xbrowse with SetMultiSelectCol




I wish when I click on first column ( SetMultiSelectCol) call the function btnbar() ( change the buttonbar) and refreshtitle() ( change dialog title)


I tried with
Code (fw): Select all Collapse
WITH OBJECT  oBrw:aCols[1]
               :bLClicked := { |r,c,f,oBrw| If( ( f := AScan( oBrw:aSelected, oBrw:BookMark ) ) == 0, ;
                     (AAdd( oBrw:aSelected, oBrw:BookMark ),Btnbar(2,oDlg:oBar,oDlg,oDbf,oBrw)), ;
                     (ADel( oBrw:aSelected, f, .t. ),IiF(LEN(oBrw:aSelected)==0,Btnbar(1,oDlg:oBar,oDlg,oDbf,oBrw),)) ), ;
                       Refresh_title(oBrw,oDlg,oDbf,cTitle),;
                     oBrw:RefreshCurrent()  }
             END
but not work and make error give me error on :bLClicked

this is a small sample
Code (fw): Select all Collapse
// sample with SetMultiSelectCol

#include 'fivewin.ch'
#include 'xbrowse.ch'

#DEFINE TXT_DISPLAY_ITEMS   " displayed items)"
#DEFINE TXT_ITEM_SELECTED   " item selected on "
#DEFINE TXT_ITEMS_SELECTED  " items selected on "
#DEFINE TXT_SEARCH  " search "


function Main()

   local oDlg, oBrw, oFont,oBar,oDbf
   local cTitle := "Customers"

       oDbf :=TDatabase():Open( , "Customer", "DBFCDX", .T. )
       oDbf:setorder(1)
       oDbf:Gotop()

   DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14

   DEFINE DIALOG oDlg SIZE 640,440 PIXEL ;
      FONT oFont



   @ 40, 2 XBROWSE oBrw OF oDlg SIZE -5,-2 PIXEL ;
      AUTOCOLS DATASOURCE oDbf  NOBORDER

        MyStyleBrowse(oBrw)

       WITH OBJECT oBrw
             :SetMultiSelectCol()


           /*  WITH OBJECT  oBrw:aCols[1]
               :bLClicked := { |r,c,f,oBrw| If( ( f := AScan( oBrw:aSelected, oBrw:BookMark ) ) == 0, ;
                     (AAdd( oBrw:aSelected, oBrw:BookMark ),Btnbar(2,oDlg:oBar,oDlg,oDbf,oBrw)), ;
                     (ADel( oBrw:aSelected, f, .t. ),IiF(LEN(oBrw:aSelected)==0,Btnbar(1,oDlg:oBar,oDlg,oDbf,oBrw),)) ), ;
                       Refresh_title(oBrw,oDlg,oDbf,cTitle),;
                     oBrw:RefreshCurrent()  }
             END
            */


            :lHScroll  := .f.
            :CreateFromCode()
         END


       FOR i := 2 TO Len( oBrw:aCols )

             oCol := oBrw:aCols[ i ]
             oCol:bLDClickData  := {|| oBrw:edit() }
          NEXT






   ACTIVATE DIALOG oDlg CENTERED;
    ON INIT ( Btnbar(0,oBar,oDlg,oDbf,oBrw) ,;
              Btnbar(1,oDlg:oBar,oDlg,oDbf,oBrw) ,;
              Refresh_title(oBrw,oDlg,oDbf,cTitle))
   RELEASE FONT oFont

return nil
//-----------------------------------------------------------------------------------------//
Function Btnbar(nBar,oBar,oDlg,oDbf,oBrw)  // ,aBtnBar
   local aBtnBar
   local x

   if Valtype( oBar ) = "O"
      For x := Len( oBar:aControls ) to 1 step - 1
         oBar:Del( x )
      Next x
   endif

   Do case

   case nbar = 0
       DEFINE BUTTONBAR oBar OF oDlg  SIZE 80,70  TOP NOBORDER  2015

case nbar = 1
   aBtnBar := array(6)
   DEFINE BUTTON aBtnBar[1] OF oBar PROMPT "New"  ;
                 ACTION NIL
   DEFINE BUTTON aBtnBar[2] OF oBar PROMPT "Modify"  ;
                 ACTION NIL GROUP  WHEN oDbf:OrdKeyCount() > 0
   DEFINE BUTTON aBtnBar[3] OF oBar PROMPT "Duplicate"  ;
                 ACTION NIL       WHEN oDbf:OrdKeyCount() > 0
   DEFINE BUTTON aBtnBar[4] OF oBar PROMPT "Del" ;
                 ACTION NIL           WHEN oDbf:OrdKeyCount() > 0
   DEFINE BUTTON aBtnBar[5] OF oBar PROMPT "Print"  ;
                 ACTION oBrw:Report()  GROUP WHEN oDbf:OrdKeyCount() > 0
   DEFINE BUTTON aBtnBar[6] OF oBar PROMPT "Help" RESOURCE "HLP_DLG"  ;
                 ACTION NIL  BTNRIGHT

case nbar = 2
    aBtnBar := array(3)
    DEFINE BUTTON aBtnBar[1] OF oBar PROMPT "Del"  ;
                  ACTION NIL          WHEN oDbf:OrdKeyCount() > 0
    DEFINE BUTTON aBtnBar[2] OF oBar PROMPT "Print"  ;
                  ACTION oBrw:Report() GROUP WHEN oDbf:OrdKeyCount() > 0
    DEFINE BUTTON aBtnBar[3] OF oBar PROMPT "Help"   ;
                   ACTION NIL  BTNRIGHT
endcase
return oBar
//--------------------------------------------------------------------------//
Function Refresh_title(oBrw,oDlg,oDbf,cTitle)
   local nCounter
   local cString

IF Len(oBrw:aSelected) >=1
   If Len(oBrw:aSelected) = 1
      cString := " ( " +ltrim(Str( Len(oBrw:aSelected)))+ TXT_ITEM_SELECTED +lTrim(str(oDbf:KeyCount()))+TXT_DISPLAY_ITEMS
   else
      cString := " ( " +ltrim(Str( Len(oBrw:aSelected)))+TXT_ITEMS_SELECTED +lTrim(str(oDbf:KeyCount()))+TXT_DISPLAY_ITEMS
    Endif
 else
    cString :=" ( "+lTrim(str(oDbf:KeyCount()))+TXT_DISPLAY_ITEMS
Endif
oDlg:SetText( cTitle+cString)
 return Nil
//--------------------------------------------------------------------------//
 Function MyStyleBrowse(oBrw)
   local nColorPigiama := RGB(243,243,238)


    WITH OBJECT oBrw
            :nRowHeight          := 25
            :l2007               := .F.
            :l2015               := .T.
            :lRecordSelector     := .F.
            :nColDividerStyle    := LINESTYLE_LIGHTGRAY
            :nRowDividerStyle    := LINESTYLE_LIGHTGRAY
            :nStretchCol         := STRETCHCOL_WIDEST
            :nMarqueeStyle        := MARQSTYLE_HIGHLROW

            :lAllowRowSizing     := .F.
            :lAllowColSwapping   := .F.
            :lAllowColHiding     := .F.
            :lAllowSizings       := .F.

             :lDrawBorder := .t.
             :nClrBorder := Rgb(195,195,185)

            :bRecSelHeader    := ""
         :bClrStd := { || { CLR_BLACK, If( oBrw:KeyNo % 2 == 0, CLR_WHITE,nColorPigiama ) } }
         END
 return nil
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: problem wth SetMultiSelectCol
Posted: Sat Apr 29, 2023 03:07 PM
Silvio, en mi version solo funciona asi:
Code (fw): Select all Collapse
#include 'fivewin.ch'
#include 'xbrowse.ch'
#include "constant.ch"
#include "report.ch"

ANNOUNCE RDDSYS
REQUEST OrdKeyNo, OrdKeyCount, OrdCreate, OrdKeyGoto // Para ListBox
REQUEST DBFCDX, DBFFPT

STATIC aBtnBar
STATIC lLigaBtn1 := .T., lLigaBtn2 := .T., lLigaBtn3 := .T., ;
       lLigaBtn4 := .T., lLigaBtn5 := .T., lLigaBtn6 := .T.

FUNCTION test()

   LOCAL oDlg, oDbf, oFont
   LOCAL oBar
   LOCAL aBtnBrow
   LOCAL nBottom   := 27.2
   LOCAL nRight    := 89
   LOCAL nWd       := Max( nRight * DLG_CHARPIX_W, 180 )
   LOCAL nHt       := nBottom * DLG_CHARPIX_H

   aBtnBar := Array( 8 ) // no puede ser LOCAL

   rddSetDefault( "DBFCDX" )

   oDbf := TDatabase():Open( , "Customer", "DBFCDX", .T. )
   oDbf:setorder( 1 )
   oDbf:Gotop()

   /* // PARA TESTES EN MI VERSION
   IF NetUse( "CUSTOMER", .T. ) // asi, mi version funciona de 1000.

      DATABASE oDbf

      oDbf:Load()
      oDbf:SetBuffer( .T. )

      oDbf:setorder( 1 )
      oDBf:GoTop()

   ELSE

      MsgStop( "Banco de Dados CUSTOMER Bloqueado", "Cuidado!" )

      RETURN NIL

   ENDIF
   */

   DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL TiTle "test"

   @ 110, 10 XBROWSE oBrw SIZE - 10, - 10 PIXEL OF oDlg ;
      DATASOURCE oDbf AUTOCOLS AUTOSORT FONT oFont NOBORDER CELL LINES

   WITH OBJECT oBrw

      WITH OBJECT oBrw:InsCol( 1 )

         :bEditValue    := {|| AScan( oBrw:aSelected, oBrw:BookMark ) > 0 }
         :SetCheck( NIL, .T. )
         :nHeadBmpNo    := {|| If( Len( oBrw:aSelected ) == oBrw:nLen, 1, 2 ) }
         :bFooter       := {|| Str( Len( oBrw:aSelected ) ) }

      END

      :bLClicked := {| r, c, f, oBrw | If( oBrw:MouseColPos( c ) == 1, ;
         If( ( f := AScan( oBrw:aSelected, oBrw:BookMark ) ) == 0, ;
         ( AAdd( oBrw:aSelected, oBrw:BookMark ), Btnbar( 2, oDlg:oBar, oDlg, oDbf, oBrw ) ), ;
         ( ADel( oBrw:aSelected, f, .T. ), Btnbar( 1, oDlg:oBar, oDlg, oDbf, oBrw ) ) ), NIL ), ;
         oBrw:RefreshCurrent() }

      :bKeyChar   := {| k | If( k == VK_SPACE, ( oBrw:oCol( 1 ):CheckToggle(), oBrw:RefreshCurrent(), 0 ), NIL ) }
      :bLDblClick := {|| oBrw:oCol( 1 ):CheckToggle(), oBrw:RefreshCurrent() }
      :bClrStd    := {|| { CLR_BLACK, If( oBrw:oCol( 1 ):Value, 0x80ffff, CLR_WHITE ) } }

      :nRowHeight          := 25
      :l2007               := .F.
      :l2015               := .T.
      :lRecordSelector     := .F.
      :nColDividerStyle    := LINESTYLE_LIGHTGRAY
      :nRowDividerStyle    := LINESTYLE_LIGHTGRAY
      :nStretchCol         := STRETCHCOL_WIDEST
      :nMarqueeStyle       := MARQSTYLE_HIGHLROW
      :lAllowRowSizing     := .F.
      :lAllowColSwapping   := .F.
      :lAllowColHiding     := .F.
      :lAllowSizings       := .F.
      :lDrawBorder := .T.
      :nClrBorder := Rgb( 195, 195, 185 )
      :bClrStd := {|| { CLR_BLACK, If( oBrw:KeyNo % 2 == 0, CLR_WHITE, RGB( 243, 243, 238 ) ) } }

      :CreateFromCode()
   END

   FOR i := 2 TO Len( oBrw:aCols )

      oCol := oBrw:aCols[ i ]
      oCol:bLDClickData  := {|| msginfo( "Modify" ) }

   NEXT

   @ 85, 10 BTNBMP aBtnBrow FLAT  SIZE 80, 20  OF oDlg PIXEL ;
      PROMPT "Select menu" NOROUND                           ;
      ACTION ::ShowPopUp( {| oBtn | MenuContextual( oBtn, oBrw, oDbf, oDlg ) } )

   ACTIVATE DIALOG oDlg CENTERED                      ;
      ON INIT (  Btnbar( 1, oBar, oDlg, oDbf, oBrw ), ;
                 Btnbar( 1, oDlg:oBar, oDlg, oDbf, oBrw ),       ;
                 ChangeButtons( oDlg:oBar ) )

RETURN NIL

FUNCTION Btnbar( nBar, oBar, oDlg, oDbf, oBrw )

   LOCAL x

   // esto no funciona en mi version
   IF ValType( oBar ) = "O"
      FOR x := Len( oBar:aControls ) TO 1 STEP - 1
         oBar:Del( x )
      NEXT x
   ENDIF

   DO CASE
   CASE nbar = 0

      DEFINE BUTTONBAR oBar OF oDlg  SIZE 80, 70  TOP NOBORDER  2007

      oBar:Refresh()

   CASE nbar = 1

      DEFINE BUTTONBAR oBar OF oDlg  SIZE 80, 70  TOP NOBORDER  2007

      DEFINE BUTTON aBtnBar[ 1 ] OF oBar PROMPT "New"       WHEN( lLigaBtn1 ) ;
         ACTION NIL

      DEFINE BUTTON aBtnBar[ 2 ] OF oBar PROMPT "Modify"    WHEN( lLigaBtn2 ) ;
         ACTION NIL

      DEFINE BUTTON aBtnBar[ 3 ] OF oBar PROMPT "Duplicate" WHEN( lLigaBtn3 ) ;
         ACTION NIL

      DEFINE BUTTON aBtnBar[ 4 ] OF oBar PROMPT "Del"       WHEN( lLigaBtn4 ) ;
         ACTION NIL

      DEFINE BUTTON aBtnBar[ 5 ] OF oBar PROMPT "Print"     WHEN( lLigaBtn5 ) ;
         ACTION oBrw:Report()

      DEFINE BUTTON aBtnBar[ 6 ] OF oBar PROMPT "HElp"      WHEN( lLigaBtn6 ) ;
         ACTION NIL BTNRIGHT

   CASE nbar = 2

      DEFINE BUTTONBAR oBar OF oDlg  SIZE 80, 70  TOP NOBORDER  2007 // 2015

      DEFINE BUTTON aBtnBar[4] OF oBar PROMPT "Del"       WHEN( lLigaBtn4 ) ;
         ACTION NIL

      DEFINE BUTTON aBtnBar[5] OF oBar PROMPT "Print"     WHEN( lLigaBtn5 ) ;
         ACTION oBrw:Report()

      DEFINE BUTTON aBtnBar[6] OF oBar PROMPT "Help"      WHEN( lLigaBtn6 ) ;
         ACTION NIL BTNRIGHT

   ENDCASE

RETURN oBar

FUNCTION ChangeButtons( oBar )

   AEval( oBar:aControls, {| oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )

RETURN .T.

FUNCTION MenuContextual( oControl, oBrw, oDbf, oParent )

   LOCAL oMenu

   MENU oMenu POPUP

   IF oBrw:IsSelectedRow()

      MENUITEM "Deselect row" ;
         ACTION ( oBrw:SelectRow( 0 ), ;
          Btnbar( 1, oParent:oBar, oParent, oDbf, oBrw ) )

   ELSE

      MENUITEM "Select row"   ;
         ACTION ( oBrw:SelectRow( 2 ), ;
          Btnbar( 2, oParent:oBar, oParent, oDbf, oBrw ) )

   ENDIF

   SEPARATOR
   MENUITEM "Print"  ;
      ACTION oBrw:Report()

   ENDMENU

RETURN oMenu

FUNCTION NetUse( cDbf, lShared )

   LOCAL cAlias := cFileName( cDbf )
   LOCAL bAlias := cFileName( cDbf )

   If cDbf = NIL .OR. !File( cDbf + ".DBF" )
      MsgStop( "NOME DO ARQUIVO INCORRETO" + CRLF + CRLF + ;
               "NÃO ACHEI BANCO DE DADOS." + CRLF + CRLF + ;
               cDbf + ".DBF", "ERRO FATAL!!" )
      RETURN( .F. )
   ENDIF

   IIf( lShared = NIL, lShared := .F., lShared )

   IF lShared = .T.

      USE ( cDbf ) ALIAS ( cAlias ) VIA "DBFCDX" SHARED NEW

   ELSE

      USE ( cDbf ) ALIAS ( cAlias ) VIA "DBFCDX" EXCLUSIVE NEW

   ENDIF

   IF !NetErr()
      RETURN( .T. )
   ENDIF

   // Se nÆo podemos abrir, solicita repeti‡Æo
   MsgStop( "IMPOSSIVEL ABRIR BANCO DE DADOS: " + cAlias + CRLF + ;
                     OemToAnsi( "BLOQUEADO POR OUTRO USUµRIO." ), ;
            "ERRO FATAL DE REDE! FECHAR BANCO DE DADOS." )

RETURN( .F. )

// FIN - kapiabafwh@gmail.com
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: problem wth SetMultiSelectCol
Posted: Sat Apr 29, 2023 05:51 PM

No good ..

please not change btnbar function of Cristobal run ok

Your solution Is no good because It go to conflict to doubleclick call edit function

Oy Mr. Nageswarao can resolve it

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: problem wth SetMultiSelectCol
Posted: Sat Apr 29, 2023 08:24 PM
Silvio.Falconi wrote:No good ..

please not change btnbar function of Cristobal run ok

Your solution Is no good because It go to conflict to doubleclick call edit function

Oy Mr. Nageswarao can resolve it
Dear Silvio, DATA bLClicked is of TXBROWSE CLASS
You must calculate the column in which the mouse click occurred
Try with this code
Code (fw): Select all Collapse
// Remove             //WITH OBJECT  oBrw:aCols[1]
               :bLClicked := { |r,c,f,oBrw| if( oBrw:Mousecolpos( c ) == 1, ;
                    ( If( ( f := AScan( oBrw:aSelected, oBrw:BookMark ) ) == 0, ;
                     (AAdd( oBrw:aSelected, oBrw:BookMark ),Btnbar(2,oDlg:oBar,oDlg,oDbf,oBrw)), ;
                     (ADel( oBrw:aSelected, f, .t. ),IiF(LEN(oBrw:aSelected)==0,Btnbar(1,oDlg:oBar,oDlg,oDbf,oBrw),)) ), ;
                       Refresh_title(oBrw,oDlg,oDbf,cTitle),;
                     oBrw:RefreshCurrent() ), ) }
//Rems             //END
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: problem wth SetMultiSelectCol
Posted: Sat Apr 29, 2023 09:20 PM
cnavarro wrote:
No good ..

please not change btnbar function of Cristobal run ok

Your solution Is no good because It go to conflict to doubleclick call edit function

Oy Mr. Nageswarao can resolve it
Dear Silvio, DATA bLClicked is of TXBROWSE CLASS
You must calculate the column in which the mouse click occurred
Try with this code
Code (fw): Select all Collapse
// Remove             //WITH OBJECT  oBrw:aCols[1]
               :bLClicked := { |r,c,f,oBrw| if( oBrw:Mousecolpos( c ) == 1, ;
                    ( If( ( f := AScan( oBrw:aSelected, oBrw:BookMark ) ) == 0, ;
                     (AAdd( oBrw:aSelected, oBrw:BookMark ),Btnbar(2,oDlg:oBar,oDlg,oDbf,oBrw)), ;
                     (ADel( oBrw:aSelected, f, .t. ),IiF(LEN(oBrw:aSelected)==0,Btnbar(1,oDlg:oBar,oDlg,oDbf,oBrw),)) ), ;
                       Refresh_title(oBrw,oDlg,oDbf,cTitle),;
                     oBrw:RefreshCurrent() ), ) }
//Rems             //END
Cris,
I've already tried
that might work but
when I click on the first column, both the xbrowse table and the buttonbar shake
obviously for the modification I will have to use the doubleclick from the second column
but everything is unstable, everything shakes and flashes when I click on the first column


on xbrowse class there is :bOnMultiSelect but I not understood how create it

from fwh 12.08

(1) New DATA bOnMultiSelect:
If assigned, the codeblock is executed with Self and nOperation as parameters after
a multiselect operation.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: problem wth SetMultiSelectCol
Posted: Sat Apr 29, 2023 09:38 PM
Perhaps

:bOnMultiSelect := { || (IIF(LEN(oBrw:aSelected)==0,;
Btnbar(1,oDlg:oBar,oDlg,oDbf,oBrw),;
Btnbar(2,oDlg:oBar,oDlg,oDbf,oBrw) ),Refresh_title(oBrw,oDlg,oDbf,cTitle)) }

but it shakes and flashes all the same



I I try with
:bOnMultiSelect := { || Refresh_title(oBrw,oDlg,oDbf,cTitle) }

it run ok but then not run the btnbar function

So, is the btnbar go to shakes and flashes all
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: problem wth SetMultiSelectCol - RESOLVED !!!
Posted: Sun Apr 30, 2023 09:36 AM
found the solution

Code (fw): Select all Collapse
 
:SetMultiSelectCol()
         :bLClicked := { |r,c,f,oBrw| if( oBrw:Mousecolpos( c ) == 1, ;
                    ( if( ( f := AScan( oBrw:aSelected, oBrw:BookMark ) ) == 0, ;
                     ( AAdd( oBrw:aSelected, oBrw:BookMark ), ;
                       if( Len( oBrw:aSelected ) = 1, Btnbar(2,oDlg:oBar,oDlg,oDbf,oBrw), ) ), ;
                     ( ADel( oBrw:aSelected, f, .t. ), ;
                       if( LEN(oBrw:aSelected)==0, Btnbar(1,oDlg:oBar,oDlg,oDbf,oBrw), )) ), ;
                     Refresh_title(oBrw,oDlg,oDbf,cTitle),;
                     oBrw:RefreshCurrent() ), ) }

then we must change bar class

method del
from :: refresh() to ::refresh(.f.) line 717

method btnadjust
from ::oWnd:Refresh() to ::oWnd:Refresh(.f.) line 571


and all run ok without flash , without the system vibrates and flashes

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: problem wth SetMultiSelectCol
Posted: Sun Apr 30, 2023 10:36 AM
Dear Silvio,

many thanks for your great feedback

Already implemented for the next FWH build that it is coming :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: problem wth SetMultiSelectCol
Posted: Sun Apr 30, 2023 01:54 PM
Dear Silvio
As I told you in my email, please do not modify the class in this way to ensure compatibility with older developments.
The best way to do it would be to add the lRefresh parameter in both methods
Code (fw): Select all Collapse
METHOD Del( nPos, lRefresh ) CLASS TBar

   local n
   local lGroup:= ::aControls[ nPos ]:lGroup
   
   DEFAULT lRefresh   := .T.

.../...

   ::BtnAdjust( lRefresh )
   ::Refresh()

return nil
Code (fw): Select all Collapse
METHOD BtnAdjust( lRefresh ) CLASS TBar

   local n, nGroups := 0, nPopups := 0
   local l3D := ::l3D .and. ! ( ::l2007 .or. ::l2010 .or. ::l2013 .or. ::l2015)
   local nRow := If( l3D, 2, -1 )
   local nCol := If( l3D, 2, -1 ) + ::nOffSet

   DEFAULT lRefresh  := .T.

... / ...

   endcase

   ::oWnd:Refresh( lRefresh )

return ni
When you use method Del, then use oBar:Del( nPos, .F. ) if is neccesary
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: problem wth SetMultiSelectCol
Posted: Sun Apr 30, 2023 06:35 PM
Modified as Cristobal proposal

many thanks Cristobal :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: problem wth SetMultiSelectCol
Posted: Wed May 03, 2023 08:32 AM
Antonio Linares wrote:Modified as Cristobal proposal

many thanks Cristobal :-)
in the xbrowse table if I press space the record check is activated
but it doesn't activate the buttonbar menu change
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: problem wth SetMultiSelectCol
Posted: Wed May 03, 2023 09:04 AM
Resolved!!

:bKeyChar := {| k | (If( k == VK_SPACE,(IIF( oBrw:IsSelectedRow(),;
Btnbar(1,oDlg:oBar,oDlg,oDbf,oBrw,aBtnBrow[4]), ;
Btnbar(2,oDlg:oBar,oDlg,oDbf,oBrw,aBtnBrow[4]))), nil),;
Refresh_title(oBrw,oDlg,oDbf,cSection))}
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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

Continue the discussion