aboutsummaryrefslogtreecommitdiff
path: root/CruUI-Generate/cru_ui.cpp
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2018-11-19 23:56:00 +0800
committerGitHub <noreply@github.com>2018-11-19 23:56:00 +0800
commit30333294fcd5917a9f3572f0c4c6dfc2ec429a3c (patch)
tree7d5d91ba4a0d979ceefea05bbe99efc47a9bf6a3 /CruUI-Generate/cru_ui.cpp
parent3edc249f48b4d7e692c782c1ca4809e07fa0726f (diff)
parent5291b587708b7f1b9be9187aa4df99ea2cfe0538 (diff)
downloadcru-30333294fcd5917a9f3572f0c4c6dfc2ec429a3c.tar.gz
cru-30333294fcd5917a9f3572f0c4c6dfc2ec429a3c.tar.bz2
cru-30333294fcd5917a9f3572f0c4c6dfc2ec429a3c.zip
Merge pull request #23 from crupest/20-framelayout
Add FrameLayout.
Diffstat (limited to 'CruUI-Generate/cru_ui.cpp')
-rw-r--r--CruUI-Generate/cru_ui.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/CruUI-Generate/cru_ui.cpp b/CruUI-Generate/cru_ui.cpp
index 3436f3f4..497af786 100644
--- a/CruUI-Generate/cru_ui.cpp
+++ b/CruUI-Generate/cru_ui.cpp
@@ -283,6 +283,7 @@ using cru::ui::controls::ToggleButton;
using cru::ui::controls::Button;
using cru::ui::controls::TextBox;
using cru::ui::controls::ListItem;
+using cru::ui::controls::FrameLayout;
int APIENTRY wWinMain(
HINSTANCE hInstance,
@@ -363,6 +364,8 @@ int APIENTRY wWinMain(
inner_layout->AddChild(TextBlock::Create(L"Toggle debug border"));
+ const auto l = FrameLayout::Create();
+ l->GetLayoutParams()->padding.SetLeftRight(20.0f);
const auto toggle_button = ToggleButton::Create();
#ifdef CRU_DEBUG_LAYOUT
toggle_button->toggle_event.AddHandler([&window](cru::ui::events::ToggleEventArgs& args)
@@ -370,7 +373,8 @@ int APIENTRY wWinMain(
window->SetDebugLayout(args.GetNewState());
});
#endif
- inner_layout->AddChild(toggle_button);
+ l->AddChild(toggle_button);
+ inner_layout->AddChild(l);
layout->AddChild(inner_layout);
}
@@ -3083,6 +3087,27 @@ namespace cru::ui::controls
//-------end of file: src\ui\controls\button.cpp
//--------------------------------------------------------
//--------------------------------------------------------
+//-------begin of file: src\ui\controls\frame_layout.cpp
+//--------------------------------------------------------
+
+namespace cru::ui::controls
+{
+ FrameLayout::FrameLayout() : Control(true)
+ {
+
+ }
+
+ FrameLayout::~FrameLayout() = default;
+
+ StringView FrameLayout::GetControlType() const
+ {
+ return control_type;
+ }
+}
+//--------------------------------------------------------
+//-------end of file: src\ui\controls\frame_layout.cpp
+//--------------------------------------------------------
+//--------------------------------------------------------
//-------begin of file: src\ui\controls\linear_layout.cpp
//--------------------------------------------------------