summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-04-30 13:18:27 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-04-30 13:18:27 +0300
commitbaf51bf25e71d3c4c3130f56153919cbeed4ff75 (patch)
tree4a8ddd24d371ec3b4c8f863300c514df47ce521a
parent6ea772c9cd8f281478f3a521148c8ea50863fc74 (diff)
code cleaning
-rw-r--r--src/core/stduserinfo/src/userinfo.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp
index 32fd4117db..ae5fcfe62b 100644
--- a/src/core/stduserinfo/src/userinfo.cpp
+++ b/src/core/stduserinfo/src/userinfo.cpp
@@ -234,7 +234,7 @@ class CUserInfoDlg : public CDlgBase
if (Proto_GetStatus(szProto) < ID_STATUS_ONLINE)
btnUpdate.Disable();
else
- btnUpdate.Enable(!IsWindowVisible(GetDlgItem(m_hwnd, IDC_UPDATING)));
+ btnUpdate.Enable(!IsWindowVisible(m_updating.GetHwnd()));
}
}
@@ -263,7 +263,7 @@ class CUserInfoDlg : public CDlgBase
}
}
- CCtrlBase m_place;
+ CCtrlBase m_place, m_updating;
CCtrlButton btnUpdate;
CCtrlTreeView m_tree;
CTimer updateTimer;
@@ -277,6 +277,7 @@ public:
m_tree(this, IDC_PAGETREE),
m_place(this, IDC_TABS),
btnUpdate(this, IDC_UPDATE),
+ m_updating(this, IDC_UPDATING),
updateTimer(this, 1)
{
SetMinSize(480, 382);
@@ -313,13 +314,13 @@ public:
//////////////////////////////////////////////////////////////////////
m_updateAnimFrame = 0;
- GetDlgItemText(m_hwnd, IDC_UPDATING, m_szUpdating, _countof(m_szUpdating));
+ m_updating.GetText(m_szUpdating, _countof(m_szUpdating));
CheckOnline();
if (!CallContactService(m_hContact, PS_GETINFO, SGIF_ONOPEN)) {
btnUpdate.Disable();
updateTimer.Start(100);
}
- else ShowWindow(GetDlgItem(m_hwnd, IDC_UPDATING), SW_HIDE);
+ else m_updating.Hide();
return true;
}
@@ -450,7 +451,7 @@ public:
/* if they're not gonna send any more ACK's don't let that mean we should crash */
if (!ack->hProcess && !ack->lParam) {
- ShowWindow(GetDlgItem(m_hwnd, IDC_UPDATING), SW_HIDE);
+ m_updating.Hide();
updateTimer.Stop();
CheckOnline();
break;
@@ -468,7 +469,7 @@ public:
break;
if (i == (INT_PTR)ack->hProcess) {
- ShowWindow(GetDlgItem(m_hwnd, IDC_UPDATING), SW_HIDE);
+ m_updating.Hide();
updateTimer.Stop();
CheckOnline();
}
@@ -552,7 +553,7 @@ public:
if (hContact)
if (!CallContactService(hContact, PS_GETINFO)) {
btnUpdate.Disable();
- ShowWindow(GetDlgItem(m_hwnd, IDC_UPDATING), SW_SHOW);
+ m_updating.Show();
updateTimer.Start(100);
}
}
@@ -561,7 +562,7 @@ public:
{
wchar_t str[128];
mir_snwprintf(str, L"%.*s%s%.*s", m_updateAnimFrame % 10, L".........", m_szUpdating, m_updateAnimFrame % 10, L".........");
- SetDlgItemText(m_hwnd, IDC_UPDATING, str);
+ m_updating.SetText(str);
if (++m_updateAnimFrame == UPDATEANIMFRAMES)
m_updateAnimFrame = 0;
}