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

View file

@ -31,16 +31,21 @@ MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsi
int w, h;
int left = 8;
int th;
int x = 0;
int ww = MwGetInteger(handle, MwNwidth);
int wh = MwGetInteger(handle, MwNheight);
int x = 0;
int wx;
int wy;
int ww = handle == NULL ? 0 : MwGetInteger(handle, MwNwidth);
int wh = handle == NULL ? 0 : MwGetInteger(handle, MwNheight);
w = 512;
h = 32 * 4;
wx = wy = 0;
if(handle == NULL) wx = wy = MwDEFAULT;
p.x = (ww - w) / 2;
p.y = (wh - h) / 2;
window = MwVaCreateWidget(MwWindowClass, "messagebox", handle, 0, 0, w, h,
window = MwVaCreateWidget(MwWindowClass, "messagebox", handle, wx, wy, w, h,
MwNtitle, title,
NULL);
@ -100,7 +105,7 @@ MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsi
NULL);
MwLLBeginStateChange(window->lowlevel);
MwLLDetach(window->lowlevel, &p);
if(handle != NULL) MwLLDetach(window->lowlevel, &p);
MwLLSetSizeHints(window->lowlevel, w, h, w, h);
MwLLMakePopup(window->lowlevel, handle->lowlevel);
MwLLEndStateChange(window->lowlevel);