 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Sat Feb 08, 2025 4:26 am Post subject: %lv width |
|
|
Lately, I have been developing a financial data presentation and reporting program.
I have found the %lv table display very useful, using view = 1. (not sure how to use onter view values)
I know it is early days in my understanding of %lv, but I am finding the use of width and height a bit unfriendly as inputs.
I now include the pixel width in all column headings for a more predictable layout.
For width, I am adjusting �width� to be sum( column_pixel_width) + 50 (fudge), which is working ok.
I do think there should be a fit_width option available, as this width value is a bit cumbersome. Fudge is also an unknown !
For height, I use "height = min ( max_height, n_row*16+20 )", but an automatic option to fit the height could also help ?
Early days, but any other views ?
John
PS:
%lv appears to be a good table display option for variable length fonts.
With a "fit_width" option available, perhaps width and height could be interpreted as max_width and max_height, as the seamless transfer to horizontal and vertical scrolling works very well for larger data displays.
Could the actual width and height be returned ? although I am not yet experienced with changing table sizes (does this happen?) or editing data.
I also find the use of "%lv[grid_lines,full_row_select]&" works well when returning selected row(s) in array "SEL".
I hope to advance to edit cells at a later stage, which may change my suggestions ! |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8177 Location: Salford, UK
|
Posted: Sat Feb 08, 2025 8:22 am Post subject: |
|
|
John
I would be willing to do some more work on %lv, as time permits, but I would need some sample code to work on. If you could isolate one issue at a time with sample code then I will aim to take a look at it soon.
It is many years since %lv first appeared and the Microsoft control has had more features added to it in the mean time. |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Sun Feb 09, 2025 4:57 am Post subject: |
|
|
Paul,
I am unsure as to what are "Microsoft control features" (MCF) and what are Clearwin+ Options (C+O). I am wondering if MCF covers this already.
If the header format includes a column width for all columns, then the width could be the minimum of sum(column_widths) or "width" argument. Is there a MCF that enasbles this ?
For the C+O I select, the final column width is expanded to meet the "width" argument, which I would "option"ly want to stop.
There is also a minimum "width" value, below which a horizontal slider is included, which can be greater than sum(column_widths) ( a bit of a catch 22 )
There are also the other case when column widths are not explicitly defined in the header. I am not sure of the rules for estimating this, probably based on the column header pixel width. In this case there is still a width value = sum(column_widths).
Does Clearwin+ determine the column width values ?
I am unsure if this "sum_width" value is only available in the Microsoft control, or available to Clearwin+, but an option to fit to the min ( sum(column_widths), width_arg ) could altrady be in the MCF.
The case for height fit controls is possibly less important as there is only the height of a row and the height of the header. Do we know these pixel values ?
I must qualify my comments, as it is early in my use of %LV and I do not know of edit uses that could change the size of the LV control. Is this a possibility ?
Is it a possibility to use a MCF feature to add a C+O option to adjust the control width to = min ( sum(column_widths), width_arg )
At present I am echoing all the list rows to a text file, so I could read this text file to generate the %lv inputs, as a sample program.
( I am already doing this to export the tables to Excel for printing, especially where there are too many rows to display. I haven't asked questions about printing LV controls yet ! )
Thanks again for your advice on this,
John |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8177 Location: Salford, UK
|
Posted: Sun Feb 09, 2025 11:05 am Post subject: |
|
|
John
When I wrote of new Microsoft control features, I was thinking of features that might now be added to the ClearWin+ library in order to improve %lv in some way. I was not thinking of features that the user of %lv might access directly.
If you can provide me with a sample program that illustrates the problem then I will see what can be done.
As I recall, in the standard approach, the user provides the pixel width and height of the control but it is a long time since I have looked at this though I do confess that I was the original author of %lv and it does have some short falls. |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Sun Feb 09, 2025 11:34 am Post subject: |
|
|
Hi Paul,
Thanks for the offer to review %lv. I will look to develop a sample program that may demonstrate the problem.
I have also developed a utility routine to estimate the actual pixel width of each column header for the table width:
integer function get_lv_header_pixel_width ( header_row )
This reads each "|column header_pixels|" else uses
call get_text_size@ ( header_row(s:e), npix, depth )
I can use this to set the width (once I have understood the extra fudge pixels to stop the horizontal scroll)
Again it is early days in my use of %lv, which does offer a good presentation of tables of data. |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Wed Feb 12, 2025 1:51 pm Post subject: |
|
|
I have now expanded:
integer function get_lv_header_pixel_width ( lv_data, nrows )
to also read all the data rows and use get_text_size@ to determine the max pixel width required of the header row plus the data rows.
This is helpful to understand the width required for each column and the table, so this should keep me quiet for a while. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|