Some useful modifications to XBROWSE

Some useful modifications to XBROWSE

Postby byte-one » Tue Feb 16, 2016 1:53 pm

All changed lines are marked with BYTE-ONE

In CLASS TXBrwColumn

1. Remove PROTECTED to use this data
Code: Select all  Expand view
DATA nColDividerWidth //PROTECTED // not yet implemented. //BYTE-ONE

2. Following changes to make listboxes widther as the xBrowse-column and a empty(::aEditListTxt) not make a runtime-error and the height of the listbox follows the fontsize
Code: Select all  Expand view
DATA nLbxWidth INIT 0   //Width from Listbox //BYTE-ONE

Code: Select all  Expand view
METHOD ShowBtnList( nKey ) CLASS TXBrwColumn

   local aBound
   local xValue
   local hBrush
   local nAt, nRow, nCol, nWidth, nHeight, aColors, oFont
   local lWhen    := ( ::bEditWhen == nil .or. Eval( ::bEditWhen, Self ) )

   if ::aEditListTxt == nil .or. (valtype(::aEditListTxt)=="A" .and. len(::aEditListTxt)==0)    //BYTE-ONE
      MsgStop( "oCol:aEditListTxt not defined or oCol:aEditListTxt has len 0", "Fivewin: Class TXBrwColumn" )   //BYTE-ONE
      return .f.
   endif

   if ::bOnPostEdit == nil
      MsgStop( "oCol:bOnPostEdit not defined",;
               "Fivewin: Class TXBrwColumn" )
      return .f.
   endif

   ::oBrw:nColSel := ::nPos

   if ValType( ::aEditListTxt[ 1 ] ) == 'A'
      ::aEditListBound  := ArrTranspose( ::aEditListTxt )[ 1 ]
      ::aEditListTxt    := ArrTranspose( ::aEditListTxt )[ 2 ]
   endif

   aBound   := IfNil( ::aEditListBound, AClone( ::aEditListTxt ) )
   if ValType( xValue := ::Value ) == 'C'
      xValue   := Trim( xValue )
   endif
   if ( nAt := Ascan( aBound, xValue ) ) == 0
      if ValType( xValue ) == 'C'
         do while Len( xValue ) > 1 .and. nAt == 0
            xValue      := Left( xValue, Len( xValue ) - 1 )
            nAt         := AScan( aBound, xValue )
         enddo
      elseif ( nAt := AScan( aBound, { |u| xValue <= u } ) ) == 0
         nAt   := Len( aBound )
      endif
   endif
   xValue   := nil

   nRow     := ( ::oBrw:nRowSel * ::oBrw:nRowHeight ) + ::oBrw:HeaderHeight() - 1
//   nCol     := ::nDisplayCol - 2
   nWidth   := max(::nWidth + 3,::nLbxWidth) //BYTE-ONE
//   nCol     := if( ::nDisplayCol - 2 + nWidth > ::oBrw:BrwWidth() , ::nDisplayCol +  2 + ::oBrw:BrwWidth() - nWidth,::nDisplayCol - 2 )   //BYTE-ONE
   nCol     := if( ::nDisplayCol - 2 + nWidth > ::oBrw:BrwWidth() , ::oBrw:BrwWidth() - nWidth,::nDisplayCol - 2 )  //BYTE-ONE
//   nHeight  := Len( ::aEditListTxt ) * ( FontHeight( ::oBrw, ::oBrw:oFont ) ) + 2
   nHeight  := Len( ::aEditListTxt ) * ( FontHeight( ::oBrw, if(::oEditFont == NIL ,::oBrw:oFont,If( ValType( ::oEditFont ) == 'B', Eval( ::oEditFont ), ::oEditFont )) ) ) + 2 //BYTE-ONE

Image
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Some useful modifications to XBROWSE

Postby Antonio Linares » Tue Feb 16, 2016 8:44 pm

Günther,

Many thanks

We are going to review it asap
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42076
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Some useful modifications to XBROWSE

