mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-20 15:36:47 +00:00
setting to prefer os native file dialog uis (off by default because they are slow and bad)
This commit is contained in:
@@ -680,6 +680,12 @@ os_graphical_message(B32 error, String8 title, String8 message)
|
||||
fprintf(stderr, "%.*s\n\n", str8_varg(message));
|
||||
}
|
||||
|
||||
internal String8
|
||||
os_graphical_pick_file(Arena *arena, String8 initial_path)
|
||||
{
|
||||
return str8_zero();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: @os_hooks Shell Operations
|
||||
|
||||
|
||||
@@ -191,6 +191,7 @@ internal void os_set_cursor(OS_Cursor cursor);
|
||||
//~ rjf: @os_hooks Native User-Facing Graphical Messages (Implemented Per-OS)
|
||||
|
||||
internal void os_graphical_message(B32 error, String8 title, String8 message);
|
||||
internal String8 os_graphical_pick_file(Arena *arena, String8 initial_path);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: @os_hooks Shell Operations
|
||||
|
||||
@@ -242,6 +242,12 @@ os_graphical_message(B32 error, String8 title, String8 message)
|
||||
{
|
||||
}
|
||||
|
||||
internal String8
|
||||
os_graphical_pick_file(Arena *arena, String8 initial_path)
|
||||
{
|
||||
return str8_zero();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: @os_hooks Shell Operations
|
||||
|
||||
|
||||
@@ -1577,6 +1577,29 @@ os_graphical_message(B32 error, String8 title, String8 message)
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
internal String8
|
||||
os_graphical_pick_file(Arena *arena, String8 initial_path)
|
||||
{
|
||||
String8 result = {0};
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
U64 buffer_size = 4096;
|
||||
U16 *buffer = push_array(scratch.arena, U16, buffer_size);
|
||||
OPENFILENAMEW params = {sizeof(params)};
|
||||
{
|
||||
params.lpstrFile = (WCHAR *)buffer;
|
||||
params.nMaxFile = buffer_size;
|
||||
params.lpstrInitialDir = (WCHAR *)str16_from_8(scratch.arena, initial_path).str;
|
||||
}
|
||||
if(GetOpenFileNameW(¶ms))
|
||||
{
|
||||
result = str8_from_16(arena, str16_cstring((U16 *)buffer));
|
||||
}
|
||||
scratch_end(scratch);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: @os_hooks Shell Operations
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#pragma comment(lib, "UxTheme")
|
||||
#pragma comment(lib, "ole32")
|
||||
#pragma comment(lib, "user32")
|
||||
#pragma comment(lib, "comdlg32")
|
||||
#ifndef WM_NCUAHDRAWCAPTION
|
||||
#define WM_NCUAHDRAWCAPTION (0x00AE)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user