From e7198780400e52d809f6829edbac625a96c770f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Sch=C3=BCmann?= Date: Thu, 25 Dec 2014 00:31:21 +0000 Subject: SendSS: * resource cosmetics (and logical change as button != checkbox) ID_btnDesc => ID_chkDesc ID_btnDeleteAfterSend => ID_chkDeleteAfterSend * unified some checkbox related code while we are at it^^ (UMainForm.cpp) git-svn-id: http://svn.miranda-ng.org/main/trunk@11611 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SendScreenshotPlus/src/UMainForm.cpp | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'plugins/SendScreenshotPlus/src/UMainForm.cpp') diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index 644316f4b2..812a9fca16 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -337,16 +337,16 @@ void TfrmMain::wmInitdialog(WPARAM wParam, LPARAM lParam) { SetWindowText(hCtrl, hIcon ? _T("") : _T("...")); } - if (hCtrl = GetDlgItem(m_hWnd, ID_btnDesc)) { - SendDlgItemMessage(m_hWnd, ID_btnDesc, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Fill description textbox."), MBBF_TCHAR); + if (hCtrl = GetDlgItem(m_hWnd, ID_chkDesc)) { + SendDlgItemMessage(m_hWnd, ID_chkDesc, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Fill description textbox."), MBBF_TCHAR); HICON hIcon = GetIconBtn(m_opt_btnDesc ? ICO_BTN_DESKON : ICO_BTN_DESK); SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); SetWindowText(hCtrl, hIcon ? _T("") : _T("D")); SendMessage(hCtrl, BM_SETCHECK, m_opt_btnDesc ? BST_CHECKED : BST_UNCHECKED, NULL); } - if (hCtrl = GetDlgItem(m_hWnd, ID_btnDeleteAfterSend)) { - SendDlgItemMessage(m_hWnd, ID_btnDeleteAfterSend, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Delete after send"), MBBF_TCHAR); + if (hCtrl = GetDlgItem(m_hWnd, ID_chkDeleteAfterSend)) { + SendDlgItemMessage(m_hWnd, ID_chkDeleteAfterSend, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Delete after send"), MBBF_TCHAR); HICON hIcon = GetIconBtn(m_opt_btnDeleteAfterSend ? ICO_BTN_DELON : ICO_BTN_DEL); SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); SetWindowText(hCtrl, hIcon ? _T("") : _T("X")); @@ -406,24 +406,24 @@ void TfrmMain::wmCommand(WPARAM wParam, LPARAM lParam) { case ID_btnExplore: TfrmMain::btnExploreClick(); break; - case ID_btnDesc:{ + case ID_chkDesc:{ m_opt_btnDesc=!m_opt_btnDesc; HICON hIcon=GetIconBtn(m_opt_btnDesc?ICO_BTN_DESKON:ICO_BTN_DESK); SendMessage((HWND)lParam,BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcon); break;} - case ID_btnDeleteAfterSend:{ - m_opt_btnDeleteAfterSend = (m_opt_btnDeleteAfterSend == 0); + case ID_chkDeleteAfterSend:{ + m_opt_btnDeleteAfterSend=!m_opt_btnDeleteAfterSend; HICON hIcon=GetIconBtn(m_opt_btnDeleteAfterSend?ICO_BTN_DELON:ICO_BTN_DEL); SendMessage((HWND)lParam,BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcon); if(m_cSend) m_cSend->m_bDeleteAfterSend=m_opt_btnDeleteAfterSend; break;} case ID_chkEditor:{ - m_opt_chkEditor = Button_GetCheck((HWND)lParam); + m_opt_chkEditor=!m_opt_chkEditor; HICON hIcon=GetIconBtn(m_opt_chkEditor?ICO_BTN_EDITON:ICO_BTN_EDIT); SendMessage((HWND)lParam,BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcon); break;} case ID_chkOpenAgain: - m_opt_chkOpenAgain = Button_GetCheck((HWND)lParam); + m_opt_chkOpenAgain=Button_GetCheck((HWND)lParam); break; case ID_btnCapture: TfrmMain::btnCaptureClick(); @@ -866,13 +866,13 @@ void TfrmMain::cboxSendByChange() { } bState = (itemFlag & SS_DLG_DELETEAFTERSSEND); hIcon = GetIconBtn(m_opt_btnDeleteAfterSend ? ICO_BTN_DELON : ICO_BTN_DEL); - SendDlgItemMessage(m_hWnd, ID_btnDeleteAfterSend, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(bState ? hIcon : 0)); - Button_Enable(GetDlgItem(m_hWnd, ID_btnDeleteAfterSend), bState); + SendDlgItemMessage(m_hWnd, ID_chkDeleteAfterSend, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(bState ? hIcon : 0)); + Button_Enable(GetDlgItem(m_hWnd, ID_chkDeleteAfterSend), bState); bState = (itemFlag & SS_DLG_DESCRIPTION); hIcon = GetIconBtn(m_opt_btnDesc ? ICO_BTN_DESKON : ICO_BTN_DESK); - SendDlgItemMessage(m_hWnd, ID_btnDesc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(bState ? hIcon : 0)); - Button_Enable(GetDlgItem(m_hWnd, ID_btnDesc), bState); + SendDlgItemMessage(m_hWnd, ID_chkDesc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(bState ? hIcon : 0)); + Button_Enable(GetDlgItem(m_hWnd, ID_chkDesc), bState); } //--------------------------------------------------------------------------- @@ -1089,7 +1089,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) { db_set_dw(NULL,SZ_SENDSS,"FileNumber",FileNumber); mir_free(m_pszFile); m_pszFile=ret; mir_free(m_pszFileDesc); - if(IsWindowEnabled(GetDlgItem(m_hWnd,ID_btnDesc)) && m_opt_btnDesc){ + if(IsWindowEnabled(GetDlgItem(m_hWnd,ID_chkDesc)) && m_opt_btnDesc){ m_pszFileDesc=pszFileDesc; }else{ mir_free(pszFileDesc); @@ -1111,7 +1111,7 @@ void TfrmMain::FormClose() { if(m_opt_tabCapture==2){ /// existing file TCHAR description[1024]; GetDlgItemText(m_hwndTabPage, ID_edtCaption, description, SIZEOF(description)); - if(!IsWindowEnabled(GetDlgItem(m_hWnd,ID_btnDesc)) || !m_opt_btnDesc) + if(!IsWindowEnabled(GetDlgItem(m_hWnd,ID_chkDesc)) || !m_opt_btnDesc) *description='\0'; if(m_cSend) { m_cSend->m_bDeleteAfterSend = false; /// well... guess it's better to not delete existing files for now... -- cgit v1.2.3