@@ -29,16 +29,16 @@ BEGIN_MESSAGE_MAP(CAGInfoWnd, CWnd)
29
29
END_MESSAGE_MAP()
30
30
31
31
32
- void CAGInfoWnd::ShowTips(BOOL bShow)
32
+ void CAGInfoWnd::ShowTips(CString str, BOOL bShow)
33
33
{
34
34
m_bShowTip = bShow;
35
35
36
36
if (bShow)
37
37
ShowWindow (SW_SHOW);
38
38
else
39
39
ShowWindow (SW_HIDE);
40
-
41
- Invalidate (FALSE );
40
+ strText = str;
41
+ Invalidate (TRUE );
42
42
}
43
43
44
44
void CAGInfoWnd::SetVideoResolution (int nWidth, int nHeight)
@@ -85,8 +85,8 @@ void CAGInfoWnd::OnPaint()
85
85
// 640x480,15fps,400k
86
86
GetClientRect (&rcClient);
87
87
rcClient.top += 4 ;
88
- strTip.Format (_T (" %dx%d, %dfps, %dK \n %u" ), m_nWidth, m_nHeight, m_nFps, m_nBitrate, m_nUID);
89
- dc.DrawText (strTip , &rcClient, DT_VCENTER | DT_CENTER);
88
+ // strTip.Format(_T("%dx%d, %dfps, %dK \n %u"), m_nWidth, m_nHeight, m_nFps, m_nBitrate, m_nUID);
89
+ dc.DrawText (strText , &rcClient, DT_VCENTER | DT_CENTER);
90
90
}
91
91
}
92
92
@@ -105,6 +105,7 @@ BOOL CAGInfoWnd::OnEraseBkgnd(CDC* pDC)
105
105
106
106
IMPLEMENT_DYNAMIC (CAGVideoWnd, CWnd)
107
107
108
+
108
109
CAGVideoWnd::CAGVideoWnd()
109
110
: m_nUID(0 )
110
111
, m_crBackColor(RGB(0x58 , 0x58 , 0x58 ))
@@ -123,6 +124,7 @@ CAGVideoWnd::~CAGVideoWnd()
123
124
BEGIN_MESSAGE_MAP (CAGVideoWnd, CWnd)
124
125
ON_WM_ERASEBKGND()
125
126
ON_WM_LBUTTONDOWN()
127
+ ON_WM_LBUTTONUP()
126
128
ON_WM_RBUTTONDOWN()
127
129
ON_WM_CREATE()
128
130
ON_WM_PAINT()
@@ -143,16 +145,6 @@ BOOL CAGVideoWnd::OnEraseBkgnd(CDC* pDC)
143
145
GetClientRect (&rcClient);
144
146
145
147
pDC->FillSolidRect (&rcClient, m_crBackColor);
146
- /* if (!m_imgBackGround.GetImageInfo(0, &imgInfo))
147
- return TRUE;
148
-
149
- ptDraw.SetPoint((rcClient.Width() - imgInfo.rcImage.right) / 2, (rcClient.Height() - imgInfo.rcImage.bottom) / 2);
150
- if (ptDraw.x < 0)
151
- ptDraw.x = 0;
152
- if (ptDraw.y <= 0)
153
- ptDraw.y = 0;
154
-
155
- m_imgBackGround.Draw(pDC, 0, ptDraw, ILD_NORMAL);*/
156
148
return TRUE ;
157
149
}
158
150
@@ -229,11 +221,19 @@ void CAGVideoWnd::OnLButtonDown(UINT nFlags, CPoint point)
229
221
{
230
222
// TODO: add message handle code and /or call default values here
231
223
232
- ::SendMessage (GetParent()->GetSafeHwnd(), WM_SHOWBIG , (WPARAM)this , (LPARAM)m_nUID );
224
+ ::SendMessage (GetParent()->GetSafeHwnd(), WM_LBUTTON_DOWN_WND , (WPARAM)point.x , (LPARAM)point.y );
233
225
234
226
CWnd::OnLButtonDown (nFlags, point);
235
227
}
236
228
229
+ void CAGVideoWnd::OnLButtonUp (UINT nFlags, CPoint point)
230
+ {
231
+ // TODO: add message handle code and /or call default values here
232
+
233
+ ::SendMessage (GetParent()->GetSafeHwnd(), WM_LBUTTON_UP_WND, (WPARAM)point.x, (LPARAM)point.y);
234
+
235
+ CWnd::OnLButtonDown (nFlags, point);
236
+ }
237
237
238
238
void CAGVideoWnd::OnRButtonDown (UINT nFlags, CPoint point)
239
239
{
@@ -256,11 +256,11 @@ int CAGVideoWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
256
256
}
257
257
258
258
259
- void CAGVideoWnd::ShowVideoInfo (BOOL bShow)
259
+ void CAGVideoWnd::ShowVideoInfo (CString str, BOOL bShow)
260
260
{
261
261
m_bShowVideoInfo = bShow;
262
262
263
- m_wndInfo.ShowTips (bShow);
263
+ m_wndInfo.ShowTips (str, bShow);
264
264
Invalidate (TRUE );
265
265
}
266
266
0 commit comments