Home » Community » Newbie corner » Function key to Button
Function key to Button [message #54349] |
Thu, 02 July 2020 05:51  |
Shwetha
Messages: 39 Registered: August 2011
|
Member |
|
|
Hi,
How to assign function key to button which is on the sub layouts
ie, for example in ScatterCtrlDemo we have tabctrls.
In Tab5Dynamic I need to invoke button action start, stop with fn keys..
please guide.
Thank you.
|
|
|
|
|
Re: Function key to Button [message #54356 is a reply to message #54352] |
Fri, 03 July 2020 10:41   |
Oblivion
Messages: 1202 Registered: August 2007
|
Senior Contributor |
|
|
Hello Shwetha,
Quote:still not clear.
I get the following error :
cannot call member function 'virtual bool Upp::TopWindow::Key(Upp::dword, int)' without object
Koldo has shown the correct generic way: If your derived class is based on TopWindow, it will work. But in your specific example, the button is called froım Tab5_Dynamic class, which is derived from ScatterDemo. So you should call ScatterDemo::Key (or any other base class that derives from Upp::Ctrl, thati s suitable), if you need to further process ScatterDemo keys (you'll probably need that in the future.)
Try this instead:
bool Tab5_Dynamic::Key(dword key, int val)
{
LOG("key");
DUMP("KeyAction");
if(key == K_CTRL_S) {
bStart.Action();
return true;
} else
return ScatterDemo::Key(key, val);
}
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Fri, 03 July 2020 11:50] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 15:07:11 CEST 2025
Total time taken to generate the page: 0.01046 seconds
|