Error using subscribeEvent()
Posted: Mon Feb 21, 2005 06:01
Hi we are developing a calendar control, with the foll sub controls.
Calendarcontrol
MonthPane
DateButton.
Iam firing an event EventDateClicked from DateButton class on OnMouseButtonUp().
I have subscribed for EventDateClicked of DateButton in Monthpane and has associated an event handler OnDateClick() in monthpane to handle the same. From within OnDateClick() I am firing EventDateClicked to its parent i.e CalendarControl
I have subscribed for EventDateClicked of MonthPane in CalendarControl and has associated an event handler OnDateClick() in calendarControl to handle the same. I receive the error "Exception: No event named 'Clicked' is defined for this EventSet" on execution of subscribeevent for this.
From the log I could make out that the events are getting fired from datebutton and monthpane. But the last subscription fails.
Pl find the code snippet below.
const utf8 DateButton::EventDateClicked[] = "Clicked";
void DateButton::addDateButtonEvents(void)
{
//events to be sent to parent
addEvent(EventDateClicked);
}
const utf8 MonthPane::EventDateClicked[] = "Clicked";
void MonthPane::addMonthPaneEvents(void)
{
addEvent(EventDateClicked);
}
void MonthPane::layoutDateButton(uint *lastDateButtonId, Point dateButtonPosition)
{
...
dateButton->subscribeEvent(DateButton::EventDateClicked,
Event::Subscriber(&MonthPane::onDateClick, this));
}
void CalendarControl::createMonthPaneInstance(Point positionOfMonthPane, uint * lastMonthPaneId)
{
...
monthPane->subscribeEvent(MonthPane::EventDateClicked,
Event::Subscriber(&CalendarControl::onDateClick, this));
}
Pl. let me know the exact problem, and how to resolve it
Looking forward towards your early help. My work is stuck up.
regards
krithiga
Calendarcontrol
MonthPane
DateButton.
Iam firing an event EventDateClicked from DateButton class on OnMouseButtonUp().
I have subscribed for EventDateClicked of DateButton in Monthpane and has associated an event handler OnDateClick() in monthpane to handle the same. From within OnDateClick() I am firing EventDateClicked to its parent i.e CalendarControl
I have subscribed for EventDateClicked of MonthPane in CalendarControl and has associated an event handler OnDateClick() in calendarControl to handle the same. I receive the error "Exception: No event named 'Clicked' is defined for this EventSet" on execution of subscribeevent for this.
From the log I could make out that the events are getting fired from datebutton and monthpane. But the last subscription fails.
Pl find the code snippet below.
const utf8 DateButton::EventDateClicked[] = "Clicked";
void DateButton::addDateButtonEvents(void)
{
//events to be sent to parent
addEvent(EventDateClicked);
}
const utf8 MonthPane::EventDateClicked[] = "Clicked";
void MonthPane::addMonthPaneEvents(void)
{
addEvent(EventDateClicked);
}
void MonthPane::layoutDateButton(uint *lastDateButtonId, Point dateButtonPosition)
{
...
dateButton->subscribeEvent(DateButton::EventDateClicked,
Event::Subscriber(&MonthPane::onDateClick, this));
}
void CalendarControl::createMonthPaneInstance(Point positionOfMonthPane, uint * lastMonthPaneId)
{
...
monthPane->subscribeEvent(MonthPane::EventDateClicked,
Event::Subscriber(&CalendarControl::onDateClick, this));
}
Pl. let me know the exact problem, and how to resolve it
Looking forward towards your early help. My work is stuck up.
regards
krithiga