[Gambas-user] GTK versus QT

Philippe Valarcher philippe.valarcher at free.fr
Thu Feb 23 14:09:40 CET 2023


Le jeudi 23 février 2023 à 13:44 +0100, Jorge Carrión a écrit :
> Tried with QT5 and GTK3, both works fine for me here.
> 
> Best Regards
> 
> El jue, 23 feb 2023 a las 12:52, Philippe Valarcher
> (<philippe.valarcher at free.fr>) escribió:
> > I have a concern on a small program, with the component GB.QT The
> > Form_Keypress works well and does what I ask him when with GB.GTK
> > or even GB.GTK3 The keyboard entry takes only the last figure, The
> > concatenation of the figures is not done (we can check it by doing
> > a simple operation of the 11+1 style, under GTK it gives = 2 while
> > under QT it gives = 12.
> > There is certainly a way to turn around but I have not yet found.
> > I attach a text file with the incriminated procedures as well as
> > the 47 version (under GB.GTK).
> > 
> > Thank you for your help.
> > 
> > 
> > 
> > ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
It works only with gb.qt5 on my machine not with gb.gtk nor gb.gtk3.
I have to send it with gb.gtk.
I tried with this :
Public Sub Form_KeyPress() 

Dim vText As Variant
Dim cChiffres As String[] = ["0", "1", "2", "3", "4", "5", "6", "7",
"8", "9", ",", "."]
Dim cSignes As String[] = ["+", "-", "*", "x", "/", "^", Chr(92)]

vText = Key.Text 

If vText Match "." Then vText = Replace(vText, ".", ",") 

If Key.Code = key.Return Or Key.Code = key.Enter Then btnEgal_Click()
If Key.Code = Key.Esc Then btnCancel_Click()
If Key.Code = Key.Backspace Or Key.Code = Key.Delete Then
btnEffacer_Click()
If Key.Code = Key.ShiftKey Then btnMod.Text = "Div"
If Key.Code = Key.AltKey Then btnMod.Text = "Mod"

' If cChiffres.Exist(vText) Then
If IsDigit(vtext) Then
Last.text = vText
Chiffres_Click()
Endif

If cSignes.Exist(vText) Then
' If IsPunct(vtext) Then
Last.Text = vText
Signes_Click()
Endif

If Not cSignes.Exist(Key.Text) Or Not cChiffres.Exist(Key.Text) Then
Stop Event '<--- rien d'autre que les signes et les chiffres autorisés

Me.Text = ("Calculatrice ") '<----------------------------------- pour
ne pas afficher vText dans le titre du formulaire

Catch
Message.Error(Str(Error.Class) & ", code : " & Error.Code & ", " &
Str(Error.Backtrace) & " à " & Error.Where & " | " & Error.Text)

End

But it works only for digits not for punct

Thank you
Best Regards
-- 
Philippe Valarcher <philippe.valarcher at free.fr>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230223/2065bc30/attachment.htm>


More information about the User mailing list