1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Name: wxCasFrame Class
///
/// Purpose: wxCas main frame
///
/// Author: ThePolish <thepolish@vipmail.ru>
///
/// Copyright (c) 2004-2011 ThePolish ( thepolish@vipmail.ru )
///
/// Derived from CAS by Pedro de Oliveira <falso@rdk.homeip.net>
///
/// Pixmaps from aMule http://www.amule.org
///
/// This program is free software; you can redistribute it and/or modify
/// it under the terms of the GNU General Public License as published by
/// the Free Software Foundation; either version 2 of the License, or
/// (at your option) any later version.
///
/// This program is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU General Public License for more details.
///
/// You should have received a copy of the GNU General Public License
/// along with this program; if not, write to the
/// Free Software Foundation, Inc.,
/// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _WXCASFRAME_H
#define _WXCASFRAME_H
#include <wx/bitmap.h>
#include <wx/button.h>
#include <wx/filename.h>
#include <wx/frame.h>
#include <wx/panel.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/statline.h>
#include <wx/stattext.h>
#include <wx/timer.h>
#include <wx/toolbar.h>
#include "onlinesig.h"
#ifdef __LINUX__ // System monitoring on Linux
#include "linuxmon.h"
#endif
/// Main wxCas Frame
class WxCasFrame: public wxFrame
{
private:
wxToolBar *m_toolbar;
wxBitmap m_toolBarBitmaps[ 6 ];
wxBoxSizer *m_frameVBox;
wxBoxSizer *m_mainPanelVBox;
wxPanel *m_mainPanel;
wxStaticLine *m_staticLine;
#ifdef __WINDOWS__
wxStaticLine *m_BottomStaticLine;
#endif
wxStaticBox *m_sigPanelSBox;
wxStaticBoxSizer *m_sigPanelSBoxSizer;
wxStaticBox *m_monPanelSBox;
wxStaticBoxSizer *m_monPanelSBoxSizer;
wxStaticBox *m_hitPanelSBox;
wxStaticBoxSizer *m_hitPanelSBoxSizer;
wxStaticBox *m_absHitPanelSBox;
wxStaticBoxSizer *m_absHitPanelSBoxSizer;
wxStaticText *m_statLine_1;
wxStaticText *m_statLine_2;
wxStaticText *m_statLine_3;
wxStaticText *m_statLine_4;
wxStaticText *m_statLine_5;
wxStaticText *m_statLine_6;
wxStaticText *m_statLine_7;
wxStaticText *m_absHitLine;
wxButton *m_absHitButton;
wxStaticText *m_hitLine;
wxButton *m_hitButton;
wxTimer * m_refresh_timer;
wxTimer * m_ftp_update_timer;
OnLineSig *m_aMuleSig;
unsigned int m_maxLineCount;
#ifdef __LINUX__ // System monitoring on Linux
wxStaticText *m_sysLine_1;
wxStaticText *m_sysLine_2;
LinuxMon *m_sysMonitor;
#endif
enum
{
ID_BAR_REFRESH = 1000,
ID_BAR_SAVE,
ID_BAR_PRINT,
ID_BAR_PREFS,
ID_BAR_ABOUT,
ID_REFRESH_TIMER,
ID_FTP_UPDATE_TIMER,
ID_HIT_BUTTON,
ID_ABS_HIT_BUTTON
};
// Get maximum of 2 uint
unsigned int GetMaxUInt( const unsigned int a, const unsigned int b )
{
return ( ( a ) > ( b ) ? ( a ) : ( b ) );
}
// Constructing Stat_lines
wxString MakeStatLine_1() const;
wxString MakeStatLine_2() const;
wxString MakeStatLine_3() const;
wxString MakeStatLine_4() const;
wxString MakeStatLine_5() const;
wxString MakeStatLine_6() const;
wxString MakeStatLine_7() const;
// Constructing Hits_lines
wxString MakeHitsLine_1() const;
wxString MakeHitsLine_2() const;
#ifdef __LINUX__ // System monitoring on Linux
// Constructing Sys_lines
wxString MakeSysLine_1() const;
wxString MakeSysLine_2() const;
#endif
protected:
bool UpdateStatsPanel ();
void UpdateAll ( bool forceFitting = FALSE );
void SaveAbsoluteHits();
void OnBarRefresh ( wxCommandEvent & event );
void OnBarAbout ( wxCommandEvent & event );
void OnBarSave ( wxCommandEvent & event );
void OnBarPrint ( wxCommandEvent & event );
void OnBarPrefs ( wxCommandEvent & event );
void OnRefreshTimer ( wxTimerEvent & event );
void OnFtpUpdateTimer ( wxTimerEvent & event );
void OnHitButton ( wxCommandEvent & event );
void OnAbsHitButton ( wxCommandEvent & event );
DECLARE_EVENT_TABLE ()
public:
/// Constructor
WxCasFrame ( const wxString& title );<--- Class 'WxCasFrame' has a constructor with 1 argument that is not explicit. [+]Class 'WxCasFrame' has a constructor with 1 argument that is not explicit. Such, so called "Converting constructors", should in general be explicit for type safety reasons as that prevents unintended implicit conversions.
/// Destructor
~WxCasFrame ();
/// Get Online statistics image
wxImage *GetStatImage () const;
/// Refresh timer period changing
bool ChangeRefreshPeriod( const int newPeriod );
/// Refresh timer period changing
bool ChangeFtpUpdatePeriod( const int newPeriod );
/// Set amulesig.dat file
void SetAmuleSigFile( const wxFileName& file );
};
#endif /* _WXCASFRAME_H */
// File_checked_for_headers
|