More window cleaning
This commit is contained in:
parent
6adc441e6f
commit
53c98a227d
29 changed files with 422 additions and 261 deletions
|
@ -18,17 +18,17 @@ TextEditorController* TextEditorView::GetController()
|
|||
void TextEditorView::Initialize()
|
||||
{
|
||||
auto label = Label::Create();
|
||||
label->SetLabel("Text Editor");
|
||||
label->SetBackgroundColor(Color::Create(181, 189, 200));
|
||||
label->SetMargin(1);
|
||||
label->setLabel("Text Editor");
|
||||
label->setBackgroundColor(Color::Create(181, 189, 200));
|
||||
label->setMargin(1);
|
||||
|
||||
auto textBox = TextBox::Create();
|
||||
mTextBox = textBox.get();
|
||||
|
||||
auto saveButton = Button::Create();
|
||||
saveButton->SetLabel("Save");
|
||||
saveButton->SetBackgroundColor(Color::Create(200, 200, 200));
|
||||
saveButton->SetMargin(2);
|
||||
saveButton->setLabel("Save");
|
||||
saveButton->setBackgroundColor(Color::Create(200, 200, 200));
|
||||
saveButton->setMargin(2);
|
||||
auto onSave = [this](Widget* self){
|
||||
if(this && mController && mTextBox)
|
||||
{
|
||||
|
@ -36,12 +36,12 @@ void TextEditorView::Initialize()
|
|||
mController->OnSave();
|
||||
};
|
||||
};
|
||||
saveButton->SetOnClickFunction(onSave);
|
||||
saveButton->setOnClickFunction(onSave);
|
||||
|
||||
auto clearButton = Button::Create();
|
||||
clearButton->SetLabel("Clear");
|
||||
clearButton->SetBackgroundColor(Color::Create(200, 200, 200));
|
||||
clearButton->SetMargin(2);
|
||||
clearButton->setLabel("Clear");
|
||||
clearButton->setBackgroundColor(Color::Create(200, 200, 200));
|
||||
clearButton->setMargin(2);
|
||||
auto onClear = [this](Widget* self){
|
||||
if(this && mController && mTextBox)
|
||||
{
|
||||
|
@ -49,12 +49,12 @@ void TextEditorView::Initialize()
|
|||
mTextBox->SetContent("");
|
||||
};
|
||||
};
|
||||
clearButton->SetOnClickFunction(onClear);
|
||||
clearButton->setOnClickFunction(onClear);
|
||||
|
||||
auto loadButton = Button::Create();
|
||||
loadButton->SetLabel("Load");
|
||||
loadButton->SetBackgroundColor(Color::Create(200, 200, 200));
|
||||
loadButton->SetMargin(2);
|
||||
loadButton->setLabel("Load");
|
||||
loadButton->setBackgroundColor(Color::Create(200, 200, 200));
|
||||
loadButton->setMargin(2);
|
||||
auto onLoad = [this](Widget* self){
|
||||
if(this && mController && mTextBox)
|
||||
{
|
||||
|
@ -62,7 +62,7 @@ void TextEditorView::Initialize()
|
|||
mTextBox->SetContent(mController->GetContent());
|
||||
};
|
||||
};
|
||||
loadButton->SetOnClickFunction(onLoad);
|
||||
loadButton->setOnClickFunction(onLoad);
|
||||
|
||||
auto buttonSpacer = VerticalSpacer::Create();
|
||||
buttonSpacer->AddWidgetWithScale(std::move(saveButton), 1);
|
||||
|
@ -70,11 +70,11 @@ void TextEditorView::Initialize()
|
|||
buttonSpacer->AddWidgetWithScale(std::move(loadButton), 1);
|
||||
|
||||
auto hSpacer = HorizontalSpacer::Create();
|
||||
hSpacer->AddWidgetWithScale(std::move(label), 1);
|
||||
hSpacer->AddWidgetWithScale(std::move(textBox), 14);
|
||||
hSpacer->AddWidgetWithScale(std::move(buttonSpacer), 1);
|
||||
hSpacer->addWidgetWithScale(std::move(label), 1);
|
||||
hSpacer->addWidgetWithScale(std::move(textBox), 14);
|
||||
hSpacer->addWidgetWithScale(std::move(buttonSpacer), 1);
|
||||
|
||||
AddWidget(std::move(hSpacer));
|
||||
addWidget(std::move(hSpacer));
|
||||
}
|
||||
|
||||
std::unique_ptr<TextEditorView> TextEditorView::Create()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue