Index pitfalls
From Vectorlab
| This vcor page is currently under construction.
By: All of us!. Last edit: 2010.9.25 (YYYY.MM.DD) In the category:Under construction you'll find a list of all pages currently marked as under construction. |
Below a list of index pitfalls.
[edit] Line Style (dash)
- negative index = line style dash
- lineStyle is a negative index, consistent with the document default indices for line styles, with a value in the range -1 to -n. Line Styles are sometimes referred to as Dash Styles. (n = the number of line or dash styles in the document).
- Dialogs:
- GetLineStyleChoice
(dialogID:LONGINT; itemID:LONGINT; VAR lineStyle:INTEGER); - list of linestyles available in current document as pop-up choice menu.
- SetLineStyleChoice
(dialogID:LONGINT; itemID:LONGINT; lineStyle:INTEGER); - list of linestyles available in current document as pop-up choice menu.
- GetLineStyleChoice
- Dialogs:
- positive index = line style dash
- styleIndex is a positive index, position according to the available list of dash styles in current document, but NOT as everywhere else negative.
- List Browsers:
- GetLBItemDashStyle
(dialogID, componentID:LONGINT; itemIndex:INTEGER; subItemIndex:INTEGER; VAR styleIndex, VAR lineWeight:INTEGER): BOOLEAN; - Gets the specified list browser item's dash style.
- SetLBItemDashStyle
(dialogID:LONGINT; componentID:LONGINT; itemIndex:INTEGER; subItemIndex:INTEGER; styleIndex:INTEGER; lineWeight:INTEGER): BOOLEAN; - Sets the specified list browser item's dash style.
- GetLBItemDashStyle
- List Browsers:
[edit] Line (pen) Pattern
- positive index range 0 to 71 = pen pattern
- linePattern is a positive index, consistent with the document's indices for Pen and Fill Patterns, with a value in the range 0 to 71 (try to avoid using patterns over number 8 as the results are very much printer dependent).
- negative index = line style dash
- if is a negative index then is a lineStyle, see above: Line Style.
[edit] Arrowheads (marker) style
Document defaults routines gets and sets arrowheads using bit values in pairs of 4, while object and class routines use flags in range 0-6. Some Modern Dialogs routines use a 1-based index.
| ARROW TYPE | INDEX 1-BASED | FLAG | BIT VALUE |
|---|---|---|---|
| Dialogs - Modern:
only when using predefined arrowheads, deprecated routine! | Object:
Classes: | Document defaults: | |
| Solid arrow | 1 | 0 | 0=none, 1=start, 2=end, 3=both |
| Hollow Arrow | 2 | 1 | 4=none, 5=start, 6=end, 7=both |
| Open Arrow | 3 | 2 | 8=none, 9=start, 10=end, 11=both |
| Dot | 4 | 3 | 12=none, 13=start, 14=end, 15=both |
| Circle | 5 | 4 | 16=none, 17=start, 18=end, 19=both |
| Slash | 6 | 5 | 20=none, 21=start, 22=end, 23=both |
| Cross | 7 | 6 | 24=none, 25=start, 26=end, 27=both |
- A value between 0-6
- for all object and class marker styles. The object routines allow for checking start and end of marker through boolean values, not all routines allow for checking the angle (and not all markers have an angle parameter, like dots, for example). Class routines do allow for checking end and start marker only since VW 12.5.
- Note (objects' markers)
- GetMarker, SetMarker do not set the marker's angle!
- Use GetObjArrow, SetObjArrow instead
- Note (classes' markers)
- GetClassArrow, SetClassArrow do not set start and end marker, whereby as to the present VW edition (12.5.1) it is not possible to set different markers for start or end using the "Class Edit" dialog. This might hint to a feature yet to come.
- The following vailable routines are not recognized by VW 12.5 Fundamentals:
[edit] Fill Type
The fill type of a referenced object can be retrived through the standard routines FFillPat, GetFPat, GetClFPat, etc, or through the object preference flag 696. The fill index is returned by the previously mentioned routines, while GetObjectVariableLongint(h, 695) seems to return always the same value, no matter how the object attributes are:
| FILL | FILL TYPE and STYLE INDEX | FILL TYPE | FILL STYLE INDEX |
|---|---|---|---|
| FFillPat, FillPat | GetObjectVariableInt
(h, 696) read only | GetObjectVariableLongint
(h, 695) should be read/write | |
| none (no fill) | 0 | 1 | unchanging longint value |
| solid | 1 | 2 | unchanging longint value |
| bitmap pattern | 0-71 | 3 | unchanging longint value |
| hatch | negative index value | 4 | unchanging longint value |
| gradient | negative index value | 5 | unchanging longint value |
| image | negative index value | 6 | unchanging longint value |
- Example
AlrtDialog(Concat( 'Fill type with obj prefs: ', GetObjectVariableInt(FSActLayer, 696), Chr(13), 'Fill index with obj prefs: ', GetObjectVariableInt(FSActLayer, 695), Chr(13), 'Fill index with getFPat: ', GetFPat(FSActLayer) )); { fill type and fill style of the first selected object }
[edit] Poly and Poly3D
The following polygon/polyline routines are toggling the index base from 0-based to 1-based. Special care is needed.
| Index 1-based | Index 0-based |
|---|---|
| GetPolyPt | GetPolyPt3D from VW 13 it returns z-value adding the layer's Z |
| SetPolyPt | SetPolyPt3D from VW 13 it sets z-value subtracting the layer's Z |
[edit] Colors
Colors are a theme for itself. Please read Colours (isma) for a more extensive discussion about the topic. Let here only be given a short comparison list of the different values used.
- Undocumented feature
- While most routines should accept a
LONGINTtriplet value in range 0-65535, many basic attributes routines also accept a color index. The routines labelled with 1 or 2 have this feature. This might come handy in many cases, saving needless conversions through: RGBToColorIndex or the other way around ColorIndexToRGB.
- Known bug
- SetFillBack, SetFillFore will remove the "ByClass" attribute of the PEN as well.
- SetPenBack, SetPenFore will remove the "ByClass" attribute of the FILL.
- Remember to parse for the "ByClass" attribute and restore it (up to VW 13).
| COLOR INDEX (color palette) | INT VALUE 0-255 | LONGINT VALUE 0-65535 |
|---|---|---|
| Document defaults:
Object: Classes: Layer: Hatches: Dialog - Modern:
Worksheet: | Gradient (document defaults):
List Browser: | Document defaults:
Object:
Classes:
Layer: Light: Dialog - Modern: |
- ↑ 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 Officially documented for accepting three LONGINT values in range 0-65535, this routine also accept a single color index value corresponding to the color palette.
- ↑ 2.00 2.01 2.02 2.03 2.04 2.05 2.06 2.07 2.08 2.09 2.10 2.11 2.12 2.13 2.14 2.15 Also accepts a single parameter of type
INTEGERcorresponding to one of the 256 Colors defined in the document's Color Palette.



