VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/VolumePimWizardPage.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-07-19 06:46:27 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-07-19 09:29:45 (GMT)
commit515895342820a9d0a35391ec4d316c3782a75768 (patch)
treeb3c64668eba1bd654914acd42e986d6f90d80462 /src/Main/Forms/VolumePimWizardPage.cpp
parent63818bcaa44b9ce0b59ac2c56afdee1f5e1976ba (diff)
downloadVeraCrypt-515895342820a9d0a35391ec4d316c3782a75768.zip
VeraCrypt-515895342820a9d0a35391ec4d316c3782a75768.tar.gz
User Interface enhancements for PIM
Diffstat (limited to 'src/Main/Forms/VolumePimWizardPage.cpp')
-rw-r--r--src/Main/Forms/VolumePimWizardPage.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/Main/Forms/VolumePimWizardPage.cpp b/src/Main/Forms/VolumePimWizardPage.cpp
index 58d9d6a..36dc4c7 100644
--- a/src/Main/Forms/VolumePimWizardPage.cpp
+++ b/src/Main/Forms/VolumePimWizardPage.cpp
@@ -23,6 +23,10 @@ namespace VeraCrypt
VolumePimWizardPage::VolumePimWizardPage (wxPanel* parent)
: VolumePimWizardPageBase (parent)
{
+ wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST); // wxFILTER_NUMERIC does not exclude - . , etc.
+ const wxChar *valArr[] = { L"0", L"1", L"2", L"3", L"4", L"5", L"6", L"7", L"8", L"9" };
+ validator.SetIncludes (wxArrayString (array_capacity (valArr), (const wxChar **) &valArr));
+ VolumePimTextCtrl->SetValidator (validator);
}
VolumePimWizardPage::~VolumePimWizardPage ()
@@ -46,6 +50,20 @@ namespace VeraCrypt
return 0;
}
+ void VolumePimWizardPage::SetVolumePim (int pim)
+ {
+ if (pim > 0)
+ {
+ VolumePimTextCtrl->SetValue (StringConverter::FromNumber (pim));
+ }
+ else
+ {
+ VolumePimTextCtrl->SetValue (wxT(""));
+ }
+
+ OnPimChanged (pim);
+ }
+
bool VolumePimWizardPage::IsValid ()
{
return true;
@@ -53,7 +71,12 @@ namespace VeraCrypt
void VolumePimWizardPage::OnPimChanged (wxCommandEvent& event)
{
- if (GetVolumePim() != 0)
+ OnPimChanged (GetVolumePim ());
+ }
+
+ void VolumePimWizardPage::OnPimChanged (int pim)
+ {
+ if (pim > 0)
{
VolumePimHelpStaticText->SetForegroundColour(*wxRED);
VolumePimHelpStaticText->SetLabel(LangString["PIM_CHANGE_WARNING"]);