[Solved] Advise on Forms
Posted
#1
(In Topic #1036)
Enthusiast

I was hoping someone could advise me on something
I have a EPoS application that was designed for a Keyboard I am now turning it into a touchscreen application
<IMG src="https://algpos.co.uk/gambas/RetailPoS_1.png">
</IMG>The idea is when the user touches the "Sign on off" button key the form "frmsignedoff" would think the key A has been pressed (as this is the key on the keyboard for that function)
<IMG src="https://algpos.co.uk/gambas/RetailPoS_2.png">
</IMG>Yes I know I could change the code so the button would display the sign on key but the F1-F8 (top buttons) all have tons of code written for them already
I would like it so the forms still function the same (as the system has so much code already for the given support i could not really re do them to run on the keys
<IMG src="https://algpos.co.uk/gambas/RetailPoS_3.png">
</IMG>I don't mind updating the code that handles the "key" presses but I don't really want to start from scratch again.
I am using the workspace1 to hold my user forms (eg the salescreen form and the Tender screen etc)
would there be a way to get the active form (example say the sign on screen is showing (in the second Pic) (its name is frmsignon) and have a public function called for example TouchKey(FucntionName as string) and have something like
Posted
Guru

There's Application.ActiveWindow
/comp/gb.qt4/application/activewindow - Gambas Documentation
Posted
Enthusiast

the number keys are btn_Key0 - btn_Key9 and they live on the form frmbackground
in the workspace1 I have a form called frmqtyRequest
how can I send the numbers to the currently active form in the workspace1?
so when I click say the button 3 the number 3 would show in the input box of the form
Posted
Guru

If you are in the KeyPress event of any form then Key object will still be valid in another so something like…
WorkSpace1.frmqtyRequest.Form_KeyPress()
Posted
Enthusiast

I have a few forms that take input for example
Frmsalescreen
Frmsignon
Frmtenderscreen
They all take number input
Would it be bette to move functions into a global function that uses a case select?
1 guest and 0 members have just viewed this.



