mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-19 17:15:11 +00:00

tab ordering has been added to the username textbox and the list of methods. this serves two purposes: 1. the listbox is initially selected, so the user can select entries using keyboard. 2. navigation between the listbox and the username textbox can be done using TAB. additionally, 3. the message and control layout has been tweaked to hopefully make it a bit user friendly. 4. the last selected method is remembered via a preference key. 5. a [X] button has been added on top-right so that the window can be closed via mouse. (previously, it was only possible with the keyboard Esc option or by clicking on one of the methods.)
45 lines
1010 B
C++
45 lines
1010 B
C++
/*
|
|
Copyright (C) 2008 - 2024
|
|
by Mark de Wever <koraq@xs4all.nl>
|
|
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY.
|
|
|
|
See the COPYING file for more details.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "gui/dialogs/modal_dialog.hpp"
|
|
|
|
namespace gui2::dialogs
|
|
{
|
|
|
|
class mp_method_selection : public modal_dialog
|
|
{
|
|
public:
|
|
/** Corresponds to each connection option. */
|
|
enum class choice { JOIN = 0, CONNECT, HOST, LOCAL };
|
|
|
|
mp_method_selection()
|
|
: modal_dialog(window_id())
|
|
{
|
|
}
|
|
|
|
choice get_choice() const;
|
|
|
|
private:
|
|
virtual const std::string& window_id() const override;
|
|
|
|
virtual void pre_show() override;
|
|
|
|
virtual void post_show() override;
|
|
};
|
|
|
|
} // namespace dialogs
|