1715{
1716 SetBackgroundColour(*wxWHITE);
1717
1718 wxBoxSizer* main_sizer = new wxBoxSizer(wxVERTICAL);
1719
1720 close_img = ScalableBitmap(
this,
"hum_popup_close", 24);
1721
1724
1727
1728
1729 m_staticText_note =
new Label(
this,
_L(
"Please change the desiccant when it is too wet. The indicator may not represent accurately in following cases: when the lid is open or the desiccant pack is changed. It takes a few hours to absorb the moisture, and low temperatures also slow down the process."));
1733
1734
1735 Bind(wxEVT_LEFT_UP, [this](auto& e) {
1736
1737 auto rect = ClientToScreen(wxPoint(0, 0));
1738
1739 auto close_left = rect.x + GetSize().x -
close_img.GetBmpWidth() - FromDIP(38);
1740 auto close_right = close_left +
close_img.GetBmpWidth();
1741 auto close_top = rect.y + FromDIP(24);
1742 auto close_bottom = close_top +
close_img.GetBmpHeight();
1743
1744 auto mouse_pos = ClientToScreen(e.GetPosition());
1745 if (mouse_pos.x > close_left
1746 && mouse_pos.y > close_top
1747 && mouse_pos.x < close_right
1748 && mouse_pos.y < close_bottom
1749 )
1750 {
1751 Dismiss();
1752 }
1753 });
1754
1755 main_sizer->Add(0, 0, 0, wxTOP, FromDIP(24));
1757 main_sizer->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(28));
1758 main_sizer->Add(
curr_humidity_img, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, FromDIP(35));
1759 main_sizer->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(15));
1761 main_sizer->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(6));
1763 main_sizer->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(5));
1764 main_sizer->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(25));
1765 SetSizer(main_sizer);
1766 Layout();
1767 Fit();
1768
1770 wxGetApp().UpdateDarkUIWin(this);
1771}
#define _L(s)
Definition OBJ.cpp:34
static wxFont Head_24
Definition Label.hpp:40
wxBitmap create_scaled_bitmap(const std::string &bmp_name_in, wxWindow *win, const int px_cnt, const bool grayscale, const std::string &new_color, const bool menu_bitmap, const bool resize, const bool bitmap2, const std::vector< std::string > &array_new_color)
Definition wxExtensions.cpp:448