Fixing warnings and style.
This commit is contained in:
@@ -19,7 +19,8 @@ namespace xe {
|
|||||||
namespace ui {
|
namespace ui {
|
||||||
|
|
||||||
MainWindow::MainWindow(Emulator* emulator)
|
MainWindow::MainWindow(Emulator* emulator)
|
||||||
: PlatformWindow(L"xenia"), emulator_(emulator),
|
: PlatformWindow(L"xenia"),
|
||||||
|
emulator_(emulator),
|
||||||
main_menu_(MenuItem::Type::kNormal) {}
|
main_menu_(MenuItem::Type::kNormal) {}
|
||||||
|
|
||||||
MainWindow::~MainWindow() = default;
|
MainWindow::~MainWindow() = default;
|
||||||
@@ -74,7 +75,8 @@ bool MainWindow::Initialize() {
|
|||||||
|
|
||||||
main_menu_.AddChild(std::move(file));
|
main_menu_.AddChild(std::move(file));
|
||||||
|
|
||||||
auto debug = std::make_unique<PlatformMenu>(MenuItem::Type::kPopup, L"&Debug");
|
auto debug =
|
||||||
|
std::make_unique<PlatformMenu>(MenuItem::Type::kPopup, L"&Debug");
|
||||||
|
|
||||||
SetMenu(&main_menu_);
|
SetMenu(&main_menu_);
|
||||||
|
|
||||||
@@ -89,9 +91,7 @@ void MainWindow::OnClose() {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::OnCommand(int id) {
|
void MainWindow::OnCommand(int id) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
X_STATUS MainWindow::LaunchPath(std::wstring path) {
|
X_STATUS MainWindow::LaunchPath(std::wstring path) {
|
||||||
X_STATUS result;
|
X_STATUS result;
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
// TODO(benvanik): only on windows.
|
// TODO(benvanik): only on windows.
|
||||||
#include "xenia/ui/win32/win32_loop.h"
|
#include "xenia/ui/win32/win32_loop.h"
|
||||||
#include "xenia/ui/win32/win32_window.h"
|
|
||||||
#include "xenia/ui/win32/win32_menu_item.h"
|
#include "xenia/ui/win32/win32_menu_item.h"
|
||||||
|
#include "xenia/ui/win32/win32_window.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
class Emulator;
|
class Emulator;
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ namespace ui {
|
|||||||
|
|
||||||
MenuItem::MenuItem(Type type) : type_(type), parent_item_(nullptr) {}
|
MenuItem::MenuItem(Type type) : type_(type), parent_item_(nullptr) {}
|
||||||
|
|
||||||
MenuItem::MenuItem(Type type, const std::wstring &text) :
|
MenuItem::MenuItem(Type type, const std::wstring& text)
|
||||||
type_(type), parent_item_(nullptr), text_(text) {}
|
: type_(type), parent_item_(nullptr), text_(text) {}
|
||||||
|
|
||||||
MenuItem::~MenuItem() = default;
|
MenuItem::~MenuItem() = default;
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ Win32MenuItem::Win32MenuItem(Type type, int id, const std::wstring& text)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Win32MenuItem::Win32MenuItem(Type type)
|
Win32MenuItem::Win32MenuItem(Type type) : Win32MenuItem(type, 0, L"") {}
|
||||||
: Win32MenuItem(type, 0, L"") {}
|
|
||||||
|
|
||||||
Win32MenuItem::Win32MenuItem(Type type, const std::wstring& text)
|
Win32MenuItem::Win32MenuItem(Type type, const std::wstring& text)
|
||||||
: Win32MenuItem(type, 0, text) {}
|
: Win32MenuItem(type, 0, text) {}
|
||||||
@@ -44,7 +43,8 @@ void Win32MenuItem::OnChildAdded(MenuItem* generic_child_item) {
|
|||||||
|
|
||||||
switch (child_item->type()) {
|
switch (child_item->type()) {
|
||||||
case MenuItem::Type::kPopup:
|
case MenuItem::Type::kPopup:
|
||||||
AppendMenuW(handle_, MF_POPUP, (UINT)child_item->handle(),
|
AppendMenuW(handle_, MF_POPUP,
|
||||||
|
reinterpret_cast<UINT_PTR>(child_item->handle()),
|
||||||
child_item->text().c_str());
|
child_item->text().c_str());
|
||||||
break;
|
break;
|
||||||
case MenuItem::Type::kSeparator:
|
case MenuItem::Type::kSeparator:
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ class Win32MenuItem : public MenuItem {
|
|||||||
void OnChildRemoved(MenuItem* child_item) override;
|
void OnChildRemoved(MenuItem* child_item) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
HMENU handle_;
|
HMENU handle_;
|
||||||
uint32_t position_; // Position within parent, if any
|
uint32_t position_; // Position within parent, if any
|
||||||
int id_;
|
int id_;
|
||||||
|
|||||||
@@ -204,9 +204,7 @@ LRESULT Win32Window::WndProc(HWND hWnd, UINT message, WPARAM wParam,
|
|||||||
|
|
||||||
case WM_COMMAND: {
|
case WM_COMMAND: {
|
||||||
OnCommand(LOWORD(wParam));
|
OnCommand(LOWORD(wParam));
|
||||||
break;
|
} break;
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Win32Control::WndProc(hWnd, message, wParam, lParam);
|
return Win32Control::WndProc(hWnd, message, wParam, lParam);
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
#include "xenia/base/delegate.h"
|
#include "xenia/base/delegate.h"
|
||||||
#include "xenia/ui/control.h"
|
#include "xenia/ui/control.h"
|
||||||
#include "xenia/ui/ui_event.h"
|
|
||||||
#include "xenia/ui/menu_item.h"
|
#include "xenia/ui/menu_item.h"
|
||||||
|
#include "xenia/ui/ui_event.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
|||||||
Reference in New Issue
Block a user