Mercurial > dwindows
comparison win/dw.c @ 355:3a71623fc219
Changes to implement justification on container columns.
author | mhessling@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 18 Apr 2003 09:28:27 +0000 |
parents | 84a24d739d12 |
children | 39983df2b93d |
comparison
equal
deleted
inserted
replaced
354:3a51ecc8383a | 355:3a71623fc219 |
---|---|
6016 int API dw_container_setup(HWND handle, unsigned long *flags, char **titles, int count, int separator) | 6016 int API dw_container_setup(HWND handle, unsigned long *flags, char **titles, int count, int separator) |
6017 { | 6017 { |
6018 ContainerInfo *cinfo = (ContainerInfo *)GetWindowLong(handle, GWL_USERDATA); | 6018 ContainerInfo *cinfo = (ContainerInfo *)GetWindowLong(handle, GWL_USERDATA); |
6019 int z, l = 0; | 6019 int z, l = 0; |
6020 unsigned long *tempflags = calloc(sizeof(unsigned long), count + 2); | 6020 unsigned long *tempflags = calloc(sizeof(unsigned long), count + 2); |
6021 LV_COLUMN lvc; | 6021 LVCOLUMN lvc; |
6022 | 6022 |
6023 if(separator == -1) | 6023 if(separator == -1) |
6024 { | 6024 { |
6025 tempflags[0] = DW_CFA_RESERVED; | 6025 tempflags[0] = DW_CFA_RESERVED; |
6026 l = 1; | 6026 l = 1; |
6034 | 6034 |
6035 for(z=0;z<count;z++) | 6035 for(z=0;z<count;z++) |
6036 { | 6036 { |
6037 if(titles[z]) | 6037 if(titles[z]) |
6038 { | 6038 { |
6039 lvc.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; | 6039 lvc.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM | LVCF_FMT; |
6040 lvc.pszText = titles[z]; | 6040 lvc.pszText = titles[z]; |
6041 lvc.cchTextMax = strlen(titles[z]); | 6041 lvc.cchTextMax = strlen(titles[z]); |
6042 lvc.fmt = flags[z]; | 6042 if(flags[z] & DW_CFA_RIGHT) |
6043 lvc.fmt = LVCFMT_RIGHT; | |
6044 else if(flags[z] & DW_CFA_CENTER) | |
6045 lvc.fmt = LVCFMT_CENTER; | |
6046 else | |
6047 lvc.fmt = LVCFMT_LEFT; | |
6043 lvc.cx = 75; | 6048 lvc.cx = 75; |
6044 lvc.iSubItem = count; | 6049 lvc.iSubItem = count; |
6045 SendMessage(handle, LVM_INSERTCOLUMN, (WPARAM)z + l, (LPARAM)&lvc); | 6050 SendMessage(handle, LVM_INSERTCOLUMN, (WPARAM)z + l, (LPARAM)&lvc); |
6046 } | 6051 } |
6047 } | 6052 } |