Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: [Berlin] Missing events FMX.Grid.TStringGrid



Permlink Replies: 7 - Last Post: Oct 10, 2016 2:28 PM Last Post By: Alain Villeneuve
midou sidou

Posts: 11
Registered: 6/15/06
[Berlin] Missing events FMX.Grid.TStringGrid
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 29, 2016 6:00 AM
Hello,

I want to use the StringGrid OnClick event. It passed for published to public. In my unit.h, i wrote this :

public : void __fastcall TForm1::StringGrid1Click(TObject *Sender);

and in my unit.cpp :
void __fastcall TForm1::StringGrid1Click(TObject *Sender)
{
ShowMessage("it works");
}

At runtime, it nothing happens by clicking the StringGrid!!!
Patricio Cerda

Posts: 122
Registered: 3/13/01
Re: [Berlin] Missing events FMX.Grid.TStringGrid
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 30, 2016 6:53 AM   in response to: midou sidou in response to: midou sidou
midou sidou wrote:
Hello,

I want to use the StringGrid OnClick event. It passed for published to public. In my unit.h, i wrote this :

public : void __fastcall TForm1::StringGrid1Click(TObject *Sender);

and in my unit.cpp :
void __fastcall TForm1::StringGrid1Click(TObject *Sender)
{
ShowMessage("it works");
}

At runtime, it nothing happens by clicking the StringGrid!!!

Hello,

I can't help you midou sidou, but I would enforce your post with my own similar problem: I have the same problem with FMX TGrid, this method is not present on the Object Inspector events, but it is described on documentation. I have tried the same as you did, adding the declaration and definition of the method, but it didn't worked also. How could I use this method? I'm using C++ Builder Berlin 10.1 on an Android app.

Best regards,
Patricio Cerda
Borja Serrano

Posts: 53
Registered: 1/10/13
Re: [Berlin] Missing events FMX.Grid.TStringGrid
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 30, 2016 9:59 AM   in response to: Patricio Cerda in response to: Patricio Cerda
Have you tried the OnTap event?
Patricio Cerda

Posts: 122
Registered: 3/13/01
Re: [Berlin] Missing events FMX.Grid.TStringGrid
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 30, 2016 10:16 AM   in response to: Borja Serrano in response to: Borja Serrano
Have you tried the OnTap event?

Yes Borja, thanks for your help.
OnTap event works well on Android device, but I need to test my app also on Win64 where is not posible to use OnTap event. Then, I need to use a mouse and OnClick event handler, but it is not working.

Best regards,
Patricio Cerda
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: [Berlin] Missing events FMX.Grid.TStringGrid
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 31, 2016 10:36 AM   in response to: midou sidou in response to: midou sidou
midou wrote:

I want to use the StringGrid OnClick event. It passed for published to
public. In my unit.h, i wrote this :

public : void __fastcall TForm1::StringGrid1Click(TObject *Sender);

and in my unit.cpp :

void __fastcall TForm1::StringGrid1Click(TObject *Sender)
{
ShowMessage("it works");
}

At runtime, it nothing happens by clicking the StringGrid!!!

It is not enough to just write the handler, you have to assign it to the
event. And since you declared the handler as public instead of published,
the assignment can only be done in code at runtime, such as in your Form's
constructor:

StringGrid1->OnClick = &StringGrid1Click;


--
Remy Lebeau (TeamB)
Patricio Cerda

Posts: 122
Registered: 3/13/01
Re: [Berlin] Missing events FMX.Grid.TStringGrid
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 31, 2016 3:49 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thanks Remy,

It is not enough to just write the handler, you have to assign it to the
event. And since you declared the handler as public instead of published,
the assignment can only be done in code at runtime, such as in your Form's
constructor:

StringGrid1->OnClick = &StringGrid1Click;

It works!

Could you explain please which could be the way to assign the event if it was declared as published?
Could you comment about the advantages/objectives of the both alternatives (Public vs Published)?

Best regards,
Patricio Cerda
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: [Berlin] Missing events FMX.Grid.TStringGrid
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 31, 2016 5:20 PM   in response to: Patricio Cerda in response to: Patricio Cerda
Patricio wrote:

Could you explain please which could be the way to assign
the event if it was declared as published?

An event handler that is declared as published has RTTI that the Object Inspector
can use to assign the handler to any compatible event that is also declared
as published. That is the whole reason published exists in the first place
- to provide design-time RTTI support.

--
Remy Lebeau (TeamB)
Alain Villeneuve

Posts: 1
Registered: 3/17/02
Re: [Berlin] Missing events FMX.Grid.TStringGrid
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2016 2:28 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
But my question reading this is why OnClick and OnDblClick are no longer published ?

All user are not only working on mobile, Windows and Mac OS are still in use !
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02