04-11-2023, 05:22 PM
One thing that I like to do is put a couple of outermost lines of a text box as black. It tends to make my dialog boxes "pop" when over-layed against various background colors.
For example...
For example...
Code: (Select All)
SUB Dialog_Box (heading AS STRING, xsiz AS INTEGER, ysiz AS INTEGER, ypos AS INTEGER, bcol AS _UNSIGNED LONG, tcol AS _UNSIGNED LONG, xj AS STRING)
cr& = _DEST ' save calling destination
dbox& = _NEWIMAGE(xsiz, ysiz, 32) ' define box
_DEST dbox&
COLOR tcol, &HFF282828 ' set text color with grey background
CLS
FOR x% = 0 TO 5 ' draw bounding box 6 pixels thick
b~& = -&HFF000000 * (x% < 2) - bcol * (x% >= 2) ' color=outer two black, balance bcol
LINE (0 + x%, 0 + x%)-(xsiz - 1 - x%, ysiz - 1 - x%), b~&, B 'draw color border
NEXT x%
_PRINTSTRING (_SHR(xsiz, 1) - _SHL(LEN(heading), 2), 31), heading 'print heading centered, two rows below top
_DEST cr& ' restore calling destination
xp = 0 * (xj = "l") - (_SHR(_WIDTH, 1) - _SHR(xsiz, 1)) * (xj = "c") - (_WIDTH - xsiz) * (xj = "r") 'set justification
_PUTIMAGE (xp, ypos), dbox& ' display box
_FREEIMAGE dbox& ' clean up
END SUB 'Dialog_Box
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
sha_na_na_na_na_na_na_na_na_na: