Skip to content

Commit

Permalink
历史流量统计中当月总流量显示增加上传和下载流量显示;繁体中文翻译更新;版本号更新
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongyang219 committed Nov 11, 2018
1 parent 7c0f849 commit 9565d67
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
10 changes: 8 additions & 2 deletions TrafficMonitor/DrawCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,20 @@ void CDrawCommon::SetDC(CDC * pDC)
m_pDC = pDC;
}

void CDrawCommon::DrawWindowText(CRect rect, LPCTSTR lpszString, COLORREF color, Alignment align, bool draw_back_ground)
void CDrawCommon::DrawWindowText(CRect rect, LPCTSTR lpszString, COLORREF color, Alignment align, bool draw_back_ground, bool multi_line)
{
m_pDC->SetTextColor(color);
if(!draw_back_ground)
m_pDC->SetBkMode(TRANSPARENT);
m_pDC->SelectObject(m_pfont);
CSize text_size = m_pDC->GetTextExtent(lpszString);
UINT format{ DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX }; //CDC::DrawText()函数的文本格式

UINT format; //CDC::DrawText()函数的文本格式
if (multi_line)
format = DT_EDITCONTROL | DT_WORDBREAK | DT_NOPREFIX;
else
format = DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX;

if (text_size.cx > rect.Width()) //如果文本宽度超过了矩形区域的宽度,设置了居中时左对齐
{
if (align == Alignment::RIGHT)
Expand Down
2 changes: 1 addition & 1 deletion TrafficMonitor/DrawCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CDrawCommon
CDC* GetDC() { return m_pDC; }
void SetBackColor(COLORREF back_color) { m_back_color = back_color; }

void DrawWindowText(CRect rect, LPCTSTR lpszString, COLORREF color, Alignment align = Alignment::LEFT, bool draw_back_ground = false); //在指定的矩形区域内绘制文本
void DrawWindowText(CRect rect, LPCTSTR lpszString, COLORREF color, Alignment align = Alignment::LEFT, bool draw_back_ground = false, bool multi_line = false); //在指定的矩形区域内绘制文本

void SetDrawRect(CRect rect); //设置绘图剪辑区域
static void SetDrawRect(CDC* pDC, CRect rect);
Expand Down
Binary file modified TrafficMonitor/HistoryTrafficCalendarDlg.cpp
Binary file not shown.
Binary file modified TrafficMonitor/HistoryTrafficCalendarDlg.h
Binary file not shown.
7 changes: 1 addition & 6 deletions TrafficMonitor/TrafficMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void CTrafficMonitorApp::LoadConfig()

//其他设置
m_cfg_data.m_show_internet_ip = ini.GetBool(L"connection_details", L"show_internet_ip", false);
m_cfg_data.m_use_log_scale = ini.GetBool(_T("histroy_traffic"), _T("use_log_scale"), false);
m_cfg_data.m_use_log_scale = ini.GetBool(_T("histroy_traffic"), _T("use_log_scale"), true);

m_no_multistart_warning = ini.GetBool(_T("other"), _T("no_multistart_warning"), false);
m_notify_interval = ini.GetInt(_T("other"), _T("notify_interval"), 60);
Expand All @@ -148,11 +148,6 @@ void CTrafficMonitorApp::SaveConfig()
ini.WriteBool(L"general", L"show_all_interface", m_general_data.show_all_interface);

//主窗口设置
//保存前先获取窗口的位置
//CRect rect;
//m_pMainWnd->GetWindowRect(rect);
//m_cfg_data.m_position_x = rect.left;
//m_cfg_data.m_position_y = rect.top;
ini.WriteInt(L"config", L"transparency", m_cfg_data.m_transparency);
ini.WriteBool(L"config", L"always_on_top", m_cfg_data.m_always_on_top);
ini.WriteBool(L"config", L"lock_window_pos", m_cfg_data.m_lock_window_pos);
Expand Down
Binary file modified TrafficMonitor/TrafficMonitor.rc
Binary file not shown.
4 changes: 2 additions & 2 deletions TrafficMonitor/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ using std::ofstream;

#define MAX_INSERT_TO_TASKBAR_CNT 5 //尝试嵌入任务栏的最大次数

#define VERSION L"1.75"
#define COMPILE_DATE L"2018/08/11"
#define VERSION L"1.76"
#define COMPILE_DATE L"2018/11/11"

#define MAX_NOTIFY_ICON 4 //可选的通知区图标数量

Expand Down

0 comments on commit 9565d67

Please sign in to comment.