Show LINESTYLE of Xbrowse on line - (run with errors)

Show LINESTYLE of Xbrowse on line - (run with errors)

Postby Silvio.Falconi » Mon Oct 17, 2022 8:41 am

I have this xbrowse and I put on buttonbar a button to activare the vertical Lines (hide or show)
the button call a method Marcar(nOpt)
nOpt can be 1/2/3 only 1 and 3 activated

Image

at init the xbrowse have this configuration

for nOpt1

Code: Select all  Expand view

METHOD SetupBrowseVertical(nrecnos) CLASS TLOTTO
   local  nRecords := nRecnos

    WITH OBJECT ::oLbx
                      :nRowHeight    := 30
                      :nClrBorder := CLR_GRAY

                      :lHscroll            := .t.
                      :l2007               := .F.
                      :l2015               := .F.
                     // :nStretchCol         := STRETCHCOL_WIDEST
                      :lAllowRowSizing     := .F.
                      :lAllowColSwapping   := .F.
                      :lAllowColHiding     := .F.
                      :lRecordSelector     := .F.
                      :nColDividerStyle    := LINESTYLE_LIGHTGRAY
                      :nRowDividerStyle    := LINESTYLE_LIGHTGRAY



      FOR i := 2 TO LEN(:aCols)
         oCol := :aCols[ i ]
         oCol:nWidth   := 17
      NEXT

       FOR i := 1 TO 1
             oCol := :aCols[ i ]
             oCol:nWidth   := 60
             oCol:nColDividerStyle    := LINESTYLE_BLACK
             oCol:bClrStd := {|| { CLR_WHITE, RGB(255,0,0) } }
          NEXT


      END

      Return nil
 



for nOpt 3

Code: Select all  Expand view
METHOD SetupBrowseHorizontal() CLASS TLOTTO

        WITH OBJECT ::oLbx
                      :nRowHeight    := 30
                      :nClrBorder := CLR_GRAY

                      :lHscroll            := .t.
                      :l2007               := .F.
                      :l2015               := .T.
                     // :nStretchCol         := STRETCHCOL_WIDEST
                      :lAllowRowSizing     := .F.
                      :lAllowColSwapping   := .F.
                      :lAllowColHiding     := .F.
                      :lRecordSelector     := .F.
                      :nColDividerStyle    := LINESTYLE_LIGHTGRAY
                      :nRowDividerStyle    := LINESTYLE_LIGHTGRAY

                  //    :SetGroupHeader( "Estrazione",  1,  2)
                      :SetGroupHeader( "Bari",        3,  7 )
                      :SetGroupHeader( "Cagliari",    8, 12 )
                      :SetGroupHeader( "Firenze",    13, 17 )
                      :SetGroupHeader( "Genova",     18, 22 )
                      :SetGroupHeader( "Milano",     23, 27 )
                      :SetGroupHeader( "Napoli",     28, 32 )
                      :SetGroupHeader( "Palermo",    33, 37 )
                      :SetGroupHeader( "Roma",       38, 42 )
                      :SetGroupHeader( "Torino",     43, 47 )
                      :SetGroupHeader( "Venezia",    48, 52 )
                      :SetGroupHeader( "Nazionale",  53, 57 )

      FOR i := 3 TO LEN(:aCols)
         oCol := :aCols[ i ]
         oCol:nWidth   := 17
      NEXT

          FOR i := 1 TO 1
             oCol := :aCols[ i ]
             oCol:nWidth   := 60
             oCol:nColDividerStyle    := LINESTYLE_BLACK
             oCol:bClrStd := {|| { CLR_WHITE, RGB(255,0,0) } }
          NEXT


       END

       RETURN NIL




on Source
Code: Select all  Expand view
DEFINE BUTTON oSelf:oLines FILENAME ".\bitmaps\marca.png"     OF ::oBar    ;
      TOOLTIP "lines"  ACTION oSelf:Marcar(aShowCbx[1]:nAt)




I made this method
nPt1 -> must show the Lienstyle step 5 column

Code: Select all  Expand view
METHOD Marcar(nOpt ) CLASS TLOTTO
      local  nRecords := val(::nRecnos)
      local i,oCol

      ::lMarcar:=!::lMarcar


      IF nOpt=1
        //Vert
         If ::lMarcar

         FOR i := 1 TO (nRecords*5)  STEP 5
             oCol := ::oLbx:aCols[ i ]
             oCol:nColDividerStyle    := LINESTYLE_BLACK
          NEXT


       ELSE

          FOR i := 1 TO (nRecords*5) STEP 5
             oCol := ::oLbx:aCols[ i ]
             oCol:nColDividerStyle    := LINESTYLE_LIGHTGRAY
          NEXT
        Endif

      ELSEIf nOpt=2
         //venus

      ELSEIf nOpt=3
          // Horiz

         IF ::lMarcar
         FOR i := 2 TO 55  STEP 5
             oCol := ::oLbx:aCols[ i ]
             oCol:nColDividerStyle    := LINESTYLE_BLACK
          NEXT

      ELSE

          FOR i := 2 TO 55  STEP 5
             oCol := ::oLbx:aCols[ i ]
             oCol:nColDividerStyle    := LINESTYLE_LIGHTGRAY
          NEXT
       Endif

      Endif
 
      return nil

 



why not run ?
Last edited by Silvio.Falconi on Mon Nov 07, 2022 8:26 am, edited 3 times in total.
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
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Show LINESTYLE of Xbrowse on line

Postby Silvio.Falconi » Thu Oct 20, 2022 7:16 am

Any solution please
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
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Show LINESTYLE of Xbrowse on line

Postby karinha » Thu Oct 20, 2022 2:54 pm

Dear Silvio, if possible, make a DEMO, and send it to Mr. Nages to look at. I think this is pretty expensive to develop.

Estimado Silvio, si es posible, haga una DEMO y envíela al Sr. Nages para que la vea. Creo que esto es bastante caro de desarrollar.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Show LINESTYLE of Xbrowse on line

Postby Silvio.Falconi » Thu Oct 20, 2022 3:27 pm

karinha wrote:Dear Silvio, if possible, make a DEMO, and send it to Mr. Nages to look at. I think this is pretty expensive to develop.

Estimado Silvio, si es posible, haga una DEMO y envíela al Sr. Nages para que la vea. Creo que esto es bastante caro de desarrollar.

Regards, saludos.


Image



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

REQUEST DBFCDX

//----------------------------------------------------------------------------//

function Main()

   test1()

return nil

//----------------------------------------------------------------------------//

INIT PROCEDURE PrgInit

   RddSetDefault( "DBFCDX" )

   SET DATE ITALIAN
   SET DELETED     ON
   SET CENTURY     ON
   SET EPOCH TO    YEAR( DATE() ) - 20
//   SET MULTIPLE    OFF

return

//----------------------------------------------------------------------------//

static function Test1()

   local aData:= { ;
            { "17.08.2019",76,83,39,10,61,90,32,55,33,67},;
            { "20.08.2019",44, 4,25,29,66,74,36,55,73,30},;
            { "22.08.2019",89,54,42,12,10,35,24,46,35,47},;
            { "24.08.2019",30,64,38,60,55,44,49,66,11,16},;
            { "27.08.2019",68,11,16,72,80,15, 1,62,76,83},;
            { "29.08.2019",31,35,47,80, 2,72,12, 4,39,10},;
            { "31.08.2019",69,11,28,51,53,36,66,77,25,29},;
            { "03.09.2019",73,30,15,59,62,36, 6,24, 4,25}}
   local aColors := { ;
            {0,0xa9a9a9},{0,0x0000ff},{0,0x4848ff},{0,0x6f6fff},{0,0x32cd32}, ;
            {0,0xceb966},{0,0xd48d54},{0,0x9b8531},{0,0xff00ff}}

   local oDlg,oBar,oFont,oBrw,n
   local oNumber,oPlus,oCancel,oLines
   local lShowLines:=.f.

   DEFINE FONT oFont NAME "VERDANA" SIZE 0,-16
   DEFINE DIALOG oDlg SIZE 800,400 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
   TITLE "Test separator lines"

   DEFINE BUTTONBAR oBar OF oDlg SIZE 80,30 2015
   oBar:SetFont( oFont:Bold() )


DEFINE BUTTON oLines Prompt "Lines"     OF oBar    ;
      TOOLTIP "Show Lines"  ;
      ACTION  ShowLines(oBrw,@lShowLines)


  @ 30,05 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      COLUMNS {1,2,3,4,5,6,7,8,9,10,11} ;
      HEADERS {"Date","1","2","3","4","5","1","2","3","4","5"} ;
      ARRAY aData LINES  NOBORDER FASTEDIT    //LINES

      SetupBrowseColor(oBrw)
      oBrw:CreateFromCode()

    *  ShowLines(oBrw,lShowlines)

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

   return nil


  Function ShowLines(oBrw,lShowLines)
   local  nRecords := 2
   local i

    WITH OBJECT oBrw
          :nMarqueeStyle   := 2
          :lColDividerComplete :=.f.

   If lShowlines
          FOR i := 1 TO (nRecords*5)  STEP 5
             oCol := oBrw:aCols[ i ]
             oCol:nColDividerStyle    := LINESTYLE_BLACK
          NEXT
         lShowlines:=.f.
   Else
           FOR i := 1 TO (nRecords*5)  STEP 5
             oCol := oBrw:aCols[ i ]
             oCol:nColDividerStyle    := LINESTYLE_LIGHTGRAY
          NEXT
          lShowlines:=.t.
       Endif

       END

       oBrw:refresh()


  return lShowlines




//-----------------------------------------------------//
Function SetupBrowseColor(oBrw)
       WITH OBJECT oBrw
          :nMarqueeStyle   := 2

         :lAllowRowSizing     := .f.
         :lAllowColSwapping   := .f.
         :lAllowColHiding     := .f.

         // NEW
         :lAllowSizings       := .f.
         :lAutoSaves          := .t.

         :lColDividerComplete :=.f.

       FOR i := 2 TO LEN(:aCols)
         oCol := :aCols[ i ]
         oCol:nWidth   := 17
      NEXT

         :nColDividerStyle    := LINESTYLE_LIGHTGRAY
         :nRowDividerStyle    := LINESTYLE_LIGHTGRAY
         :SetStyle( 2018 )

   END
return nil



 
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
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Show LINESTYLE of Xbrowse on line

Postby karinha » Thu Oct 20, 2022 9:03 pm

Estimado Silvio, explícate mejor, a partir de esta modificación que hice. Estoy muy confundido.

Dear Silvio, explain better, from this modification I made. I'm very confused.

Code: Select all  Expand view

// C:\FWH..\SAMPLES\LINESSIL.PRG

#include "fivewin.ch"

REQUEST DBFCDX

STATIC oBrw, lShowLines := .F.

FUNCTION Main()

   test1()

RETURN nil

INIT PROCEDURE PrgInit

   RddSetDefault( "DBFCDX" )

   SET DATE ITALIAN
   SET DELETED     ON
   SET CENTURY     ON
   SET EPOCH TO    YEAR( DATE() ) - 20

RETURN

STATIC FUNCTION Test1()

   LOCAL aData := { ;
      { "17.08.2019", 76, 83, 39, 10, 61, 90, 32, 55, 33, 67 }, ;
      { "20.08.2019", 44, 4, 25, 29, 66, 74, 36, 55, 73, 30 }, ;
      { "22.08.2019", 89, 54, 42, 12, 10, 35, 24, 46, 35, 47 }, ;
      { "24.08.2019", 30, 64, 38, 60, 55, 44, 49, 66, 11, 16 }, ;
      { "27.08.2019", 68, 11, 16, 72, 80, 15, 1, 62, 76, 83 }, ;
      { "29.08.2019", 31, 35, 47, 80, 2, 72, 12, 4, 39, 10 }, ;
      { "31.08.2019", 69, 11, 28, 51, 53, 36, 66, 77, 25, 29 }, ;
      { "03.09.2019", 73, 30, 15, 59, 62, 36, 6, 24, 4, 25 } }

   LOCAL aColors := { ;
      { 0, 0xa9a9a9 }, { 0, 0x0000ff }, { 0, 0x4848ff }, { 0, 0x6f6fff }, { 0, 0x32cd32 }, ;
      { 0, 0xceb966 }, { 0, 0xd48d54 }, { 0, 0x9b8531 }, { 0, 0xff00ff } }

   LOCAL oDlg, oBar, oFont, n
   LOCAL oNumber, oPlus, oCancel, oLines

   DEFINE FONT oFont NAME "VERDANA" SIZE 0, - 16

   DEFINE DIALOG oDlg SIZE 800, 400 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
      TITLE "Test separator lines"

   DEFINE BUTTONBAR oBar OF oDlg SIZE 80, 30 2015
   oBar:SetFont( oFont:Bold() )

   DEFINE BUTTON oLines PROMPT "Lines"     OF oBar    ;
      TOOLTIP "Show Lines"  ;
      ACTION  ShowLines( oBrw, lShowLines )

      //ACTION  ShowLines( oBrw, @lShowLines )

   @ 30, 05 XBROWSE oBrw SIZE - 20, - 20 PIXEL OF oDlg ;
      COLUMNS { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } ;
      HEADERS { "Date", "1", "2", "3", "4", "5", "1", "2", "3", "4", "5" } ;
      ARRAY aData LINES  NOBORDER FASTEDIT    //LINES

   WITH OBJECT oBrw

      oBrw:CreateFromCode()

      ShowLines( oBrw, lShowlines )

      SetupBrowseColor( oBrw )

      oBrw:Refresh()
      oBrw:SetFocus()

   END

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

