- 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; exit;
FItemHeight := AValue; FItemHeight := AValue;
if (not HandleAllocated) then
exit;
if Style in [csOwnerDrawFixed, csOwnerDrawVariable] then if Style in [csOwnerDrawFixed, csOwnerDrawVariable] then
TWSCustomComboBoxClass(WidgetSetClass).SetItemHeight(Self, FItemHeight); TWSCustomComboBoxClass(WidgetSetClass).SetItemHeight(Self, FItemHeight);
end; end;

View File

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