-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathAppStatusBar.cpp
70 lines (54 loc) · 1.54 KB
/
AppStatusBar.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
/*
Free Download Manager Copyright (c) 2003-2016 FreeDownloadManager.ORG
*/
#include "stdafx.h"
#include "FdmApp.h"
#include "AppStatusBar.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CAppStatusBar::CAppStatusBar()
{
}
CAppStatusBar::~CAppStatusBar()
{
}
BEGIN_MESSAGE_MAP(CAppStatusBar, CStatusBar)
//{{AFX_MSG_MAP(CAppStatusBar)
ON_WM_CREATE()
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
int CAppStatusBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CStatusBar::OnCreate(lpCreateStruct) == -1)
return -1;
m_ttip.Create (this, TTS_ALWAYSTIP);
m_ttip.SendMessage(TTM_SETMAXTIPWIDTH, 0, (UINT)(WORD)-1);
CRect rc (0, 0, 0, 0);
m_ttip.AddTool (this, _T(" "), &rc, ID_SB_TRAFFIC_THISMONTH);
m_ttip.AddTool (this, LS (L_TOTAL_SPEED_SBTEXT), &rc, ID_SB_TOTALSPEED);
return 0;
}
void CAppStatusBar::OnSize(UINT nType, int cx, int cy)
{
CStatusBar::OnSize(nType, cx, cy);
CRect rc;
int i = CommandToIndex (ID_SB_TRAFFIC_THISMONTH);
GetStatusBarCtrl ().GetRect (i, &rc);
m_ttip.SetToolRect (this, ID_SB_TRAFFIC_THISMONTH, &rc);
i = CommandToIndex (ID_SB_TOTALSPEED);
GetStatusBarCtrl ().GetRect (i, &rc);
m_ttip.SetToolRect (this, ID_SB_TOTALSPEED, &rc);
}
void CAppStatusBar::SetToolTipText(UINT nIDTip, LPCTSTR pszText)
{
m_ttip.UpdateTipText (pszText, this, nIDTip);
}
BOOL CAppStatusBar::PreTranslateMessage(MSG *pMsg)
{
m_ttip.RelayEvent (pMsg);
return CStatusBar::PreTranslateMessage (pMsg);
}