RETURN nil

FUNCTION ShowLines( oBrw, lShowLines )

   LOCAL  nRecords := 2
   LOCAL i, oCol

   WITH OBJECT oBrw

      :nMarqueeStyle   := 2
      :lColDividerComplete := .F.

      IF lShowlines

         FOR i := 1 TO ( nRecords * 5 )  STEP 5
            oCol := oBrw:aCols[ i ]

            oCol:nColDividerStyle := LINESTYLE_BLACK

         NEXT
         lShowlines := .F.
      ELSE
         FOR i := 1 TO ( nRecords * 5 )  STEP 5
            oCol := oBrw:aCols[ i ]

            oCol:nColDividerStyle := LINESTYLE_LIGHTGRAY
         NEXT
         lShowlines := .T.
      ENDIF

   END

   oBrw:Refresh()
   oBrw:SetFocus()

RETURN lShowlines

FUNCTION SetupBrowseColor( oBrw )

   LOCAL I, oCol

   WITH OBJECT oBrw

      // :nMarqueeStyle   := 2
      // :nMarqueeStyle   := MARQSTYLE_HIGHLWIN7
      //:nMarqueeStyle   := MARQSTYLE_HIGHLROW
      :nMarqueeStyle    := MARQSTYLE_HIGHLCELL

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

      // NEW
      :lAllowSizings       := .F.
      :lAutoSaves          := .T.

      :lColDividerComplete := .F.

      FOR i := 2 TO LEN( :aCols )
         oCol := :aCols[ i ]
         oCol:nWidth   := 17
      NEXT



      :nColDividerStyle := LINESTYLE_LIGHTGRAY
      :nRowDividerStyle := LINESTYLE_LIGHTGRAY

      :SetStyle( 2018 )

   END

RETURN nil
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Show LINESTYLE of Xbrowse on line

Postby Silvio.Falconi » Fri Oct 21, 2022 6:34 am

No your sample not run here !!!


the :nMarqueeStyle must be 2

at init it must be

Image

if the user press the button then

Image

if the user press the button then

Image

possible that I can not do this, there is something that certainly escapes us

posible que no pueda hacer esto, hay algo que seguro se nos escapa
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
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Show LINESTYLE of Xbrowse on line

Postby karinha » Fri Oct 21, 2022 1:35 pm

Dear Silvio, y ahora, que falta? Confused... hahahahahaha,

Code: Select all  Expand view

// C:\FWH..\SAMPLES\LINESSIL.PRG

#include "fivewin.ch"

REQUEST DBFCDX

STATIC oBrw, lShowLines := .F.

FUNCTION Main()

   test1()

RETURN nil

INIT PROCEDURE PrgInit

   RddSetDefault( "DBFCDX" )

   SET DATE ITALIAN
   SET DELETED     ON
   SET CENTURY     ON
   SET EPOCH TO    YEAR( DATE() ) - 20

RETURN

STATIC FUNCTION Test1()

   LOCAL aData := { ;
      { "17.08.2019", 76, 83, 39, 10, 61, 90, 32, 55, 33, 67 }, ;
      { "20.08.2019", 44, 4, 25, 29, 66, 74, 36, 55, 73, 30 }, ;
      { "22.08.2019", 89, 54, 42, 12, 10, 35, 24, 46, 35, 47 }, ;
      { "24.08.2019", 30, 64, 38, 60, 55, 44, 49, 66, 11, 16 }, ;
      { "27.08.2019", 68, 11, 16, 72, 80, 15, 1, 62, 76, 83 }, ;
      { "29.08.2019", 31, 35, 47, 80, 2, 72, 12, 4, 39, 10 }, ;
      { "31.08.2019", 69, 11, 28, 51, 53, 36, 66, 77, 25, 29 }, ;
      { "03.09.2019", 73, 30, 15, 59, 62, 36, 6, 24, 4, 25 } }

   LOCAL aColors := { ;
      { 0, 0xa9a9a9 }, { 0, 0x0000ff }, { 0, 0x4848ff }, { 0, 0x6f6fff }, { 0, 0x32cd32 }, ;
      { 0, 0xceb966 }, { 0, 0xd48d54 }, { 0, 0x9b8531 }, { 0, 0xff00ff } }

   LOCAL oDlg, oBar, oFont, n
   LOCAL oNumber, oPlus, oCancel, oLines

   DEFINE FONT oFont NAME "VERDANA" SIZE 0, - 16

   DEFINE DIALOG oDlg SIZE 800, 400 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
      TITLE "Test separator lines"

   DEFINE BUTTONBAR oBar OF oDlg SIZE 80, 30 2015
   oBar:SetFont( oFont:Bold() )

   DEFINE BUTTON oLines PROMPT "Lines"     OF oBar    ;
      TOOLTIP "Show Lines"  ;
      ACTION  ShowLines( oBrw, lShowLines )

      //ACTION  ShowLines( oBrw, @lShowLines )

   @ 30, 05 XBROWSE oBrw SIZE - 20, - 20 PIXEL OF oDlg ;
      COLUMNS { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } ;
      HEADERS { "Date", "1", "2", "3", "4", "5", "1", "2", "3", "4", "5" } ;
      ARRAY aData LINES  NOBORDER FASTEDIT    //LINES

   WITH OBJECT oBrw

      oBrw:CreateFromCode()

      ShowLines( oBrw, lShowlines )

      SetupBrowseColor( oBrw )

      oBrw:Refresh()
      oBrw:SetFocus()

   END

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

RETURN nil

FUNCTION ShowLines( oBrw, lShowLines )

   LOCAL  nRecords := 2
   LOCAL i, oCol

   WITH OBJECT oBrw

      :nMarqueeStyle   := 2
      :lColDividerComplete := .F.

      IF lShowlines

         FOR i := 1 TO ( nRecords * 5 )  STEP 5
            oCol := oBrw:aCols[ i ]

            oCol:nColDividerStyle := LINESTYLE_BLACK

         NEXT
         lShowlines := .F.
      ELSE
         FOR i := 1 TO ( nRecords * 5 )  STEP 5
            oCol := oBrw:aCols[ i ]

            oCol:nColDividerStyle := LINESTYLE_LIGHTGRAY
         NEXT
         lShowlines := .T.
      ENDIF

   END

   oBrw:Refresh()
   oBrw:SetFocus()

RETURN lShowlines

FUNCTION SetupBrowseColor( oBrw )

   LOCAL I, oCol, nBkMode

   WITH OBJECT oBrw

      :nMarqueeStyle := 2
      // :nMarqueeStyle := MARQSTYLE_HIGHLWIN7
      // :nMarqueeStyle := MARQSTYLE_HIGHLROW
      // :nMarqueeStyle := MARQSTYLE_HIGHLCELL
      // :nMarqueeStyle := MARQSTYLE_NOMARQUEE

      // :lMultiSelect := .F.

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

      // NEW
      :lAllowSizings       := .F.
      :lAutoSaves          := .T.

      :lColDividerComplete := .F.
      :lRecordSelector     := .F. // poner o no, COL de la flechita de la izq

      FOR i := 2 TO LEN( :aCols )

         oCol := :aCols[ i ]
         oCol:nWidth   := 17

      NEXT

      //:nColDividerStyle := LINESTYLE_LIGHTGRAY
      //:nRowDividerStyle := LINESTYLE_LIGHTGRAY
      :nColDividerStyle := LINESTYLE_BLACK
      :nRowDividerStyle := LINESTYLE_BLACK

      // :nClrBorder  := CLR_GRAY
      // :lDrawBorder := .T.
      :nColorBox := CLR_HRED

      // :lColChangeNotify := .T.
      // :bChange          := { |o| if( o:nColSel<>1, ( o:nColSel:=1, o:RefreshCurrent() ), nil ) }

      // oCol:bClrSelFocus := {|| { CLR_BLACK, { { 1, RGB( 252, 235, 220 ), RGB( 255, 0,0 ) } }}}

      :SetStyle( 2018 )

   END

RETURN nil
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Show LINESTYLE of Xbrowse on line

Postby Silvio.Falconi » Fri Oct 21, 2022 1:56 pm

karinha wrote:Dear Silvio, y ahora, que falta? Confused... hahahahahaha,

Code: Select all  Expand view

// C:\FWH..\SAMPLES\LINESSIL.PRG

#include "fivewin.ch"

REQUEST DBFCDX

STATIC oBrw, lShowLines := .F.

FUNCTION Main()

   test1()

RETURN nil

INIT PROCEDURE PrgInit

   RddSetDefault( "DBFCDX" )

   SET DATE ITALIAN
   SET DELETED     ON
   SET CENTURY     ON
   SET EPOCH TO    YEAR( DATE() ) - 20

