Page 1 of 1

xbrowse Border

Posted: Fri Nov 10, 2023 2:33 pm
by Silvio.Falconi
Image

how can I have the black border at the right side of the xbrowse after the scrollbar ?

I made

Code: Select all | Expand

 @ 40, 10 XBROWSE oBrw OF oDlg SIZE 300, -20 PIXEL ;
      AUTOCOLS DATASOURCE oDbf NOBORDER

                   WITH OBJECT oBrw
                             :lDrawBorder := .t.
                             :nClrBorder := CLR_BLACK
                     END
but the border is drawed only on left and up and down of the xbrowse

If I make
oBrw:lVScroll := .f.
oBrw:lhScroll := .f.

the border is painted good but I need to use Vscroll

Image


I think we need to tell the xbrowse class that when there is vertical scrolling the border must be drawn after the scroll

any solution ?

Re: xbrowse Border

Posted: Mon Nov 13, 2023 8:17 am
by Silvio.Falconi
For Antonio & NagesWarao Lines 2674/2675 of Xbrowse class

I propose this solution for displaying the border in the presence of vertical scrolling

if ::lDrawBorder
// ::Box( 0, 0, ::nHeight - 1, ::nWidth - 1, IfNil( ::nClrBorder, ::hColPen ) )
::Box( 0, 0, ::nHeight - 1, ::BrwWidth(), IfNil( ::nClrBorder, ::hColPen ) )
endif


Image

the same must be made in the presence of Horizontal scrolling but I not found the part where draw the box when there ::lHscroll is true

better can be

oBrw:lVScroll := .t.
oBrw:lhScroll := .t.

Code: Select all | Expand

 

 if ::lDrawBorder
     If ::lVScroll
         ::Box( 0, 0, ::nHeight - 1, ::BrwWidth(), IfNil( ::nClrBorder, ::hColPen ) )
      Endif
     If ::lHScroll
         ::Box( 0, 0, ::BrwHeight(), ::nWidth - 1, IfNil( ::nClrBorder, ::hColPen ) )
      endif
     If ::lVScroll  .and. ::lHScroll
         ::Box( 0, 0, ::BrwHeight(), ::BrwWidth(), IfNil( ::nClrBorder, ::hColPen ) )
     endif
  endif

 
Image

it run also with oBrw:lfooter := .t.

My Advice
the best modification is to draw the border after the horizontal and vertical scroll and not before as I have solved, certainly you would know how to do it
i.e. the border should be drawn around the whole control as it was a long time ago (xbrowse Ortiz de Zuniga)