aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2017-11-28 08:35:23 +0100
committerToni Uhlig <matzeton@googlemail.com>2017-11-28 08:35:23 +0100
commit93a9beaba09346b580d16bb171fcb3fd21015710 (patch)
tree846d21254c998ea55c8c6645a2b11b2d19cc7fcc /src
parentad2eb5255824e884771e4e6b9abb4bd09be596be (diff)
UpdateGUI: added minimalistic "TAB" navigation
Diffstat (limited to 'src')
-rw-r--r--src/UpdateGUI.cpp16
-rw-r--r--src/UpdateGUI.hpp1
2 files changed, 15 insertions, 2 deletions
diff --git a/src/UpdateGUI.cpp b/src/UpdateGUI.cpp
index 4d3e613..e46d634 100644
--- a/src/UpdateGUI.cpp
+++ b/src/UpdateGUI.cpp
@@ -24,6 +24,8 @@ wxBEGIN_EVENT_TABLE(UpdateGUIFrame, wxFrame)
EVT_BUTTON(wxID_IMPORTCSV, UpdateGUIFrame::OnImportCSV)
EVT_BUTTON(wxID_DOUPDATE, UpdateGUIFrame::OnUpdate)
+ EVT_NAVIGATION_KEY(UpdateGUIFrame::OnNavigationKey)
+
EVT_COMMAND(wxID_ANY, wxEVT_THREAD, UpdateGUIFrame::OnThread)
wxEND_EVENT_TABLE()
@@ -76,10 +78,10 @@ UpdateGUIFrame::UpdateGUIFrame(const wxString& title, const wxPoint& pos, const
subBox->Add(subButton, 0, wxALL, 5);
subBox->AddStretchSpacer();
ipEntry = new wxTextCtrl(this, wxID_IP, wxEmptyString, wxDefaultPosition,
- wxDefaultSize, wxTE_PROCESS_TAB);
+ wxDefaultSize, 0);
ipBox->Add(ipEntry, 1, wxEXPAND|wxALL, 5);
pwEntry = new wxTextCtrl(this, wxID_PW, wxEmptyString, wxDefaultPosition,
- wxDefaultSize, wxTE_PASSWORD | wxTE_PROCESS_TAB);
+ wxDefaultSize, wxTE_PASSWORD);
pwBox->Add(pwEntry, 1, wxEXPAND|wxALL, 5);
imgEntry = new wxTextCtrl(this, wxID_IMG, wxEmptyString, wxDefaultPosition,
wxDefaultSize, wxTE_READONLY
@@ -253,6 +255,16 @@ void UpdateGUIFrame::OnUpdate(wxCommandEvent& event)
SetStatusText(wxT("Jobs started."));
}
+void UpdateGUIFrame::OnNavigationKey(wxNavigationKeyEvent& event)
+{
+ /* Try to use a wxPanel OR make wxButtons work! */
+ auto focused_window = FindFocus()->GetId();
+ switch (focused_window) {
+ case wxID_IP: pwEntry->SetFocus(); break;
+ default: ipEntry->SetFocus(); break;
+ }
+}
+
void UpdateGUIFrame::OnThread(wxCommandEvent& event)
{
wxString wxs;
diff --git a/src/UpdateGUI.hpp b/src/UpdateGUI.hpp
index bba0799..e953ac6 100644
--- a/src/UpdateGUI.hpp
+++ b/src/UpdateGUI.hpp
@@ -45,6 +45,7 @@ private:
void OnUpdateFile(wxCommandEvent& event);
void OnImportCSV(wxCommandEvent& event);
void OnUpdate(wxCommandEvent& event);
+ void OnNavigationKey(wxNavigationKeyEvent& event);
void OnThread(wxCommandEvent& event);
wxDECLARE_EVENT_TABLE();