Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MaximInterface
Diff: WifiConnectWindow.cpp
- Revision:
- 8:a0d75dff3c9b
- Parent:
- 7:66c5dedc750b
- Child:
- 13:6a6225690c2e
--- a/WifiConnectWindow.cpp Thu Mar 09 11:38:33 2017 -0600
+++ b/WifiConnectWindow.cpp Thu Apr 06 15:16:30 2017 -0500
@@ -45,17 +45,21 @@
static const char serverAddress[] = "www.maxim-security.com";
static const uint16_t serverPort = 3900;
-WifiConnectWindow::WifiConnectWindow(Graphic * parent) : Window(parent), m_state(NotStarted),
- m_description("WiFi SSID: " + std::string(wifiSsid) + "\nWiFi Password: " + std::string(wifiPassword), this),
- m_backButton("Back", this), m_continueButton("Connect to WiFi", this)
+WifiConnectWindow::WifiConnectWindow() : m_state(NotStarted)
{
+ m_description.setParent(this);
+ m_description.setText("WiFi SSID: " + std::string(wifiSsid) + "\nWiFi Password: " + std::string(wifiPassword));
m_description.setWordWrap(true);
+ m_backButton.setParent(this);
+ m_backButton.setText("Back");
m_backButton.setClickedHandler(Button::EventHandler(this, &WifiConnectWindow::backButtonClicked));
+ m_continueButton.setParent(this);
+ m_continueButton.setText("Connect to WiFi");
m_continueButton.setClickedHandler(Button::EventHandler(this, &WifiConnectWindow::continueButtonClicked));
m_continueButton.setFocused();
}
-void WifiConnectWindow::doPostLayout()
+void WifiConnectWindow::updated()
{
switch (m_state)
{
@@ -132,14 +136,13 @@
}
}
-void WifiConnectWindow::doLayout()
+void WifiConnectWindow::resized()
{
- m_backButton.setX(0);
- m_backButton.setY(height() - m_backButton.height());
- m_continueButton.setX(width() - m_continueButton.width());
- m_continueButton.setY(height() - m_continueButton.height());
- m_description.setWidth(width());
- m_description.setHeight(std::min(m_backButton.y(), m_continueButton.y()));
+ m_backButton.resize(m_backButton.preferredWidth(), m_backButton.preferredHeight());
+ m_backButton.move(0, height() - m_backButton.height());
+ m_continueButton.resize(m_continueButton.preferredWidth(), m_continueButton.preferredHeight());
+ m_continueButton.move(width() - m_continueButton.width(), height() - m_continueButton.height());
+ m_description.resize(width(), std::min(m_backButton.y(), m_continueButton.y()));
}
bool WifiConnectWindow::doProcessKey(Key key)