Add missing "F"

This commit is contained in:
sum2012 2014-06-02 16:40:37 +08:00
parent 93827b383d
commit c9219e1d0c
2 changed files with 19 additions and 7 deletions

View File

@ -838,12 +838,13 @@ void MacAddressScreen::CreateViews() {
leftColumn->Add(new ItemHeader(s->T("Mac address:")));
leftColumn->Add(new Choice(tempMacAddress));
LinearLayout *A_E_Column = new LinearLayout(ORIENT_HORIZONTAL, new AnchorLayoutParams(0, 480, 10, 300, NONE, 150));
A_E_Column->Add(new Button("A"))->OnClick.Handle(this, &MacAddressScreen::OnAClick);
A_E_Column->Add(new Button("B"))->OnClick.Handle(this, &MacAddressScreen::OnBClick);
A_E_Column->Add(new Button("C"))->OnClick.Handle(this, &MacAddressScreen::OnCClick);
A_E_Column->Add(new Button("D"))->OnClick.Handle(this, &MacAddressScreen::OnDClick);
A_E_Column->Add(new Button("E"))->OnClick.Handle(this, &MacAddressScreen::OnEClick);
LinearLayout *A_F_Column = new LinearLayout(ORIENT_HORIZONTAL, new AnchorLayoutParams(0, 480, 10, 300, NONE, 150));
A_F_Column->Add(new Button("A"))->OnClick.Handle(this, &MacAddressScreen::OnAClick);
A_F_Column->Add(new Button("B"))->OnClick.Handle(this, &MacAddressScreen::OnBClick);
A_F_Column->Add(new Button("C"))->OnClick.Handle(this, &MacAddressScreen::OnCClick);
A_F_Column->Add(new Button("D"))->OnClick.Handle(this, &MacAddressScreen::OnDClick);
A_F_Column->Add(new Button("E"))->OnClick.Handle(this, &MacAddressScreen::OnEClick);
A_F_Column->Add(new Button("F"))->OnClick.Handle(this, &MacAddressScreen::OnFClick);
LinearLayout *rightColumn = new LinearLayout(ORIENT_HORIZONTAL, new AnchorLayoutParams(0, 120, 10, NONE, NONE, 10));
rightColumn->Add(new Button("0"))->OnClick.Handle(this, &MacAddressScreen::On0Click);
rightColumn->Add(new Button("1"))->OnClick.Handle(this, &MacAddressScreen::On1Click);
@ -860,7 +861,7 @@ void MacAddressScreen::CreateViews() {
rightColumn->Add(new Button(d->T("OK")))->OnClick.Handle(this, &MacAddressScreen::OnOKClick);
rightColumn->Add(new Button(d->T("Cancel")))->OnClick.Handle(this, &MacAddressScreen::OnCancelClick);
root_->Add(leftColumn);
root_->Add(A_E_Column);
root_->Add(A_F_Column);
root_->Add(rightColumn);
}
@ -924,6 +925,16 @@ UI::EventReturn MacAddressScreen::OnEClick(UI::EventParams &e) {
return UI::EVENT_DONE;
}
UI::EventReturn MacAddressScreen::OnFClick(UI::EventParams &e) {
if (tempMacAddress.length() < 17) {
tempMacAddress.append("F");
if (tempMacAddress.length() > 1 && tempMacAddress.length() < 17 && tempMacAddress.at(tempMacAddress.length() - 2) != ':')
tempMacAddress.append(":");
}
CreateViews();
return UI::EVENT_DONE;
}
UI::EventReturn MacAddressScreen::On1Click(UI::EventParams &e) {
if (tempMacAddress.length() < 17) {
tempMacAddress.append("1");

View File

@ -146,6 +146,7 @@ private:
UI::EventReturn OnCClick(UI::EventParams &e);
UI::EventReturn OnDClick(UI::EventParams &e);
UI::EventReturn OnEClick(UI::EventParams &e);
UI::EventReturn OnFClick(UI::EventParams &e);
UI::EventReturn On0Click(UI::EventParams &e);
UI::EventReturn On1Click(UI::EventParams &e);
UI::EventReturn On2Click(UI::EventParams &e);