Home » Community » Newbie corner » Touchscreen and buttons
Touchscreen and buttons [message #48605] |
Tue, 08 August 2017 12:10 |
Giorgio
Messages: 218 Registered: August 2015
|
Experienced Member |
|
|
Hi there,
I am experimenting with a touch screen on a raspberry. I developed the application on Windows, but it compiled on raspbian with almost no additional effort - just to fix less than 20 lines of code - and I think that is quite remarkable.
The original application was meant to be used with mouse and keyboard, so I have to tune the User Interface to make the application usable: first problem I encountered is with buttons.
If I use a "custom" button (i.e. a button created by me and to which I assigned a function with btn.WhenPush = THISBACK(myFunction); ) the button works as expected. If I use "built-in" buttons (i.e. the button ok and cancel of a CtrlLayoutOKCancel window) they do not work: when I press them on the touch screen, I see that they are pressed and released, but nothing happens. Someone else encountered this problem?
As a workaround, I tried to assign the method Close() to the ok and cancel buttons, but - due to my newbie-ity - I did not figure out how to do that; this is the original code, working without a problem with keyboard and mouse:
#include "ListOp.h"
ListOp::ListOp(MLav _macrolav)
{
CtrlLayoutOKCancel(*this, t_("Select operator"));
std::vector<S_OPERATORS> mylist = db_data.FindOperators(_macrolav);
for (size_t i=0; i<mylist.size(); i++)
SwOperators.Set((int)i, mylist[i].ID, mylist[i].NAME);
ok.Ok();
cancel.Cancel();
}
I tried adding the following:
[...]
ok.Ok();
ok.WhenPush = THISBACK(this.Close);
cancel.Cancel();
cancel.WhenPush = THISBACK(this.Close);
...and this:
[...]
ok.Ok();
ok.WhenPush = THISBACK(this->Close);
cancel.Cancel();
cancel.WhenPush = THISBACK(this->Close);
...but the code does not compile.
Any suggestion is appreciated.
Regards,
Gio
|
|
|
Goto Forum:
Current Time: Sat Apr 20 04:30:01 CEST 2024
Total time taken to generate the page: 0.02113 seconds
|