Grids

General development discussion.

Moderators: Susan Smith, admin, Gabriel

BLarry1T
Posts: 22
Joined: Thu Jul 14, 2011 9:14 am

Grids

Post by BLarry1T »

I seem to recall a demo at one of the conferences where a grid was displayed similar to green bar paper.

Does anyone recall which conference?
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Post by Gabriel »

Its been shown at a few conferences, from what I recall.

To do this, you want to display your grid and populate it with data. Then after its populated, you use the ATTR specification to apply colors to the displayed records. You specify a color mask that makes the grid colored with greenbar.

The only problem is, if someone resorts the Grid by clicking on the column headers. You can deal with this by checking to see if the user sorted the column and reapplying the color mask (advanced) or by disabling column sorting by using the "^NOSORT" in one of your column form specs when applying the grid headers (easier).

http://brwiki.ads.net/index.php?title=G ... s_in_Cells
http://brwiki.ads.net/index.php?title=Grids#unsorted
BLarry1T
Posts: 22
Joined: Thu Jul 14, 2011 9:14 am

FORM GRID

Post by BLarry1T »

What does the attrib look like? And for which versions.

I would like to print the grid light blue on dark blue.
I would like to use the 6 digit hex specificaiton (ie #FF0000)

i have limited control using r/g:b for example.

using codes doesn't work, for me.
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

31270 PRINT #LISTWIN, FIELDS LISTSPEC$&",attr": (MAT RS,MAT RE,MAT RA$)

Where RS is the start array, RE is the end array and RA$ is the attribute array

The attribute$ array can carry substitutions like [SELECTED] if it is set

config attribute [SELECTED]N/#0000FF:#FFFFFF,font=Arial:medium:slant" ! medium blue letters on white background

If you are coloring a LIST RS and RE are row numbers if you are coloring a GRID RS an RE are cell numbers
BLarry1T
Posts: 22
Joined: Thu Jul 14, 2011 9:14 am

Grid

Post by BLarry1T »

only the spec before the colon seems to be working.

I need a spec, a / and speca:specb ?

as in N/#0000FF:#FF0000
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

What BR version are you using?
Are you using a substitution or putting the spec into mat RA$?
BLarry1T
Posts: 22
Joined: Thu Jul 14, 2011 9:14 am

Grids

Post by BLarry1T »

I am trying to accomplish this with 4.18, but I could use 4.2

I am trying to use the RA$
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

Use 4.2 I'm not sure when cell coloration arrived, but the ability to change fonts and substitute using [ATTRIB] substitutions I'm pretty sure was 4.2, not 4.18.
BLarry1T
Posts: 22
Joined: Thu Jul 14, 2011 9:14 am

Grids

Post by BLarry1T »

I think I am getting about the same response in either, but I will stick to 4.2.

Should I be using ATTRIB substitions, or can I use #:#
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

Use attribute substitutions
BLarry1T
Posts: 22
Joined: Thu Jul 14, 2011 9:14 am

ATTRIB

Post by BLarry1T »

What is the role of the / in the specification statement?
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Post by Gabriel »

The syntax for specifying HTML coloring in a substitute statement is "/#COLOR:#COLOR" where COLOR is a 6 digit hex code representing the HTML color.

The "/" is part of the specification. Its purpose it to let BR know that you're specifying an html color, and to seperate the color specification from any other specifications that are in that particular substitute statement.

In the example "N/#0000FF:#FFFFFF", the "/" separates the color from the N.

Gabriel
BLarry1T
Posts: 22
Joined: Thu Jul 14, 2011 9:14 am

Color

Post by BLarry1T »

When I use the spec N/#:#, i can get a color for the first part, but just black for the second.

R:G works fine

I guess the answer is just use the substitute process
BLarry1T
Posts: 22
Joined: Thu Jul 14, 2011 9:14 am

Post by BLarry1T »

Where is the reference for setting the colors using the config/attribute commands?

CONFIG ATTRIBUTE[BLUE] #COLOR ?
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

At some point when we became able to change font sizes, colors, boldness, slant and use HTML colors as well as RGB etc. all of the colon, comma, slash etc. parsing became a real burden for BR. SO, at that point, which I believe was in early 4.2, but not the first 4.2, the routine to set the attributes was condensed to the section of BR that dealth with CONFIG SUBSTITUTE statements and the BR table lookup to do the conversion started residing there rather than being re-done each time a FIELDS sttement was encountered.

So going forward make all of your attribute sttements happen in CONFIG ATTRIBUTE sections. You can do this by putting them into your BRCONFIG.SYS file, doing an EXECUTE CONFIG in your program or PRODing in an external statement that contains the CONFIG ATTRIBUTE sttement.

I personally like using the PROC becasue I can set stndard attributes in an external file and then if I decide I want to change the look of things I change that one file and all programs respect the changed presentation.

The N/ at the start of the attrribute is actually a legacy section that tells BR what to use on a monochrome monitor. N/ was "NORMAL". The sections following the / are the color specs for FOREGROUNG and : BACKGROUND. These can be either RGB codes or #000000 HTML color specs that you can get from an HTML color wheel. These can also be sub-specs like [LTBLUE] if you have configured the [LTBLUE] spec before using it in your [ATTRIB] spec
Post Reply