win32: invalidate groupbox on enable change if themes are active (issue ), misc

git-svn-id: trunk@14528 -
This commit is contained in:
paul 2008-03-15 13:04:21 +00:00
parent 313cbcf318
commit d0f4ce1d1c
3 changed files with 16 additions and 11 deletions

View File

@ -144,7 +144,7 @@ begin
Result := Rect(0,0, MaxWidth, Screen.Height-4*HintBorderWidth);
if AHint='' then exit;
DrawText(Canvas.GetUpdatedHandle([csFontValid]), PChar(AHint), Length(AHint),
Result, DT_CalcRect or DT_NOPREFIX or DT_WORDBREAK);
Result, DT_CALCRECT or DT_NOPREFIX or DT_WORDBREAK);
inc(Result.Right,4*HintBorderWidth);
inc(Result.Bottom,4*HintBorderWidth);
//debugln('THintWindow.CalcHintRect Result=',dbgs(Result));

View File

@ -31,11 +31,6 @@ begin
TWin32WidgetSet(WidgetSet).HandleWakeMainThread(nil);
end;
{ addition XP messages }
const
WM_THEMECHANGED = $31A;
{-----------------------------------------------------------------------------
Function: PropEnumProc
Params: Window - The window with the property
@ -628,15 +623,18 @@ var
procedure EnableChildWindows(WinControl: TWinControl; Enable: boolean);
var
i : integer;
i: integer;
ChildControl: TWinControl;
begin
for i := 0 to WinControl.ControlCount-1 do begin
if WinControl.Controls[i] is TWinControl then begin
for i := 0 to WinControl.ControlCount-1 do
begin
if WinControl.Controls[i] is TWinControl then
begin
ChildControl := TWinControl(WinControl.Controls[i]);
if Enable then begin
if Enable then
begin
if ChildControl.Enabled then
EnableWindow(ChildControl.Handle, true)
EnableWindow(ChildControl.Handle, true);
end
else
EnableWindow(ChildControl.Handle, false);
@ -1500,6 +1498,10 @@ begin
if not ThemeServices.ThemesEnabled
and (lWinControl is TCustomBitBtn)
then DrawBitBtnImage(TCustomBitBtn(lWinControl), TCustomBitBtn(lWinControl).Caption);
// if it is groupbox and themed app then invalidate it on enable change
// to redraw graphic controls on it (issue 0007877)
if ThemeServices.ThemesAvailable and (lWinControl is TCustomGroupBox) then
lWinControl.Invalidate;
end;
WM_ERASEBKGND:
begin

View File

@ -312,6 +312,9 @@ SWP_DEFERERASE = $2000;
SWP_ASYNCWINDOWPOS = $4000;
SWP_STATECHANGED = $8000; // used by windows but not documented (used even in wine)
// addition XP messages
WM_THEMECHANGED = $31A;
// missing imagelist macros and constants
const