Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Компоненты";
Текущий архив: 2006.02.12;
Скачать: [xml.tar.bz2];

Вниз

Что сделать с некорректной отрисовкой TCustomListBox?   Найти похожие ветки 

 
Aleksandr.   (2005-08-25 17:14) [0]

Точнее, я накатал объекта-потомка от этого класса, имеющего, в первую очередь, Style=lbOwnerDrawFixed и специфику отрисовки объектов своих итемов. При свойстве IntegralHeight=false отрисовка с таким стилем имеет неприятную особенность при некратности высот элементов высоте поля рисования оставлять пустую белую или черную полосу внизу за последним элементом (такое наблюдается и в Борландовском Object Inspector, кстати), а при IntegralHeight=true - не менее неприятную особенность вообще не заполнять ClientRect своего Parent, пока его высота не станет кратной высоте элемента.
Какие есть варианты управления отрисовкой объекта, чтобы избежать всего этого?
Я пытался отработать со стилем lbOwnerDrawVariable, но там проявилась другая ерунда - MeasureItem делает почему-то только один вызов для первого добавляемого элемента, после чего перед отрисовкой больше не вызывается.


 
Юрий Зотов ©   (2005-08-26 00:45) [1]

Из описания WM_MEASUREITEM в MSDN.

When the owner window receives the WM_MEASUREITEM message, the owner fills in the MEASUREITEMSTRUCT structure pointed to by the lpMeasureItem parameter of the message and returns; this informs the system of the dimensions of the control. If a list box or combo box is created with the LBS_OWNERDRAWVARIABLE or CBS_OWNERDRAWVARIABLE style, this message is sent to the owner for each item in the control; otherwise, this message is sent once.

The system sends the WM_MEASUREITEM message to the owner window of combo boxes and list boxes created with the OWNERDRAWFIXED style before sending the WM_INITDIALOG message. As a result, when the owner receives this message, the system has not yet determined the height and width of the font used in the control; function calls and calculations requiring these values should occur in the main function of the application or library.



Страницы: 1 вся ветка

Форум: "Компоненты";
Текущий архив: 2006.02.12;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.44 MB
Время: 0.036 c
2-1138003499
mozgan
2006-01-23 11:04
2006.02.12
"Размножение" компонента Image1


9-1125154608
Зм1й
2005-08-27 18:56
2006.02.12
Ресурсы


15-1137993600
begin...end
2006-01-23 08:20
2006.02.12
С Днём рождения! 23 января


2-1138190213
Scavenger
2006-01-25 14:56
2006.02.12
Панель задач.


2-1137498839
Goast
2006-01-17 14:53
2006.02.12
Информация о ходе копирования файлов





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский