Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » RegisterSystemHotKey not work here
RegisterSystemHotKey not work here [message #55256] Fri, 23 October 2020 15:13 Go to next message
BetoValle is currently offline  BetoValle
Messages: 202
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member

i build function to remove in the class

class HWld : public WithmeuL<TopWindow> {
private:
void fxRemove();
int keyId;
public:
typedef HWld CLASSNAME;
.......................
void HWld::fxRemove(){
int i = grid.GetCursor();
String s;
s << i;
PromptOK( s );
grid.Remove( i );

}
....................... below in constructor compilation error occurs
main.cpp (86): error: 'this' cannot be implicitly captured in this context

HWld::HWld()

{

CtrlLayout(*this, "Titulo da janela");
keyId = Ctrl::RegisterSystemHotKey(K_CTRL_DELETE, []{ fxRemove(); } );

I had done a simple test before with:

int id = Ctrl::RegisterSystemHotKey(K_CTRL_DELETE, [] { PromptOK("Ctrl delete ok"); });

it didn't generate an error, I thought I could put a function in place of the promptOK
so how should i write the code?

there is probably another alternative using a WhenAction but I don't know how to write this option.


Thanks




Re: RegisterSystemHotKey not work here [message #55259 is a reply to message #55256] Fri, 23 October 2020 15:48 Go to previous message
BetoValle is currently offline  BetoValle
Messages: 202
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
i found a solution that worked, replacing the lambda function
and it was like this:
keyId = Ctrl :: RegisterSystemHotKey (K_CTRL_DELETE, THISBACK (fxRemove));

but I haven't figured out how to do it using WhenAction.
Previous Topic: Column Visible / hidden (arrayCtrl)
Next Topic: What collection to use to achieve this?
Goto Forum:
  


Current Time: Fri Mar 29 14:51:30 CET 2024

Total time taken to generate the page: 0.01558 seconds