diff options
Diffstat (limited to 'src/Main/GraphicUserInterface.cpp')
-rw-r--r-- | src/Main/GraphicUserInterface.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Main/GraphicUserInterface.cpp b/src/Main/GraphicUserInterface.cpp index 41bfa100..1cb62671 100644 --- a/src/Main/GraphicUserInterface.cpp +++ b/src/Main/GraphicUserInterface.cpp @@ -1842,70 +1842,78 @@ namespace VeraCrypt listCtrl->GetItemRect (0, itemRect); if (addedCols) listCtrl->ClearAll(); else listCtrl->DeleteAllItems(); } else listCtrl->GetItemRect (0, itemRect); int headerHeight = itemRect.y; #ifdef TC_WINDOWS headerHeight += 4; #elif defined (TC_MACOSX) headerHeight += 7; #elif defined (__WXGTK__) headerHeight += 5; #endif int rowHeight = itemRect.height; #ifdef TC_MACOSX rowHeight += 1; #endif listCtrl->SetMinSize (wxSize (listCtrl->GetMinSize().GetWidth(), rowHeight * rowCount + headerHeight)); } void GraphicUserInterface::SetListCtrlWidth (wxListCtrl *listCtrl, size_t charCount, bool hasVerticalScrollbar) const { int width = GetCharWidth (listCtrl) * charCount; #ifdef TC_MACOSX if (!hasVerticalScrollbar) width += GetScrollbarWidth (listCtrl); #endif listCtrl->SetMinSize (wxSize (width, listCtrl->GetMinSize().GetHeight())); } + + void GraphicUserInterface::SetContentProtection (bool enable) const + { +#if defined(TC_WINDOWS) || defined(TC_MACOSX) + GetActiveWindow()->SetContentProtection(enable ? wxCONTENT_PROTECTION_ENABLED : wxCONTENT_PROTECTION_NONE); +#endif + } + void GraphicUserInterface::ShowErrorTopMost (const wxString &message) const { ShowMessage (message, wxOK | wxICON_ERROR, true); } void GraphicUserInterface::ShowInfoTopMost (const wxString &message) const { ShowMessage (message, wxOK | wxICON_INFORMATION, true); } int GraphicUserInterface::ShowMessage (const wxString &message, long style, bool topMost) const { wxString caption = Application::GetName(); wxString subMessage = message; #ifdef TC_MACOSX size_t p = message.find (L"\n"); if (p != string::npos) { // Divide message to caption and info message caption = message.substr (0, p); p = message.find_first_not_of (L'\n', p); if (p != string::npos) subMessage = message.substr (p); else subMessage.clear(); if (subMessage.EndsWith (L"?")) { // Move question to caption caption += wstring (L" "); p = subMessage.find_last_of (L".\n"); if (p != string::npos) { |