COLOR clause in DSMSGBOX

This forum is for eXpress++ general support.
Post Reply
Message
Author
fursideup
Posts: 8
Joined: Tue Feb 02, 2010 2:26 pm
Location: Gates Canyon, California

COLOR clause in DSMSGBOX

#1 Post by fursideup »

need a way to change colors on message boxes
Jon Steven

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: COLOR clause in DSMSGBOX

#2 Post by rdonnay »

I can do this, but then all text will be the same color.
I'll send you an update.
The eXpress train is coming - and it has more cars.

fursideup
Posts: 8
Joined: Tue Feb 02, 2010 2:26 pm
Location: Gates Canyon, California

Re: COLOR clause in DSMSGBOX

#3 Post by fursideup »

that will be fine
Jon Steven

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: COLOR clause in DSMSGBOX

#4 Post by rdonnay »

Make the following change to DCDIALOG.CH:

Code: Select all

#xtranslate DCMSGBOX <list,...>       ;
           [TITLE <cTitle>]        ;
           [TIMEOUT <nSeconds>]    ;
           [<yesno:YESNO>]         ;
           [TO <output>]           ;
           [FONT <cFont>]          ;
           [BUTTONS <aButtons>]    ;
           [CHOICE <nChoice>]      ;
           [HOTKEY <cHotKey>]      ;
           [EVAL <bEval>]          ;
           [ICON <nIcon>]          ;
           [<nr:NOAUTORESTORE>]    ;
           [<always:ALWAYSONTOP>]  ;
           [_ALWAYSONTOP <_always>];
           [COLOR <nFg> [,<nBg>]]  ;   <<<<<<<<<<  
   =>                              ;
  [<output> := ] ;
    DC_MsgBox(,,{<list>},<cTitle>,,<nSeconds>,<.yesno.>,<nChoice>, ;
              <aButtons>,,,<cHotKey>,<cFont>,<bEval>,<nIcon>,<.nr.>, ;
              <.always.>[.OR.<_always>], ;
              [{<nFg>,<nBg>}] ) <<<<<<<<<<<<
Make the following change to _DCMSG.PRG

Code: Select all

FUNCTION dc_msgbox ( nRow, nCol, aMessage, cTitle, lWait, nSeconds, lYesNo,;
                     nChoice, aItems, aMenuId, cMenuName, cHotKey, cFont, ;
                     bEval, nIcon, lNoRestore, lAlwaysOnTop, ;
                     aColor )   <<<<<<<<


      FOR i := 1 TO LEN(aMessage)
        @ nLine, 1 DCSAY Pad(aMessage[i],nWidth) FONT cFont SIZE 0
        IF Valtype(aColor) == 'A'  <<<<<<<<<<<
           ATail(GetList)[aGETLIST_COLOR] := aColor  <<<<<<<<<<<
        ENDIF  <<<<<<<<<<<
        nLine++
      NEXT
dcmsgbox.zip is attached

Copy _dcmsg.prg to \exp19\source\dclipx and run build19_sl1.bat to rebuild dclipx.dll
Attachments
dcmsgbox.zip
(45.8 KiB) Downloaded 824 times
The eXpress train is coming - and it has more cars.

Post Reply