BOOL DeleteFormats(int parentID, ARRAY& formatIDs) { if(formatIDs.GetSize() <= 0) return TRUE; try { //Delete the requested data formats INT_PTR count = formatIDs.GetSize(); for(int i = 0; i < count; i++) { theApp.m_db.execDMLEx(_T("DELETE FROM Data WHERE lID = %d;"), formatIDs[i]); } CClip clip; if(clip.LoadFormats(parentID)) { DWORD CRC = clip.GenerateCRC(); //Update the main table with new size theApp.m_db.execDMLEx(_T("UPDATE Main SET CRC = %d WHERE lID = %d"), CRC, parentID); } } CATCH_SQLITE_EXCEPTION return TRUE; }
bool CHotKeys::FindFirstConflict(ARRAY& keys, INT_PTR* pX, INT_PTR* pY) { bool bConflict = false; INT_PTR i, j; INT_PTR count = keys.GetSize(); DWORD key; for(i = 0; i < count && !bConflict; i++) { key = keys.ElementAt(i); // only check valid keys if(key == 0) continue; // scan the array for a duplicate for(j = i+1; j < count; j++ ) { if(keys.ElementAt(j) == key) { bConflict = true; break; } } } if(bConflict) { if(pX) *pX = i-1; if(pY) *pY = j; } return bConflict; }
void CQListCtrl::LoadCopyOrCutToClipboard() { ARRAY arr; GetSelectionItemData(arr); INT_PTR count = arr.GetSize(); if(count <= 0) return; CProcessPaste paste; //Don't send the paste just load it into memory paste.m_bSendPaste = false; if(count > 1) paste.GetClipIDs().Copy(arr); else paste.GetClipIDs().Add(arr[0]); //Don't move these to the top BOOL bItWas = g_Opt.m_bUpdateTimeOnPaste; g_Opt.m_bUpdateTimeOnPaste = FALSE; paste.DoPaste(); g_Opt.m_bUpdateTimeOnPaste = bItWas; }
// caution! this alters hotkeys based upon corresponding indexes void CHotKeys::SetKeys(ARRAY& keys, bool bSave) { INT_PTR count = GetSize(); ASSERT(count == keys.GetSize()); for(int i=0; i < count; i++) { ElementAt(i)->SetKey(keys[(INT)i], bSave); } }
bool CQListCtrl::PutSelectedItemOnDittoCopyBuffer(long lBuffer) { bool bRet = false; ARRAY arr; GetSelectionItemData(arr); INT_PTR nCount = arr.GetSize(); if(nCount > 0 && arr[0]) { CDittoCopyBuffer::PutClipOnDittoCopyBuffer(arr[0], lBuffer); bRet = true; } return bRet; }
void CQListCtrl::SendSelection(ARRAY &arrItems) { GetParent()->SendMessage(NM_SELECT, arrItems.GetSize(), (LPARAM) arrItems.GetData()); }