mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-21 06:32:05 +02:00
v114.5
* improved appended firmware detection [devinacker] * added dynamic rate control support to ALSA and PulseAudio drivers [RedDwarf] * added option to use native file dialogs
This commit is contained in:
@@ -6,6 +6,13 @@ static auto Application_keyboardProc(HWND, UINT, WPARAM, LPARAM) -> bool;
|
||||
static auto Application_processDialogMessage(MSG&) -> void;
|
||||
static auto CALLBACK Window_windowProc(HWND, UINT, WPARAM, LPARAM) -> LRESULT;
|
||||
|
||||
auto pApplication::exit() -> void {
|
||||
quit();
|
||||
auto processID = GetCurrentProcessId();
|
||||
auto handle = OpenProcess(SYNCHRONIZE | PROCESS_TERMINATE, true, processID);
|
||||
TerminateProcess(handle, 0);
|
||||
}
|
||||
|
||||
auto pApplication::modal() -> bool {
|
||||
return state().modalCount > 0;
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@
|
||||
namespace hiro {
|
||||
|
||||
struct pApplication {
|
||||
static auto exit() -> void;
|
||||
static auto modal() -> bool;
|
||||
static auto run() -> void;
|
||||
static auto pendingEvents() -> bool;
|
||||
|
@@ -19,12 +19,9 @@ static auto BrowserWindow_fileDialog(bool save, BrowserWindow::State& state) ->
|
||||
|
||||
string filters;
|
||||
for(auto& filter : state.filters) {
|
||||
auto part = filter.split("(");
|
||||
auto part = filter.split("|", 1L);
|
||||
if(part.size() != 2) continue;
|
||||
part[1].trimRight(")", 1L);
|
||||
part[1].replace(" ", "");
|
||||
part[1].transform(",", ";");
|
||||
filters.append(filter, "\t", part[1], "\t");
|
||||
filters.append(filter, "\t", part[1].merge(";"), "\t");
|
||||
}
|
||||
|
||||
utf16_t wfilters(filters);
|
||||
|
@@ -3,7 +3,9 @@
|
||||
namespace hiro {
|
||||
|
||||
auto pFrame::construct() -> void {
|
||||
hwnd = CreateWindow(L"BUTTON", L"",
|
||||
hwnd = CreateWindowEx(
|
||||
//WS_EX_TRANSPARENT fixes rendering issues caused by Windows using WS_CLIPCHILDREN
|
||||
WS_EX_TRANSPARENT, L"BUTTON", L"",
|
||||
WS_CHILD | BS_GROUPBOX,
|
||||
0, 0, 0, 0, _parentHandle(), nullptr, GetModuleHandle(0), 0);
|
||||
pWidget::construct();
|
||||
|
@@ -94,22 +94,6 @@ auto pLabel::windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) -> ma
|
||||
return msg == WM_ERASEBKGND;
|
||||
}
|
||||
|
||||
if(msg == WM_LBUTTONDOWN || msg == WM_MBUTTONDOWN || msg == WM_RBUTTONDOWN) {
|
||||
switch(msg) {
|
||||
case WM_LBUTTONDOWN: self().doMousePress(Mouse::Button::Left); break;
|
||||
case WM_MBUTTONDOWN: self().doMousePress(Mouse::Button::Middle); break;
|
||||
case WM_RBUTTONDOWN: self().doMousePress(Mouse::Button::Right); break;
|
||||
}
|
||||
}
|
||||
|
||||
if(msg == WM_LBUTTONUP || msg == WM_MBUTTONUP || msg == WM_RBUTTONUP) {
|
||||
switch(msg) {
|
||||
case WM_LBUTTONUP: self().doMouseRelease(Mouse::Button::Left); break;
|
||||
case WM_MBUTTONUP: self().doMouseRelease(Mouse::Button::Middle); break;
|
||||
case WM_RBUTTONUP: self().doMouseRelease(Mouse::Button::Right); break;
|
||||
}
|
||||
}
|
||||
|
||||
return pWidget::windowProc(hwnd, msg, wparam, lparam);
|
||||
}
|
||||
|
||||
|
@@ -74,6 +74,8 @@ auto pWidget::setGeometry(Geometry geometry) -> void {
|
||||
geometry.setY(geometry.y() - displacement.y());
|
||||
}
|
||||
SetWindowPos(hwnd, nullptr, geometry.x(), geometry.y(), geometry.width(), geometry.height(), SWP_NOZORDER);
|
||||
//RedrawWindow fixes painting problems when adjusting Layouts manually
|
||||
RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ALLCHILDREN);
|
||||
pSizable::setGeometry(geometry);
|
||||
}
|
||||
|
||||
|
@@ -16,10 +16,9 @@ static auto CALLBACK Window_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
|
||||
return Shared_windowProc(DefWindowProc, hwnd, msg, wparam, lparam);
|
||||
}
|
||||
|
||||
//warning: do not add WS_CLIPCHILDREN; this will break painting of Frame ("BUTTON" BS_GROUPBOX) controls
|
||||
static const uint PopupStyle = WS_POPUP;
|
||||
static const uint FixedStyle = WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX | WS_BORDER;
|
||||
static const uint ResizableStyle = WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_THICKFRAME;
|
||||
static const uint PopupStyle = WS_POPUP | WS_CLIPCHILDREN;
|
||||
static const uint FixedStyle = WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX | WS_BORDER | WS_CLIPCHILDREN;
|
||||
static const uint ResizableStyle = WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_THICKFRAME | WS_CLIPCHILDREN;
|
||||
|
||||
uint pWindow::minimumStatusHeight = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user