Remember last week’s Notes Mail Database Size Indicator? Mike O’Brien and John Head referred to Notes 8.01, where this will be included. I liked my solution, but after seeing the screenshot, it looked a bit pale.
The new challenge was to give it a more graphical look. So I created another version, still very easy to implement, but with a better look. It conditionally displays an image of the total and used space:
- A green bar for used space less than 70%
- An orange bar for 70-89%
- A red bar for 90-100% (and up)
- A gray bar if no quotum exists.
There’s still an indication of the quotum, but for the particular version I had to develop, my customer doesn’t want that, so the screenshot are not 100% accurate (but I’m too lazy to replace them ;-))
How to implement?
From a designerâ€™s perspective, you need to know if you want it for yourself only (and prohibit design refresh) or for the whole company (do the adjustments in the mailfile template). Obviously, you should first test in your own mailfile.
These are the implementation steps:
- Copy form DbSizeGraphicfrom the Mail Database Size Indicator Demo database and paste it in your mailbox template.
- Copy all image resources starting with mailsize from the database and paste them in your mailbox template.
- (At least for version 6.5 of Notes) Change frameset MailFS Left by adding an extra frame with height=40px (width=relative 1).
How does it work?
- With Fireworks, I created example graphic images for all four types (empty/green/orange/red)
- For each graphic I export a 5px wide left, middle and right part (t.i. for f.e. green, I don’t need a right part)
- Then, in the form, I needed to construct the progress bar. Say, f.e. for a 35% progress, the total image is constructed out of 20 segments, 7 of them are green, 13 are gray. This is how it looks like in Designer:
- Field Score is the percentage for the bar, calculated in the PostOpen
- Field NrOfSegmentsis the number of segments used to construct the bar. If you ever want to customize this solution for other purposes, the number of segments and width of the segments are parameters for bar size and precision (more segments is higer precision)
- Field FilledSegments calculates how many segments need a color, f.e. for a Score of 50, we need 10 colored segments.
- Field ImgStatus defines when to use what color, f.e. for scores <70, we need green, this is "1" (orange is "2", red is "3")
- Field ImgValues is the result of the calculations: a list of strings representing the images to use. Here’s an example:
The values correspond with the aliases for the images in the image library.
- Finally, the segments itself are computed images with
@Text(ImageValues[x])as code, where x=the number of the segment.
@Textis needed by the computed image, to make sure it’s text. Note that the segments are held together by a single-cell table. Without that, a resize of the mailframe may result in a linebreak, splitting the bar in 2.
You can reuse and customize this solution in other applications by changing the graphics and the number of segments (both in the field NrOfSegments and the actual number of images for the segments + their computed values).