multi-column_20list_20boxes
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
multi-column_20list_20boxes [2018/03/31 13:19] – external edit 127.0.0.1 | multi-column_20list_20boxes [2024/01/05 00:21] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====Multi-column list boxes===== | =====Multi-column list boxes===== | ||
- | //by Richard Russell, October 2006//\\ \\ If you want to display a list of items in a multiple-column format the best way is probably to use a **list view** control: that provides facilities for column headers, column dividers, user-adjustable column widths, sorting-by-column etc. See [[/ | + | //by Richard Russell, October 2006//\\ \\ If you want to display a list of items in a multiple-column format the best way is probably to use a **list view** control: that provides facilities for column headers, column dividers, user-adjustable column widths, sorting-by-column etc. See [[/ |
+ | |||
+ | <code bb4w> | ||
INSTALL @lib$+" | INSTALL @lib$+" | ||
LBS_SORT = 2 | LBS_SORT = 2 | ||
Line 23: | Line 25: | ||
SYS " | SYS " | ||
SYS " | SYS " | ||
- | The structure member **tab.wid%** determines the width of the columns, in dialogue box units; here it is set to 50. The TAB character (CHR$9) is used to separate the contents of the different columns in the strings written to the list box. Note that the last parameter of **PROC_listbox** enables the use of tabs and disables sorting.\\ \\ To specify an explicit position for each tab stop the code must be modified as follows:\\ \\ | + | </ |
+ | |||
+ | The structure member **tab.wid%** determines the width of the columns, in dialogue box units; here it is set to 50. The TAB character (CHR$9) is used to separate the contents of the different columns in the strings written to the list box. Note that the last parameter of **PROC_listbox** enables the use of tabs and disables sorting.\\ \\ To specify an explicit position for each tab stop the code must be modified as follows: | ||
+ | |||
+ | <code bb4w> | ||
INSTALL @lib$+" | INSTALL @lib$+" | ||
LBS_SORT = 2 | LBS_SORT = 2 | ||
Line 46: | Line 52: | ||
SYS " | SYS " | ||
SYS " | SYS " | ||
+ | </ | ||
+ | |||
Here the variable **ntabs%** contains the number of tab stops wanted; in this case 2. The integer array **tabs.pos%()** contains the positions of the tab stops, in dialogue box units. Here the first column is the same width as before (50 units) but the second column is narrower (30 units).\\ \\ A similar technique can be used for a list box on the main output window rather than in a dialogue box. In that case you will need to use **SendMessage** rather than **SendDlgItemMessage** and the style value used in [[http:// | Here the variable **ntabs%** contains the number of tab stops wanted; in this case 2. The integer array **tabs.pos%()** contains the positions of the tab stops, in dialogue box units. Here the first column is the same width as before (50 units) but the second column is narrower (30 units).\\ \\ A similar technique can be used for a list box on the main output window rather than in a dialogue box. In that case you will need to use **SendMessage** rather than **SendDlgItemMessage** and the style value used in [[http:// |
multi-column_20list_20boxes.1522502369.txt.gz · Last modified: 2024/01/05 00:17 (external edit)