+ wxLogMessage(wxT("System resumed from suspend."));
+ }
+#endif // wxHAS_POWER_EVENTS
+
+
+ void UpdatePowerSettings(wxPowerType powerType, wxBatteryState batteryState)
+ {
+ wxString powerStr;
+ switch ( m_powerType = powerType )
+ {
+ case wxPOWER_SOCKET:
+ powerStr = wxT("wall");
+ break;
+
+ case wxPOWER_BATTERY:
+ powerStr = wxT("battery");
+ break;
+
+ default:
+ wxFAIL_MSG(wxT("unknown wxPowerType value"));
+ // fall through
+
+ case wxPOWER_UNKNOWN:
+ powerStr = wxT("psychic");
+ break;
+ }
+
+ wxString batteryStr;
+ switch ( m_batteryState = batteryState )
+ {
+ case wxBATTERY_NORMAL_STATE:
+ batteryStr = wxT("charged");
+ break;
+
+ case wxBATTERY_LOW_STATE:
+ batteryStr = wxT("low");
+ break;
+
+ case wxBATTERY_CRITICAL_STATE:
+ batteryStr = wxT("critical");
+ break;
+
+ case wxBATTERY_SHUTDOWN_STATE:
+ batteryStr = wxT("empty");
+ break;
+
+ default:
+ wxFAIL_MSG(wxT("unknown wxBatteryState value"));
+ // fall through
+
+ case wxBATTERY_UNKNOWN_STATE:
+ batteryStr = wxT("unknown");
+ break;
+ }
+
+ SetStatusText(wxString::Format(
+ wxT("System is on %s power, battery state is %s"),
+ powerStr.c_str(),
+ batteryStr.c_str()));