Position of msg* dialogs

Position of msg* dialogs

Postby ADutheil » Mon Jul 16, 2012 2:43 pm

Is there a way to have the msg* functions dialog obey the SetCenterOnParent( .T. ) setting?
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Position of msg* dialogs

Postby ukoenig » Mon Jul 16, 2012 5:32 pm

André,

I think it is not possible with the normal message.
I changed a few parts of the Messagebox-Functions from < Ramesh >.
viewtopic.php?f=3&t=22834&p=122051#p122051
Now it is possible, to center a message on any Dialog-position.
Sample : a full screen filemanager with a Dialog Top / left-corner
I can post the needed changes, in case You like this solution.

Working on a modified version testing all possible Messages,
Gradient-define and much more.

Image

Image

Image

Best Regards
Uwe :lol:
Last edited by ukoenig on Wed Jul 18, 2012 3:39 pm, edited 3 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Position of msg* dialogs

Postby ADutheil » Tue Jul 17, 2012 11:14 am

I was about to write my own functions but now you and Ramesh did it for me :D . Thanks a lot.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Position of msg* dialogs

Postby ukoenig » Tue Jul 17, 2012 12:02 pm

André,

how to use :

LOCAL aRect[4]

@ 200, 280 BUTTON "&Message" OF oDlg1 SIZE 45, 13 PIXEL ;
ACTION MYMSGBOX( .T., aRect, "There is an error and the process could not be completed."+CRLF+"Please try it once again.",,"Error Message",,,aGradiate1,,,,oIcon1)

// save the Dialog-zize to a Array
ACTIVATE DIALOG oDlg1 ;
ON INIT ( oDlg1:Move( 50, 30, , , .f. ), ;
aRect[1] := oDlg1:nTop, aRect[2] := oDlg1:nLeft, ;
aRect[3] := oDlg1:nHeight, aRect[4] := oDlg1:nWidth
)


Changes in Ramesh's function :

// lPosition = .T. means < calculated >
FUNCTION MyMsgBox( lPosition, aRect, cMsg, aOptions, cTitle, xIcon, nDefault, aGradiate, ;
bAction, oFont, cFileRes, oIcon, uVar, cPict, bValid,;
lSpinner, lMeter, oMeter, lCancel)
...
...
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT (DlgInit(oDlg, lPosition, aRect, oFont, cMsg, aOptions, cTitle, nDefault,;
aGradiate, bAction, xIcon, @uVar, cPict, bValid,;
lSpinner, lMeter, oMeter, @lCancel),;
gradiate(oDlg, aGradiate))

STATIC FUNCTION DlgInit(oDlg, lPosition, aRect, oFont, cMsg, aOptions, cTitle, nDefault,;
aGradiate, bAction, xIcon, uVar, cPict, bValid,;
lSpinner, lMeter, oMeter, lCancel )
...
...
// calculate the center-position
IF lPosition = .T.
oDlg:Move( aRect[1] + ( aRect[3] / 2 ) - ( nMaxHeight / 2 ), ;
aRect[2] + ( aRect[4] / 2 ) - ( nMaxWidth / 2 ), , , .f. )

ELSE
// centered on Main-window
WndCenter(oDlg:hWnd)
ENDIF

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Position of msg* dialogs

Postby ukoenig » Thu Jul 19, 2012 6:30 pm

View :

viewtopic.php?f=3&t=24479

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 95 guests