Page 1 of 1

DCMSGBOX...BUTTONS request

Posted: Fri Jun 04, 2010 10:22 am
by fbaker
Hello Roger,

Before the next release, could you take a look at the following mod as a possibility.
It would help the look of these buttons if there could be a BUTTSIZE width, height clause
where the understanding would be that the buttons in the buttons array are on a single row
with at least one col space between them if they fit within the width of the implied width of the msg box.

Thank you.

Fred 331/252 at the moment.

Re: DCMSGBOX...BUTTONS request

Posted: Sun Jun 06, 2010 11:38 am
by rdonnay
Trying to calculate all of this dynamically would require a major rewrite of the DC_MsgBox() function. It is old code and was never intended for this kind of complexity.

What I can do however, it modify the code to put the buttons in one row, with a fixed size if you pass a new BUTTSIZE parameter as an array (in pixels).

Re: DCMSGBOX...BUTTONS request

Posted: Sun Jun 06, 2010 4:58 pm
by fbaker
Roger,

I think we're on the same page. I would be very satisfied with a single BUTTSIZE declaration to size all buttons on a single row. Perhaps the absence of the BUTTSIZE clause could mean revert to the current display of stacked buttons. I'm really just looking for a button that looks more like the regular DCPUSHBUTTON sizing result.

Thank you. Fred

Re: DCMSGBOX...BUTTONS request

Posted: Mon Jun 07, 2010 10:16 am
by rdonnay
Here is a new _DCMSG.PRG and DCDIALOG.CH.

Copy _DCMSG.PRG to your \exp19\source\dclipx directory.
Copy DCDIALOG.CH to your \exp19\include directory.

Rebuild DCLIPX.DLL by running BUILD19.BAT or BUILD19_SL1.BAT.

There are new options to the DCMSGBOX command:

BUTTSIZE <nWidth>, <nHeight> [HORIZONTAL]

COLOR <nFgColor> [,<nBgColor>]

Example:

Code: Select all

#INCLUDE "dcdialog.CH"

FUNCTION Main()

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

wtf nChoice, lStatus pause

RETURN nil


PROC appsys ; return