[Lazarus] TMenu(Item) AutoLineReduction: help needed from Delphi users/owners
Bart
bartjunk64 at gmail.com
Thu Sep 12 19:06:35 CEST 2024
On Thu, Sep 12, 2024 at 3:16 PM Werner Pamler via lazarus
<lazarus at lists.lazarus-ide.org> wrote:
> > I suppose this is how Delphi works as well.
> Yes.
Thanks for confirming.
> > But I have absolutely no idea if Delphi does this as well.
> Restores ItemB
RethinkLines did not restore ItemB, we did it on purpose before
calling RethinkLines.
> and the separator
So, I did it OK then in this case.
> > Question 2
> > And TopLevel.AutoLineReduction starts out as maManual, so all
> > separators are visible.
> Yes
> > Now I do: TopLevel.AutoLineReduction := maAutomatic
> > Then I do: TopLevel.RethinkLines
> >
> > It will now show as:
> > - ItemA
> > - Separator
> > - ItemB
> > - Separator
> > - ItemC
> >
> > This is Delphi compatible AFAIK.
> Hmmm... I have this code in a button. When I click on this button
> immediately after running the project, you are right, there are only
> single separators. But when I first open the menu to verify the double
> separators and then click on the button, nothing changes, and the double
> separators remain...
So, RethinkLines only works if the menu was never shown before?
That's confusing to say the least.
It's also not what the documents suggest,
> > I implemented RethinkLines so that this will set all separators Visble
> > property to True again.
> I added a second button for the maManual code. Running the program and
> clicking both buttons in the order of your description, nothing changes
> - there are still single separators.
This begs the question: what is the use of having maManual in that case.
But that part of the code can easily be removed/commented out.
I did implement it that way based upon a comment in the bugtracker
though, so that confuses me even more.
--
Bart
More information about the lazarus
mailing list