[Gambas-user] window resize help
Bruce Steers
bsteers4 at gmail.com
Tue Dec 20 17:35:48 CET 2022
I'm begining to thing it's a bug in the OS.
i've noticed that when resizing firefox window from top or left edge the
opposite edge seems to visibly waver a bit but get's corrected.
attached is a much cleaner version that uses Rect to adjust the window and
doesn't bother with mouse.startx
but the left and top edge still glitch when moving.
The only think i can think is that mouse position data being received is
not clean and thows out the occasional wierd number that has to be
accounted for.
I found using Me.X caused more glitches that Me.ScreenX so i added a
checkbox to use X or ScreenX when moving.
So to anyone trying to help here i have found a number of ways to do
resize, that is not the problem.
there is a positional glitch happening.
When moving the left edge the code get's the Rect of the form and modifies
Rect.Left then uses Window.Move() with the Rect properties.
this, according to docs, does not affect the right edge position, but
there's a glitch i guess because the right edge moves a bit when it should
not.
Thank you for looking into it though :)
Respects
BruceS
On Tue, 20 Dec 2022 at 14:18, gian via User <user at lists.gambas-basic.org>
wrote:
> Il 20/12/22 14:40, gian via User ha scritto:
> > Il 19/12/22 17:10, Bruce Steers ha scritto:
> >> Hey all.
> >>
> >> I wrote a routine to resize a window without a titlebar/border
> >>
> >> it tracks the mouse and makes the mouse image change okay (needs a
> >> better way to set it back to normal though)
> >>
> >> Something is not correct though with moving the Left or Top edge and I
> >> can't get my head around it.
> >>
> >> it seems to be jumpy setting the width or height when moving the left
> >> edge top, the opposite edge moves a bit and it shouldn't :(
> >>
> >> I tried a few methods but still the left/top edge is glitchy :(
> >> i've attached 2 versions
> >> 1.0.1 just uses Me.Move a lot
> >> 1.0.2 better uses Rect and i've tried to use Mouse.ScreenX not mouse
> >> StartX method.
> >> both glitch about the same.
> >>
> >> Anyone got a better, more robust method for window resizing via
> >> left/top edge?
> >>
> >> Cheers
> >> BruceS
> >>
> >
> >
> > Hi,
> >
> > I don't know if this will help your problem, but when I tried to find
> > the exact height of the window menus so that I could show a popup window
> > (instead of the menu) I had noticed that the top position of the window
> > minus the border differed depending on the libraries.
> >
> > For example:
> >
> > For Each h As Component In Components
> > If h.Name Like "gb.qt*" Then
> > $iMenuH = hFont.TextHeight(sMenu) + Style.BoxFrameHeight
> > Else If h.Name Like "gb.gtk*" Then
> > $iMenuH = hFont.TextHeight(sMenu) + (Style.BoxFrameHeight * 2)
> > Endif
> > Next
> >
> >
> > So the popup for QT libraries had to start slightly lower than for GTK
> >
> > Something similar I had done for the left side again with the help of
> > Style but I couldn't find the latest version of my test and the old ones
> > didn't work right, sorry :-(
> >
> > Maybe Benoit could clarify things :-)
> >
> > Greetings
> >
> > Gianluigi
> >
>
> Sorry I got confused, it is exactly the opposite :-(
>
> With GTK > $iMenuH = hFont.TextHeight(sMenu) + Style.BoxFrameHeight
>
> With QT > $iMenuH = hFont.TextHeight(sMenu) + (Style.BoxFrameHeight * 2)
>
> Greetings
>
> Gianluigi
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221220/897cbdd7/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CustomWindow-1.0.2.tar.gz
Type: application/gzip
Size: 13596 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221220/897cbdd7/attachment-0001.gz>
More information about the User
mailing list