dcbrowse FIT
dcbrowse FIT
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.
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.
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: dcbrowse FIT
That would be a very valuable function for me, too.
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: dcbrowse FIT
Your wish is my command parameter
Here it is.

Here it is.
- Attachments
-
- MaxFit.zip
- (152.94 KiB) Downloaded 800 times
The eXpress train is coming - and it has more cars.
Re: dcbrowse FIT
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.
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
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
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.
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} ...
Re: dcbrowse FIT
This must be due to your FREEZELEFT clause.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.
Frozen columns do not have a horizontal scrollbar.
The eXpress train is coming - and it has more cars.
Re: dcbrowse FIT
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.
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
My test program works as expected.
Can you give me a test program that doesn't work?
Can you give me a test program that doesn't work?
The eXpress train is coming - and it has more cars.
Re: dcbrowse FIT
Hi Roger,
It is working in a test program I just tried, it doesn't work in my application.
I will check my code again within a few days. I suppose I overlook it now.
It is working in a test program I just tried, it doesn't work in my application.

I will check my code again within a few days. I suppose I overlook it now.
Re: dcbrowse FIT
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.
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.
