diff options
author | crupest <crupest@outlook.com> | 2019-04-04 23:08:22 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-04-04 23:08:22 +0800 |
commit | 6268f3ca09afef812cf288f323cacff22fbfcffc (patch) | |
tree | 86e89d3b4212ae069075f799a5278c120e258e73 /src/main.cpp | |
parent | dbda5a8e4f0d59ad95be8fc3ee7b21e9122cc474 (diff) | |
download | cru-6268f3ca09afef812cf288f323cacff22fbfcffc.tar.gz cru-6268f3ca09afef812cf288f323cacff22fbfcffc.tar.bz2 cru-6268f3ca09afef812cf288f323cacff22fbfcffc.zip |
Finish refactor!!!
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/main.cpp b/src/main.cpp index c35213f7..c0c90002 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,28 +1,27 @@ -#include "pre.hpp" - -#include "application.hpp" -#include "ui/controls/button.hpp" -#include "ui/controls/flex_layout.hpp" -#include "ui/controls/text_block.hpp" -#include "ui/window.hpp" - -using cru::Application; -using cru::String; -using cru::StringView; +#include "cru/platform/native_window.hpp" +#include "cru/platform/ui_applicaition.hpp" +#include "cru/ui/controls/button.hpp" +#include "cru/ui/controls/flex_layout.hpp" +#include "cru/ui/controls/text_block.hpp" +#include "cru/ui/window.hpp" + +using cru::platform::UiApplication; using cru::ui::Rect; using cru::ui::Thickness; using cru::ui::Window; using cru::ui::controls::Button; using cru::ui::controls::FlexLayout; using cru::ui::controls::TextBlock; - +/* int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) { #ifdef CRU_DEBUG _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif +*/ - Application application(hInstance); +int main() { + auto application = UiApplication::GetInstance(); const auto window = Window::CreateOverlapped(); @@ -40,7 +39,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, text_block2->SetText(L"Hello World!"); flex_layout->AddChild(text_block2, 1); - window->Show(); + window->GetNativeWindow()->SetVisible(true); - return application.Run(); + return application->Run(); } |