FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Proposal to change TXBrowse Class to show sharp alignments
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
Proposal to change TXBrowse Class to show sharp alignments
Posted: Thu Jan 15, 2015 06:12 AM
Dear Antonio,

I Propose the following changes to TxBrowse to
show the Boxes and Lines sharper touching to
their borders:
Code (fw): Select all Collapse
Line 580:
*METHOD BrwWidth()     INLINE GetClientRect( ::hWnd )[ 4 ]
 METHOD BrwWidth()     INLINE GetClientRect( ::hWnd )[ 4 ] + 2       // +2 IS ADDED BY RAMESH BABU P TO TOUCH THE BROWSER COLUMN TO THE RIGHT BORDER

Line 1452:
*DrawVert( hDC, nCol - 3, nHeight, nTemp,          hWhitePen )       // DELETED BY RAMESH BABU P - TO REMOVE THE WHITE COLUMN OF ROW SELECTOR
 DrawVert( hDC, nCol - 2, nHeight, nTemp,          hGrayPen )

Line 1455:
*DrawVert( hDC, 1,        0,       nBrwHeight + 3, hWhitePen )       // DELETED BY RAMESH BABU P - TO REMOVE THE WHITE COLUMN OF ROW SELECTOR 

Lines 1637 and 1638:
*DrawHorz( hDC, nRow,     2, ::nRecSelWidth - 4, hGrayPen  )         // THIS LINE IS DELETED BY RAMESH BABU P TO REDUCE THE GAP BETWEEN RECORD SELECTOR ROW AND FIRST COLUMN ROW
*DrawHorz( hDC, nRow + 1, 2, ::nRecSelWidth - 4, hWhitePen )         // THIS LINE IS DELETED BY RAMESH BABU P TO REDUCE THE GAP BETWEEN RECORD SELECTOR ROW AND FIRST COLUMN ROW
DrawHorz( hDC, nRow,    1, ::nRecSelWidth - 0, hGrayPen  )           // THIS LINE IS ADDED BY RAMESH BABU P - REDUCED 4 THE GAP BETWEEN RECORD SELECTOR ROW AND FIRST COLUMN ROW

Line 1696:    
*DrawHorz( hDC, nRow, 1, nBrwWidth, hHeaderPen ) //hColPen )         // DELETED BY RAMESH BABU P   - PAINTING HEADER BOTTOM ROW IN BLUE COLOR
DrawHorz( hDC, nRow, 1, nBrwWidth, hGrayPen )   //hColPen )          // CORRECTED BY RAMESH BABU P - NOW HEADER BOTTOM LINE PROPERLY PAINTED WITH GRAY COLOR

Line 1701:
*nHeight := ::nHeaderHeight - 3 // Caution: Do not change -3 in a haste. This adjusts 3 pixels added in Adjust method
*nHeight := ::nHeaderHeight // Caution: Do not change -3 in a haste. This adjusts 3 pixels added in Adjust method
nHeight := ::nHeaderHeight - 3                                       // RESTORED Line 1701 BACK BY RAMESH BABU P   - TO REDUCE HEADER HEIGHT IN COMPARISION WITH ::lFlatStyle HEADER HEIGHT

Line 1714:
*DrawVert( hDC, nCol - 2, nRow + 1, nRow + nHeight - 2, hHeaderPen ) // DELETED BY RAMESH BABU P   - PAINTING HEADER COLUMN SEPARATERORS IN BLUE
DrawVert( hDC, nCol - 2, nRow, nRow + nHeight, hGrayPen )            // CORRECTED BY RAMESH BABU P - NOW PROPERLY PAINTED WITH GRAY COLOR COLUMN SEPARATORS EVEN TOUCHING THE TOP AND BOTTOM LINES OF HEADER

Lines 1716 and 1717:
*DrawVert( hDC, nCol - 2, nRow + 1, nRow + nHeight - 2, hGrayPen  )  // DELETED BY RAMESH BABU P   - PAINTING 2 PIXEL GAP BETWEEN HEADER COLUMN SEPARATERORS WITH TOP AND BOTTOM LINES
*DrawVert( hDC, nCol - 1, nRow + 1, nRow + nHeight - 2, hWhitePen )  // DELETED BY RAMESH BABU P   - PAINTING 2 PIXEL GAP BETWEEN HEADER COLUMN SEPARATERORS WITH TOP AND BOTTOM LINES
DrawVert( hDC, nCol - 2, nRow-1, nRow + nHeight, hGrayPen  )         // DELETED BY RAMESH BABU P   - 2 PIXEL GAP BETWEEN TOP/BOTTOM LINES OF HEADER COLUMN SEPARATERORS IS REMOVED
DrawVert( hDC, nCol - 1, nRow-1, nRow + nHeight, hWhitePen )         // DELETED BY RAMESH BABU P   - 2 PIXEL GAP BETWEEN TOP/BOTTOM LINES OF HEADER COLUMN SEPARATERORS IS REMOVED

Lines 1745 and 1746
*DrawVert( hDC, nCol - 2, nRow + 1, nRow + nHeight - 2, hGrayPen  )  // DELETED BY RAMESH BABU P
*DrawVert( hDC, nCol - 1, nRow + 1, nRow + nHeight - 2, hWhitePen )  // DELETED BY RAMESH BABU P
DrawVert( hDC, nCol - 2, nRow-1, nRow + nHeight, hGrayPen  )         // CHANGED BY RAMESH BABU P TO INCREASED 2 PIXELS TO TOUCH THE RIGHT SIDE BORDER OF THE CONTROL
DrawVert( hDC, nCol - 1, nRow-1, nRow + nHeight, hWhitePen )         // CHANGED BY RAMESH BABU P TO INCREASED 2 PIXELS TO TOUCH THE RIGHT SIDE BORDER OF THE CONTROL

Line 1748:
*DrawHorz( hDC, nRow + nHeight - 1, 0, nBrwWidth, hHeaderPen  )
DrawHorz( hDC, nRow + nHeight - 1, 0, nBrwWidth, hGrayPen  )         // CORRECTED BY RAMESH BABU P - NOW HEADER BOTTOM LINE PROPERLY PAINTED WITH GRAY COLOR

Line 1782:
*DrawVert( hDC, nCol - 2, nRow + 1, nRow + nHeight - 2, hPen )       // DELETED BY RAMESH BABU P   - PAINTING HEADER COLUMN SEPARATERORS IN BLUE
DrawVert( hDC, nCol - 2, nRow + 1, nRow + nHeight - 2, hGrayPen )    // CORRECTED BY RAMESH BABU P - NOW PROPERLY PAINTED WITH GRAY COLOR COLUMN SEPARATORS

Lines 1784 and 1785:
*DrawVert( hDC, nCol - 2, nRow + 1, nRow + nHeight - 2, hGrayPen )   // DELETED BY RAMESH BABU P   - PAINTING HEADER COLUMN SEPARATERORS IN BLUE
*DrawVert( hDC, nCol - 1, nRow + 1, nRow + nHeight - 2, hWhitePen )  // DELETED BY RAMESH BABU P   - PAINTING HEADER COLUMN SEPARATERORS IN BLUE
DrawVert( hDC, nCol - 2, nRow-1, nRow + nHeight, hGrayPen )          // CORRECTED BY RAMESH BABU P - NOW PROPERLY PAINTED WITH GRAY COLOR COLUMN SEPARATORS
DrawVert( hDC, nCol - 1, nRow-1, nRow + nHeight, hWhitePen )         // CORRECTED BY RAMESH BABU P - NOW PROPERLY PAINTED WITH GRAY COLOR COLUMN SEPARATORS

Line 1792:
*DrawVert( hDC, nCol - 2, nRow + 1, nRow + nHeight - 2, hPen )       // DELETED BY RAMESH BABU P   - PAINTING FOOTER LAST COLUMN SEPARATERORS IN BLUE
DrawVert( hDC, nCol - 2, nRow + 1, nRow + nHeight - 2, hGrayPen )    // CORRECTED BY RAMESH BABU P - NOW PROPERLY PAINTED WITH GRAY COLOR COLUMN SEPARATORS AND STRETCHED TO TOUCH UP/DOWN LINES

Lines 1794 and 1795
*DrawVert( hDC, nCol - 2, nRow + 1, nRow + nHeight - 2, hGrayPen )   // DELETED BY RAMESH BABU P   - PAINTING FOOTER LAST COLUMN SEPARATERORS
*DrawVert( hDC, nCol - 1, nRow + 1, nRow + nHeight - 2, hWhitePen )  // DELETED BY RAMESH BABU P   - PAINTING FOOTER LAST COLUMN SEPARATERORS
DrawVert( hDC, nCol - 2, nRow-1, nRow + nHeight, hGrayPen )          // CORRECTED BY RAMESH BABU P - NOW PROPERLY PAINTED WITH GRAY COLOR COLUMN SEPARATORS
DrawVert( hDC, nCol - 1, nRow-1, nRow + nHeight, hWhitePen )         // CORRECTED BY RAMESH BABU P - NOW PROPERLY PAINTED WITH GRAY COLOR COLUMN SEPARATORS


The sample Application to test these changes are available here:

http:\\aksharasoft.com\fwh\testxbrw.zip

Regards,

-Ramesh Babu P
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Proposal to change TBrowse Class to show sharp alignments
Posted: Thu Jan 15, 2015 06:52 AM

