-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwelcome_window.h
43 lines (34 loc) · 925 Bytes
/
welcome_window.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#if !defined(WELCOME_WINDOW_H)
#define WELCOME_WINDOW_H
#include <memory>
#include <optional>
#include "connection.h"
#include "util.h"
#include "window.h"
namespace trainlist8 {
class MessagePump;
class WelcomeWindow final : public Window {
public:
static const wchar_t windowClass[];
explicit WelcomeWindow(HWND handle, MessagePump &pump, const wchar_t *connectTo);
~WelcomeWindow() = default;
protected:
LRESULT windowProc(unsigned int message, WPARAM wParam, LPARAM lParam) override;
private:
std::unique_ptr<HFONT, util::FontDeleter> font;
HWND label;
HWND localhostRadio;
HWND otherComputerRadio;
HWND hostnameEdit;
HWND connectButton;
HWND cancelButton;
std::optional<Connection> connection;
winrt::Windows::Foundation::IAsyncAction connecting;
bool cancelling, closePending, quitOnDestroy;
void updateLayoutAndFont();
void updateControlsEnabled();
void connect();
};
}
#endif