Page 1 of 1

CenterMsgs()

Posted: Sun Dec 22, 2019 2:05 pm
by byte-one
If on start of the app CenterMsgs() are using, then freezes the programm after call a msgrun() with title!

Re: CenterMsgs()

Posted: Sun Dec 22, 2019 6:12 pm
by nageswaragunupudi
To center msgRun() in a window/dialog, use this syntax"

Code: Select all

MsgRun( cCaption, cTitle, bAction, oWndParent )

Re: CenterMsgs()

Posted: Mon Dec 23, 2019 7:29 am
by nageswaragunupudi
byte-one wrote:If on start of the app CenterMsgs() are using, then freezes the programm after call a msgrun() with title!
Please make the following correction to
fwh\source\function\msgrun.prg:

Please locate the following lines in the function msgrun(...)
lines 25 to 34

Code: Select all

     IF cTitle == NIL
          DEFINE DIALOG oDlg ;
               FROM 0,0 TO 3, Len( cCaption ) + 4 ;
               STYLE nOr( DS_MODALFRAME, WS_POPUP )
     ELSE
          DEFINE DIALOG oDlg ;
               FROM 0,0 TO 4, Max( Len( cCaption ), Len( cTitle ) ) + 4 ;
               TITLE cTitle ;
               STYLE DS_MODALFRAME
     ENDIF
 
Please modify the last lines like this:

Code: Select all

     IF cTitle == NIL
          DEFINE DIALOG oDlg ;
               FROM 0,0 TO 3, Len( cCaption ) + 4 ;
               STYLE nOr( DS_MODALFRAME, WS_POPUP )
     ELSE
          DEFINE DIALOG oDlg ;
               FROM 0,0 TO 4, Max( Len( cCaption ), Len( cTitle ) ) + 4 + 2 ;
               TITLE cTitle

     ENDIF