Re: xdialog background color
HINT: (take it or leave it)
Instead of using something like:
{Background=__backcolor__}
I use double square brackets:
{Background=[[backcolor]]}
And, yes, there is a method to my madness ==> The double square brackets will REALLY mess up the resulting xdialog and makes it hard to miss if you forget to change them with stritran - BTDT. (see attached screenshot before reading further - then go to the end)
Here's some code to demonstrate.
Now, you probably noticed right away that the "qty" wasn't corrected. However, did you notice the PDF 'variable' that wasn't fixed also? I'm sure some will catch it but it would be a lot easier to miss - especially if there were more text - than the [[]] stuff. (That's not in the code above. I added it to the screenshot for demo purposes only.)
Edit: Actually, this screenshot is a bad example. Often the text being modified is within a paragraph (or at least a sentence or label area) of text and the error becomes even more obvious. In this example, it almost looks like there should be a data entry field where the [[]] was used.
HINT: (take it or leave it)
Instead of using something like:
{Background=__backcolor__}
I use double square brackets:
{Background=[[backcolor]]}
And, yes, there is a method to my madness ==> The double square brackets will REALLY mess up the resulting xdialog and makes it hard to miss if you forget to change them with stritran - BTDT. (see attached screenshot before reading further - then go to the end)
Here's some code to demonstrate.
Code:
fchc = "SomeFolder" qty = 9 dlg_text = <<%dlg% {ysize=.3}{units=F}{font=Arial,9,n}{sp}{background=pale yellow}{wrap=75}; {color=red}{font=Arial,11,b}THIS PROCESS CANNOT BE UNDONE!;{font=Arial,9,n}{color=black} {sp}; Since this process can only be undone by moving each file manually, please verify that the PDF files in the New_Scans folder will be moved to the following destination folder after encryption.; {sp}; {font=Arial,11,b}Files to be Encrypted:{font=Arial,11,b} [[qty]]; {sp}; {font=Arial,11,b}Destination Folder:{font=Arial,11,b}{color=red} [[fchc]]; {color=black} {sp};{font=Arial,9,n} {justify=center}<*Yes - this above folder is correct!OK> <Oops\! Wrong folder!cancel> %dlg% 'dlg_text = stritran( dlg_text, "[[qty]]", ltrim(str(qty)) ) dlg_text = stritran( dlg_text, "[[fchc]]", alltrim( fchc ) ) DIM dlg_result as C dlg_result = ui_dlg_box( "VERIFY SCAN FOLDER", dlg_text, <<%code% %code%)
Edit: Actually, this screenshot is a bad example. Often the text being modified is within a paragraph (or at least a sentence or label area) of text and the error becomes even more obvious. In this example, it almost looks like there should be a data entry field where the [[]] was used.
Comment