If there is a DCBROWSE … FIT with multiple columns, clicking in the most left or right field causes the whole browse to shift slightly left or right.
I noticed this for quite some time, but I accepted it as a “feature”.
The same issue arises if you have a horizontal scrollbar, you can shift the scrollbar, even if there is only 2 or 3 small columns.
You can observe this behaviour in xdemo, “Samples 1\ArrayBrow”.
Until one of my customers that uses DCBROWSE extensively for data entry told me he was getting irritated by that restless data-entry window. Today I found time to investigate, and found that the fix is amazingly simple, and it took me only 15 minutes to locate. Should have done this before……
The scrollbar width in Win-7 seems to be 17 pixels, and not 15.
Current code in _dc_dcgetbx.prg (arround line 3100 in my code build 255)
Code: Select all
FOR j := 1 TO Len(aTokens)
IF aTokens[j]:isDerivedFrom('XbpScrollBar') .AND. ;
aTokens[j]:type == XBPSCROLL_VERTICAL
nWidth += 15
ENDIF
NEXT
Code: Select all
FOR j := 1 TO Len(aTokens)
IF aTokens[j]:isDerivedFrom('XbpScrollBar') .AND. ;
aTokens[j]:type == XBPSCROLL_VERTICAL
//
// J. Duijf 02-07-2011
// More accurate width of vertical scroll-bar
// Prevent shifting columns when clicking left/right column
// nWidth += 15
//
nWidth += aTokens[j]:CurrentSize()[1]
ENDIF
NEXT
However: All DCBROWSE get 2 pixels wider then before.
Regards,
Jack Duijf