[lazarus] patch for setmenu

Darek Mazur darekm at emadar.com
Wed Dec 17 17:39:37 EST 2003


Hi

When I was testing SETMENU I found a bug: I have changed MAINMENU many times
(choice from 3 MENUS) and MAINMENU has been changed only one for each first
set MENU,  second time was no change. (sorry for my english)

my patch for this:
inCUSTOMFORM.INC
Procedure TCustomForm.SetMenu(Value : TMainMenu);



  FMenu := Value;
  if FMenu<>nil then begin
    FMenu.Parent:=Self;
    if HandleAllocated and (not (csLoading in ComponentState)) then begin
      FMenu.HandleNeeded;
      AttachMenuToWindow(FMENU);  // <--- this added
    end;
  end;


I use FPC 1.9 + WIN32


Darek






More information about the Lazarus mailing list