Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Plain Text by sadsdsd ( 13 years ago )
#include "MainWindow.h"

#include <nana\gui\widgets\button.hpp>

#define CTRL_CAST(ctrl,ty) reinterpret_cast<ty*>(this->m_mapControl[ctrl].get())

using namespace nana::gui;

MainWindow::MainWindow(void) : form(API::make_center(150,150),appearance(true,true,true,true,false,false,false))
{
 this->m_mapControl[MAIN_CONTROL::TESTBTN].reset(new button(this->handle(),nana::rectangle(5,5,140,25)));
 auto btn = CTRL_CAST(MAIN_CONTROL::TESTBTN,button);
 btn->caption(STR("Test Button"));
 btn->make_event<events::click>(std::bind(&MainWindow;::TestClick,this));
}


MainWindow::~MainWindow(void)
{
}

void MainWindow::TestClick()
{
 this->caption(STR("Clicked this Window"));
}

 

Revise this Paste

Your Name: Code Language: