More string conversion.
This commit is contained in:
@@ -53,7 +53,8 @@ Win32Window::~Win32Window() {
|
||||
}
|
||||
}
|
||||
|
||||
int Win32Window::Initialize(const char* title, uint32_t width, uint32_t height) {
|
||||
int Win32Window::Initialize(const std::wstring& title, uint32_t width,
|
||||
uint32_t height) {
|
||||
int result = Window::Initialize(title, width, height);
|
||||
if (result) {
|
||||
return result;
|
||||
@@ -164,11 +165,11 @@ void Win32Window::EnableMMCSS() {
|
||||
FreeLibrary(hLibrary);
|
||||
}
|
||||
|
||||
bool Win32Window::set_title(const char* title) {
|
||||
bool Win32Window::set_title(const std::wstring& title) {
|
||||
if (!Window::set_title(title)) {
|
||||
return false;
|
||||
}
|
||||
XEIGNORE(SetWindowTextA(handle_, title));
|
||||
XEIGNORE(SetWindowText(handle_, title.c_str()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,46 +10,45 @@
|
||||
#ifndef XENIA_UI_WIN32_WIN32_WINDOW_H_
|
||||
#define XENIA_UI_WIN32_WIN32_WINDOW_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <xenia/core.h>
|
||||
|
||||
#include <xenia/ui/window.h>
|
||||
|
||||
|
||||
namespace xe {
|
||||
namespace ui {
|
||||
namespace win32 {
|
||||
|
||||
|
||||
class Win32Window : public Window {
|
||||
public:
|
||||
public:
|
||||
Win32Window(xe_run_loop_ref run_loop);
|
||||
virtual ~Win32Window();
|
||||
~Win32Window() override;
|
||||
|
||||
virtual int Initialize(const char* title, uint32_t width, uint32_t height);
|
||||
int Initialize(const std::wstring& title, uint32_t width,
|
||||
uint32_t height) override;
|
||||
|
||||
virtual bool set_title(const char* title);
|
||||
virtual bool set_cursor_visible(bool value);
|
||||
bool set_title(const std::wstring& title) override;
|
||||
bool set_cursor_visible(bool value) override;
|
||||
HWND handle() const { return handle_; }
|
||||
|
||||
LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
protected:
|
||||
virtual bool SetSize(uint32_t width, uint32_t height);
|
||||
virtual void OnClose();
|
||||
protected:
|
||||
bool SetSize(uint32_t width, uint32_t height) override;
|
||||
void OnClose() override;
|
||||
|
||||
private:
|
||||
private:
|
||||
void EnableMMCSS();
|
||||
bool HandleMouse(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
bool HandleKeyboard(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
HWND handle_;
|
||||
bool closing_;
|
||||
HWND handle_;
|
||||
bool closing_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace win32
|
||||
} // namespace ui
|
||||
} // namespace xe
|
||||
|
||||
|
||||
#endif // XENIA_UI_WIN32_WIN32_WINDOW_H_
|
||||
|
||||
Reference in New Issue
Block a user