Thanks for the suggestions. We shall study the changes proposed. If you can provide screenshots of the browse before and after the changes, other users also can offer their opinions.

Regards



G. N. Rao.

Hyderabad, India
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
Re: Proposal to change TBrowse Class to show sharp alignments
Posted: Fri Jan 16, 2015 01:29 AM
Dear Mr.Rao,

These are the images comparing before and afater changes.


images upload


image upload

Regards,

-Ramesh Babu P
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Proposal to change TBrowse Class to show sharp alignments
Posted: Fri Jan 16, 2015 01:36 AM

Thanks Mr Babu

Regards



G. N. Rao.

Hyderabad, India
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: Proposal to change TBrowse Class to show sharp alignments
Posted: Sun Jan 18, 2015 05:23 PM

These changes work for me. excellent job Mr Babu. Thank You.

regards

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Proposal to change TBrowse Class to show sharp alignments
Posted: Sun Jan 18, 2015 05:31 PM

Thanks for your feedback.

We intended to include these changes in 15.01 but could not complete all our tests, as we were to too preoccupied with testing other new/enhanced features for this release. We shall incorporate these suggestions in the next release.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Proposal to change TBrowse Class to show sharp alignments
Posted: Sun Jan 18, 2015 05:57 PM

Good work Mr. Babu.

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Re: Proposal to change TBrowse Class to show sharp alignments
Posted: Sun Jan 18, 2015 11:50 PM

Ramesh, can you post the code of samples,
nice colors combination. :-)

salu2
carlos vargas

Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
Re: Proposal to change TBrowse Class to show sharp alignments
Posted: Mon Jan 19, 2015 04:26 AM
Thank you all for your interest in my work.

Mr.Carlos,

This is the code I used to paint xBrowse

- Ramesh Babu P

Code (fw): Select all Collapse
...
...

WITH OBJECT oBrw
        oBrw:l2007        := .T.
        oBrw:lFlatStyle   := .F.
        ColorScheme(oBrw)
END

...
...

FUNCTION ColorScheme(oBrw)

LOCAL aHeadGrad := { {  1, RGB(238,248,238), RGB(170,210,110) } }
LOCAL aFootGrad := { {  1, RGB(255,238,213), RGB(244, 147, 0) } }
LOCAL aColorStd := { {  1, RGB(255,255,255), RGB(252,253,213) } }
LOCAL aColorSel := { {  1, RGB(255,238,213), RGB(252,253,117) } }
LOCAL aRowGrad  := { {  1, RGB(255,255,255), RGB(174,221, 15) } }
LOCAL aSelGrad  := { {  1, RGB(255,238,213), RGB(244,147,  0) } }
LOCAL aColorFlt := { {  1, RGB(255,255,255), RGB(195,195,195) } }

WITH OBJECT oBrw

     DO CASE

        CASE :l2007
             :lFlatStyle             := .F.
             :nRowDividerStyle  := LINESTYLE_LIGHTGRAY
             :nColDividerStyle   := LINESTYLE_LIGHTGRAY
             :nRecSelColor        := nRGB(238,248,238)
             :bClrSelFocus        := { || { CLR_BLUE, aSelGrad  } }  // Color of all Columns of Selected Row
             :bClrRowFocus      := { || { CLR_BLUE, aRowGrad  } }  // Un-Selected Columns of Selected Row Color
             :bClrStd               := { || { CLR_BLUE, aColorStd } }  // All Rows of Browser
             :bClrSel               := { || { CLR_BLUE, aColorSel } }  // Selected Row of Browser
             :bClrHeader         := { || { 1, nRGB(238,248,238),nRGB(170,210,110) } }
             :bClrFooter         := { || { 1, nRGB(238,248,238),nRGB(170,210,110) } }
             :bClrGrad            := { | lInvert | If( lInvert, aRowGrad, { { 1, nRGB(238,248,238),nRGB(170,210,110) } } ) }

        CASE :lFlatStyle
             :bClrHeader      := {||{CLR_BLACK, RGB(237,237,237)}}
             :bClrFooter       := :bClrHeader
             :bClrSelFocus    := {|| { CLR_WHITE, GetSysColor( COLOR_HIGHLIGHT )} }
             :bClrStd           := {|| { CLR_BLACK, CLR_WHITE}}
             :bClrSel           := {|| { GetSysColor( COLOR_INACTIVECAPTIONTEXT ), GetSysColor( COLOR_INACTIVECAPTION )} }
             :bClrGrad         := {|| { CLR_BLACK, {{1, CLR_WHITE, GetSysColor( COLOR_BTNFACE ) } } } }  // All Rows of Browser

     ENDCASE
END

RETURN nil

Continue the discussion