Support enter key in some text boxes as button click that matches.

This commit is contained in:
Kevin Whitaker
2017-02-23 18:41:29 -05:00
parent f75419cfbd
commit f11f3de4e4
2 changed files with 2 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ LoginInterface::LoginInterface(WebInterface* app)
usernameField = new Wt::WLineEdit();
passwordField = new Wt::WLineEdit();
passwordField->setEchoMode(Wt::WLineEdit::EchoMode::Password);
passwordField->enterPressed().connect(this, &LoginInterface::loginCheck);
usernameArea->addWidget(new Wt::WText("Username:"));
usernameArea->addWidget(usernameField);
passwordArea->addWidget(new Wt::WText("Password:"));

View File

@@ -43,6 +43,7 @@ RequestInterface::RequestInterface(WebInterface* app)
searchBtn->setTextFormat(Wt::XHTMLText);
searchBtn->decorationStyle().font().setFamily(Wt::WFont::Default,"FontAwesome");
searchBtn->setText("");
searchBox->enterPressed().connect(this, &RequestInterface::searchClicked);
searchLayout->addWidget(searchBox);
searchLayout->addWidget(searchBtn);
searchBtn->clicked().connect(this, &RequestInterface::searchClicked);