1 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 /// Name: wxCasFrame Class
4 /// Purpose: wxCas main frame
6 /// Author: ThePolish <thepolish@vipmail.ru>
8 /// Copyright (c) 2004-2011 ThePolish ( thepolish@vipmail.ru )
10 /// Derived from CAS by Pedro de Oliveira <falso@rdk.homeip.net>
12 /// Pixmaps from aMule http://www.amule.org
14 /// This program is free software; you can redistribute it and/or modify
15 /// it under the terms of the GNU General Public License as published by
16 /// the Free Software Foundation; either version 2 of the License, or
17 /// (at your option) any later version.
19 /// This program is distributed in the hope that it will be useful,
20 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
21 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 /// GNU General Public License for more details.
24 /// You should have received a copy of the GNU General Public License
25 /// along with this program; if not, write to the
26 /// Free Software Foundation, Inc.,
27 /// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
34 #include <wx/bitmap.h>
35 #include <wx/button.h>
36 #include <wx/filename.h>
40 #include <wx/statbox.h>
41 #include <wx/statline.h>
42 #include <wx/stattext.h>
44 #include <wx/toolbar.h>
47 #include "onlinesig.h"
49 #ifdef __LINUX__ // System monitoring on Linux
54 class WxCasFrame
: public wxFrame
58 wxBitmap m_toolBarBitmaps
[ 6 ];
60 wxBoxSizer
*m_frameVBox
;
61 wxBoxSizer
*m_mainPanelVBox
;
65 wxStaticLine
*m_staticLine
;
68 wxStaticLine
*m_BottomStaticLine
;
71 wxStaticBox
*m_sigPanelSBox
;
72 wxStaticBoxSizer
*m_sigPanelSBoxSizer
;
74 wxStaticBox
*m_monPanelSBox
;
75 wxStaticBoxSizer
*m_monPanelSBoxSizer
;
77 wxStaticBox
*m_hitPanelSBox
;
78 wxStaticBoxSizer
*m_hitPanelSBoxSizer
;
80 wxStaticBox
*m_absHitPanelSBox
;
81 wxStaticBoxSizer
*m_absHitPanelSBoxSizer
;
83 wxStaticText
*m_statLine_1
;
84 wxStaticText
*m_statLine_2
;
85 wxStaticText
*m_statLine_3
;
86 wxStaticText
*m_statLine_4
;
87 wxStaticText
*m_statLine_5
;
88 wxStaticText
*m_statLine_6
;
89 wxStaticText
*m_statLine_7
;
91 wxStaticText
*m_absHitLine
;
92 wxButton
*m_absHitButton
;
94 wxStaticText
*m_hitLine
;
95 wxButton
*m_hitButton
;
98 wxTimer
* m_refresh_timer
;
99 wxTimer
* m_ftp_update_timer
;
101 OnLineSig
*m_aMuleSig
;
102 unsigned int m_maxLineCount
;
104 #ifdef __LINUX__ // System monitoring on Linux
106 wxStaticText
*m_sysLine_1
;
107 wxStaticText
*m_sysLine_2
;
108 LinuxMon
*m_sysMonitor
;
113 ID_BAR_REFRESH
= 1000,
124 // Get maximum of 2 uint
125 unsigned int GetMaxUInt( const unsigned int a
, const unsigned int b
)
127 return ( ( a
) > ( b
) ? ( a
) : ( b
) );
130 // Constructing Stat_lines
131 wxString
MakeStatLine_1() const;
132 wxString
MakeStatLine_2() const;
133 wxString
MakeStatLine_3() const;
134 wxString
MakeStatLine_4() const;
135 wxString
MakeStatLine_5() const;
136 wxString
MakeStatLine_6() const;
137 wxString
MakeStatLine_7() const;
139 // Constructing Hits_lines
140 wxString
MakeHitsLine_1() const;
141 wxString
MakeHitsLine_2() const;
143 #ifdef __LINUX__ // System monitoring on Linux
144 // Constructing Sys_lines
145 wxString
MakeSysLine_1() const;
146 wxString
MakeSysLine_2() const;
150 bool UpdateStatsPanel ();
151 void UpdateAll ( bool forceFitting
= FALSE
);
152 void SaveAbsoluteHits();
154 void OnBarRefresh ( wxCommandEvent
& event
);
155 void OnBarAbout ( wxCommandEvent
& event
);
156 void OnBarSave ( wxCommandEvent
& event
);
157 void OnBarPrint ( wxCommandEvent
& event
);
158 void OnBarPrefs ( wxCommandEvent
& event
);
159 void OnRefreshTimer ( wxTimerEvent
& event
);
160 void OnFtpUpdateTimer ( wxTimerEvent
& event
);
161 void OnHitButton ( wxCommandEvent
& event
);
162 void OnAbsHitButton ( wxCommandEvent
& event
);
164 DECLARE_EVENT_TABLE ()
168 WxCasFrame ( const wxString
& title
);
173 /// Get Online statistics image
174 wxImage
*GetStatImage () const;
176 /// Refresh timer period changing
177 bool ChangeRefreshPeriod( const int newPeriod
);
179 /// Refresh timer period changing
180 bool ChangeFtpUpdatePeriod( const int newPeriod
);
182 /// Set amulesig.dat file
183 void SetAmuleSigFile( const wxFileName
& file
);
186 #endif /* _WXCASFRAME_H */
187 // File_checked_for_headers