From 0ca62a37d66c52042fc8565bd2538d7f19f92e66 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Fri, 25 Oct 2019 22:48:08 +0200 Subject: [PATCH] MacOSX: fix truncated algorithms description in the Encryption Options page of the volume creation wizard, which happened after moving to wxWidgets 3.1.2 --- src/Main/Forms/EncryptionOptionsWizardPage.cpp | 18 ++++++++++++++++++ src/Main/Forms/EncryptionOptionsWizardPage.h | 6 ++++++ 2 files changed, 24 insertions(+) diff --git a/src/Main/Forms/EncryptionOptionsWizardPage.cpp b/src/Main/Forms/EncryptionOptionsWizardPage.cpp index e20a6593..0d899fb5 100644 --- a/src/Main/Forms/EncryptionOptionsWizardPage.cpp +++ b/src/Main/Forms/EncryptionOptionsWizardPage.cpp @@ -24,6 +24,9 @@ namespace VeraCrypt : EncryptionOptionsWizardPageBase (parent) { +#ifdef TC_MACOSX + EncryptionAlgorithmStaticText->Connect( wxEVT_SIZE, wxSizeEventHandler( EncryptionOptionsWizardPage::HandleOnSize ), NULL, this ); +#endif EncryptionAlgorithms = EncryptionAlgorithm::GetAvailableAlgorithms(); foreach (shared_ptr ea, EncryptionAlgorithms) { @@ -45,6 +48,21 @@ namespace VeraCrypt } +#ifdef TC_MACOSX + EncryptionOptionsWizardPage::~EncryptionOptionsWizardPage() + { + EncryptionAlgorithmStaticText->Disconnect( wxEVT_SIZE, wxSizeEventHandler( EncryptionOptionsWizardPage::HandleOnSize ), NULL, this ); + } + + void EncryptionOptionsWizardPage::HandleOnSize( wxSizeEvent& event ) + { + int width, height; + EncryptionAlgorithmStaticText->GetClientSize (&width, &height); + EncryptionAlgorithmStaticText->Wrap (width); + event.Skip(); + } +#endif + shared_ptr EncryptionOptionsWizardPage::GetEncryptionAlgorithm () const { return Gui->GetSelectedData (EncryptionAlgorithmChoice)->GetNew(); diff --git a/src/Main/Forms/EncryptionOptionsWizardPage.h b/src/Main/Forms/EncryptionOptionsWizardPage.h index b8d42d7e..fbc63f9e 100644 --- a/src/Main/Forms/EncryptionOptionsWizardPage.h +++ b/src/Main/Forms/EncryptionOptionsWizardPage.h @@ -22,6 +22,9 @@ namespace VeraCrypt public: EncryptionOptionsWizardPage (wxPanel* parent); +#ifdef TC_MACOSX + ~EncryptionOptionsWizardPage (); +#endif shared_ptr GetEncryptionAlgorithm () const; shared_ptr GetHash () const; bool IsValid () { return true; } @@ -37,6 +40,9 @@ namespace VeraCrypt void OnHashHyperlinkClick (wxHyperlinkEvent& event); void OnTestButtonClick (wxCommandEvent& event); +#ifdef TC_MACOSX + void HandleOnSize( wxSizeEvent& event ); +#endif EncryptionAlgorithmList EncryptionAlgorithms; HashList Hashes; };