RETURN

STATIC FUNCTION Test1()

   LOCAL aData := { ;
      { "17.08.2019", 76, 83, 39, 10, 61, 90, 32, 55, 33, 67 }, ;
      { "20.08.2019", 44, 4, 25, 29, 66, 74, 36, 55, 73, 30 }, ;
      { "22.08.2019", 89, 54, 42, 12, 10, 35, 24, 46, 35, 47 }, ;
      { "24.08.2019", 30, 64, 38, 60, 55, 44, 49, 66, 11, 16 }, ;
      { "27.08.2019", 68, 11, 16, 72, 80, 15, 1, 62, 76, 83 }, ;
      { "29.08.2019", 31, 35, 47, 80, 2, 72, 12, 4, 39, 10 }, ;
      { "31.08.2019", 69, 11, 28, 51, 53, 36, 66, 77, 25, 29 }, ;
      { "03.09.2019", 73, 30, 15, 59, 62, 36, 6, 24, 4, 25 } }

   LOCAL aColors := { ;
      { 0, 0xa9a9a9 }, { 0, 0x0000ff }, { 0, 0x4848ff }, { 0, 0x6f6fff }, { 0, 0x32cd32 }, ;
      { 0, 0xceb966 }, { 0, 0xd48d54 }, { 0, 0x9b8531 }, { 0, 0xff00ff } }

   LOCAL oDlg, oBar, oFont, n
   LOCAL oNumber, oPlus, oCancel, oLines

   DEFINE FONT oFont NAME "VERDANA" SIZE 0, - 16

   DEFINE DIALOG oDlg SIZE 800, 400 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
      TITLE "Test separator lines"

   DEFINE BUTTONBAR oBar OF oDlg SIZE 80, 30 2015
   oBar:SetFont( oFont:Bold() )

   DEFINE BUTTON oLines PROMPT "Lines"     OF oBar    ;
      TOOLTIP "Show Lines"  ;
      ACTION  ShowLines( oBrw, lShowLines )

      //ACTION  ShowLines( oBrw, @lShowLines )

   @ 30, 05 XBROWSE oBrw SIZE - 20, - 20 PIXEL OF oDlg ;
      COLUMNS { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } ;
      HEADERS { "Date", "1", "2", "3", "4", "5", "1", "2", "3", "4", "5" } ;
      ARRAY aData LINES  NOBORDER FASTEDIT    //LINES

   WITH OBJECT oBrw

      oBrw:CreateFromCode()

      ShowLines( oBrw, lShowlines )

      SetupBrowseColor( oBrw )

      oBrw:Refresh()
      oBrw:SetFocus()

   END

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

RETURN nil

FUNCTION ShowLines( oBrw, lShowLines )

   LOCAL  nRecords := 2
   LOCAL i, oCol

   WITH OBJECT oBrw

      :nMarqueeStyle   := 2
      :lColDividerComplete := .F.

      IF lShowlines

         FOR i := 1 TO ( nRecords * 5 )  STEP 5
            oCol := oBrw:aCols[ i ]

            oCol:nColDividerStyle := LINESTYLE_BLACK

         NEXT
         lShowlines := .F.
      ELSE
         FOR i := 1 TO ( nRecords * 5 )  STEP 5
            oCol := oBrw:aCols[ i ]

            oCol:nColDividerStyle := LINESTYLE_LIGHTGRAY
         NEXT
         lShowlines := .T.
      ENDIF

   END

   oBrw:Refresh()
   oBrw:SetFocus()

RETURN lShowlines

FUNCTION SetupBrowseColor( oBrw )

   LOCAL I, oCol, nBkMode

   WITH OBJECT oBrw

      :nMarqueeStyle := 2
      // :nMarqueeStyle := MARQSTYLE_HIGHLWIN7
      // :nMarqueeStyle := MARQSTYLE_HIGHLROW
      // :nMarqueeStyle := MARQSTYLE_HIGHLCELL
      // :nMarqueeStyle := MARQSTYLE_NOMARQUEE

      // :lMultiSelect := .F.

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

      // NEW
      :lAllowSizings       := .F.
      :lAutoSaves          := .T.

      :lColDividerComplete := .F.
      :lRecordSelector     := .F. // poner o no, COL de la flechita de la izq

      FOR i := 2 TO LEN( :aCols )

         oCol := :aCols[ i ]
         oCol:nWidth   := 17

      NEXT

      //:nColDividerStyle := LINESTYLE_LIGHTGRAY
      //:nRowDividerStyle := LINESTYLE_LIGHTGRAY
      :nColDividerStyle := LINESTYLE_BLACK
      :nRowDividerStyle := LINESTYLE_BLACK

      // :nClrBorder  := CLR_GRAY
      // :lDrawBorder := .T.
      :nColorBox := CLR_HRED

      // :lColChangeNotify := .T.
      // :bChange          := { |o| if( o:nColSel<>1, ( o:nColSel:=1, o:RefreshCurrent() ), nil ) }

      // oCol:bClrSelFocus := {|| { CLR_BLACK, { { 1, RGB( 252, 235, 220 ), RGB( 255, 0,0 ) } }}}

      :SetStyle( 2018 )

   END

RETURN nil
 


Regards, saludos.



NOT RUN
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
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Show LINESTYLE of Xbrowse on line

Postby karinha » Fri Oct 21, 2022 2:15 pm

Entonces, solo el maestro Nages te ayudará. Mi conocimiento de xBrowse es limitado.

So, only master Nages to help you. My knowledge of xBrowse is limited.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Show LINESTYLE of Xbrowse on line

Postby Silvio.Falconi » Wed Nov 02, 2022 9:34 pm

Nages, Please How I can resolve it ?
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
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Show LINESTYLE of Xbrowse on line

Postby nageswaragunupudi » Thu Nov 03, 2022 3:37 am

At present, there is no way to change the color of the vertical divider color after creating the browse.
We will consider providing this in future versions.
Even then we will provide facility to change color of the pen ( GRAY to BLACK or any other color) but not the thickness of the Vertical Line.

For now, I will give you a small function, Using this function, you can change the color of the line at your will.
Please use this function till we provide the feature in the new versions.

Code: Select all  Expand view

function ColPenColor( oCol, nColor )

   if oCol:hColPen != nil
      DeleteObject( oCol:hColPen )
   endif

   oCol:hColPen := CreatePen( PS_SOLID, 1, nColor )
   oCol:oBrw:Refresh()

return nil
 
Regards

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

Re: Show LINESTYLE of Xbrowse on line

Postby Silvio.Falconi » Thu Nov 03, 2022 9:18 am

nageswaragunupudi wrote:At present, there is no way to change the color of the vertical divider color after creating the browse.
We will consider providing this in future versions.
Even then we will provide facility to change color of the pen ( GRAY to BLACK or any other color) but not the thickness of the Vertical Line.

For now, I will give you a small function, Using this function, you can change the color of the line at your will.
Please use this function till we provide the feature in the new versions.

Code: Select all  Expand view

function ColPenColor( oCol, nColor )

   if oCol:hColPen != nil
      DeleteObject( oCol:hColPen )
   endif

   oCol:hColPen := CreatePen( PS_SOLID, 1, nColor )
   oCol:oBrw:Refresh()

return nil
 



thanks even if I didn't understand how to highlight the columns on my METHOD Marcar(nOpt ) CLASS TLOTTO
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
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Show LINESTYLE of Xbrowse on line

Postby Silvio.Falconi » Thu Nov 03, 2022 9:27 am

before set all
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:nRowDividerStyle := LINESTYLE_LIGHTGRAY
then
Code: Select all  Expand view


If lShowlines
       FOR i := 1 TO (nRecords*5)  STEP 5
             oCol := ::oLbx:aCols[ i ]
             ColPenColor( oCol, CLR_BLACK )
          NEXT
       else
          FOR i := 1 TO (nRecords*5)  STEP 5
             oCol := ::oLbx:aCols[ i ]
             ColPenColor( oCol, CLR_GRAY )
          NEXT
     Endif
 


Image



run ok


a sample test
Code: Select all  Expand view

#include "fivewin.ch"

REQUEST DBFCDX

STATIC oBrw, lShowLines := .F.

FUNCTION Main()

   test1()

RETURN nil

INIT PROCEDURE PrgInit

   RddSetDefault( "DBFCDX" )

   SET DATE ITALIAN
   SET DELETED     ON
   SET CENTURY     ON
   SET EPOCH TO    YEAR( DATE() ) - 20

RETURN




