Error using subscribeEvent()

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
krithigal
Not too shy to talk
Not too shy to talk
Posts: 40
Joined: Wed Jan 12, 2005 12:06

Error using subscribeEvent()

Postby krithigal » 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

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Error using subscribeEvent()

Postby CrazyEddie » Tue Feb 22, 2005 09:34

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.

Which means you are attempting to subscribe to an event that does not exist (that is, has not been added to the EventSet that you are making a subscription to).

You need to double-check the names of the event strings and that you are indeed adding them to the EventSet for which you are attempting the subscription.

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 5 guests