-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFrameStatistics.cpp
142 lines (100 loc) · 2.74 KB
/
FrameStatistics.cpp
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
/********************************************************************************
Gnucleus - An Application for the Gnutella Network
Copyright (C) 2000-2005 John Marshall Group
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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
By contributing code you grant John Marshall Group an unlimited, non-exclusive
license to your contribution.
For support, questions, commercial use, etc...
E-Mail: swabby@c0re.net
********************************************************************************/
#include "stdafx.h"
#include "Gnucleus.h"
#include "FrameStatistics.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CFrameStatistics, CGnuMdiChildWnd)
CFrameStatistics::CFrameStatistics()
{
}
CFrameStatistics::~CFrameStatistics()
{
}
BEGIN_MESSAGE_MAP(CFrameStatistics, CGnuMdiChildWnd)
//{{AFX_MSG_MAP(CFrameStatistics)
//}}AFX_MSG_MAP
ON_WM_SIZING()
END_MESSAGE_MAP()
BOOL CFrameStatistics::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~FWS_ADDTOTITLE;
cs.lpszName = "Statistics";
if( !CGnuMdiChildWnd::PreCreateWindow(cs) )
return false;
cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
return true;
}
#define YWINMIN 350
#define XWINMIN 650
#define FORM_BOTTOM \
if(cRect.Height() < YWINMIN) \
pRect->bottom = pRect->top + YWINMIN;
#define FORM_TOP \
if(cRect.Height() < YWINMIN) \
pRect->top = pRect->bottom - YWINMIN;
#define FORM_LEFT \
if(cRect.Width() < XWINMIN) \
pRect->left = pRect->right - XWINMIN;
#define FORM_RIGHT \
if(cRect.Width() < XWINMIN) \
pRect->right = pRect->left + XWINMIN;
void CFrameStatistics::OnSizing(UINT fwSide, LPRECT pRect)
{
CGnuMdiChildWnd::OnSizing(fwSide, pRect);
CRect cRect = pRect;
switch(fwSide)
{
case WMSZ_BOTTOM:
FORM_BOTTOM;
break;
case WMSZ_BOTTOMLEFT:
FORM_BOTTOM;
FORM_LEFT;
break;
case WMSZ_BOTTOMRIGHT:
FORM_BOTTOM;
FORM_RIGHT;
break;
case WMSZ_TOP:
FORM_TOP;
break;
case WMSZ_TOPLEFT:
FORM_TOP;
FORM_LEFT;
break;
case WMSZ_TOPRIGHT:
FORM_TOP;
FORM_RIGHT;
break;
case WMSZ_LEFT:
FORM_LEFT;
break;
case WMSZ_RIGHT:
FORM_RIGHT;
break;
default:
break;
}
}