xBrowse: Vertical Merge

xBrowse: Vertical Merge

Postby hua » Wed Apr 22, 2020 9:14 am

Hi,
Trying to set up vertical merge on Col 1 and Col 2. But doesn't seem to work.
Am using Harbour+FWH1912 for this.

What seems to be wrong:
1. Despite merging, horizontol lines are still painted in col 1
2. Only one checkbox appeared in col 2. Col 2 should have 2 check boxes. One for item 1 the other for item 2

Any help is appreciated TIA

Code: Select all  Expand view

  redefine xbrowse ::oBrw id 101 of ::oDlg ;
     columns LN_CARGO, LN_SELECT, LN_REMA, LN_ACCN, LN_ACCNDESC, LN_AMOU                ;
     headers "No", "", "Remarks", "Code", "Account", "Amount (" + TRIM( zCurr ) + ") " ;
     lines ;
     array ::aFiledbf ;
     update

    ::oBrw:nStretchCol         := STRETCHCOL_WIDEST
    ::oBrw:bKeyDown            := { | nKey | ::FC_ONCHG( nKey )   }
    ::oBrw:bClrSel             := {|| {CLR_BLACK, CLR_HGRAY} }
    ::oBrw:bClrStd             := {|| {CLR_BLACK, bckClr(::oBrw)} }

    aeval(::oBrw:aCols,{|o| o:bLDClickData  := { || ::FC_ONCHG( VK_RETURN) }, o:nEditType := EDIT_GET})
    ::oBrw:aCols[2]:setCheck()
    ::oBrw:No:lMergeVert := .t.
    ::oBrw:aCols[2]:lMergeVert := .t.

 



Image
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse: Vertical Merge

Postby Silvio.Falconi » Wed Apr 22, 2020 10:40 am

if you not give us a test sample we cannot help you
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: 7053
Joined: Thu Oct 18, 2012 7:17 pm

Re: xBrowse: Vertical Merge

Postby karinha » Wed Apr 22, 2020 12:03 pm

Mui bién Silvio. Asi és.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7811
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: xBrowse: Vertical Merge

Postby hua » Thu Apr 23, 2020 3:31 am

Here's a reduced, self-contained sample.

1. recur.rc
Code: Select all  Expand view

recur DIALOG 15, 19, 440, 303
EXSTYLE WS_EX_DLGMODALFRAME
STYLE DS_ABSALIGN | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
CAPTION "Insert Recurring Items"
FONT 10, "System"
{
 CONTROL "&Ok", 102, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 165, 283, 50, 16
 CONTROL "", 101, "TXBrowse", WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, 5, 21, 431, 251
}
 


2. recur.prg
Code: Select all  Expand view

#include "fivewin.ch"
#include "xbrowse.ch"

#define PIC "@Z 999,999.99"
#define LN_NO     1
#define LN_SELECT 2

function main()
  local aFiledbf := { {1, .f., "PAY A", "CL601", "ACCRUALS - AUDIT FEE", transform(100, PIC)}, ;
                      {1, .f., "PAY B", "CL600", "ACCRUALS - OTHERS"   , transform(200, PIC)}, ;
                      {1, .f., "Payee: PAYEE", "", "", transform(0, PIC)}, ;
                      {2, .f., "PAY C", "PD004", "ACCUM DEPRN. - MOTOR VEHICLE", transform(500, PIC)}, ;
                      {2, .f., "PAY D", "E0079", "ADT ALARM", transform(300, PIC)}, ;
                      {2, .f., "Payee: ADT ALARM", "", "", transform(0, PIC)}, ;
                      {3, .f., "PAY E", "PD001", "ACCUM DEPRN.", transform(150, PIC)}, ;
                      {3, .f., "Payee: SMITH", "", "", transform(0, PIC)} ;
                    }
  local oDlg, oBrw

  define dialog oDlg resource "recur" //font ofont
  redefine xbrowse oBrw id 101 of oDlg ;
    columns LN_NO, LN_SELECT, 3, 4, 5, 6          ;
    headers "No", "", "Remarks", "Code", "Account", "Amount" ;
    cell lines noborder ;
    array aFiledbf ;
    update

    oBrw:nStretchCol := STRETCHCOL_WIDEST
    oBrw:bKeyDown    := { | nKey | FC_ONCHG( nKey, oBrw )   }
    oBrw:bClrSel     := {|| {CLR_BLACK, CLR_HGRAY} }
    oBrw:bClrStd     := {|| {CLR_BLACK, bckClr(oBrw)} }

    aeval(oBrw:aCols,{|o| o:bLDClickData  := { || FC_ONCHG( VK_RETURN, oBrw) }})
    oBrw:aCols[2]:setCheck()
    oBrw:No:lMergeVert := .t.
    oBrw:aCols[2]:lMergeVert := .t.

    redefine button id 102 of oDlg action oDlg:end()

    activate dialog oDlg centered
return nil
//----------------------------------------------------------------------
function bckClr(oXbrw)
  local aRow := oXbrw:aRow(), nRet := CLR_WHITE

  if aRow[LN_SELECT]
     nRet := nRGB(216, 76, 216)
  else
     if aRow[LN_NO] != nil
        nRet := if(mod(aRow[LN_NO],2) == 0, 12706303, 16772310)
     endif
  endif
return nRet
//----------------------------------------------------------------------
procedure fc_onchg(nKey, oBrw)
     local no, i

     DO CASE
        CASE nKey == VK_RETURN .or. nKey == VK_SPACE
             no := oBrw:aRow()[LN_NO]
             for i := 1 to len(oBrw:aArrayData)
                 if oBrw:aArrayData[i, LN_NO] == no
                    oBrw:aArrayData[i, LN_SELECT] := !oBrw:aArrayData[i, LN_SELECT]
                 endif
                 if oBrw:aArrayData[i, LN_NO] > no
                    exit
                 endif
             next
             oBrw:Refresh()
             oBrw:SetFocus()
     ENDCASE
return
 
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse: Vertical Merge

Postby hua » Mon Apr 27, 2020 1:35 am

Hi Rao,
Could you offer some insight? TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse: Vertical Merge

Postby nageswaragunupudi » Thu Apr 30, 2020 4:44 am

In the present implementation, we see the horizontal lines if the back color of bClrStd is not the same as oBrw:nClrPane (by default CLR_WHITE).
So, if you choose CLR_WHITE as the back color in bClrStd, you will not see these lines.

We improved this in the version FWH2004 to be released soon. With this improvement, your example will look fine.
Regards

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

Re: xBrowse: Vertical Merge

Postby nageswaragunupudi » Thu Apr 30, 2020 10:36 am

This is how your program will look like from FWH2004 onwards.

Image
Regards

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

Re: xBrowse: Vertical Merge

Postby hua » Sat May 02, 2020 4:57 am

Thank you for solving the line issue Rao. Great work!

Can you advice me on the 2nd column? It is also merged. I expected to see 3 check boxes. One for each No but only one is shown.

The checkbox will be toggled when user double click on any of the row to indicate which sets are selected by user

TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse: Vertical Merge

Postby nageswaragunupudi » Sat May 02, 2020 6:23 am

After the line
Code: Select all  Expand view
   oBrw:aCols[2]:lMergeVert := .t.
 


Add this line of code:
Code: Select all  Expand view
  oBrw:aCols[2]:bMergeValue := { |oCol| oCol:oBrw:aRow[ 1 ] }
 
Regards

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

Re: xBrowse: Vertical Merge

Postby hua » Wed May 06, 2020 7:16 am

Hi Rao,

nageswaragunupudi wrote:Add this line of code:
Code: Select all  Expand view
  oBrw:aCols[2]:bMergeValue := { |oCol| oCol:oBrw:aRow[ 1 ] }
 


The above works in my reduced self-contained sample but in my actual program it causes the checkbox to appear on each row of items.
Both were linked with FWH1912.

1. Any idea on what can I do to start finding why the different behaviour?
2. Can you share what need to be changed in xbrowse source to eliminate the white lines?

TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse: Vertical Merge

Postby nageswaragunupudi » Wed May 06, 2020 10:21 am

1) Please try
Code: Select all  Expand view
oBrw:aCols[2]:bMergeValue := { |oCol| oCol:oBrw:aCols[ 1 ]:Value }
 


2) Please keep back color in all bClrStd as CLR_WHITE and see.
Regards

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

Re: xBrowse: Vertical Merge

Postby hua » Wed May 06, 2020 12:30 pm

Thanks for the prompt reply Rao!

All your suggestions works. Thanks!
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse: Vertical Merge

Postby hua » Fri May 15, 2020 9:42 am

Hi Rao,
Can I have zebra effect by playing with fonts for each set of No.?

If it's possible can you share the snippet to do it?

TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse: Vertical Merge

Postby nageswaragunupudi » Fri May 15, 2020 9:58 am

Please try:
Code: Select all  Expand view
oBrw:oDataFonts := { || If( <cond>, oFont1, oFont2 ) }
Regards

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

Re: xBrowse: Vertical Merge

Postby hua » Mon May 18, 2020 6:10 am

nageswaragunupudi wrote:Please try:
Code: Select all  Expand view
oBrw:oDataFonts := { || If( <cond>, oFont1, oFont2 ) }


Thanks Rao! It works!
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 80 guests