[Gambas-user] "Long" click

Miguel Manso mmanso at ...626...
Mon Sep 25 12:34:24 CEST 2017


Hi all,

I've found a strange issue related with this subject and qt5.

In the example you sent me, if you replace the Form1.Show() to
Form1.ShowModal(), on a computer with touchscreen it won't work correctly.
I mean, it opens the Form1 but the next touch you do on the screen, will be
ignored. After that, it works normally. Every time you do a ShowModal in
the middle of a MouseDown and MouseUp event (with the timer) the first
click on the opened form won't be handled...

I've been analyzing this for hours and I've found that using gb.qt4 work ok
and this issue doesn't happen.

Again, this only happens using the touchscreen. If I use the mouse, it
works correctly.

Any suggestions on this wierd issue?

Thanks a lot.




On 23 September 2017 at 18:47, PICCORO McKAY Lenz <mckaygerhard at ...626...>
wrote:

> i understand perfectly..
>
> --->here but presed but not released
> ----> here a second was passed
> ----> here 20 second was passed but button are not released
> -----> here due more that 20 second passed and but not released a
> form/window are raised
>
>
> your code looks with sense, but maybe i a good idea start the timming based
> on the button pressure, and not the moouse
>
> your code says> if the MOUSE button click ON ANY PART OF THE FORM start
> timing to calculate how long are pressed..
>
> and i thing you want > if the MOUSE button click ON SOME SPECIFIC BUTTON
> FORM et etc
>
>
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
> 2017-09-21 6:08 GMT-04:00 ML <d4t4full at ...626...>:
>
> > My guess is that you want a new form to appear after the button is
> > raised, but having been pressed more than X seconds.
> > To this end, I'd add a timer with the desired "long-click lenght" to the
> > main form (the one that "receives the long-click").
> > Maybe also the form and all its controls should have an observer and
> > apply the timer to the observer, if more than one control may receive
> > the "long click".
> > So it would be MouseDown->Enable timer->MouseUp->Disable Timer. If the
> > timer triggered, the form should be shown:
> >
> >   Public Sub Form1_MouseDown()
> >
> >     'Start timing clicks
> >     tmrLongClickEnabled = True
> >
> >   End
> >
> >   Public Sub Form1_MouseUp()
> >
> >     'Stop timing clicks
> >     tmrLongClick.Enabled = False
> >
> >   End
> >
> >   Public Sub tmrLongClick_Timer()
> >
> >     'If the timer triggered before being disabled, it was a
> > "long-click", so we show the "other" form
> >     Form2.Show()
> >
> >     'We also disable the timer so no more than ONE form is shown per
> > "long-click".
> >     tmrLongClick.Enabled = False
> >
> >   End
> >
> > Disclaimer: It looks good on paper, but did not actually try it.
> >
> > HTH,
> > zxMarce
> >
> > On 21/09/17 06:28, Gianluigi wrote:
> > > I'm not sure I understand, but that's not enough?
> > >
> > > Public Sub Button1_MouseDown()
> > >
> > >   Form1.Show()
> > >
> > > End
> > >
> > > Public Sub Button1_MouseUp()
> > >
> > >   Form1.Hide()
> > >
> > > End
> > >
> > > Regards
> > > Gianluigi
> > >
> > > 2017-09-21 8:19 GMT+02:00 Miguel Manso <mmanso at ...626...>:
> > >> Hi All,
> > >> I'm using gambas3 for some time now and I'd like to know your opinion
> > >> about the best way to implement a "long" click.
> > >> The idea is to leave a button presses for a certain amount of seconds
> > >> and without releasing it, a new form will open.
> > >> We did this using a timer but I'd like to know if there's any
> > >> "recommended" way of doing it.
> > >> Thanks.
> > >> --
> > >> Miguel Manso
> >
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
Miguel Manso



More information about the User mailing list