Index: src/ch/AppHelper.h =================================================================== diff -u -r541304f4e098b4c7617b718287ab40646d5deb92 -rf102f95617e81f56adbed6403e42602ea8c509b5 --- src/ch/AppHelper.h (.../AppHelper.h) (revision 541304f4e098b4c7617b718287ab40646d5deb92) +++ src/ch/AppHelper.h (.../AppHelper.h) (revision f102f95617e81f56adbed6403e42602ea8c509b5) @@ -57,9 +57,9 @@ TPathProcessor m_pathProcessor; TCHAR* m_pszProgramName; // name of this program (ie. CH.exe) - TCHAR* m_pszAppName; // app-name string of this app - TCHAR* m_pszAppNameVer; // extended app-name-with small version - TCHAR* m_pszAppVersion; // app-version string of this app (VERSION based) + const TCHAR* m_pszAppName; // app-name string of this app + const TCHAR* m_pszAppNameVer; // extended app-name-with small version + const TCHAR* m_pszAppVersion; // app-version string of this app (VERSION based) boost::optional m_optPortableMode; }; Index: src/ch/DirectoryChooser.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -rf102f95617e81f56adbed6403e42602ea8c509b5 --- src/ch/DirectoryChooser.cpp (.../DirectoryChooser.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/ch/DirectoryChooser.cpp (.../DirectoryChooser.cpp) (revision f102f95617e81f56adbed6403e42602ea8c509b5) @@ -46,7 +46,7 @@ dlg.m_bdData.iView=GetPropValue(rConfig); dlg.m_bdData.bIgnoreDialogs=GetPropValue(rConfig); - dlg.m_bdData.strInitialDir=(dlg.m_bdData.cvRecent.size() > 0) ? dlg.m_bdData.cvRecent.at(0) : _T(""); + dlg.m_bdData.strInitialDir=(dlg.m_bdData.cvRecent.size() > 0) ? dlg.m_bdData.cvRecent.at(0) : CString(L""); if(eOperation == chengine::eOperation_Copy) dlg.m_bdData.strCaption = GetResManager().LoadString(IDS_TITLECOPY_STRING); Index: src/ch/MiniViewDlg.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -rf102f95617e81f56adbed6403e42602ea8c509b5 --- src/ch/MiniViewDlg.cpp (.../MiniViewDlg.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/ch/MiniViewDlg.cpp (.../MiniViewDlg.cpp) (revision f102f95617e81f56adbed6403e42602ea8c509b5) @@ -42,6 +42,264 @@ bool CMiniViewDlg::m_bLock=false; +void OnPause(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) +{ + switch (uiMsg) + { + case MSG_DRAWBUTTON: + { + CRect rcCopy = pData->rcButton; + rcCopy.DeflateRect(2, 2, 2, 2); + + // frame drawing + if (!pData->bPressed || pDlg->m_ctlStatus.GetCurSel() == LB_ERR) + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); + else + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); + + // fill the background + rcCopy.DeflateRect(1, 1, 1, 1); + pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); + + // pause + CPen pen; + int iPenWidth = rcCopy.Width() / 10 + 1; + pen.CreatePen(PS_SOLID, iPenWidth, pData->bEnabled ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_BTNSHADOW)); + CPen* pOld = pDC->SelectObject(&pen); + + int iOffset = rcCopy.Width() / 3; + pDC->MoveTo(rcCopy.left + iOffset - ROUND(0.66*iPenWidth) + pData->bPressed, rcCopy.top + 1 * iPenWidth + pData->bPressed); + pDC->LineTo(rcCopy.left + iOffset - ROUND(0.66*iPenWidth) + pData->bPressed, rcCopy.bottom - ROUND(1.5*iPenWidth) + pData->bPressed); + pDC->MoveTo(rcCopy.right - iOffset - ROUND(0.66*iPenWidth) + pData->bPressed, rcCopy.top + 1 * iPenWidth + pData->bPressed); + pDC->LineTo(rcCopy.right - iOffset - ROUND(0.66*iPenWidth) + pData->bPressed, rcCopy.bottom - ROUND(1.5*iPenWidth) + pData->bPressed); + + pDC->SelectObject(pOld); + break; + } + case MSG_ONCLICK: + { + int iSel = pDlg->m_ctlStatus.GetCurSel(); + if (iSel == LB_ERR || (size_t)iSel >= pDlg->m_ctlStatus.m_vItems.size()) + return; + + chengine::TTaskPtr spTask = pDlg->m_pTasks->GetTaskByTaskID(pDlg->m_ctlStatus.m_vItems.at(iSel)->m_tTaskID); + if (spTask) + spTask->PauseProcessing(); + else + pDlg->m_pTasks->TasksPauseProcessing(); + + break; + } + } +} + +void OnCloseBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) +{ + switch (uiMsg) + { + case MSG_DRAWBUTTON: + { + CRect rcCopy = pData->rcButton; + rcCopy.DeflateRect(2, 2, 2, 2); + + // frame + if (!pData->bPressed) + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); + else + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); + + // background + rcCopy.DeflateRect(1, 1, 1, 1); + pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); + + // close + CPen pen; + int iPenSize = rcCopy.Width() / 10 + 1; + pen.CreatePen(PS_SOLID | PS_INSIDEFRAME, iPenSize, GetSysColor(COLOR_BTNTEXT)); + CPen* pOld = pDC->SelectObject(&pen); + + switch (iPenSize) + { + case 1: + pDC->MoveTo(rcCopy.left + pData->bPressed + ROUND(1.4*iPenSize), rcCopy.top + pData->bPressed + ROUND(1.4*iPenSize)); + pDC->LineTo(rcCopy.right + pData->bPressed - ROUND(1.4*iPenSize), rcCopy.bottom + pData->bPressed - ROUND(1.6*iPenSize)); + pDC->MoveTo(rcCopy.left + pData->bPressed + ROUND(1.4*iPenSize), rcCopy.bottom + pData->bPressed - ROUND(2.6*iPenSize)); + pDC->LineTo(rcCopy.right + pData->bPressed - ROUND(1.4*iPenSize), rcCopy.top + pData->bPressed + ROUND(0.4*iPenSize)); + break; + default: + pDC->MoveTo(rcCopy.left + pData->bPressed + ROUND(1.4*iPenSize), rcCopy.top + pData->bPressed + ROUND(1.4*iPenSize)); + pDC->LineTo(rcCopy.right + pData->bPressed - ROUND(2.0*iPenSize), rcCopy.bottom + pData->bPressed - ROUND(2.0*iPenSize)); + pDC->MoveTo(rcCopy.left + pData->bPressed + ROUND(1.4*iPenSize), rcCopy.bottom + pData->bPressed - ROUND(2.0*iPenSize)); + pDC->LineTo(rcCopy.right + pData->bPressed - ROUND(2.0*iPenSize), rcCopy.top + pData->bPressed + ROUND(1.4*iPenSize)); + break; + } + + pDC->SelectObject(pOld); + break; + } + case MSG_ONCLICK: + pDlg->SendMessage(WM_CLOSE, 0, 0); + break; + } +} + +void OnResume(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) +{ + switch (uiMsg) + { + case MSG_DRAWBUTTON: + { + CRect rcCopy = pData->rcButton; + rcCopy.DeflateRect(2, 2, 2, 2); + + // frame + if (!pData->bPressed || pDlg->m_ctlStatus.GetCurSel() == LB_ERR) + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); + else + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); + + // bkgnd + rcCopy.DeflateRect(1, 1, 1, 1); + pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); + + // triangle + int iOffset = rcCopy.Width() / 4; + int iHeight = rcCopy.Width() / 10 + 1; + POINT pt[3] = { {rcCopy.left + iOffset - 1 + pData->bPressed, rcCopy.top + 1 * iHeight + pData->bPressed}, {rcCopy.left + iOffset - 1 + pData->bPressed, rcCopy.bottom - ROUND(1.625*iHeight) + pData->bPressed}, + {rcCopy.right - iOffset - 1 + pData->bPressed, rcCopy.top + 1 * iHeight + pData->bPressed + (rcCopy.Height() - 3 * iHeight + 1) / 2} }; + + CBrush brs; + brs.CreateSolidBrush(pData->bEnabled ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_BTNSHADOW)); + CBrush* pOld = pDC->SelectObject(&brs); + + CPen pen; + pen.CreatePen(PS_SOLID, 1, pData->bEnabled ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_BTNSHADOW)); + CPen *pOldPen = pDC->SelectObject(&pen); + pDC->SetPolyFillMode(WINDING); + + pDC->Polygon(pt, 3); + + pDC->SelectObject(pOld); + pDC->SelectObject(pOldPen); + + break; + } + case MSG_ONCLICK: + { + int iSel = pDlg->m_ctlStatus.GetCurSel(); + if (iSel == LB_ERR || (size_t)iSel >= pDlg->m_ctlStatus.m_vItems.size()) + return; + + chengine::TTaskPtr spTask = pDlg->m_pTasks->GetTaskByTaskID(pDlg->m_ctlStatus.m_vItems.at(iSel)->m_tTaskID); + if (spTask) + { + if (spTask->GetTaskState() == chengine::eTaskState_Waiting) + spTask->SetForceFlag(true); + else + spTask->ResumeProcessing(); + } + else + pDlg->m_pTasks->TasksResumeProcessing(); + break; + } + } +} + +void OnCancelBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) +{ + switch (uiMsg) + { + case MSG_DRAWBUTTON: + { + CRect rcCopy = pData->rcButton; + rcCopy.DeflateRect(2, 2, 2, 2); + + // frame + if (!pData->bPressed || pDlg->m_ctlStatus.GetCurSel() == LB_ERR) + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); + else + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); + + // bkgnd + rcCopy.DeflateRect(1, 1, 1, 1); + pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); + + // square + int iWidth = rcCopy.Width() / 10 + 1; + rcCopy.DeflateRect(1 * iWidth + pData->bPressed, 1 * iWidth + pData->bPressed, ROUND(1.6*iWidth) - pData->bPressed, 1 * iWidth - pData->bPressed); + pDC->FillSolidRect(&rcCopy, pData->bEnabled ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_BTNSHADOW)); + break; + } + case MSG_ONCLICK: + int iSel = pDlg->m_ctlStatus.GetCurSel(); + if (iSel == LB_ERR || (size_t)iSel >= pDlg->m_ctlStatus.m_vItems.size()) + return; + + chengine::TTaskPtr spTask = pDlg->m_pTasks->GetTaskByTaskID(pDlg->m_ctlStatus.m_vItems.at(iSel)->m_tTaskID); + if (spTask) + spTask->CancelProcessing(); + else + pDlg->m_pTasks->TasksCancelProcessing(); + break; + } +} + +void OnRestartBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) +{ + switch (uiMsg) + { + case MSG_DRAWBUTTON: + { + CRect rcCopy = pData->rcButton; + rcCopy.DeflateRect(2, 2, 2, 2); + + // frame + if (!pData->bPressed || pDlg->m_ctlStatus.GetCurSel() == LB_ERR) + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); + else + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); + + // bkgnd + rcCopy.DeflateRect(1, 1, 1, 1); + pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); + + // triangle in a square + int iOffset = rcCopy.Width() / 4; + int iHeight = rcCopy.Width() / 10 + 1; + POINT pt[3] = { {rcCopy.left + iOffset - 1 + pData->bPressed, rcCopy.top + 1 * iHeight + pData->bPressed}, {rcCopy.left + iOffset - 1 + pData->bPressed, rcCopy.bottom - ROUND(1.625*iHeight) + pData->bPressed}, + {rcCopy.right - iOffset - 1 + pData->bPressed, rcCopy.top + 1 * iHeight + pData->bPressed + (rcCopy.Height() - 3 * iHeight + 1) / 2} }; + + CBrush brs; + brs.CreateSolidBrush(pData->bEnabled ? RGB(255, 0, 0) : GetSysColor(COLOR_BTNSHADOW)); + CBrush* pOld = pDC->SelectObject(&brs); + + CPen pen; + pen.CreatePen(PS_SOLID, 1, pData->bEnabled ? RGB(255, 0, 0) : GetSysColor(COLOR_BTNSHADOW)); + CPen *pOldPen = pDC->SelectObject(&pen); + + pDC->SetPolyFillMode(WINDING); + pDC->Polygon(pt, 3); + pDC->SelectObject(pOld); + pDC->SelectObject(pOldPen); + + break; + } + case MSG_ONCLICK: + { + int iSel = pDlg->m_ctlStatus.GetCurSel(); + if (iSel == LB_ERR || (size_t)iSel >= pDlg->m_ctlStatus.m_vItems.size()) + return; + + chengine::TTaskPtr spTask = pDlg->m_pTasks->GetTaskByTaskID(pDlg->m_ctlStatus.m_vItems.at(iSel)->m_tTaskID); + if (spTask) + spTask->RestartProcessing(); + else + pDlg->m_pTasks->TasksRestartProcessing(); + break; + } + } +} + ///////////////////////////////////////////////////////////////////////////// // CMiniViewDlg dialog @@ -397,264 +655,6 @@ } } -void OnPause(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) -{ - switch (uiMsg) - { - case MSG_DRAWBUTTON: - { - CRect rcCopy=pData->rcButton; - rcCopy.DeflateRect(2,2,2,2); - - // frame drawing - if (!pData->bPressed || pDlg->m_ctlStatus.GetCurSel() == LB_ERR) - pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); - else - pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); - - // fill the background - rcCopy.DeflateRect(1, 1, 1, 1); - pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); - - // pause - CPen pen; - int iPenWidth=rcCopy.Width()/10+1; - pen.CreatePen(PS_SOLID, iPenWidth, pData->bEnabled ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_BTNSHADOW)); - CPen* pOld=pDC->SelectObject(&pen); - - int iOffset=rcCopy.Width()/3; - pDC->MoveTo(rcCopy.left+iOffset-ROUND(0.66*iPenWidth)+pData->bPressed, rcCopy.top+1*iPenWidth+pData->bPressed); - pDC->LineTo(rcCopy.left+iOffset-ROUND(0.66*iPenWidth)+pData->bPressed, rcCopy.bottom-ROUND(1.5*iPenWidth)+pData->bPressed); - pDC->MoveTo(rcCopy.right-iOffset-ROUND(0.66*iPenWidth)+pData->bPressed, rcCopy.top+1*iPenWidth+pData->bPressed); - pDC->LineTo(rcCopy.right-iOffset-ROUND(0.66*iPenWidth)+pData->bPressed, rcCopy.bottom-ROUND(1.5*iPenWidth)+pData->bPressed); - - pDC->SelectObject(pOld); - break; - } - case MSG_ONCLICK: - { - int iSel=pDlg->m_ctlStatus.GetCurSel(); - if (iSel == LB_ERR || (size_t)iSel >= pDlg->m_ctlStatus.m_vItems.size()) - return; - - chengine::TTaskPtr spTask = pDlg->m_pTasks->GetTaskByTaskID(pDlg->m_ctlStatus.m_vItems.at(iSel)->m_tTaskID); - if(spTask) - spTask->PauseProcessing(); - else - pDlg->m_pTasks->TasksPauseProcessing(); - - break; - } - } -} - -void OnCloseBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) -{ - switch (uiMsg) - { - case MSG_DRAWBUTTON: - { - CRect rcCopy=pData->rcButton; - rcCopy.DeflateRect(2,2,2,2); - - // frame - if (!pData->bPressed) - pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); - else - pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); - - // background - rcCopy.DeflateRect(1, 1, 1, 1); - pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); - - // close - CPen pen; - int iPenSize=rcCopy.Width()/10+1; - pen.CreatePen(PS_SOLID | PS_INSIDEFRAME, iPenSize, GetSysColor(COLOR_BTNTEXT)); - CPen* pOld=pDC->SelectObject(&pen); - - switch (iPenSize) - { - case 1: - pDC->MoveTo(rcCopy.left+pData->bPressed+ROUND(1.4*iPenSize), rcCopy.top+pData->bPressed+ROUND(1.4*iPenSize)); - pDC->LineTo(rcCopy.right+pData->bPressed-ROUND(1.4*iPenSize), rcCopy.bottom+pData->bPressed-ROUND(1.6*iPenSize)); - pDC->MoveTo(rcCopy.left+pData->bPressed+ROUND(1.4*iPenSize), rcCopy.bottom+pData->bPressed-ROUND(2.6*iPenSize)); - pDC->LineTo(rcCopy.right+pData->bPressed-ROUND(1.4*iPenSize), rcCopy.top+pData->bPressed+ROUND(0.4*iPenSize)); - break; - default: - pDC->MoveTo(rcCopy.left+pData->bPressed+ROUND(1.4*iPenSize), rcCopy.top+pData->bPressed+ROUND(1.4*iPenSize)); - pDC->LineTo(rcCopy.right+pData->bPressed-ROUND(2.0*iPenSize), rcCopy.bottom+pData->bPressed-ROUND(2.0*iPenSize)); - pDC->MoveTo(rcCopy.left+pData->bPressed+ROUND(1.4*iPenSize), rcCopy.bottom+pData->bPressed-ROUND(2.0*iPenSize)); - pDC->LineTo(rcCopy.right+pData->bPressed-ROUND(2.0*iPenSize), rcCopy.top+pData->bPressed+ROUND(1.4*iPenSize)); - break; - } - - pDC->SelectObject(pOld); - break; - } - case MSG_ONCLICK: - pDlg->SendMessage(WM_CLOSE, 0, 0); - break; - } -} - -void OnResume(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) -{ - switch (uiMsg) - { - case MSG_DRAWBUTTON: - { - CRect rcCopy=pData->rcButton; - rcCopy.DeflateRect(2,2,2,2); - - // frame - if (!pData->bPressed || pDlg->m_ctlStatus.GetCurSel() == LB_ERR) - pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); - else - pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); - - // bkgnd - rcCopy.DeflateRect(1, 1, 1, 1); - pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); - - // triangle - int iOffset=rcCopy.Width()/4; - int iHeight=rcCopy.Width()/10+1; - POINT pt[3]={ {rcCopy.left+iOffset-1+pData->bPressed, rcCopy.top+1*iHeight+pData->bPressed}, {rcCopy.left+iOffset-1+pData->bPressed, rcCopy.bottom-ROUND(1.625*iHeight)+pData->bPressed}, - {rcCopy.right-iOffset-1+pData->bPressed, rcCopy.top+1*iHeight+pData->bPressed+(rcCopy.Height()-3*iHeight+1)/2} }; - - CBrush brs; - brs.CreateSolidBrush(pData->bEnabled ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_BTNSHADOW)); - CBrush* pOld=pDC->SelectObject(&brs); - - CPen pen; - pen.CreatePen(PS_SOLID, 1, pData->bEnabled ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_BTNSHADOW)); - CPen *pOldPen=pDC->SelectObject(&pen); - pDC->SetPolyFillMode(WINDING); - - pDC->Polygon(pt, 3); - - pDC->SelectObject(pOld); - pDC->SelectObject(pOldPen); - - break; - } - case MSG_ONCLICK: - { - int iSel=pDlg->m_ctlStatus.GetCurSel(); - if (iSel == LB_ERR || (size_t)iSel >= pDlg->m_ctlStatus.m_vItems.size()) - return; - - chengine::TTaskPtr spTask = pDlg->m_pTasks->GetTaskByTaskID(pDlg->m_ctlStatus.m_vItems.at(iSel)->m_tTaskID); - if (spTask) - { - if(spTask->GetTaskState() == chengine::eTaskState_Waiting) - spTask->SetForceFlag(true); - else - spTask->ResumeProcessing(); - } - else - pDlg->m_pTasks->TasksResumeProcessing(); - break; - } - } -} - -void OnCancelBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) -{ - switch (uiMsg) - { - case MSG_DRAWBUTTON: - { - CRect rcCopy=pData->rcButton; - rcCopy.DeflateRect(2,2,2,2); - - // frame - if (!pData->bPressed || pDlg->m_ctlStatus.GetCurSel() == LB_ERR) - pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); - else - pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); - - // bkgnd - rcCopy.DeflateRect(1, 1, 1, 1); - pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); - - // square - int iWidth=rcCopy.Width()/10+1; - rcCopy.DeflateRect(1*iWidth+pData->bPressed, 1*iWidth+pData->bPressed, ROUND(1.6*iWidth)-pData->bPressed, 1*iWidth-pData->bPressed); - pDC->FillSolidRect(&rcCopy, pData->bEnabled ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_BTNSHADOW)); - break; - } - case MSG_ONCLICK: - int iSel=pDlg->m_ctlStatus.GetCurSel(); - if (iSel == LB_ERR || (size_t)iSel >= pDlg->m_ctlStatus.m_vItems.size()) - return; - - chengine::TTaskPtr spTask = pDlg->m_pTasks->GetTaskByTaskID(pDlg->m_ctlStatus.m_vItems.at(iSel)->m_tTaskID); - if(spTask) - spTask->CancelProcessing(); - else - pDlg->m_pTasks->TasksCancelProcessing(); - break; - } -} - -void OnRestartBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) -{ - switch (uiMsg) - { - case MSG_DRAWBUTTON: - { - CRect rcCopy=pData->rcButton; - rcCopy.DeflateRect(2,2,2,2); - - // frame - if (!pData->bPressed || pDlg->m_ctlStatus.GetCurSel() == LB_ERR) - pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); - else - pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); - - // bkgnd - rcCopy.DeflateRect(1, 1, 1, 1); - pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); - - // triangle in a square - int iOffset=rcCopy.Width()/4; - int iHeight=rcCopy.Width()/10+1; - POINT pt[3]={ {rcCopy.left+iOffset-1+pData->bPressed, rcCopy.top+1*iHeight+pData->bPressed}, {rcCopy.left+iOffset-1+pData->bPressed, rcCopy.bottom-ROUND(1.625*iHeight)+pData->bPressed}, - {rcCopy.right-iOffset-1+pData->bPressed, rcCopy.top+1*iHeight+pData->bPressed+(rcCopy.Height()-3*iHeight+1)/2} }; - - CBrush brs; - brs.CreateSolidBrush(pData->bEnabled ? RGB(255, 0, 0) : GetSysColor(COLOR_BTNSHADOW)); - CBrush* pOld=pDC->SelectObject(&brs); - - CPen pen; - pen.CreatePen(PS_SOLID, 1, pData->bEnabled ? RGB(255, 0, 0) : GetSysColor(COLOR_BTNSHADOW)); - CPen *pOldPen=pDC->SelectObject(&pen); - - pDC->SetPolyFillMode(WINDING); - pDC->Polygon(pt, 3); - pDC->SelectObject(pOld); - pDC->SelectObject(pOldPen); - - break; - } - case MSG_ONCLICK: - { - int iSel=pDlg->m_ctlStatus.GetCurSel(); - if (iSel == LB_ERR || (size_t)iSel >= pDlg->m_ctlStatus.m_vItems.size()) - return; - - chengine::TTaskPtr spTask = pDlg->m_pTasks->GetTaskByTaskID(pDlg->m_ctlStatus.m_vItems.at(iSel)->m_tTaskID); - if(spTask) - spTask->RestartProcessing(); - else - pDlg->m_pTasks->TasksRestartProcessing(); - break; - } - } -} - void CMiniViewDlg::OnSelchangeProgressList() { RefreshStatus(); Index: src/ch/ch.h =================================================================== diff -u -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af -rf102f95617e81f56adbed6403e42602ea8c509b5 --- src/ch/ch.h (.../ch.h) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) +++ src/ch/ch.h (.../ch.h) (revision f102f95617e81f56adbed6403e42602ea8c509b5) @@ -88,6 +88,8 @@ void InitLoggers(); }; +CCopyHandlerApp& GetApplication(); + inline CCopyHandlerApp& GetApp() { return GetApplication(); Index: src/ch/debug.h =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -rf102f95617e81f56adbed6403e42602ea8c509b5 --- src/ch/debug.h (.../debug.h) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/debug.h (.../debug.h) (revision f102f95617e81f56adbed6403e42602ea8c509b5) @@ -24,7 +24,7 @@ struct __dbg_msg__ { UINT uiMsg; - TCHAR *pszText; + const TCHAR *pszText; }; ////////////////////////////////////// Index: src/ictranslate/ICTranslateDlg.cpp =================================================================== diff -u -r9ddf8fdd5f641491dd30c49eb90f8f740314b6af -rf102f95617e81f56adbed6403e42602ea8c509b5 --- src/ictranslate/ICTranslateDlg.cpp (.../ICTranslateDlg.cpp) (revision 9ddf8fdd5f641491dd30c49eb90f8f740314b6af) +++ src/ictranslate/ICTranslateDlg.cpp (.../ICTranslateDlg.cpp) (revision f102f95617e81f56adbed6403e42602ea8c509b5) @@ -178,13 +178,13 @@ lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; lvc.fmt = LVCFMT_LEFT; lvc.cx = uiWidth / 5; - lvc.pszText = _T("ID"); + lvc.pszText = (LPWSTR)_T("ID"); m_ctlBaseLanguageList.InsertColumn(0, &lvc); m_ctlCustomLanguageList.InsertColumn(0, &lvc); lvc.cx = 4 * uiWidth / 5; - lvc.pszText = _T("Text"); + lvc.pszText = (LPWSTR)_T("Text"); m_ctlBaseLanguageList.InsertColumn(1, &lvc); m_ctlCustomLanguageList.InsertColumn(1, &lvc); @@ -500,7 +500,7 @@ m_ctlCustomLanguageList.InsertItem(&lvi); lvi.mask = LVIF_TEXT; - lvi.pszText = _T(""); + lvi.pszText = (LPWSTR)_T(""); lvi.iItem = 0; lvi.iSubItem = 1; @@ -571,7 +571,7 @@ if(pCustomItem) lvi.pszText = (PTSTR)pCustomItem->GetText(); else - lvi.pszText = _T(""); + lvi.pszText = (LPWSTR)_T(""); m_ctlCustomLanguageList.SetItem(&lvi); } Index: src/libchengine/TFileException.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -rf102f95617e81f56adbed6403e42602ea8c509b5 --- src/libchengine/TFileException.cpp (.../TFileException.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TFileException.cpp (.../TFileException.cpp) (revision f102f95617e81f56adbed6403e42602ea8c509b5) @@ -21,7 +21,7 @@ namespace chengine { - TFileException::TFileException(chcore::EGeneralErrors eErrorCode, DWORD dwNativeErrorCode, const chcore::TSmartPath& path, wchar_t* pszMsg, const wchar_t* pszFile, size_t stLineNumber, const wchar_t* pszFunction) : + TFileException::TFileException(chcore::EGeneralErrors eErrorCode, DWORD dwNativeErrorCode, const chcore::TSmartPath& path, const wchar_t* pszMsg, const wchar_t* pszFile, size_t stLineNumber, const wchar_t* pszFunction) : TCoreException(eErrorCode, pszMsg, pszFile, stLineNumber, pszFunction), m_dwNativeErrorCode(dwNativeErrorCode), m_path(path) Index: src/libchengine/TFileException.h =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -rf102f95617e81f56adbed6403e42602ea8c509b5 --- src/libchengine/TFileException.h (.../TFileException.h) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TFileException.h (.../TFileException.h) (revision f102f95617e81f56adbed6403e42602ea8c509b5) @@ -28,7 +28,7 @@ class LIBCHENGINE_API TFileException : public chcore::TCoreException { public: - TFileException(chcore::EGeneralErrors eErrorCode, DWORD dwNativeErrorCode, const chcore::TSmartPath& path, wchar_t* pszMsg, + TFileException(chcore::EGeneralErrors eErrorCode, DWORD dwNativeErrorCode, const chcore::TSmartPath& path, const wchar_t* pszMsg, const wchar_t* pszFile, size_t stLineNumber, const wchar_t* pszFunction); void GetErrorInfo(wchar_t* pszBuffer, size_t stMaxBuffer) const override; Index: src/libchengine/TLocalFilesystemFile.cpp =================================================================== diff -u -r32e9c223239ddbe4055bf468e92efe33f90f5f94 -rf102f95617e81f56adbed6403e42602ea8c509b5 --- src/libchengine/TLocalFilesystemFile.cpp (.../TLocalFilesystemFile.cpp) (revision 32e9c223239ddbe4055bf468e92efe33f90f5f94) +++ src/libchengine/TLocalFilesystemFile.cpp (.../TLocalFilesystemFile.cpp) (revision f102f95617e81f56adbed6403e42602ea8c509b5) @@ -86,7 +86,7 @@ DWORD dwLastError = GetLastError(); LOG_ERROR(m_spLog) << "Opening file for reading failed with error: " << dwLastError << GetFileInfoForLog(m_bNoBuffering); - throw TFileException(eErr_CannotOpenFile, dwLastError, m_pathFile, L"Cannot open for reading", LOCATION); + throw TFileException(chcore::eErr_CannotOpenFile, dwLastError, m_pathFile, L"Cannot open for reading", LOCATION); } LOG_DEBUG(m_spLog) << "Opening file for reading succeeded. New handle: " << m_hFile << GetFileInfoForLog(m_bNoBuffering); Index: src/libchengine/TLocalFilesystemFile.h =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -rf102f95617e81f56adbed6403e42602ea8c509b5 --- src/libchengine/TLocalFilesystemFile.h (.../TLocalFilesystemFile.h) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TLocalFilesystemFile.h (.../TLocalFilesystemFile.h) (revision f102f95617e81f56adbed6403e42602ea8c509b5) @@ -63,7 +63,7 @@ void InternalClose(); - std::wstring TLocalFilesystemFile::GetFileInfoForLog(bool bNoBuffering) const; + std::wstring GetFileInfoForLog(bool bNoBuffering) const; private: chcore::TSmartPath m_pathFile; Index: src/libchengine/TOrderedBufferQueue.h =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -rf102f95617e81f56adbed6403e42602ea8c509b5 --- src/libchengine/TOrderedBufferQueue.h (.../TOrderedBufferQueue.h) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TOrderedBufferQueue.h (.../TOrderedBufferQueue.h) (revision f102f95617e81f56adbed6403e42602ea8c509b5) @@ -24,6 +24,8 @@ #include "TOverlappedDataBuffer.h" #include "TBufferList.h" #include +#include "../libchcore/ErrorCodes.h" +#include "../libchcore/TCoreException.h" namespace chengine { @@ -91,9 +93,9 @@ void TOrderedBufferQueue::PushError(TOverlappedDataBuffer* pBuffer, T& rRetryQueue) { if(!pBuffer) - throw TCoreException(eErr_InvalidArgument, L"pBuffer is NULL", LOCATION); + throw chcore::TCoreException(chcore::eErr_InvalidArgument, L"pBuffer is NULL", LOCATION); if(!pBuffer->HasError()) - throw TCoreException(eErr_InvalidArgument, L"Cannot push successful buffer to failed queue", LOCATION); + throw chcore::TCoreException(chcore::eErr_InvalidArgument, L"Cannot push successful buffer to failed queue", LOCATION); boost::unique_lock lock(m_mutex);