fix sizing when menu is attached to window

git-svn-id: trunk@5471 -
This commit is contained in:
micha 2004-05-14 15:20:47 +00:00
parent d916890343
commit 664f41ac03
2 changed files with 14 additions and 2 deletions

View File

@ -1251,10 +1251,16 @@ end;
procedure TWin32WidgetSet.AttachMenuToWindow(AMenuObject: TComponent);
var
AMenu: TMenu;
AWinControl: TWinControl;
begin
AMenu := AMenuObject as TMenu;
if AMenu.FCompStyle = csMainMenu then
Windows.SetMenu(TWinControl(AMenu.Owner).Handle, AMenu.Handle);
begin
AWinControl := TWinControl(AMenu.Owner);
Windows.SetMenu(AWinControl.Handle, AMenu.Handle);
// inform LCL of changed client size
AWinControl.DoAdjustClientRectChange;
end;
end;
{ Private methods (in no significant order) }
@ -2953,6 +2959,9 @@ End;
{
$Log$
Revision 1.193 2004/05/14 15:20:47 micha
fix sizing when menu is attached to window
Revision 1.192 2004/05/12 15:11:46 micha
fix sizing/non-sizing border sizes

View File

@ -568,7 +568,7 @@ begin
if SendSizeMsgOnDiff then begin
//writeln('LCLBoundsNeedsUpdate B ',TheWinControl.Name,':',TheWinControl.ClassName,' Sending WM_SIZE');
Sender.InvalidateClientRectCache(true);
SendMessage(Window, WM_SIZE, 0, MakeLParam(IntfWidth, IntfHeight));
Windows.PostMessage(Window, WM_SIZE, 0, MakeLParam(IntfWidth, IntfHeight));
end;
end;
@ -761,6 +761,9 @@ end;
{ =============================================================================
$Log$
Revision 1.41 2004/05/14 15:20:47 micha
fix sizing when menu is attached to window
Revision 1.40 2004/05/12 15:11:46 micha
fix sizing/non-sizing border sizes