.h
//--------------------------------------------------------------------------------------------------
class xxx{
private:
TNotifyEvent FOnCustomClick;
void __fastcall FireCustomClick();
public:
__property TNotifyEvent OnCustomClick = { read=FOnCustomClick, write=FOnCustomClick };
}
//--------------------------------------------------------------------------------------------------
.cpp
//--------------------------------------------------------------------------------------------------
void __fastcall TfrmRecorder::FireCustomClick()
{
if (FOnCustomClick)
FOnCustomClick(this);
}
void __fastcall TfrmRecorder::PanelCustomMouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
FireCustomClick();
}
//--------------------------------------------------------------------------------------------------
.h
//--------------------------------------------------------------------------------------------------
void __fastcall OnMyCustomClick(TObject *Sender);
//--------------------------------------------------------------------------------------------------
.cpp
//--------------------------------------------------------------------------------------------------
void __fastcall TfmMain::OnMyCustomClick(TObject *Sender)
{
}
m_vecRecorders[i]->OnMCustomClick = OnMyCustomClick;
//--------------------------------------------------------------------------------------------------