home *** CD-ROM | disk | FTP | other *** search
- FIELD LAYOUT
-
-
- This section describes the suggested field border and title placement and the
- creation of the Right and Bottom parameters in the Field structure.
-
- Using the default Workbench font Topaz-80, each character is 8x8 pixels in
- size. The format shown below is recommended for fields in windows on the
- Workbench screen or any screen that uses a 640x200 resolution. You may use
- adapt the same theory to other resolution screens. The borders shown below
- are the same as those that appear on the Vendor Maintenance example program.
- The inside border is rendered white (pen 1), and the outside border serves as
- a "shadow" and is rendered black (pen 2).
-
- The diagram is an example of a field where MaxChars equals 2 (in other words,
- there is only one visible character).
-
- The characters used in the diagram below have the following
- meaning:
- T - pixel occupied by the first character in the field title.
- 1 - pixel occupied by the first character in the field contents.
- 2 - pixel occupied by the second character in the field contents.
- Note that this is the terminal null and is not displayed.
- * - pixel at the Left,Top window location
- # - pixel occupied by the inside field border
- $ - pixel occupied by the outside field border
- + - blank pixel, shown only for reference
-
- TTTTTTTT <-- Top - 11
- TTTTTTTT
- TTTTTTTT
- TTTTTTTT
- TTTTTTTT
- TTTTTTTT
- TTTTTTTT
- TTTTTTTT
- ++++++++
- #################### <-- Top - 2
- #++++++++++++++++++#$$
- #++*111111122222222#$$ <-- Top
- #++1111111122222222#$$
- #++1111111122222222#$$
- #++1111111122222222#$$
- #++1111111122222222#$$
- #++1111111122222222#$$
- #++1111111122222222#$$
- #++1111111122222222#$$ <-- Top + window->IFont->tf_YSize - 1
- ####################$$ or Bottom - window->BorderBottom
- $$$$$$$$$$$$$$$$$$$$
-
- ^ ^ ^
- | Left Left + MaxChars * window->IFont->tf_XSize - 1
- | or Right - window->BorderRight
- Left - 3
-
-
- Notes:
-
- The bottom line of text used by the field contents is blank for all but those
- characters which have "drops", such as g, p, q, etc.
-
- You must leave room for the terminal null even though it is never actually
- displayed. This is because the nature of the console device causes it to
- "borrow" imagery from this character position when a character is deleted.
- Thus, any border imagery rendered in the null position will be trashed.
-
- The field_click() function only checks the area occupied by the field text
- for a mouse click. It has nothing to do with the field borders. In the
- above diagram, the pixels represented by the 1's, 2's, and * would return
- positive for a mouse click within that field.
-
- The Right border is calculated by adding the window->BorderRight parameter to
- the right-most pixel of the null character in the field. The Bottom border
- is calculated by adding the window->BorderBottom parameter to the bottommost
- pixel of the field text.
-
- The entire visible portion of the field (considered to be the rectangle
- bounded by Left,Top and Right,Bottom) must be within the visible portion of
- the window for the field to be active.
-
-
- IntuiText structures:
-
- To place the field title in the position as shown above, set:
- field->FieldTitle->LeftEdge = field->Left - 3
- field->FieldTitle->TopEdge = field->Top - 11
-
-
- Border structures:
-
- To create the borders as shown above, set:
- border1.LeftEdge = border2.LeftEdge = field->Left - 3
- border1.TopEdge = border2.TopEdge = field->Top - 2
-
- And create the following pairs:
- pairs2[] = { 0,0, C*X,0, C*X,Y+2, 0,Y+2, 0,0 };
- pairs1[] = { 2,Y+3, C*X+1,Y+3, C*X+1,1, C*X+2,1, C*X+2,Y+3 };
- where:
- C = field->MaxChars
- X = window->IFont->tf_XSize
- Y = window->IFont->tf_YSize
-
-
- Field Layout 01/13/90
- © Copyright 1990 Timm Martin
- All Rights Reserved Worldwide
-
- /*-- END --*/
-