fixed SpinEdit.Visible and SpinEdit.Enabled

git-svn-id: trunk@7093 -
This commit is contained in:
vincents 2005-04-20 14:08:38 +00:00
parent 4088211fec
commit 4c93d064a5
2 changed files with 33 additions and 5 deletions

View File

@ -381,14 +381,22 @@ Var
end;
end;
procedure DestroySpinEditBuddy(SpinEdit: TCustomSpinEdit);
procedure DestroySpinEditBuddy(SpinEditHandle: HWND);
var
Buddy: HWND;
begin
Buddy := SendMessage(SpinEdit.Handle, UDM_GETBUDDY, 0, 0);
Buddy := SendMessage(SpinEditHandle, UDM_GETBUDDY, 0, 0);
DestroyWindow(Buddy);
end;
procedure EnableSpinEditBuddy(SpinEditHandle: HWND; Enable: boolean);
var
Buddy: HWND;
begin
Buddy := SendMessage(SpinEditHandle, UDM_GETBUDDY, 0, 0);
Windows.EnableWindow(Buddy, Enable);
end;
procedure DisposeComboEditWindowInfo(ComboBox: TCustomComboBox);
var
Buddy: HWND;
@ -726,7 +734,7 @@ Begin
if lWinControl is TCheckListBox then
TWin32CheckListBoxStrings.DeleteItemRecords(Window);
if lWinControl is TCustomSpinEdit then
DestroySpinEditBuddy(TCustomSpinEdit(lWinControl));
DestroySpinEditBuddy(Window);
if lWinControl is TCustomComboBox then
DisposeComboEditWindowInfo(TCustomComboBox(lWinControl));
if WindowInfo^.Overlay<>HWND(nil) then
@ -776,7 +784,9 @@ Begin
Begin
If WParam <> 0 Then
LMessage.Msg := LM_SETEDITABLE;
If (lWinControl is TCustomSpinEdit) then
EnableSpinEditBuddy(Window, WParam<>0);
// ugly hack to give bitbtns a nice look
// When no theming active, the internal image needs to be
// recreated when the enabled state is changed
@ -1538,6 +1548,9 @@ end;
{
$Log$
Revision 1.201 2005/04/20 14:08:38 vincents
fixed SpinEdit.Visible and SpinEdit.Enabled
Revision 1.200 2005/04/13 17:17:16 micha
fix taskbar button being removed and reinserted when minimizing mainform

View File

@ -54,7 +54,8 @@ type
class procedure SetSelStart(const ACustomSpinEdit: TCustomSpinEdit; NewStart: integer); override;
class procedure SetSelLength(const ACustomSpinEdit: TCustomSpinEdit; NewLength: integer); override;
class procedure ShowHide(const AWinControl: TWinControl); override;
class procedure UpdateControl(const ACustomSpinEdit: TCustomSpinEdit); override;
end;
@ -139,6 +140,20 @@ begin
EditSetSelLength(SendMessage(ACustomSpinEdit.Handle, UDM_GETBUDDY, 0, 0), NewLength);
end;
procedure TWin32WSCustomSpinEdit.ShowHide(const AWinControl: TWinControl);
var
Buddy: HWND;
begin
// call inherited
TWin32WSWinControl.ShowHide(AWinControl);
Buddy := SendMessage(AWinControl.Handle, UDM_GETBUDDY, 0, 0);
if AWinControl.HandleObjectShouldBeVisible then
ShowWindow(Buddy, SW_SHOW)
else
ShowWindow(Buddy, SW_HIDE);
end;
procedure TWin32WSCustomSpinEdit.UpdateControl(const ACustomSpinEdit: TCustomSpinEdit);
begin
UpdateSpinEditControl(ACustomSpinEdit.Handle, ACustomSpinEdit);