XBROWSE WINDOWS SEVEN LIKE

XBROWSE WINDOWS SEVEN LIKE

Postby Silvio » Fri Mar 11, 2011 10:36 am

Nages,
Can I show
oBrw:nColDividerStyle :=LINESTYLE_BLACK

on Xbrowse like Windows Seven (oBrw:nMarqueeStyle = MARQSTYLE_HIGHLWIN7) ?

on old xbrowse I could make it and use also the subclass for windows seven

Image


with old version of xbrowse there are problems to save the state and click with mouse on tree

with the last xbrowse we have correct theseproblems but we cannot show nColDividerStyle :=LINESTYLE_BLACK correctly



I have this class :
Code: Select all  Expand view
// Using Windows 7 row selection colors in xbrowse

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

#define MARQSTYLE_HIGHLWIN7  7


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

CLASS TXbrWin7 FROM TXBrowse

   CLASSDATA lRegistered AS LOGICAL // This is compulsory for derived classes

   METHOD Adjust()
   METHOD FullPaint() INLINE ( ::lTransparent .or. ::lMergeVert .or. ::nMarqueeStyle == MARQSTYLE_HIGHLWIN7 )
   METHOD DrawLine( lSelected, nRowSel )

ENDCLASS

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

METHOD Adjust() CLASS TXBrWin7

   if ::nMarqueeStyle == MARQSTYLE_HIGHLWIN7
     // ::nRowDividerStyle   := LINESTYLE_NOLINES
     // ::nColDividerStyle   := LINESTYLE_NOLINES
    //  ::nColDividerStyle   := LINESTYLE_BLACK


      ::bClrSelFocus       := ;
      ::bClrSel            := { || { CLR_BLACK, ;
                                 { { 1, RGB( 220, 235, 252 ), ;
                                 RGB( 193, 219, 252 ) } } } }

   endif

return Super:Adjust()

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

METHOD DrawLine( lSelected, nRowSel ) CLASS TXBrWin7

   local hDC, nRow, nBrwWidth, nDataHeight

   Super:DrawLine( lSelected, nRowSel )

   DEFAULT lSelected := .f.

   if lSelected
      if ::nMarqueeStyle == MARQSTYLE_HIGHLWIN7

         hDC         := ::GetDC()
         nRow        := ( ( ::nRowSel - 1 ) * ::nRowHeight ) + ::HeaderHeight()
         nBrwWidth   := ::BrwWidth()
         nDataHeight := ::DataHeight()

         RoundBox( hDC, 2, nRow - 1, nBrwWidth - 1, nRow + nDataHeight,     2, 2,;
                   RGB( 235, 244, 253 ), 1 )
         RoundBox( hDC, 1, nRow - 2, nBrwWidth,     nRow + nDataHeight + 1, 2, 2,;
                   RGB( 125, 162, 206 ), 1 )
      endif
   endif

return Self

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




I made

oApp():oGrid := TXBrWin7():New( oApp():oDlg )
oApp():oGrid:nTop := 00
oApp():oGrid:nLeft := nSplit+2
oApp():oGrid:nBottom := ::nGridBottom
oApp():oGrid:nRight := ::nGridRight

Ut_BrwRowConfig7( oApp():oGrid )


---------------------------------------------------
FUNCTION Ut_BrwRowConfig7( oBrw )

oBrw:lRecordSelector := .t. // .t.
oBrw:lAllowRowSizing := .t.
oBrw:lColDividerComplete := .t. // .f.
oBrw:lAllowColSwapping := .t.
oBrw:lAllowColHiding := .t.
oBrw:lFastEdit := .f.

oBrw:nRowSel := 1
oBrw:nColSel := 1
oBrw:nColOffset := 1
oBrw:nFreeze := 0
oBrw:nCaptured := 0
oBrw:nLastEditCol := 0

oBrw:nRowDividerStyle := LINESTYLE_NOLINES
oBrw:nColDividerStyle :=LINESTYLE_BLACK // LINESTYLE_NOLINES
oBrw:nMarqueeStyle = MARQSTYLE_HIGHLWIN7 // for Windows 7 style

RETURN nil
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 31 guests