summaryrefslogtreecommitdiff
path: root/src/wx/password_entry.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-10-20 22:12:41 +0100
committerCarl Hetherington <cth@carlh.net>2021-12-03 00:21:28 +0100
commitf1ea52e954cc466d70b5d5ee530a7af5d41b9cc6 (patch)
treee85d64bd9fb2d5755a6e802dfa5e8abab668678e /src/wx/password_entry.cc
parent5b1002d4668e22d21f23ed374779b899c5972f84 (diff)
Assorted tidying up.
Diffstat (limited to 'src/wx/password_entry.cc')
-rw-r--r--src/wx/password_entry.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/wx/password_entry.cc b/src/wx/password_entry.cc
index f44ed9cb0..4dd894718 100644
--- a/src/wx/password_entry.cc
+++ b/src/wx/password_entry.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2019-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -18,17 +18,20 @@
*/
-#include "password_entry.h"
+
#include "check_box.h"
+#include "password_entry.h"
#include "wx_util.h"
+
using std::string;
using boost::bind;
+
PasswordEntry::PasswordEntry (wxWindow* parent)
{
_panel = new wxPanel (parent, wxID_ANY);
- wxBoxSizer* sizer = new wxBoxSizer (wxHORIZONTAL);
+ auto sizer = new wxBoxSizer (wxHORIZONTAL);
_text = new wxTextCtrl (_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD);
sizer->Add (_text, 1, wxRIGHT, DCPOMATIC_SIZER_GAP);
_show = new CheckBox (_panel, _("Show"));
@@ -39,18 +42,20 @@ PasswordEntry::PasswordEntry (wxWindow* parent)
_text->Bind (wxEVT_TEXT, bind(boost::ref(Changed)));
}
+
wxPanel *
PasswordEntry::get_panel () const
{
return _panel;
}
+
void
PasswordEntry::show_clicked ()
{
_panel->Freeze ();
- wxString const pass = _text->GetValue ();
- wxSizer* sizer = _text->GetContainingSizer ();
+ auto const pass = _text->GetValue ();
+ auto sizer = _text->GetContainingSizer ();
long from, to;
_text->GetSelection (&from, &to);
sizer->Detach (_text);
@@ -63,12 +68,14 @@ PasswordEntry::show_clicked ()
_panel->Thaw ();
}
+
string
PasswordEntry::get () const
{
return wx_to_std (_text->GetValue());
}
+
void
PasswordEntry::set (string s)
{