diff options
Diffstat (limited to 'src/connection_dialog.cpp')
| -rw-r--r-- | src/connection_dialog.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
| diff --git a/src/connection_dialog.cpp b/src/connection_dialog.cpp new file mode 100644 index 0000000..9dd9984 --- /dev/null +++ b/src/connection_dialog.cpp | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | #include "connection_dialog.h" | ||
| 2 | |||
| 3 | #include "tracker_config.h" | ||
| 4 | |||
| 5 | ConnectionDialog::ConnectionDialog() | ||
| 6 | : wxDialog(nullptr, wxID_ANY, "Connect to Archipelago") { | ||
| 7 | server_box_ = new wxTextCtrl(this, -1, GetTrackerConfig().ap_server, wxDefaultPosition, | ||
| 8 | {300, -1}); | ||
| 9 | player_box_ = new wxTextCtrl(this, -1, GetTrackerConfig().ap_player, wxDefaultPosition, | ||
| 10 | {300, -1}); | ||
| 11 | password_box_ = new wxTextCtrl(this, -1, GetTrackerConfig().ap_password, | ||
| 12 | wxDefaultPosition, {300, -1}); | ||
| 13 | |||
| 14 | wxFlexGridSizer* form_sizer = new wxFlexGridSizer(2, 10, 10); | ||
| 15 | |||
| 16 | form_sizer->Add( | ||
| 17 | new wxStaticText(this, -1, "Server:"), | ||
| 18 | wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); | ||
| 19 | form_sizer->Add(server_box_, wxSizerFlags().Expand()); | ||
| 20 | form_sizer->Add( | ||
| 21 | new wxStaticText(this, -1, "Player:"), | ||
| 22 | wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); | ||
| 23 | form_sizer->Add(player_box_, wxSizerFlags().Expand()); | ||
| 24 | form_sizer->Add( | ||
| 25 | new wxStaticText(this, -1, "Password:"), | ||
| 26 | wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); | ||
| 27 | form_sizer->Add(password_box_, wxSizerFlags().Expand()); | ||
| 28 | |||
| 29 | wxBoxSizer* top_sizer = new wxBoxSizer(wxVERTICAL); | ||
| 30 | top_sizer->Add(new wxStaticText( | ||
| 31 | this, -1, "Enter the details to connect to Archipelago."), | ||
| 32 | wxSizerFlags().Align(wxALIGN_LEFT).DoubleBorder()); | ||
| 33 | top_sizer->Add(form_sizer, wxSizerFlags().DoubleBorder().Expand()); | ||
| 34 | top_sizer->Add(CreateButtonSizer(wxOK | wxCANCEL), wxSizerFlags().Center()); | ||
| 35 | |||
| 36 | SetSizerAndFit(top_sizer); | ||
| 37 | |||
| 38 | Center(); | ||
| 39 | server_box_->SetFocus(); | ||
| 40 | } | ||
