|
Custom Layouts (Sentry Layout Format)
Representing Fonts Representing Colors Representing Date/Time Formats
Normal Elements: Image Label Bevel GroupBox
Special Elements: ExitUsernameBox ExitPasswordBox ExitOKButton ExitOKButton2 ChangePasswordButton ChangePasswordButton2
LeaveMessageButton LeaveMessageButton2 MessageCountLabel AwayMessageLabel ClockLabel ClockLabel2 AnalogClock SentryUptimeLabel SystemUptimeLabel
A .SLF file takes on the same text formatting as an INI file:
[SectionName]
Name=value
name=value
;name=value (this is commented out and won't be read)
Fonts are represented in SLF as a single line taking this format:
,Font Name,Font Size,Style Attributes,Font Color,Character Set,
Font Name the name of the font face, such as Arial, Tahoma, Courier, Times New Roman, etc.
Font Size A number representing the size of the font in points
Style Attributes Indicates whether a font is Bold, Italic, Underline, and/or Strikeout.
Use b for bold, i for Italics, u for Underline, and s for strikeout.
For example, to have a bold and italicized style, use bu. For no style formatting, do not use any letters.
Font Color The color of the text iteself. See TColor.
Character Set The character set to use. Most likely this value should always be 1 for the systems default set, but you can override it with these values:
Value |
Description |
0 |
ANSI characters. |
1 |
Font is chosen based solely on Name and Size. If the described font is not available on the system, Windows will substitute another font. |
2 |
Standard symbol set. |
77 |
Macintosh characters. Not available on NT 3.51. |
128 |
Japanese shift-JIS characters. |
129 |
Korean characters (Wansung). |
130 |
Korean characters (Johab). Not available on NT 3.51 |
134 |
Simplified Chinese characters (mainland china). |
136 |
Traditional Chinese characters (Taiwanese). |
161 |
Greek characters. Not available on NT 3.51. |
162 |
Turkish characters. Not available on NT 3.51 |
163 |
Vietnamese characters. Not available on NT 3.51. |
177 |
Hebrew characters. Not available on NT 3.51 |
178 |
Arabic characters. Not available on NT 3.51 |
186 |
Baltic characters. Not available on NT 3.51. |
204 |
Cyrillic characters. Not available on NT 3.51. |
222 |
Thai characters. Not available on NT 3.51 |
238 |
Includes diacritical marks for eastern european countries. Not available on NT 3.51. |
255 |
Depends on the codepage of the operating system. |
An example font string to represent 10pt Courier New with black text and a bold style (like this):
font=,Courier New,10,b,clBlack,1,
Note that a Font string must always start with a comma and always end with a comma!
SLF uses the Deplhi's TColor format, either a named constant or a 4-byte hex representation:
If you specify TColor as a specific 4-byte hexadecimal number instead of using the constants defined in the Graphics unit, the low three bytes represent RGB color intensities for blue, green, and red, respectively. The value $00FF0000 represents full-intensity, pure blue, $0000FF00 is pure green, and $000000FF is pure red. $00000000 is black and $00FFFFFF is white.
If the highest-order byte is zero ($00), the color obtained is the closest matching color in the system palette. If the highest-order byte is one ($01), the color obtained is the closest matching color in the currently realized palette. If the highest-order byte is two ($02), the value is matched with the nearest color in the logical palette of the current device context.
The following tables lists the color constants from the Graphics unit. The first two columns list the colors that map to the closest matching color in the system palette, while the last two columns list the colors that are defined in the Windows Control panel.
Value |
Meaning |
clNone |
White on Windows 9x, Black on NT. |
clAqua |
Aqua |
clBlack |
Black |
clBlue |
Blue |
clCream |
Cream |
clDkGray |
Dark Gray |
clFuchsia |
Fuchsia |
clGray |
Gray |
clGreen |
Green |
clLime |
Lime green |
clLtGray |
Light Gray |
clMaroon |
Maroon |
clMedGray |
Medium Gray |
clMoneyGreen |
Mint green |
clNavy |
Navy blue |
clOlive |
Olive green |
clPurple |
Purple |
clRed |
Red |
clSilver |
Silver |
clSkyBlue |
Sky blue |
clTeal |
Teal |
clWhite |
White |
clYellow |
Yellow |
Value |
Meaning |
clScrollBar |
Current color for the of scroll bar track. |
clBackground |
Current background color of the Windows desktop |
clActiveCaption |
Current color of the title bar of the active window |
clInactiveCaption |
Current color of the title bar of inactive windows |
clMenu |
Current background color of menus |
clWindow |
Current background color of windows |
clWindowFrame |
Current color of window frames |
clMenuText |
Current color of text on menus |
clWindowText |
Current color of text in windows |
clCaptionText |
Current color of the text on the title bar of the active window |
clActiveBorder |
Current border color of the active window |
clInactiveBorder |
Current border color of inactive windows |
clAppWorkSpace |
Current color of the application workspace |
clHighlight |
Current background color of selected text |
clHightlightText |
Current color of selected text |
clBtnFace |
Current color of a button face |
clBtnShadow |
Current color of a shadow cast by a button |
clGrayText |
Current color of text that is dimmed |
clBtnText |
Current color of text on a button |
clInactiveCaptionText |
Current color of the text on the title bar of an inactive window |
clBtnHighlight |
Current color of the highlighting on a button |
cl3DDkShadow |
Windows 95 or NT 4.0 only: Dark shadow for three-dimensional display elements |
cl3DLight |
Windows 95 or NT 4.0 only: Light color for three-dimensional display elements (for edges facing the light source) |
clInfoText |
Windows 95 or NT 4.0 only: Text color for tool tip controls |
clInfoBk |
Windows 95 or NT 4.0 only: Background color for tool tip controls |
clGradientActiveCaption |
Windows 98 or Windows 2000: Right side color in the color gradient of an active window's title bar. clActiveCaption specifies the left side color. |
clGradientInactiveCaption |
Windows 98 or Windows 2000: Right side color in the color gradient of an inactive window's title bar. clInactiveCaption specifies the left side color. |
clDefault |
The default color for the control to which the color is assigned. |
Representing Date/Time Formats
SLF contains a two clock elements that allows you to display the current date and/or time. The format is up to the user:
In
the following table, specifiers are given in lower case. Case is ignored in
formats, except for the "am/pm" and "a/p" specifiers.
Specifier | Displays |
c | Displays the date using the format given by the ShortDateFormat global variable, followed by the time using the format given by the LongTimeFormat global variable. The time is not displayed if the date-time value indicates midnight precisely. |
d | Displays the day as a number without a leading zero (1-31). |
dd | Displays the day as a number with a leading zero (01-31). |
ddd | Displays the day as an abbreviation (Sun-Sat) using the strings given by the ShortDayNames global variable. |
dddd | Displays the day as a full name (Sunday-Saturday) using the strings given by the LongDayNames global variable. |
ddddd | Displays the date using the format given by the ShortDateFormat global variable. |
dddddd | Displays the date using the format given by the LongDateFormat global variable. |
e | Displays the year in the current period/era as a number without a leading zero (Japanese, Korean and Taiwanese locales only). |
ee | Displays the year in the current period/era as a number with a leading zero (Japanese, Korean and Taiwanese locales only). |
g | Displays the period/era as an abbreviation (Japanese and Taiwanese locales only). |
gg | Displays the period/era as a full name. (Japanese and Taiwanese locales only). |
m | Displays the month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed. |
mm | Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed. |
mmm | Displays the month as an abbreviation (Jan-Dec) using the strings given by the ShortMonthNames global variable. |
mmmm | Displays the month as a full name (January-December) using the strings given by the LongMonthNames global variable. |
yy | Displays the year as a two-digit number (00-99). |
yyyy | Displays the year as a four-digit number (0000-9999). |
h | Displays the hour without a leading zero (0-23). |
hh | Displays the hour with a leading zero (00-23). |
n | Displays the minute without a leading zero (0-59). |
nn | Displays the minute with a leading zero (00-59). |
s | Displays the second without a leading zero (0-59). |
ss | Displays the second with a leading zero (00-59). |
z | Displays the millisecond without a leading zero (0-999). |
zzz | Displays the millisecond with a leading zero (000-999). |
t | Displays the time using the format given by the ShortTimeFormat global variable. |
tt | Displays the time using the format given by the LongTimeFormat global variable. |
am/pm | Uses the 12-hour clock for the preceding h or hh specifier, and displays 'am' for any hour before noon, and 'pm' for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly. |
a/p | Uses the 12-hour clock for the preceding h or hh specifier, and displays 'a' for any hour before noon, and 'p' for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly. |
ampm | Uses the 12-hour clock for the preceding h or hh specifier, and displays the contents of the TimeAMString global variable for any hour before noon, and the contents of the TimePMString global variable for any hour after noon. |
/ | Displays the date separator character given by the DateSeparator global variable. |
: | Displays the time separator character given by the TimeSeparator global variable. |
'xx'/"xx" | Characters enclosed in single or double quotes are displayed as-is, and do not affect formatting. |
Example:
"h:mm:ss am/pm" would display the date in 12 hour form.
A SLF file is essentially a list of elements/objects that Sentry should put on the screen. Sentry starts with items from the top and then moves down... so objects that you want "on top" should be at the bottom of a SLF file. To add an element/object to the screen layout, enclose on of these items in brackets :
Layout -- Holds summary information about the SLF layout file.
Properties:
Title : The title of the SLF layout.
[Layout]
title=Fresh Software Login
Background -- Specifies screen background information.
Properties:
color |
The screen background color. See Representing colors. |
Normal SLF Elements
Image -- A picture in Bitmap, GIF, JPEG, or Metafile format. Animated GIFs are supported.
An image object lets you put your favorite graphics, logo, etc into a Sentry layout. All image objects in the SLF file must start with "image" (for example, [Image1] , [Image2]...)
Properties:
Left The X position of the field, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the field, in pixels from the top of the screen. Bigger values = farther down. Width How wide the text field should be. Height How tall the text field should be. Filename The full path to the image file. If there is only a filename and no folder path is specified, Sentry will look for the file in the same folder that the SLF file is in. Filename can be .BMP, .GIF, .JPG, .EMF, .WMF
AutoSize When set to 0, the image will have the dimensions specified by Width, Height. When set to 1, the image object will be set automatically (default: 1) Transparent When set to "1" , the image will be drawn transparently. The transparent color will be set to the color of the bottom-left pixel.
Label -- A small piece of text.
All label objects in the SLF must start with "label" (for example, [Label1], [Label2])
Properties:
Left The X position of the label, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the label, in pixels from the top of the screen. Bigger values = farther down. Width How wide the label should be. Height How tall the label should be. Caption The text to display Backcolor The background color of the label. Transparent When set to 1, the background color will be transparent and reflect the color of the object behind the label (or the SLF background color) Font The font used Autosize When set to 1, the label will be automatically sized based on the font size and the length of text Wordwrap When set to 1, text that can not fit past the "width" property will be wrapped to the next line. Wordwrap can not work with Autosize on.
Bevel -- A transparent, beveled outline.
All bevel objects in the SLF must start with "bevel" (for example, [Bevel1], [Bevel2])
Properties:
Left The X position of the label, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the label, in pixels from the top of the screen. Bigger values = farther down. Width How wide the label should be. Height How tall the label should be. Raised When set to 1, the bevel will be raised. When set to 0, the bevel will be lowered. Default: 0 *Shape
The shape the bevel should take. (this property not yet implemented)
bsBox The entire client area appears raised or lowered, depending on the value of Style. bsFrame The client area is outlined by a raised or lowered frame. bsTopLine The bevel displays a line at the top of the client area bsBottomLine The bevel displays a line at the bottom of the client area. bsLeftLine The bevel displays a line at the left side of the client area. bsRightLine The bevel displays a line at the right side of the client area. bsSpacer The bevel is an empty space.
GroupBox -- Adds a GroupBox to the SLF layout.
All GroupBox objects in the SLF must start with "GroupBox" (for example, [GroupBox1], [GroupBox2])
Properties:
Left The X position of the label, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the label, in pixels from the top of the screen. Bigger values = farther down. Width How wide the label should be. Height How tall the label should be. Caption Text to display at top of GroupBox ColorLight TColor format ColorShadow TColor format
Special SLF Elements
ExitUsernameBox -- A text box to enter the username of who wants to unlock Sentry. This field should only be used in Multi-User mode.
Properties:
Left |
The X position of the field, in pixels from the left edge of the screen. Bigger values = farther right. |
Top |
The Y position of the field, in pixels from the top of the screen. Bigger values = farther down. |
Height |
How tall the text field should be. |
Width |
How wide the text field should be. |
Backcolor |
The background color of the text field. See TColor. |
Font | The font used, |
Mask | The password mask, if any , to use. If you want to hide the actual username typed in, specify a single character here such as an asterisk * |
Visible | 0 for invisible, 1 for visible. By default all controls are visible. |
ExitPasswordBox -- A text box used to enter in the password to unlock Sentry. Can be used alone, or with ExitUsernameBox when Multi-User access is on.
Properties:
Left The X position of the field, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the field, in pixels from the top of the screen. Bigger values = farther down. Width How wide the text field should be. Height How tall the text field should be. Backcolor The background color of the text field. See TColor. Font The font used, Mask The password mask, if any , to use. If you want to hide the actual username typed in, specify a single character here such as an asterisk * Visible 0 for invisible, 1 for visible. By default all controls are visible.
ExitOKButton -- A toolbar-style button used to unlock and exit Sentry after proper authentication information has been entered.
Properties:
Left The X position of the field, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the field, in pixels from the top of the screen. Bigger values = farther down. Width How wide the text field should be. Height How tall the text field should be. Caption The text on the button, usually "OK" Font The font of the caption text Transparent set to "1" to make button transparent to the background behind it Backcolor The color of the button, if not transparent. See TColor.
ExitOKButton2 -- A Windows style button used to unlock and exit Sentry after proper authentication information has been entered.
Properties:
Left The X position of the field, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the field, in pixels from the top of the screen. Bigger values = farther down. Width How wide the text field should be. Height How tall the text field should be. Caption The text on the button, usually "OK" Font The font of the caption text
ChangePasswordButton -- A toolbar-style button that changes the Sentry password when clicked. (Currently, single-user mode only)
Properties:
Left The X position of the field, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the field, in pixels from the top of the screen. Bigger values = farther down. Width How wide the text field should be. Height How tall the text field should be. Caption The text on the button, usually "OK" Font The font used for the caption text Transparent set to "1" to make button transparent to the background behind it: Default : 1 Backcolor The color of the button if transparent = 0. See TColor.
ChangePasswordButton2 -- A Windows style button that changes the Sentry password when clicked. (Currently, single-user mode only)
Properties:
Left The X position of the field, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the field, in pixels from the top of the screen. Bigger values = farther down. Width How wide the text field should be. Height How tall the text field should be. Caption The text on the button, usually "OK" Font The font used for the caption text
LeaveMessageButton -- A toolbar-style button that leaves a message on the computer for the owner when clicked.
Properties:
Left The X position of the field, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the field, in pixels from the top of the screen. Bigger values = farther down. Width How wide the text field should be. Height How tall the text field should be. Caption The text on the button, usually "Leave a Message" Font The font for the button captoin Transparent set to "1" to make button transparent to the background behind it. Default: 1 Backcolor The color of the button, if transparent = 0. See TColor.
LeaveMessageButton2 -- A Windows style button that leaves a message on the computer for the owner when clicked.
Properties:
Left The X position of the field, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the field, in pixels from the top of the screen. Bigger values = farther down. Width How wide the text field should be. Height How tall the text field should be. Caption The text on the button, usually "Leave a Message" Font The font for the button captoin
MessageCountLabel -- A piece of text displaying how many messages have been left since Sentry started. Sentry will automatically update the text of this label as messages are left. If there is one or more messages present, clicking the label will read messages (if authorized).
Properties:
Left The X position of the label, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the label, in pixels from the top of the screen. Bigger values = farther down. Width How wide the label should be. Height How tall the label should be. Caption The initial text, by default "0 Messages". Backcolor The background color of the label. Transparent When set to 1, the background color will be transparent and reflect the color of the object behind the label (or the SLF background color) Font The font used Autosize When set to 1, the label will be automatically sized based on the font size and the length of text Wordwrap When set to 1, text that can not fit past the "width" property will be wrapped to the next line. Wordwrap can not work with Autosize on.
AwayMessageLabel -- A piece of text displaying your away message.
Properties:
Left The X position of the label, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the label, in pixels from the top of the screen. Bigger values = farther down. Width How wide the label should be. Height How tall the label should be. Caption The caption property is not used because Sentry will set the away message internally. Backcolor The background color of the label. Transparent When set to 1, the background color will be transparent and reflect the color of the object behind the label (or the SLF background color) Font The font used Autosize When set to 1, the label will be automatically sized based on the font size and the length of text Wordwrap When set to 1, text that can not fit past the "width" property will be wrapped to the next line. Wordwrap can not work with Autosize on.
ClockLabel -- A piece of text displaying either the current time, current date, or both.
Properties:
Left The X position of the label, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the label, in pixels from the top of the screen. Bigger values = farther down. Width How wide the label should be. Height How tall the label should be. Format A date-time format string that specifies how the current date/time should be formatted. Caption The caption property is not used because Sentry will set the date/time internally. Backcolor The background color of the label. Transparent When set to 1, the background color will be transparent and reflect the color of the object behind the label (or the SLF background color) Font The font used Autosize When set to 1, the label will be automatically sized based on the font size and the length of text Wordwrap When set to 1, text that can not fit past the "width" property will be wrapped to the next line. Wordwrap can not work with Autosize on.
ClockLabel2 -- Has the same functionality as ClockLabel, so you could display the current date and current time separately, in different styles.
Properties:
Left The X position of the label, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the label, in pixels from the top of the screen. Bigger values = farther down. Width How wide the label should be. Height How tall the label should be. Format A date-time format string that specifies how the current date/time should be formatted. Caption The caption property is not used because Sentry will set the date/time internally. Backcolor The background color of the label. Transparent When set to 1, the background color will be transparent and reflect the color of the object behind the label (or the SLF background color) Font The font used Autosize When set to 1, the label will be automatically sized based on the font size and the length of text Wordwrap When set to 1, text that can not fit past the "width" property will be wrapped to the next line. Wordwrap can not work with Autosize on.
AnalogClock -- Displays an analog clock.
Properties:
Left The X position of the label, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the label, in pixels from the top of the screen. Bigger values = farther down. Width How wide the label should be. Height How tall the label should be. Color The background color of the clock. By default, the same as the layout background color. Dotscolor The color of the dots marking 5-minute intervals around the clock. Showseconds When 1, a second hand is present. When 0, only the hour and minute hands are visible. Default: 1
SentryUptimeLabel -- A piece of text displaying how long Sentry has been running.
Properties:
Left The X position of the label, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the label, in pixels from the top of the screen. Bigger values = farther down. Width How wide the label should be. Height How tall the label should be. Caption The caption property is not used because Sentry will display the uptime internally Backcolor The background color of the label. Transparent When set to 1, the background color will be transparent and reflect the color of the object behind the label (or the SLF background color) Font The font used Autosize When set to 1, the label will be automatically sized based on the font size and the length of text Wordwrap When set to 1, text that can not fit past the "width" property will be wrapped to the next line. Wordwrap can not work with Autosize on.
SystemUptimeLabel -- A piece of text displaying how long Windows has been running.
Properties:
Left The X position of the label, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the label, in pixels from the top of the screen. Bigger values = farther down. Width How wide the label should be. Height How tall the label should be. Caption The caption property is not used because Sentry will display the uptime internally Backcolor The background color of the label. Transparent When set to 1, the background color will be transparent and reflect the color of the object behind the label (or the SLF background color) Font The font used Autosize When set to 1, the label will be automatically sized based on the font size and the length of text Wordwrap When set to 1, text that can not fit past the "width" property will be wrapped to the next line. Wordwrap can not work with Autosize on.
LeaveAMessageLabel -- A piece of that a message on the computer for the owner when clicked. (not yet implemented)
Properties:
Left The X position of the label, in pixels from the left edge of the screen. Bigger values = farther right. Top The Y position of the label, in pixels from the top of the screen. Bigger values = farther down. Width How wide the label should be. Height How tall the label should be. Caption The caption property is not used because Sentry will display the uptime internally Backcolor The background color of the label. Transparent When set to 1, the background color will be transparent and reflect the color of the object behind the label (or the SLF background color) Font The font used Autosize When set to 1, the label will be automatically sized based on the font size and the length of text Wordwrap When set to 1, text that can not fit past the "width" property will be wrapped to the next line. Wordwrap can not work with Autosize on.