- changed handle check in combobox SetItemHeight to more correct

git-svn-id: trunk@11154 -
This commit is contained in:
paul 2007-05-16 14:07:03 +00:00
parent 211710b030
commit 37bdf71f61
2 changed files with 8 additions and 3 deletions

View File

@ -611,6 +611,10 @@ begin
exit;
FItemHeight := AValue;
if (not HandleAllocated) then
exit;
if Style in [csOwnerDrawFixed, csOwnerDrawVariable] then
TWSCustomComboBoxClass(WidgetSetClass).SetItemHeight(Self, FItemHeight);
end;

View File

@ -35,7 +35,7 @@ uses
////////////////////////////////////////////////////
Classes, StdCtrls, Controls, Graphics, Forms, SysUtils,
////////////////////////////////////////////////////
WSStdCtrls, WSLCLClasses, Windows, LCLType,
WSStdCtrls, WSLCLClasses, WSProc, Windows, LCLType,
Win32Int, Win32Proc, InterfaceBase, Win32WSControls;
type
@ -817,11 +817,12 @@ end;
class procedure TWin32WSCustomComboBox.SetItemHeight(const ACustomComboBox: TCustomComboBox; const AItemHeight: Integer);
begin
if not WSCheckHandleAllocated(ACustomComboBox, 'SetItemHeight') then
Exit;
// size requests are done through WM_MeasureItem
// SendMessage(ACustomComboBox.Handle, CB_SETITEMHEIGHT, AItemHeight, -1);
// SendMessage(ACustomComboBox.Handle, CB_SETITEMHEIGHT, AItemHeight, 0);
if ACustomComboBox.HandleAllocated then
RecreateWnd(ACustomComboBox);
RecreateWnd(ACustomComboBox);
end;
{ TWin32WSCustomEdit helper functions }