git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@719 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
Nishi 2025-11-14 17:29:30 +00:00
commit 2737f0fcf9
6 changed files with 17 additions and 7 deletions

View file

@ -36,6 +36,7 @@ MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsi
int wy;
int ww = handle == NULL ? 0 : MwGetInteger(handle, MwNwidth);
int wh = handle == NULL ? 0 : MwGetInteger(handle, MwNheight);
MwSizeHints sh;
w = 512;
h = 32 * 4;
@ -43,10 +44,14 @@ MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsi
wx = wy = 0;
if(handle == NULL) wx = wy = MwDEFAULT;
sh.min_width = sh.max_width = w;
sh.min_height = sh.max_height = h;
p.x = (ww - w) / 2;
p.y = (wh - h) / 2;
window = MwVaCreateWidget(MwWindowClass, "messagebox", handle, wx, wy, w, h,
MwNtitle, title,
MwNsizeHints, &sh,
NULL);
window->opaque = NULL;
@ -106,8 +111,7 @@ MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsi
MwLLBeginStateChange(window->lowlevel);
if(handle != NULL) MwLLDetach(window->lowlevel, &p);
MwLLSetSizeHints(window->lowlevel, w, h, w, h);
MwLLMakePopup(window->lowlevel, handle->lowlevel);
MwLLMakePopup(window->lowlevel, handle == NULL ? NULL : handle->lowlevel);
MwLLEndStateChange(window->lowlevel);
MwAddUserHandler(window, MwNcloseHandler, messagebox_close, NULL);