Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Аватара для El Sanchez

Ветеран


Contributor


Сообщения: 1264
Благодарности: 1024

Профиль | Отправить PM | Цитировать


Цитата Dodakaedr:
я ж про то же»
Dodakaedr, diman_21Ru, пардон, ввел всех в заблуждение. Пока сам себя не проверишь, ответа не получишь. Все дело в свойстве TreeViewStyle, которое есть у листа из китайской версии. При значении True (либо в секции Setup директива ComponentsListTVStyle=yes) наблюдаем подобное поведение, WantTabs немного из другой оперы. Для решения проблемы нужно самому обработать мышиные события:
Скрытый текст

Код: Выделить весь код
type
    TCheckListBoxHelper = record
        Index: Integer;
        ItemArea: TItemArea;
    end;

var
   CLBHelper: TCheckListBoxHelper;

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure ComponentsListOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
    with TNewCheckListBox(Sender) do
    begin
        if (Button = mbLeft) and (CLBHelper.ItemArea = iaItem) and ItemEnabled[CLBHelper.Index] then
        case State[CLBHelper.Index] of
            cbUnchecked,
            cbGrayed:
                CheckItem(CLBHelper.Index, coCheckWithChildren);
            cbChecked:
                CheckItem(CLBHelper.Index, coUncheck);
        end;
    end;
end;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure ComponentsListOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea);
begin
    CLBHelper.Index := Index;
    CLBHelper.ItemArea := Area;
end;

///////////////////////////
procedure InitializeWizard;
begin
    with WizardForm.ComponentsList do
    begin
        if TreeViewStyle then
        begin
            OnMouseDown := @ComponentsListOnMouseDown;
            OnItemMouseMove := @ComponentsListOnItemMouseMove;
        end;
    end;
end;

Последний раз редактировалось El Sanchez, 06-03-2015 в 18:52. Причина: nik1967 fix

Это сообщение посчитали полезным следующие участники:

Отправлено: 09:44, 06-03-2015 | #253