Index: src/ch/StatusDlg.cpp =================================================================== diff -u -rcdf6a22ddf857f56ce2e27e26d8cd6f0b8034b2e -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 --- src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision cdf6a22ddf857f56ce2e27e26d8cd6f0b8034b2e) +++ src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) @@ -1,23 +1,21 @@ -/************************************************************************ - Copy Handler 1.x - program for copying data in Microsoft Windows - systems. - Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*************************************************************************/ - +/*************************************************************************** +* Copyright (C) 2001-2008 by J�zef Starosczyk * +* ixen@copyhandler.com * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Library General Public License * +* (version 2) as published by the Free Software Foundation; * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU Library General Public * +* License along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ #include "stdafx.h" #include "ch.h" #include "resource.h" @@ -39,7 +37,7 @@ // CStatusDlg dialog CStatusDlg::CStatusDlg(CTaskArray* pTasks, CWnd* pParent /*=NULL*/) - : CHLanguageDialog(CStatusDlg::IDD, pParent, &m_bLock) + : ictranslate::CLanguageDialog(CStatusDlg::IDD, pParent, &m_bLock) { //{{AFX_DATA_INIT(CStatusDlg) //}}AFX_DATA_INIT @@ -58,7 +56,7 @@ void CStatusDlg::DoDataExchange(CDataExchange* pDX) { - CHLanguageDialog::DoDataExchange(pDX); + CLanguageDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CStatusDlg) DDX_Control(pDX, IDC_ERRORS_EDIT, m_ctlErrors); DDX_Control(pDX, IDC_TASK_PROGRESS, m_ctlCurrentProgress); @@ -67,7 +65,7 @@ //}}AFX_DATA_MAP } -BEGIN_MESSAGE_MAP(CStatusDlg, CHLanguageDialog) +BEGIN_MESSAGE_MAP(CStatusDlg,ictranslate::CLanguageDialog) //{{AFX_MSG_MAP(CStatusDlg) ON_WM_TIMER() ON_BN_CLICKED(IDC_PAUSE_BUTTON, OnPauseButton) @@ -97,7 +95,7 @@ BOOL CStatusDlg::OnInitDialog() { - CHLanguageDialog::OnInitDialog(); + CLanguageDialog::OnInitDialog(); // get size of list ctrl CRect rcList; @@ -220,7 +218,7 @@ SetTimer(777, (UINT)GetConfig()->get_signed_num(PP_STATUSREFRESHINTERVAL), NULL); } - CHLanguageDialog::OnTimer(nIDEvent); + CLanguageDialog::OnTimer(nIDEvent); } void CStatusDlg::AddTaskInfo(int nPos, CTask *pTask, DWORD dwCurrentTime) @@ -496,12 +494,14 @@ CMenu* pPopup = menu.GetSubMenu(0); ASSERT(pPopup != NULL); + if(pPopup) + { + // set point in which to set menu + CRect rect; + GetDlgItem(IDC_SET_PRIORITY_BUTTON)->GetWindowRect(&rect); - // set point in which to set menu - CRect rect; - GetDlgItem(IDC_SET_PRIORITY_BUTTON)->GetWindowRect(&rect); - - pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, rect.right+1, rect.top, this); + pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, rect.right+1, rect.top, this); + } } BOOL CStatusDlg::OnCommand(WPARAM wParam, LPARAM lParam) @@ -512,7 +512,7 @@ { // processing priority if ( (pSelectedItem=GetSelectedItemPointer()) == NULL ) - return CHLanguageDialog::OnCommand(wParam, lParam); + return ictranslate::CLanguageDialog::OnCommand(wParam, lParam); switch (LOWORD(wParam)) { @@ -547,7 +547,7 @@ } } } - return CHLanguageDialog::OnCommand(wParam, lParam); + return ictranslate::CLanguageDialog::OnCommand(wParam, lParam); } void CStatusDlg::OnPauseButton() @@ -801,7 +801,7 @@ void CStatusDlg::OnCancel() { PostCloseMessage(); - CHLanguageDialog::OnCancel(); + CLanguageDialog::OnCancel(); } void CStatusDlg::OnAdvancedButton() @@ -816,12 +816,14 @@ CMenu* pPopup = menu.GetSubMenu(0); ASSERT(pPopup != NULL); + if(pPopup) + { + // get the point to show menu at + CRect rect; + GetDlgItem(IDC_ADVANCED_BUTTON)->GetWindowRect(&rect); - // get the point to show menu at - CRect rect; - GetDlgItem(IDC_ADVANCED_BUTTON)->GetWindowRect(&rect); - - pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, rect.right+1, rect.top, this); + pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, rect.right+1, rect.top, this); + } } void CStatusDlg::OnPopupReplacePaths() @@ -890,7 +892,7 @@ TRACE("Received WM_UPDATESTATUS\n"); RefreshStatus(); } - return CHLanguageDialog::WindowProc(message, wParam, lParam); + return ictranslate::CLanguageDialog::WindowProc(message, wParam, lParam); } void CStatusDlg::OnStickButton() @@ -901,7 +903,7 @@ void CStatusDlg::SetBufferSizesString(UINT uiValue, int iIndex) { TCHAR szData[1024]; - switch (iIndex) + switch(iIndex) { case BI_DEFAULT: GetResManager()->LoadStringCopy(IDS_BSDEFAULT_STRING, szData, 256); @@ -918,6 +920,9 @@ case BI_LAN: GetResManager()->LoadStringCopy(IDS_BSLAN_STRING, szData, 256); break; + default: + _ASSERTE(false); + szData[0] = _T('\0'); } _tcscat(szData, GetSizeString((__int64)uiValue, m_szData, _MAX_PATH)); @@ -930,7 +935,7 @@ GetParent()->PostMessage(WM_STATUSCLOSING); } -void CStatusDlg::OnLanguageChanged(WORD /*wOld*/, WORD /*wNew*/) +void CStatusDlg::OnLanguageChanged() { // remove all columns int iCnt=m_ctlStatusList.GetHeaderCtrl()->GetItemCount();