Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
CalDAV: WIP CalDAV support
[xestiacalendar/.git] / source / forms / main / frmMain-Setup.cpp
1 // frmMain.h - frmMain setup functions
2 //
3 // (c) 2016-2017 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar.
6 //
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.
10 //
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.
15 //
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/>
19 #include "frmMain.h"
21 void frmMain::SetupFormIcons()
22 {
23         // SSL icons.
24     
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));
28     
29         wxImage icons_ssl_png(sslstream, wxBITMAP_TYPE_PNG);
30         imgSSL = new wxBitmap(icons_ssl_png, -1);
31     
32         wxImage icons_sslwarning_png(sslwarningstream, wxBITMAP_TYPE_PNG);
33         imgSSLWarning = new wxBitmap(icons_sslwarning_png, -1);
34     
35         wxImage icons_nossl_png(nosslstream, wxBITMAP_TYPE_PNG);
36         imgNoSSL = new wxBitmap(icons_nossl_png, -1);
37         
38         // Activity Icon.
39     
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));
45     
46         wxImage icons_actsleep_png(actsleep, wxBITMAP_TYPE_PNG);
47         imgActIconSleep = new wxBitmap (icons_actsleep_png, -1);
48     
49         wxImage icons_act1_png(act1, wxBITMAP_TYPE_PNG);
50         imgActIcon1 = new wxBitmap (icons_act1_png, -1);
51         wxIcon wxIAct1icon;
52         wxIAct1icon.CopyFromBitmap(*imgActIcon1);
53     
54         wxImage icons_act2_png(act2, wxBITMAP_TYPE_PNG);
55         imgActIcon2 = new wxBitmap (icons_act2_png, -1);
56         wxIcon wxIAct2icon;
57         wxIAct2icon.CopyFromBitmap(*imgActIcon2);
58     
59         wxImage icons_act3_png(act3, wxBITMAP_TYPE_PNG);
60         imgActIcon3 = new wxBitmap (icons_act3_png, -1);
61         wxIcon wxIAct3icon;
62         wxIAct3icon.CopyFromBitmap(*imgActIcon3);
63     
64         wxImage icons_act4_png(act4, wxBITMAP_TYPE_PNG);
65         imgActIcon4 = new wxBitmap (icons_act4_png, -1);
66         wxIcon wxIAct4icon;
67         wxIAct4icon.CopyFromBitmap(*imgActIcon4);
68     
69         // Online/Offline icons.
70     
71         wxMemoryInputStream onlinestream(icons_online_png, sizeof(icons_online_png));
72         wxMemoryInputStream offlinestream(icons_offline_png, sizeof(icons_offline_png));
73     
74         wxImage icons_online_png(onlinestream, wxBITMAP_TYPE_PNG);
75         imgOnline = new wxBitmap(icons_online_png, -1);
76     
77         wxImage icons_offline_png(offlinestream, wxBITMAP_TYPE_PNG);
78         imgOffline = new wxBitmap(icons_offline_png, -1);
79 }
81 void frmMain::SetupStatusBar()
82 {
83 #if defined(__HAIKU__)
84     
85 #elif defined(__WIN32__)
86     
87         int stbBottomData [3] = { -1, 8, 8 };
88     
89 #else
90     
91         int stbBottomData [3] = { -1, 20, 20 };
92     
93 #endif
94     
95         stbBottom->SetFieldsCount(3, stbBottomData);
96         stbBottom->SetMinHeight(16);
97         
98         wxRect rectOnline;
99         wxRect rectSSL;
100         wxRect rectActivity;
101         stbBottom->GetFieldRect(1, rectOnline);
102         stbBottom->GetFieldRect(2, rectActivity);
103         
104         sslToolTip = new wxToolTip(wxT(""));
105     
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;
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy