Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main.cpp
- #include "SF.h"
- #include "MainInterface.h"
- LRESULT CALLBACK MainWndProc(
- HWND hwnd, // handle to window
- UINT uMsg, // message identifier
- WPARAM wParam, // first message parameter
- LPARAM lParam); // second message parameter
- using namespace SF::GUI;
- int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
- LPSTR lpszCmdLine, int nCmdShow)
- {
- EventHandler::PWindow mywindow(SF::Core::EnvFactory::createWindow());
- mywindow->Show();
- std::shared_ptr<PushButton> button = mywindow->createPushButton(L"Testbutton!");
- button->Show();
- MainInterface itf;
- MainInterface::pCallback cback(new MainInterface::callback(itf, &MainInterface::test));
- button->OnClickHandler(cback);
- return EventHandler::runLoop();
- }
- MainInterface.h:
- #ifndef MAIN_INTERFACE_H
- #define MAIN_INTERFACE_H
- #include "BaseInclude.h"
- #include "Event.h"
- using namespace SF::GUI;
- using namespace SF::Core;
- class MainInterface: public UserInterface{
- public:
- typedef Delegate<MainInterface, bool, SF::GUI::Event> callback;
- typedef std::shared_ptr<MainInterface::callback> pCallback;
- bool test(Event evt){
- std::shared_ptr<MsgBox> meineBox = EnvFactory::createMsgBox(std::wstring(L"Es funktioniert!!!"));
- return true;
- }
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement