Forum

1 reply [Last post]
mroux
User offline. Last seen 26 weeks 1 day ago. Offline
userbadge
Joined: 2010-02-23
Points: 0

Hello,

I want to developping application with Airplay studio UI builder, I follwing instruction to create calcultor sample. But I try to figure how i can program event when I clik button.

Question his,

When user interface is created where I put code to handling event.

I have visual studio 2005 and 2008 on my PC

Work under XP and Vista.

Regards

Michel,

PS. Sorry for my english. :)

Steven J
User offline. Last seen 8 hours 23 min ago. Offline
moderatorbadge
Joined: 2009-10-25
Points: 1370

Hi Michel,

There are various options as to to where you can place event handling code. In the case of the calculator tutorial, it is intended you use the same arrangement as the IwUICalculator example.

Try adding the following to you project:

class CController
{
public:
CController()
{
IW_UI_CREATE_VIEW_SLOT1(this, "CController", CController,
OnClickButton_mc, CIwUIElement*)
}

~CController()
{
IW_UI_DESTROY_VIEW_SLOTS(this)
}

private:
void OnClickButton_mc(CIwUIElement*)
{
IwAssertMsg(UI, false, ("Replace with button handling"));
}
};

Then, in your startup code, create a CController object at startup:

new CIwUIView;
new CIwUIController;
// Register button handlers
new CController;

Cheers,
Steven