Page 1 of 1

dcbrowse FIT

Posted: Wed Sep 26, 2012 2:17 am
by skiman
Hi Roger,

In my application a lot of browses are datadriven. I can't use the FIT clause, because I don't know how much columns the user will define.

Would there be a way to have a DCBROWSE .... FIT MAX 120. So if the calculated width is more than the MAX value, the total width of the browse remains that MAX value.

Re: dcbrowse FIT

Posted: Wed Sep 26, 2012 3:12 am
by Wolfgang Ciriack
That would be a very valuable function for me, too.

Re: dcbrowse FIT

Posted: Wed Sep 26, 2012 7:44 am
by rdonnay
Your wish is my command parameter :angelic-blueglow:

Here it is.

Re: dcbrowse FIT

Posted: Wed Sep 26, 2012 12:05 pm
by skiman
Roger,

Yes, works as expected. Thanks for this quick addition.

I implemented it in my own browse class, I had to change the following in _dcgetbx.prg:
IF !Empty(oParent:fitMax) .AND. nWidth > oParent:fitMax*::colPixels
nWidth := oParent:fitMax*::colPixels
ENDIF

Without the colpixels the maximum width was in pixels. I don't know if this is needed in the standard version.

Re: dcbrowse FIT

Posted: Wed Nov 28, 2012 4:16 am
by skiman
Hi Roger,

I released a new version of my application with the dcbrowse FIT MAX implemented, and it seems as there is a problem.

The horizontal scrollbar isn't working anymore with this clause. I have a DCBROWSE with the following

Code: Select all

 @ 0,0 DCBROWSE oBrowse ALIAS 'bon1' SIZE 115,21 FIT MAX 115 ;
                      USEVISUALSTYLE ;
                      CURSORMODE XBPBRW_CURSOR_ROW PARENT oStatic FREEZELEFT { 1,2} ...
Without the FIT MAX 115 the horizontal scrollbar is working. With the FIT MAX the max width is 115, but I can't scroll to the right columns.

Re: dcbrowse FIT

Posted: Wed Nov 28, 2012 8:19 am
by rdonnay
Without the FIT MAX 115 the horizontal scrollbar is working. With the FIT MAX the max width is 115, but I can't scroll to the right columns.
This must be due to your FREEZELEFT clause.
Frozen columns do not have a horizontal scrollbar.

Re: dcbrowse FIT

Posted: Thu Nov 29, 2012 1:33 am
by skiman
Hi Roger,

The frozen columns don't have a horizontal scrollbar, they never had. The columns at the right of the frozen columns have the scrollbar. This is as expected.

Without the FIT MAX this scrollbar is working, even with FREEZE LEFT. When using the FIT MAX, these scrollbar isn't working anymore.

Re: dcbrowse FIT

Posted: Thu Nov 29, 2012 6:41 am
by rdonnay
My test program works as expected.

Can you give me a test program that doesn't work?

Re: dcbrowse FIT

Posted: Mon Dec 03, 2012 9:41 am
by skiman
Hi Roger,

It is working in a test program I just tried, it doesn't work in my application. :think:

I will check my code again within a few days. I suppose I overlook it now.

Re: dcbrowse FIT

Posted: Thu Dec 27, 2012 7:35 am
by skiman
Hi,

The max is working correctly. I finally found the cause of my problem.

The parent of my browse is oStatic. And yes, I forgot to adjust the size of this static. :oops: