VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/VolumePimWizardPage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main/Forms/VolumePimWizardPage.cpp')
-rw-r--r--src/Main/Forms/VolumePimWizardPage.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Main/Forms/VolumePimWizardPage.cpp b/src/Main/Forms/VolumePimWizardPage.cpp
index 8ce23043..6500affb 100644
--- a/src/Main/Forms/VolumePimWizardPage.cpp
+++ b/src/Main/Forms/VolumePimWizardPage.cpp
@@ -23,6 +23,7 @@ namespace VeraCrypt
VolumePimWizardPage::VolumePimWizardPage (wxPanel* parent)
: VolumePimWizardPageBase (parent)
{
+ VolumePimTextCtrl->SetMinSize (wxSize (Gui->GetCharWidth (VolumePimTextCtrl) * 15, -1));
SetPimValidator ();
}
@@ -82,7 +83,7 @@ namespace VeraCrypt
}
else
{
- VolumePimHelpStaticText->SetForegroundColour(*wxBLACK);
+ VolumePimHelpStaticText->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
VolumePimHelpStaticText->SetLabel(LangString["IDC_PIM_HELP"]);
}
Fit();
@@ -91,9 +92,7 @@ namespace VeraCrypt
void VolumePimWizardPage::SetPimValidator ()
{
- 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));
+ wxTextValidator validator (wxFILTER_DIGITS);
VolumePimTextCtrl->SetValidator (validator);
}
@@ -110,7 +109,11 @@ namespace VeraCrypt
PimSizer->Replace (VolumePimTextCtrl, newTextCtrl);
VolumePimTextCtrl->Show (false);
- VolumePimTextCtrl->SetValue (wxString (L'X', VolumePimTextCtrl->GetLineLength(0)));
+ int txtLen = VolumePimTextCtrl->GetLineLength(0);
+ if (txtLen > 0)
+ {
+ VolumePimTextCtrl->SetValue (wxString (L'X', txtLen));
+ }
GetVolumePim ();
Fit();