172 lines
4.9 KiB
Plaintext
172 lines
4.9 KiB
Plaintext
;-----------------------------------------------------------------
|
|
; NTL - Native Theme Language - 07/10/00
|
|
;-----------------------------------------------------------------
|
|
|
|
Overview:
|
|
---------
|
|
|
|
An .ntl file describes the brushes, lines, rectangles, curves,
|
|
and shapes needed to draw control parts.
|
|
|
|
The .ntl file is uses the standard Windows .ini file format with multiple
|
|
sections and multiple "property = value" lines within each section.
|
|
|
|
There are 2 section types supported:
|
|
|
|
[OptionBits] - used to declare the option bit names/mappings used by the
|
|
drawing sections
|
|
|
|
[Drawing(xxx)] - used to describe how to draw the state named "xxx"
|
|
|
|
|
|
OptionBits Section:
|
|
-------------------
|
|
|
|
The [OptionBits] section contains properties lines of the form:
|
|
|
|
<name> = <number>
|
|
|
|
The <name> declares an option bit, whose bit number is specified by <number>. These
|
|
options bits are passed by the theme-aware control in the lower 16 bits of the last DWORD
|
|
param to DrawThemeBackground().
|
|
|
|
Once an optionbit is declared, its value can be tested by an "if" property in the [Drawing.xxx]
|
|
sections.
|
|
|
|
|
|
Drawing Sections:
|
|
-----------------
|
|
|
|
There are 3 types of drawing that can be done in a drawing section. A section can contain one
|
|
or more of these but each type should complete before the next type starts.
|
|
|
|
1. Collapsing Border drawing
|
|
|
|
In this mode, successive outer borders of a certain color, width, and height are drawn
|
|
from the original rectangle specified for the control part inward, towards the center
|
|
of the part. Properties allowed in this mode are:
|
|
|
|
AddBorder = SIZE <size4> COLOR <color4>
|
|
|
|
FillBorder = COLOR <color>
|
|
FillBorder = IMAGEFILE <imagefile>
|
|
FillBorder = NONE
|
|
|
|
Notes:
|
|
- "FillRect" fills the adjusted rectangle with the specified color or
|
|
by tiling the specified bitmap
|
|
|
|
2. FreeHand drawing
|
|
|
|
In this mode, we describe a brush and then can move, paint lines, and paint curves. There
|
|
is no filling involved. The x,y point coordinates range from 0-1000, unless the
|
|
"LogicalRect" property is specified to overrides them. These points are mapped at runtime
|
|
to the part's actual rectangle.
|
|
|
|
Properties allowed in this mode are:
|
|
|
|
LogicalRect = RECT <rect>
|
|
|
|
FillBrush = COLOR <color>
|
|
FillBrush = IMAGEFILE <imagefile>
|
|
FillBrush = NONE
|
|
|
|
LineBrush = COLOR <color> SIZE <size1>
|
|
LineBrush = NONE
|
|
|
|
MoveTo = POINT <point>
|
|
LineTo = POINT <point>
|
|
CurveTo = CP1 <point> CP2 <point> POINT <point>
|
|
|
|
3. Filled Shape drawing
|
|
|
|
In this mode, we describe a line brush and a fill brush and then describe the lines
|
|
and curves of the shape. After the border of the shape is drawn with the
|
|
line brush, it is filled with the fill brush. Properties allowed in this mode are:
|
|
|
|
Shape = POINT <point>
|
|
|
|
FillBrush = COLOR <color>
|
|
FillBrush = IMAGEFILE <imagefile>
|
|
FillBrush = NONE
|
|
|
|
LineBrush = COLOR <color> SIZE <size1>
|
|
LineBrush = NONE
|
|
|
|
LogicalRect = RECT <rect>
|
|
|
|
LineTo = POINT <point>
|
|
CurveTo = CP1 <point> CP2 <point> POINT <point>
|
|
|
|
EndShape = POINT <point>
|
|
|
|
Notes:
|
|
- A Shape subsection must start with a "Shape" property and end with a
|
|
"EndShape" property
|
|
|
|
- "LineBrush" and "FillBrush" can only be specified once and must be the
|
|
first 2 properties after "Shape".
|
|
|
|
|
|
There are also some general properties that can appear anywhere in a section (with the exception of
|
|
"GotoState", which if used, must be placed at the end of a section). These properties are:
|
|
|
|
if = <option bit name> (on)
|
|
if = <option bit name> (off)
|
|
|
|
else = <option bit name> (on)
|
|
else = <option bit name> (off)
|
|
|
|
endif = <option bit name>
|
|
|
|
SetOption = <option bit name> (on)
|
|
SetOption = <option bit name> (off)
|
|
|
|
GotoState = <state name>
|
|
|
|
Note: when an "else" property is used, it must match the most recent, unmatched "if" property
|
|
and have the opposite on/off setting.
|
|
|
|
Each "if" property must be matched with an "endif" property of the same
|
|
<option bit name>.
|
|
|
|
|
|
Parameters:
|
|
-----------
|
|
|
|
<imagefile>
|
|
::= [ INDEX <number> ]
|
|
|
|
<color>
|
|
::= <red number> <green number> <blue number>
|
|
::= <system color name (ex: WindowFrame)>
|
|
::= NONE
|
|
|
|
<color4>
|
|
::= <color>
|
|
::= <color> "," <color>
|
|
::= <color> "," <color> "," <color> "," <color>
|
|
|
|
<point>
|
|
::= <x number> <y number>
|
|
|
|
<rect>
|
|
::= <left number> <top number> <right number> <bottom number>
|
|
|
|
<size1>
|
|
::= <size>
|
|
|
|
<size2>
|
|
::= <size>
|
|
::= <size> "," <size>
|
|
|
|
<size4>
|
|
::= <size>
|
|
::= <size> "," <size>
|
|
::= <size> "," <size> "," <size> "," <size>
|
|
|
|
<size>
|
|
::= <number>
|
|
::= <system metric name (ex: BorderWidth)>
|
|
|