1 // frmMain.h - frmMain setup functions
3 // (c) 2016-2017 Xestia Software Development.
5 // This file is part of Xestia Calendar.
7 // Xestia Calendar is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Calendar is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
21 void frmMain::SetupFormIcons()
25 wxMemoryInputStream sslstream(icons_ssl_png, sizeof(icons_ssl_png));
26 wxMemoryInputStream sslwarningstream(icons_sslwarning_png, sizeof(icons_sslwarning_png));
27 wxMemoryInputStream nosslstream(icons_nossl_png, sizeof(icons_nossl_png));
29 wxImage icons_ssl_png(sslstream, wxBITMAP_TYPE_PNG);
30 imgSSL = new wxBitmap(icons_ssl_png, -1);
32 wxImage icons_sslwarning_png(sslwarningstream, wxBITMAP_TYPE_PNG);
33 imgSSLWarning = new wxBitmap(icons_sslwarning_png, -1);
35 wxImage icons_nossl_png(nosslstream, wxBITMAP_TYPE_PNG);
36 imgNoSSL = new wxBitmap(icons_nossl_png, -1);
40 wxMemoryInputStream act1(icons_act1_png, sizeof(icons_act1_png));
41 wxMemoryInputStream act2(icons_act2_png, sizeof(icons_act2_png));
42 wxMemoryInputStream act3(icons_act3_png, sizeof(icons_act3_png));
43 wxMemoryInputStream act4(icons_act4_png, sizeof(icons_act4_png));
44 wxMemoryInputStream actsleep(icons_actsleep_png, sizeof(icons_actsleep_png));
46 wxImage icons_actsleep_png(actsleep, wxBITMAP_TYPE_PNG);
47 imgActIconSleep = new wxBitmap (icons_actsleep_png, -1);
49 wxImage icons_act1_png(act1, wxBITMAP_TYPE_PNG);
50 imgActIcon1 = new wxBitmap (icons_act1_png, -1);
52 wxIAct1icon.CopyFromBitmap(*imgActIcon1);
54 wxImage icons_act2_png(act2, wxBITMAP_TYPE_PNG);
55 imgActIcon2 = new wxBitmap (icons_act2_png, -1);
57 wxIAct2icon.CopyFromBitmap(*imgActIcon2);
59 wxImage icons_act3_png(act3, wxBITMAP_TYPE_PNG);
60 imgActIcon3 = new wxBitmap (icons_act3_png, -1);
62 wxIAct3icon.CopyFromBitmap(*imgActIcon3);
64 wxImage icons_act4_png(act4, wxBITMAP_TYPE_PNG);
65 imgActIcon4 = new wxBitmap (icons_act4_png, -1);
67 wxIAct4icon.CopyFromBitmap(*imgActIcon4);
69 // Online/Offline icons.
71 wxMemoryInputStream onlinestream(icons_online_png, sizeof(icons_online_png));
72 wxMemoryInputStream offlinestream(icons_offline_png, sizeof(icons_offline_png));
74 wxImage icons_online_png(onlinestream, wxBITMAP_TYPE_PNG);
75 imgOnline = new wxBitmap(icons_online_png, -1);
77 wxImage icons_offline_png(offlinestream, wxBITMAP_TYPE_PNG);
78 imgOffline = new wxBitmap(icons_offline_png, -1);
81 void frmMain::SetupStatusBar()
83 #if defined(__HAIKU__)
85 #elif defined(__WIN32__)
87 int stbBottomData [3] = { -1, 8, 8 };
91 int stbBottomData [3] = { -1, 20, 20 };
95 stbBottom->SetFieldsCount(3, stbBottomData);
96 stbBottom->SetMinHeight(16);
101 stbBottom->GetFieldRect(1, rectOnline);
102 stbBottom->GetFieldRect(2, rectActivity);
104 sslToolTip = new wxToolTip(wxT(""));
106 imgConnStatus = new wxStaticBitmap(stbBottom, wxID_ANY, wxNullBitmap, wxPoint((rectOnline.GetX()),(rectOnline.GetY())), wxDefaultSize, 0 );
107 imgConnStatus->SetBitmap(*imgOnline);
108 // TODO: imgConnStatus->Connect( wxEVT_LEFT_DCLICK, wxCommandEventHandler( frmMain::ToggleConnectionStatus ), NULL, this );
110 imgActivityStatus = new wxStaticBitmap(stbBottom, wxID_ANY, wxNullBitmap, wxPoint((rectActivity.GetX()),(rectActivity.GetY())), wxDefaultSize, 0);
111 imgActivityStatus->SetBitmap(*imgActIconSleep);
112 // TODO: imgActivityStatus->Connect( wxEVT_LEFT_DCLICK, wxCommandEventHandler( frmMain::ShowActivityWindow ), NULL, this );
115 void frmMain::SetupPointers(frmActivityMgr *activityManager)
117 this->activityManager = activityManager;