-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
65 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,30 @@ | ||
#include <Windows.h> | ||
#include <memory> | ||
#include <RRS/App.h> | ||
#include <RRS/CommonType.h> | ||
#include <RRS/Window.h> | ||
#include <RRS/Button.h> | ||
#include <functional> | ||
|
||
using namespace RRS; | ||
int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPTSTR lpCmdLine, _In_ int nCmdShow) | ||
{ | ||
App::Init(hInstance); | ||
std::wstring hello = L"Hello ÊÀ½ç£¡"; | ||
auto win = std::make_unique<Window>(); | ||
win->Title = L"Hello World"; | ||
win->SetTitle(hello); | ||
win->SetFlexDirection(FlexDirection::Column); | ||
win->SetJustifyContent(JustifyContent::Center); | ||
win->AddEventListener(EventType::Loaded, [&win](EventListener* arg) { | ||
auto btn = std::make_shared<Button>(); | ||
win->AddEventListener(EventType::Loaded, [&win,&hello](EventListener* arg) { | ||
auto btn = std::make_shared<Button>(hello); | ||
btn->SetAlignSelf(LayoutAlign::Center); | ||
btn->AddEventListener(EventType::Click, [&win,&hello](EventListener* arg) { | ||
MessageBox(win->Hwnd, hello.c_str(), L"ϵͳÌáʾ", MB_ICONWARNING | MB_OK | MB_DEFBUTTON1); | ||
}); | ||
win->AddChildElement(btn); | ||
win->Show(); | ||
}); | ||
win->AddEventListener(EventType::WindowClosed, [](EventListener* arg) { | ||
App::Quit(); | ||
}); | ||
win->Load(); | ||
|
||
//If you want to implement your own window class to gain more control, read the following code. | ||
//auto win = std::make_unique<WindowHelloWorld>(); | ||
//win->Load(); | ||
|
||
return App::Exec(); | ||
} |