diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2016-03-30 10:28:13 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2016-03-30 10:28:13 +0000 |
commit | 1c2541a00e52e5dd11c8e5d1036c8208b801b25c (patch) | |
tree | 91bd315067ab922b48a74911d76ca75981392eb3 /protocols/VKontakte/src/vk_dialogs.cpp | |
parent | 41fa778883c3bbb5c14470b66c35304f894012c6 (diff) |
VKontakte: wall post dialog -> core ui
git-svn-id: http://svn.miranda-ng.org/main/trunk@16564 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_dialogs.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_dialogs.cpp | 54 |
1 files changed, 51 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/vk_dialogs.cpp b/protocols/VKontakte/src/vk_dialogs.cpp index bfd08e0e86..b934d14cf7 100644 --- a/protocols/VKontakte/src/vk_dialogs.cpp +++ b/protocols/VKontakte/src/vk_dialogs.cpp @@ -17,8 +17,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
+////////////////////////////////// IDD_CAPTCHAFORM ////////////////////////////////////////
+
CaptchaForm::CaptchaForm(CVkProto *proto, CAPTCHA_FORM_PARAMS* param) :
- CVkDlgBase(proto, IDD_CAPTCHAFORM),
+ CVkDlgBase(proto, IDD_CAPTCHAFORM, false),
m_instruction(this, IDC_INSTRUCTION),
m_edtValue(this, IDC_VALUE),
m_btnOpenInBrowser(this, IDOPENBROWSER),
@@ -98,5 +100,51 @@ void CaptchaForm::On_btnOk_Click(CCtrlButton*) void CaptchaForm::On_edtValue_Change(CCtrlEdit*)
{
- m_btnOk.Enable(mir_strlen(ptrA(m_edtValue.GetTextA())));
-}
\ No newline at end of file + m_btnOk.Enable(!IsEmpty(ptrA(m_edtValue.GetTextA())));
+}
+
+////////////////////////////////// IDD_WALLPOST ///////////////////////////////////////////
+
+WallPostForm::WallPostForm(CVkProto * proto, WALLPOST_FORM_PARAMS * param) :
+ CVkDlgBase(proto, IDD_WALLPOST, false),
+ m_edtMsg(this, IDC_ED_MSG),
+ m_edtUrl(this, IDC_ED_URL),
+ m_cbOnlyForFriends(this, IDC_ONLY_FRIENDS),
+ m_btnShare(this, IDOK),
+ m_param(param)
+{
+ m_btnShare.OnClick = Callback(this, &WallPostForm::On_btnShare_Click);
+ m_edtMsg.OnChange = Callback(this, &WallPostForm::On_edtValue_Change);
+ m_edtUrl.OnChange = Callback(this, &WallPostForm::On_edtValue_Change);
+}
+
+void WallPostForm::OnInitDialog()
+{
+ SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL), TRUE));
+ SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL)));
+
+ CMString tszTitle(FORMAT, _T("%s %s"), TranslateT("Wall message for"), m_param->ptszNick);
+ SetCaption(tszTitle);
+
+ m_btnShare.Disable();
+}
+
+void WallPostForm::OnDestroy()
+{
+ IcoLib_ReleaseIcon((HICON)SendMessage(m_hwnd, WM_SETICON, ICON_BIG, 0));
+ IcoLib_ReleaseIcon((HICON)SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, 0));
+}
+
+void WallPostForm::On_btnShare_Click(CCtrlButton *)
+{
+ m_param->ptszUrl = mir_tstrdup(m_edtUrl.GetText());
+ m_param->ptszMsg = mir_tstrdup(m_edtMsg.GetText());
+ m_param->bFriendsOnly = m_cbOnlyForFriends.GetState();
+
+ EndDialog(m_hwnd, 1);
+}
+
+void WallPostForm::On_edtValue_Change(CCtrlEdit *)
+{
+ m_btnShare.Enable(!IsEmpty(ptrT(m_edtMsg.GetText())) || !IsEmpty(ptrT(m_edtUrl.GetText())));
+}
|