On 11.10.2010 17:51, Анна wrote:
Дело дошло до тыканья в CListCtrl мышой. Что б
> выбрать столбик сортировки.
> И тут вроде работает. Стрелочка моя рисуется. Только стираться не желает.
> void CDial::OnColumnclickList1(NMHDR* pNMHDR, LRESULT* pResult)
> {
> HDITEM hdi;
> NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
>
> m_tabl.GetHeaderCtrl()->GetItem(0, &hdi); // запрос у CListCtrl чего там в
> нулевой колонке с заголовком
> ...
>
> и hdi.mask говорит что никакой стрелочки там нет. Соответственно понять рисовать
> или стирать признак сортировки не возможно.
> Понять где напортачила не получается. Хотя вру. Есть подозрение на динамическое
> создание диалога.
Как бы ListCtrl знаем. Но не понятно, что ж у тебя не получается.
Где ж ты предполагаешь эту стрелку увидать.
LVN_COLUMNCLICK Notification
--------------------------------------------------------------------------------
Notifies a list-view control's parent window that a column was clicked. This
notification message is sent in the form of a WM_NOTIFY message.
Syntax
LVN_COLUMNCLICK
pnmv = (LPNMLISTVIEW) lParam;
Parameters
pnmv
Pointer to an NMLISTVIEW structure.
The iItem member is -1, and the iSubItem
member identifies the column. All other members are zero.
mask вообще-то задаёт только, какие поля структуры HDITEM заданы, а какие — нет.
Перед вызовом GetItem ставишь в mask (среди прочих) флаг HDI_FORMAT,
и получаешь в fmt значения :
fmt
Flags that specify the item's format.
...
HDF_SORTDOWN
Version 6.00. Draws a down-arrow on this item. This is typically used to
indicate that information in the current window is sorted on this column in
descending order. This flag cannot be combined with HDF_IMAGE or HDF_BITMAP.
HDF_SORTUP
Version 6.00. Draws an up-arrow on this item. This is typically used to indicate
that information in the current window is sorted on this column in ascending
order. This flag cannot be combined with HDF_IMAGE or HDF_BITMAP.
Posted via RSDN NNTP Server 2.1 beta