@@ -4536,6 +4536,21 @@ int gws_dialog_box(int fd, int parent_wid, const char *message, int type)
45364536 int fInvalidParentWindow = FALSE;
45374537 int fClose = FALSE;
45384538
4539+ unsigned long dialog_l = 0 ;
4540+ unsigned long dialog_t = 0 ;
4541+ unsigned long dialog_w = 0 ;
4542+ unsigned long dialog_h = 0 ;
4543+ unsigned long screen_w = gws_get_system_metrics (1 );
4544+ unsigned long screen_h = gws_get_system_metrics (2 );
4545+
4546+ // Desired dialog size
4547+
4548+ dialog_w = 240 ;
4549+ dialog_h = 120 ;
4550+ // Center coordinates
4551+ dialog_l = (screen_w - dialog_w ) / 2 ;
4552+ dialog_t = (screen_h - dialog_h ) / 2 ;
4553+
45394554// Parameters validation
45404555// Make sure we don't proceed with invalid inputs.
45414556 if (fd < 0 )
@@ -4619,7 +4634,7 @@ int gws_dialog_box(int fd, int parent_wid, const char *message, int type)
46194634 WINDOW_STATUS_ACTIVE ,
46204635 WINDOW_STATE_NULL ,
46214636 "DialogBox" ,
4622- 100 , 100 , 240 , 120 ,
4637+ dialog_l , dialog_t , dialog_w , dialog_h ,
46234638 __pw_wid ,
46244639 0 ,
46254640 bg_color ,
@@ -4783,9 +4798,24 @@ int gws_message_box(int fd, int parent_wid, const char *message, int type)
47834798 int Type = type ;
47844799 int __pw_wid = parent_wid ;
47854800 int fInvalidParentWindow = FALSE;
4786-
47874801 int fClose = FALSE;
47884802
4803+ unsigned long dialog_l = 0 ;
4804+ unsigned long dialog_t = 0 ;
4805+ unsigned long dialog_w = 0 ;
4806+ unsigned long dialog_h = 0 ;
4807+ unsigned long screen_w = gws_get_system_metrics (1 );
4808+ unsigned long screen_h = gws_get_system_metrics (2 );
4809+
4810+ // Desired dialog size
4811+
4812+ dialog_w = 240 ;
4813+ dialog_h = 120 ;
4814+ // Center coordinates
4815+ dialog_l = (screen_w - dialog_w ) / 2 ;
4816+ dialog_t = (screen_h - dialog_h ) / 2 ;
4817+
4818+
47894819// Parameters validation
47904820// Make sure we don't proceed with invalid inputs.
47914821 if (fd < 0 )
@@ -4871,7 +4901,7 @@ int gws_message_box(int fd, int parent_wid, const char *message, int type)
48714901 WINDOW_STATUS_ACTIVE ,
48724902 WINDOW_STATE_NULL ,
48734903 "MessageBox" ,
4874- 100 , 100 , 240 , 120 ,
4904+ dialog_l , dialog_t , dialog_w , dialog_h ,
48754905 __pw_wid ,
48764906 0 ,
48774907 bg_color ,
0 commit comments