Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-12

patch for setmenu

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Micha Nelissen
to Darek Mazur: Hi When I was testing SETMENU I found a bug: I have changed MAINMENU many times (choice…
Marc Weustink wrote 28 lines
At 23:52 17-12-2003, Darek Mazur wrote: > 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 FMenunil then begin > FMenu.Parent:=Self; > if HandleAllocated and (not (csLoading in ComponentState)) then begin > FMenu.HandleNeeded; > AttachMenuToWindow(FMENU); // <--- this added > end; > end; Shouldn't be needed there. Isn't this something for the interface ?

It is needed. If menus have been created, then there is no call to the interface anymore.

Patch applied. Thanks,

Micha.

Reply by email

Darek Mazur

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 FMenunil 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

Reply by email

Marc Weustink
to Darek Mazur
Darek Mazur wrote 20 lines
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 FMenunil then begin FMenu.Parent:=Self; if HandleAllocated and (not (csLoading in ComponentState)) then begin FMenu.HandleNeeded; AttachMenuToWindow(FMENU); // <--- this added end; end;

Shouldn't be needed there. Isn't this something for the interface ?

Marc

Reply by email