Perhaps I find solution to use OnEnter with Textbox, Button and...
Before applying the solution, I want present to you my pov because I must move the OnEnter method (not ::bOnEnter) into every control (window, textbox, button, etc.) who want use this.
This action is due, because someone widget operates in a different way to intercept the Enter key (to see take a look to every ProcessEnter method).
I tried to write a generic method and then overwrite the method for each control, but the operation has given mixed results: I don't know, sorry
Second I find how to force/send event; take a look at LQTBASIC:SendEvent()
Third, I find solution to know what is the QT active Window: take a look inside LQTBASIC:GetActQtWin()
Also take a look to:
A) LQTBASIC:OnInit used to connect the event Show
B) LQTBASIC:OnInteractiveClose and LQTBASIC:OnRelease used to connect the (same) event Close, but read comment inside Main Function
C) small difference inside some methods
D) last but not least. I prefer this syntax
Code: Select all
CLASS CHECKBUTTON FROM APPLICATION,CONTROL,BASIC
Code: Select all
CLASS CHECKBUTTON FROM CONTROL CLASS CONTROL FROM BASIC CLASS BASIC FROM APPLICATION
I have attached an example: it's my HMG4 fork to do test. HMG4 lib it's not required.
To compile the test program, you must change .hbc and .hbp files in according with your installation.
When you run the pogram:
On the first textbox write something (if you want) and press return. The same on second textbox.
On the button you can: click or press return
Somewhere on the window (not over controls) try to click
Write me your impressions and opinions