[Solved] Advise on Forms

Post

Posted
Rating:
#1 (In Topic #1036)
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
Hi Everyone

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

Code (gambas)

  1. Public Sub TouchKey (FunctionName as string)
  2.       Select case FunctionName
  3.          Case "Key_1"
  4.            do the code for the Singon
  5.       end select
  6.  
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
I'm not sure I understand what you need.

There's Application.ActiveWindow
/comp/gb.qt4/application/activewindow - Gambas Documentation
Online now: No Back to the top

Post

Posted
Rating:
#3
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
 ok so I have lets say I have a form that take a input of 0-9 (the number keys)

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
Online now: No Back to the top

Post

Posted
Rating:
#4
Guru
BruceSteers is in the usergroup ‘Guru’
 Can you just run the Form_KeyPress() method of the other form?
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()
Online now: No Back to the top

Post

Posted
Rating:
#5
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
 But how would I do that for the other forms

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?
Online now: No Back to the top
1 guest and 0 members have just viewed this.