Roger Alcindor
asked on
OnMouseDown event handler problem
I have not been able to implement an event handler for a StringGrid OnMousedown event when the stringGrid is a multi-platform application with a target of Windows 32.
the compiler (C++ builder Embarcadero XE 10.1Berlin) gives a compile time error where the event handler is assigned in the constructor for the form Form3.
[bcc32 Error] Unit3.cpp(17): E2034 Cannot convert 'void (_fastcall * (_closure )(TObject *,TMouseButton,TShiftState ,int,int)) (TObject *,TMouseButton,TShiftState ,int,int)' to 'TMouseEvent'
Full parser context
Unit3.cpp(15): parsing: _fastcall TForm3::TForm3(TComponent *)
the code is as follows:
Can this be corrected ?
the compiler (C++ builder Embarcadero XE 10.1Berlin) gives a compile time error where the event handler is assigned in the constructor for the form Form3.
[bcc32 Error] Unit3.cpp(17): E2034 Cannot convert 'void (_fastcall * (_closure )(TObject *,TMouseButton,TShiftState
Full parser context
Unit3.cpp(15): parsing: _fastcall TForm3::TForm3(TComponent *)
the code is as follows:
__fastcall TForm3::TForm3(TComponent* Owner)
: TForm(Owner)
{
StringGrid1->OnMouseDown = StringGrid1MouseDown; // <-----This giver a compile error
}
//---------------------------------------------------------------------------
void __fastcall TForm3::StringGrid1MouseDown(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
TStringGrid *g;
int col, row;
bool fixedCol, fixedRow;
// ... code to handle mouse-down event
}
Can this be corrected ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
There is also an error in the first line of code in the event handler
where by the Button parameter can't be checked; I wish to handle only right hand button down events so the first line in the handler is
Open in new window
But there is also an error reporting that mbRight is an undefined symbol ?
So it seems the FMX controls may nor have the functionality of VCL components with regard to mouse actions and attibutes ?