Postby byte-one » Sun Feb 21, 2016 9:41 am

Mr. Rao, have you also seen this wish and/or suggestions? Thanks!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Some useful modifications to XBROWSE

Postby nageswaragunupudi » Sun Feb 21, 2016 9:45 am

Yes and we are going to provide programmer configurable width for listboxes.

We may not be able to make nColDividerWidth available immediately as this requires a lot more work and changes.
Regards

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

Re: Some useful modifications to XBROWSE

Postby nageswaragunupudi » Mon Feb 22, 2016 5:20 am

Mr Günther

I am reviewing this issue. I think there is no need for the width of the listbox to be wider than the column width (except for variation due to fonts). I can be wrong. Can you please convince me that I am wrong?
Regards

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

Re: Some useful modifications to XBROWSE

Postby byte-one » Mon Feb 22, 2016 9:05 am

Mr. Rao, i use this to show full text (for clearness) in many cases. To save is in most cases only the bounded Text. Also can the full text show in the column with 2 or more lines!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Some useful modifications to XBROWSE

Postby nageswaragunupudi » Fri Feb 26, 2016 1:16 pm

Mr Günther

I modified to set width of list-box to fit width of the widest item in the prompts or the column width, whichever is higher.

Present code from lines 12021 of xbrowse.prg ( 16.01 ) is
Code: Select all  Expand view
  nRow     := ( ::oBrw:nRowSel * ::oBrw:nRowHeight ) + ::oBrw:HeaderHeight() - 1
   nCol     := ::nDisplayCol - 2
   nWidth   := ::nWidth + 3
   nHeight  := Len( ::aEditListTxt ) * If( lTouch, DeviceTouchSpace(), FontHeight( ::oBrw, ::oBrw:oFont ) ) + 2
 

This is the revised code
Code: Select all  Expand view

   oFont    := ::EditFont
   nRow     := ( ::oBrw:nRowSel * ::oBrw:nRowHeight ) + ::oBrw:HeaderHeight() - 1
   nCol     := ::nDisplayCol - 2
   nWidth   := ::nWidth + 3
   nWidth   := Max( nWidth, CalcTextWH( ::oBrw, FW_ArrayAsList( ::aEditListTxt, CRLF ), oFont )[ 1 ] + COL_EXTRAWIDTH + ;
                            IfNil( ::nBtnWidth, 10 ) + 5 )
   nCol     := Max( 1, Min( nCol, ::oBrw:BrwWidth() - nWidth -2 ) )
   nHeight  := Len( ::aEditListTxt ) * If( lTouch, DeviceTouchSpace(), FontHeight( ::oBrw, oFont ) ) + 2
 

Any comments please?
Regards

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

Re: Some useful modifications to XBROWSE

Postby byte-one » Fri Feb 26, 2016 5:36 pm

Mr. Rao
all is in my opinion. Thanks!

1. One point is additional to respect: If the right end of the listbox reaches over the end from browse, the list should be moved to left for this overhang!

Oh, i see this is respected!! :D
2. A ::aEditListTxt-array with len == 0 make a runtime-error!

Tomorrow i will test and report.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Some useful modifications to XBROWSE

Postby TimStone » Fri Feb 26, 2016 10:43 pm

I hope the areas of concern previously expressed are addressed with xBrowse. If not, these changes may simply increase the problems. I have some very very angry customers because of the column spacing problems in the current builds and had to revert back, but that required additional re-coding because the new ones required me to make changes that then had to be commented out.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Some useful modifications to XBROWSE

Postby nageswaragunupudi » Sat Feb 27, 2016 1:19 am

2. A ::aEditListTxt-array with len == 0 make a runtime-error!

This is taken care of by testing for
Code: Select all  Expand view
  if Empty( ::aEditListTxt )
 

instead of
Code: Select all  Expand view
if ::aEditListTxt == nil

This was also implemented already.

column spacing problems

We are carefully looking into all these issues also.
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 89 guests