Page 1 of 1

Alert, MsgBox

Posted: Wed Feb 02, 2011 5:04 am
by Zdeno Bielik
Hi Roger,

is it possible add next optional parameter for Parent of created Alert's dialog?
Now, when some dialog window is moved in any side(to left or to right) or to second monitor(pc with two displays or notebook with attached next external monitor), Alert window is showed in the center of first monitor and not in or over wanted dialog window...

DC_GUIAlertColor( { GRA_CLR_WHITE, GRA_CLR_RED } )
nChoice := DC_GuiAlert( ... )


Also, there is something similar with DC_MsgBox - there is EVAL clause, where I can use DC_CenterObject(o,oMyDlgScr), but there is unwanted graphical side effect when is visible how object is moved.

Zdeno

Re: Alert, MsgBox

Posted: Wed Feb 02, 2011 8:07 am
by rdonnay
Yes, that makes sense.

Re: Alert, MsgBox

Posted: Wed Feb 02, 2011 9:16 am
by rdonnay
Coming in build 255 (this week):

1151. Added new OWNER parameter to the DCMSGBOX command and DC_MsgBox()
function. If the owner parameter is not used, the message box will
center on the primary monitor, otherwise it will center on the owner.

1152. Added new BUTTSIZE and HORIZONTAL parameters to the DCMSGBOX command
and DC_MsgBox() function. BUTTSIZE <aButtSize> will set the size of
buttons that are created with the BUTTONS clause. HORIZONTAL will
place the buttons horizontally instead of vertically.

Code: Select all

#INCLUDE "dcdialog.CH"

FUNCTION Main()

LOCAL GetList[0], oDlg

@ 0,0 DCSAY 'This is a test of DCMSGBOX centering on its owner'

@ 20,0 DCPUSHBUTTON CAPTION 'Test It!' SIZE 20,2 ACTION {||TestIt(oDlg)}

DCREAD GUI TITLE 'Msgbox centering' PARENT @oDlg

RETURN nil

* --------------

FUNCTION TestIt( oOwner )

LOCAL lStatus, nChoice := 2

DCMSGBOX 'This is a test','of the','Message box','system' ;
   BUTTONS {'Button1','Button2','Button3'} TO lStatus ;
   CHOICE @nChoice ;
   FONT '12.Helvetica Bold' ;
   COLOR GRA_CLR_RED ;
   BUTTSIZE 90,30 HORIZONTAL ;
   OWNER oOwner

RETURN nil


PROC appsys ; return

Re: Alert, MsgBox

Posted: Wed Feb 02, 2011 10:39 am
by bwolfsohn
rdonnay wrote:Coming in build 255 (this week):

1151. Added new OWNER parameter to the DCMSGBOX command and DC_MsgBox()
function. If the owner parameter is not used, the message box will
center on the primary monitor, otherwise it will center on the owner.
Roger,
i think you need to add a get/set to allow the default to center the box on the owner if desired..

That will save much recoding for many..

Re: Alert, MsgBox

Posted: Wed Feb 02, 2011 11:12 am
by rdonnay
The owner will default as the SetAppWindow() object.

Re: Alert, MsgBox

Posted: Wed Feb 02, 2011 12:42 pm
by bwolfsohn
rdonnay wrote:The owner will default as the SetAppWindow() object.
If this is not the primary monitor, you need to make the change in the docs..

thanks..

Re: Alert, MsgBox

Posted: Wed Feb 02, 2011 1:30 pm
by rdonnay
I made the changes in the code and the docs.

Re: Alert, MsgBox - build 255

Posted: Sun Feb 06, 2011 4:23 am
by Zdeno Bielik
Hi Roger,

first, thanks for adding new OWNER clause.

But there are few problems with DCMsgBox:
1. it looks like default behavior from previous builds was changed from centering of pushbuttons to alingment them to left... why? is it possible add any set/get function to set this default/wanted behavior? see 1a vs 2b or 4a vs 4b in attached image

2. in next code is missing parameter BUTTSIZE - docs says that size of buttons will depends on longest caption - and in this example both two buttons have 4 chars, so why it is so big ? and first is wrong painted too...

DCMSGBOX 'This is', 'a test', 'info', 'message' ;
BUTTONS { 'but1', 'but2' } ;
CHOICE @nChoice ;
FONT '8.Arial' ;
ICON XBPSTATIC_SYSICON_ICONQUESTION ;
HORIZONTAL

3. also, is it possible add color clause for whole dcstatic area and not only for text? something like I can set e.g. for DC_Alert() with DC_GUIAlertColor()
Now if I set COLOR for info text of DcMsgBox to e.g. White On Red, it looks not nice - more better will it looks on whole RED drawingarea of MsgBox dialog window

Zdeno