STATIC FUNCTION Test1()

   LOCAL aData := { ;
      { "17.08.2019", 76, 83, 39, 10, 61, 90, 32, 55, 33, 67 }, ;
      { "20.08.2019", 44, 4, 25, 29, 66, 74, 36, 55, 73, 30 }, ;
      { "22.08.2019", 89, 54, 42, 12, 10, 35, 24, 46, 35, 47 }, ;
      { "24.08.2019", 30, 64, 38, 60, 55, 44, 49, 66, 11, 16 }, ;
      { "27.08.2019", 68, 11, 16, 72, 80, 15, 1, 62, 76, 83 }, ;
      { "29.08.2019", 31, 35, 47, 80, 2, 72, 12, 4, 39, 10 }, ;
      { "31.08.2019", 69, 11, 28, 51, 53, 36, 66, 77, 25, 29 }, ;
      { "03.09.2019", 73, 30, 15, 59, 62, 36, 6, 24, 4, 25 } }

   LOCAL aColors := { ;
      { 0, 0xa9a9a9 }, { 0, 0x0000ff }, { 0, 0x4848ff }, { 0, 0x6f6fff }, { 0, 0x32cd32 }, ;
      { 0, 0xceb966 }, { 0, 0xd48d54 }, { 0, 0x9b8531 }, { 0, 0xff00ff } }

   LOCAL oDlg, oBar, oFont, n
   LOCAL oNumber, oPlus, oCancel, oLines
   local lShowLines:=.f.

   DEFINE FONT oFont NAME "VERDANA" SIZE 0, - 16

   DEFINE DIALOG oDlg SIZE 800, 400 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
      TITLE "Test separator lines"

   DEFINE BUTTONBAR oBar OF oDlg SIZE 80, 30 2015
   oBar:SetFont( oFont:Bold() )

   DEFINE BUTTON oLines PROMPT "Lines"     OF oBar    ;
      TOOLTIP "Show Lines"  ;
      ACTION  SetupBrowseColor( oBrw,2,@lShowLines )


   @ 30, 05 XBROWSE oBrw SIZE - 20, - 20 PIXEL OF oDlg ;
      COLUMNS { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } ;
      HEADERS { "Date", "1", "2", "3", "4", "5", "1", "2", "3", "4", "5" } ;
      ARRAY aData LINES  NOBORDER FASTEDIT    //LINES

   WITH OBJECT oBrw

      oBrw:CreateFromCode()
      SetupBrowseColor( oBrw,2,.f. )
      oBrw:Refresh()
      oBrw:SetFocus()

   END

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

RETURN nil


FUNCTION SetupBrowseColor( oBrw,nRecords,lShowlines )
   LOCAL I, oCol

   WITH OBJECT oBrw
       :nMarqueeStyle   := 3
      :lAllowRowSizing     := .F.
      :lAllowColSwapping   := .F.
      :lAllowColHiding     := .F.


      :lAllowSizings       := .F.
      :lAutoSaves          := .T.

      FOR i := 2 TO LEN( :aCols )
         oCol := :aCols[ i ]
         oCol:nWidth   := 17
      NEXT
      :nColDividerStyle := LINESTYLE_LIGHTGRAY
      :nRowDividerStyle := LINESTYLE_LIGHTGRAY
      :SetStyle( 2018 )


     IF lShowlines
         FOR i := 1 TO ( nRecords * 5 )  STEP 5
            oCol := oBrw:aCols[ i ]
            // NEW
             ColPenColor( oCol, CLR_BLACK )
         NEXT
      ELSE
         FOR i := 1 TO ( nRecords * 5 )  STEP 5
            oCol := oBrw:aCols[ i ]
            // NEW
            ColPenColor( oCol, CLR_HGRAY )
         NEXT

      ENDIF

   END
    lShowLines:=!lShowLines
RETURN lShowLines

//------------------------------------------------------//
//Nages
//http://forums.fivetechsupport.com/viewtopic.php?f=3&t=42314&sid=8eb86f74267dbc90ab43c4a11fe60be0#p254238
function ColPenColor( oCol, nColor )
   if oCol:hColPen != nil
      DeleteObject( oCol:hColPen )
   endif
   oCol:hColPen := CreatePen( PS_SOLID, 1, nColor )
   oCol:oBrw:Refresh()
return ni
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
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Show LINESTYLE of Xbrowse on line - RESOLVED !!!

Postby nageswaragunupudi » Thu Nov 03, 2022 2:34 pm

run ok

good to know.
Regards

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

Re: Show LINESTYLE of Xbrowse on line - RESOLVED !!!

Postby Silvio.Falconi » Fri Nov 04, 2022 2:18 pm

nageswaragunupudi wrote:
run ok

good to know.


Nages,
there is a problem when I use vertical scrollbar, see this ( I not Know if a question of memory or of xbrowse)


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
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests