void HeaderCtrl::LeftDown(Point p, dword keyflags) { #ifdef _DEBUG if(keyflags & K_CTRL) { String text; for(int i = 0; i < col.GetCount(); i++) text += Format(i ? " %d" : "%d", GetTabWidth(i)); WriteClipboardText(".ColumnWidths(\"" + text + "\");"); BeepExclamation(); } #endif split = GetSplit(p.x); if(IsNull(split)) return; SetCapture(); if(split >= 0) { colRect = GetTabRect(split); return; } li = pushi = -1 - split; col[pushi].WhenLeftClick(); #ifdef _DEBUG if((keyflags & K_ALT) && pushi >= 0) WriteClipboardText(AsString(GetTabWidth(pushi))); #endif if(pushi >= 0) { if(!col[pushi].WhenAction) { pushi = -1; return; } colRect = GetTabRect(pushi); push = true; } Refresh(); }
void LayDes::VisGen() { if(IsNull(currentlayout)) return; VisGenDlg dlg(CurrentLayout(), cursor); if(dlg.Run() == IDOK) WriteClipboardText(~dlg.view); }
void XmlView::CopyPath() { String path; int id = xml.GetCursor(); while(id >= 0) { String tag = xml.Get(id); if(tag.GetCount()) path = "[" + AsCString(tag) + "]" + path; id = xml.GetParent(id); } WriteClipboardText(path); }
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE previousInstance, WCHAR *commandLine, int showFlags) { HANDLE stdOut; stdOut = GetStdHandle(STD_OUTPUT_HANDLE); if (stdOut == INVALID_HANDLE_VALUE) { perror("GetStdHandle"); return 1; } if (!WriteClipboardText(NULL, stdOut)) { return 1; } LogDebug("all ok"); return 0; }
// Iterates over each product in the given list to determine if any of its prerequisites or // requirements cannot be installed because their language is incompatible with the user's // Windows language. If fIncludeGivenProducts is true, also tests each product in the list. // Returns true if there were any conflicts. User will get a message in this method, too, and // the offending item will be removed from the given list. bool MasterInstaller_t::TestAndReportLanguageConflicts(IndexList_t & rgiProducts, bool fIncludeGivenProducts) { bool fAnyConflicts = false; g_Log.Write(_T("Testing for prerequisites and requirements having language compatibility issues.")); g_Log.Write(_T("Windows language is %d"), g_langidWindowsLanguage); g_Log.Indent(); for (int iList = 0; iList < rgiProducts.GetCount(); iList++) { // Get index of next product: int iCurrentProduct = rgiProducts[iList]; g_Log.Write(_T("Checking prerequisites and requirements for %s."), m_ppmProductManager->GetName(iCurrentProduct)); g_Log.Indent(); // Get full list of active prerequisites and requirements: IndexList_t rgiNeededProducts; if (fIncludeGivenProducts) rgiNeededProducts.Add(iCurrentProduct); IndexList_t rgiThisProductOnly; rgiThisProductOnly.Add(iCurrentProduct); g_Log.Write(_T("Prerequisites...")); g_Log.Indent(); m_ppmProductManager->GetActivePrerequisites(rgiThisProductOnly, rgiNeededProducts, true); g_Log.Unindent(); g_Log.Write(_T("...Done.")); g_Log.Write(_T("Requirements...")); g_Log.Indent(); m_ppmProductManager->GetActiveRequirements(rgiThisProductOnly, rgiNeededProducts, true, true); g_Log.Unindent(); g_Log.Write(_T("...Done.")); if (rgiNeededProducts.GetCount() > 0) { g_Log.Write(_T("Checking if any of the %d dependencies of %s have a language restriction we can't honor..."), rgiNeededProducts.GetCount(), m_ppmProductManager->GetName(iCurrentProduct)); g_Log.Indent(); } else { g_Log.Write(_T("%s has no dependencies. No need to check language restrictions."), m_ppmProductManager->GetName(iCurrentProduct)); } // See if any have a language restriction we can't honor: IndexList_t rgiFailures; for (int i = 0; i < rgiNeededProducts.GetCount(); i++) { int iProd = rgiNeededProducts[i]; if (m_ppmProductManager->CriticalFileLanguageUnavailable(iProd)) { rgiFailures.Add(iProd); g_Log.Write(_T("%s uses an incompatible language."), m_ppmProductManager->GetName(iProd)); } } if (rgiFailures.GetCount() > 0) { fAnyConflicts = true; _TCHAR * pszList = NULL; for (int i = 0; i < rgiFailures.GetCount(); i++) { new_sprintf_concat(pszList, 1, m_ppmProductManager->GetName(rgiFailures[i])); new_sprintf_concat(pszList, 0, FetchString(IDC_ERROR_LANGUAGE_INCOMPATIBLE_URL)); new_sprintf_concat(pszList, 0, m_ppmProductManager->GetDownloadUrl(rgiFailures[i])); } _TCHAR * pszPart1 = my_strdup(FetchString(IDC_ERROR_LANGUAGE_INCOMPATIBLE_1)); _TCHAR * pszPart2 = my_strdup(FetchString(IDC_ERROR_LANGUAGE_INCOMPATIBLE_2)); _TCHAR * pszError = new_sprintf(_T("%s:\n%s\n%s\n\n%s"), m_ppmProductManager->GetName(iCurrentProduct), pszPart1, pszList, pszPart2); delete[] pszPart2; delete[] pszPart1; // Copy list contents to clipboard: WriteClipboardText(pszList); delete[] pszList; _TCHAR * pszTitle = new_sprintf(_T("%s - %s"), g_pszTitle, FetchString(IDC_ERROR_LANGUAGE_INCOMPATIBLE)); MessageBox(NULL, pszError, pszTitle, MB_ICONSTOP | MB_OK); g_Log.Write(_T("Language compatibility issue reported to user: '******' %s"), pszTitle, pszError); delete[] pszTitle; delete[] pszError; rgiProducts.RemoveNthItem(iList); iList--; } // End if there were any conflicts g_Log.Unindent(); g_Log.Write(_T("...Done checking if any dependencies of %s have a language restriction we can't honor..."), m_ppmProductManager->GetName(iCurrentProduct)); if (rgiNeededProducts.GetCount() > 0) { g_Log.Unindent(); g_Log.Write(_T("Done checking prerequisites and requirements for %s."), m_ppmProductManager->GetName(iCurrentProduct)); } } // Next item in given list g_Log.Unindent(); g_Log.Write(_T("End of testing for language compatibility issues.")); return fAnyConflicts; }