speed up menu creation

git-svn-id: trunk@6181 -
This commit is contained in:
micha 2004-10-29 18:55:30 +00:00
parent 67bca8d8e8
commit cfaa072cd1
2 changed files with 17 additions and 0 deletions

View File

@ -682,6 +682,17 @@ Begin
LMessage.Result := DLGC_WANTALLKEYS;
WinProcess := false;
End;
{
* TODO: make it work... icon does not show up yet, so better disable it
WM_GETICON:
begin
if WindowInfo^.WinControl is TCustomForm then
begin
LMessage.Result := TCustomForm(WindowInfo^.WinControl).GetIconHandle;
WinProcess := false;
end;
end;
}
WM_KEYDOWN:
Begin
NotifyUserInput := True;
@ -1430,6 +1441,9 @@ end;
{
$Log$
Revision 1.152 2004/10/29 18:55:30 micha
speed up menu creation
Revision 1.151 2004/10/29 14:24:17 micha
make code possible safer, with better typecasts and use of GlobalAddAtom, because windows are global

View File

@ -113,6 +113,7 @@ begin
// owner could be a popupmenu too
if (AMenuItem.Owner is TWinControl) and
TWinControl(AMenuItem.Owner).HandleAllocated and
TWinControl(AMenuItem.Owner).Visible and
([csLoading,csDestroying] * TWinControl(AMenuItem.Owner).ComponentState = []) then
DrawMenuBar(TWinControl(AMenuItem.Owner).Handle);
end;
@ -251,6 +252,7 @@ begin
// owner could be a popupmenu too
if (AMenuItem.Owner is TWinControl) and
TWinControl(AMenuItem.Owner).HandleAllocated and
TWinControl(AMenuItem.Owner).Visible and
([csLoading,csDestroying] * TWinControl(AMenuItem.Owner).ComponentState = []) then
DrawMenuBar(TWinControl(AMenuItem.Owner).Handle);
end;
@ -271,6 +273,7 @@ begin
if (AMenu<>nil) and (AMenu.Parent<>nil)
and (AMenu.Parent is TCustomForm)
and TCustomForm(AMenu.Parent).HandleAllocated
and TCustomForm(AMenu.Parent).Visible
and not (csDestroying in AMenu.Parent.ComponentState) then
DrawMenuBar(TCustomForm(AMenu.Parent).Handle);
end;