[Gambas-user] Keeping a menu open?

Bruce Steers bsteers4 at gmail.com
Mon Jan 17 21:02:07 CET 2022


On Mon, 17 Jan 2022 at 10:20, Gianluigi <bagonergi at gmail.com> wrote:

>
>
> Il giorno lun 17 gen 2022 alle ore 10:05 Gianluigi <bagonergi at gmail.com>
> ha scritto:
>
>>
>> P.S. It is clear that I have not understood how the upstream distance is
>> calculated. ;-D
>>
>>
> Hi Benoit,
>
> can you kindly help me figure out how to calculate the width of the menu
> rectangle.
>
> It seems to start after a Desktop.Scale + the width given by the menu item
> + What?
>
> My last attempt is this (see attached project):
>
> space = Desktop.Scale
>
> I add the first space + 2 spaces for each menu item, however the further I
> go the more the rectangle (and popup) moves to the right.
>
> Thanks for your attention
>
> Regards
> Gianluigi
>

You get the box dimensions in ThreeStateMenu_Draw()
You get TextWidth()

width should be something like..
$hGrid.Padding + iBoxWidth + $hGrid.Padding + iTextLen + $hGrid.Padding

Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220117/82cdf897/attachment.htm>


More information about the User mailing list