DVX_GUI/dvx/dvxDialog.h

63 lines
2.2 KiB
C

// dvxDialog.h — Modal dialogs for DVX GUI
#ifndef DVX_DIALOG_H
#define DVX_DIALOG_H
#include "dvxApp.h"
// ============================================================
// Message box button flags
// ============================================================
#define MB_OK 0x0000
#define MB_OKCANCEL 0x0001
#define MB_YESNO 0x0002
#define MB_YESNOCANCEL 0x0003
#define MB_RETRYCANCEL 0x0004
// ============================================================
// Message box icon flags
// ============================================================
#define MB_ICONINFO 0x0010
#define MB_ICONWARNING 0x0020
#define MB_ICONERROR 0x0030
#define MB_ICONQUESTION 0x0040
// ============================================================
// Message box return values
// ============================================================
#define ID_OK 1
#define ID_CANCEL 2
#define ID_YES 3
#define ID_NO 4
#define ID_RETRY 5
// Show a modal message box and return which button was pressed.
// flags = MB_xxx button flag | MB_ICONxxx icon flag
int32_t dvxMessageBox(AppContextT *ctx, const char *title, const char *message, int32_t flags);
// ============================================================
// File dialog flags
// ============================================================
#define FD_OPEN 0x0000 // Open file (default)
#define FD_SAVE 0x0001 // Save file
// ============================================================
// File dialog filter
// ============================================================
typedef struct {
const char *label; // e.g. "Text Files (*.txt)"
const char *pattern; // e.g. "*.txt" (case-insensitive, single pattern)
} FileFilterT;
// Show a modal file open/save dialog. Returns true if the user selected
// a file, false if cancelled. The selected path is written to outPath
// (buffer must be at least outPathSize bytes).
// initialDir may be NULL (defaults to current directory).
// filters/filterCount may be NULL/0 for no filter dropdown.
bool dvxFileDialog(AppContextT *ctx, const char *title, int32_t flags, const char *initialDir, const FileFilterT *filters, int32_t filterCount, char *outPath, int32_t outPathSize);
#endif // DVX_DIALOG_H