diff options
author | lecoanet | 2000-01-12 13:56:36 +0000 |
---|---|---|
committer | lecoanet | 2000-01-12 13:56:36 +0000 |
commit | 24df859cbc6bb1661abfa7bbe52cfc3dd1b14120 (patch) | |
tree | 36cbb4333c66bc50a7c8ef4919e5b7638a4cc02a | |
parent | dec60589aef2842b89e968759f702744bbefe06a (diff) | |
download | tkzinc-24df859cbc6bb1661abfa7bbe52cfc3dd1b14120.zip tkzinc-24df859cbc6bb1661abfa7bbe52cfc3dd1b14120.tar.gz tkzinc-24df859cbc6bb1661abfa7bbe52cfc3dd1b14120.tar.bz2 tkzinc-24df859cbc6bb1661abfa7bbe52cfc3dd1b14120.tar.xz |
*** empty log message ***
-rw-r--r-- | doc/refman.tex | 1522 | ||||
-rw-r--r-- | sandbox/controls.tcl | 158 | ||||
-rw-r--r-- | sandbox/testpoly.tcl | 149 | ||||
-rw-r--r-- | sandbox/testzinc.pl | 229 | ||||
-rw-r--r-- | sandbox/zinc.tcl | 258 |
5 files changed, 2316 insertions, 0 deletions
diff --git a/doc/refman.tex b/doc/refman.tex new file mode 100644 index 0000000..cc11429 --- /dev/null +++ b/doc/refman.tex @@ -0,0 +1,1522 @@ +\documentclass[11pt,twoside]{report} +\usepackage{a4wide} +\usepackage{html} +\usepackage{makeidx} + + +\newcommand{\cident}[1] {% + {\tt #1}} + +\newcommand{\ident}[1] {% + {\tt\large #1}} + +\newcommand{\option}[3]{% + \label{opt:#1} + \index{#1} + \htmlrule[WIDTH="300" left] + \begin{tabular}{rl} + Command line switch: & \ident{-#1} \\ + Database name: & \ident{#2} \\ + Database class: & \ident{#3} \\ + \end{tabular}} + +\newcommand{\command}[3]{% + \label{cmd:#2} + \index{#2} + \htmlrule[WIDTH="300" left] + {\tt\large #1 {\bf #2} #3}} + +\newcommand{\radarcmd}[2]{% + \command{pathname}{#1}{#2}} + +\newcommand{\mapinfocmd}[3]{% + \label{mpcmd:#2} + \index{#2} + \htmlrule[WIDTH="300" left] + {\tt\large mapinfo #1 {\bf #2} #3}} + +\newcommand{\attribute}[2]{% + \label{attr:#1} + \index{#1} + \htmlrule[WIDTH="300" left] + {\tt {\bf -#1} #2} + \vspace{-2\parskip}} + +\newcommand{\available}[1]{% + \hyperref[page]{\ident{#1}}{\ident{#1} (}{)}{obj:#1}} + +\newcommand{\optref}[1]{% + \hyperref[page]{\ident{#1}}{\ident{#1} (}{)}{opt:#1} + } + +\newcommand{\cmdref}[1]{% + \hyperref[page]{\ident{#1}}{\ident{#1} (}{)}{cmd:#1} + } + +\newcommand{\attrref}[1]{% + \hyperref[page]{\ident{-#1}}{\ident{-#1} (}{)}{attr:#1} + } + +\newcommand{\object}[1]{% + \label{obj:#1} + } + +\newcommand{\concept}[1]{% + \label{concept:#1} + } + +\newcommand{\objectref}[1]{% + \hyperref[page]{\ident{#1}}{\ident{#1} (}{)}{cmd:#1} + } + +\newcommand{\conceptref}[2]{% + \hyperref[page]{#1}{#1 (page }{)}{concept:#2} + } + + +\newenvironment{blockindent}{\begin{quotation}}{\end{quotation}\vspace{\parskip}} + + +\makeindex + +\parindent 0cm +\parskip 0.2cm + +\title{tkRadar reference manual\\Version 3.0} +\author{Patrick Lecoanet} +\date{1er Décembre 1999} + + +\begin{document} + +\maketitle + + + This reference manual describes the Tk \ident{radar} widget interface. It shows + how to create and configure a \ident{radar} widget, and how to use the commands + it provides to create and manipulate items. + + + +\chapter{Widget options} +\concept{options} + \option{borderwidth}{borderWidth}{BorderWidth} + \begin{blockindent} + Specifies the width of the 3d border that should be displayed around the widget + window. This border does not overlap the active radar display area. The area + requested from the geometry manager (or the window manager if applicable) is the + overall area, display area plus borders. This value can be given in any of + the forms valid for coordinates (See \cident{TkGet\_Pixels}). The default value is 2 pixels. + \end{blockindent} + + \option{backcolor}{backColor}{BackColor} + \begin{blockindent} + This the color that will be used to fill the radar window. It is also + used as a default color for some item attributes of type color. See each + color attribute for the actual source of the default color. Its default + value is white. + \end{blockindent} + + \option{cursor}{cursor}{Cursor} + \begin{blockindent} + Specifies the cursor to use when the pointer is in the radar window. + The default value is set to preserve the cursor provided at widget + creation. + \end{blockindent} + + \option{font}{font}{Font} + \begin{blockindent} + The font specified by this option is used as a default font + for item attributes of type font. Its default value is + -adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*. + \end{blockindent} + + \option{forecolor}{foreColor}{ForeColor} + \begin{blockindent} + The color specified by this option is used as a default color + for many item attributes of type color. See each each color + attribute for the actual source of the default color. Its + default value is black. + \end{blockindent} + + \option{height}{height}{Height} + \begin{blockindent} + Specifies the height of the actual radar area (i.e, this dimension + does not include the border width). This value can be given in any of + the forms valid for coordinates (See \cident{Tk\_GetPixels}). The default is + 100 pixels. + \end{blockindent} + + \option{mapdistancesymbol}{mapDistanceSymbol}{MapDistanceSymbol} + \begin{blockindent} + This option specifies the symbol to be used as a milestone + along map lines. This option can be given any Tk bitmap which + can be obtained by \cident{Tk\_GetBitmap}. The spacing between markers is + 10 nautic miles. The default value is AtcSymbol19. + \end{blockindent} + + \option{maptextfont}{mapTextFont}{MapTextFont} + \begin{blockindent} + Specifies the font used to draw the texts contained in maps. The + default is -adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*. + \end{blockindent} + + \option{overlapmanager}{overlapManager}{OverlapManager} + \begin{blockindent} + This option accepts any form valid for a boolean. It specifies if + the label overlapping avoidance algorithm should be allowed to + do its work on the track labels. The default is to enable the avoidance + algorithm. + \end{blockindent} + + \option{pickaperture}{pickAperture}{PickAperture} + \begin{blockindent} + Specifies the size of an area around the pointer that is used to tell + if the pointer is inside an item. This is useful to lessen the precision + required when picking graphical elements. This value must be a positive + integer. It defaults to 1. + \end{blockindent} + + + \option{relief}{relief}{Relief} + \begin{blockindent} + Specifies the border relief. This option can be given any legal value + for a relief (See \cident{Tk\_GetRelief} for a description of possible values). + \end{blockindent} + + + \option{speedvectorlength}{speedVectorLength}{SpeedVectorLength} + \begin{blockindent} + Specifies the duration of track speed vectors. This option is expressed + using a time unit that should be chosen by the application (often minutes) + and kept coherent with the unit of the track attribute \attrref{speedvector} + (often nautic mile / minutes). The default value is 3. + \end{blockindent} + + + \option{trackmanagedhistorysize}{trackManagedHistorySize}{TrackManagedHistorySize} + \begin{blockindent} + This option accepts only positive integers. It specifies the size of + the past position list that can be maintained by the track items. See + also the \optref{trackmanagehistory} option and the \attrref{visiblehistorysize} + track attribute. The default value is 6. + \end{blockindent} + + + \option{trackmanagehistory}{trackManageHistory}{TrackManageHistory} + \begin{blockindent} + This option accepts any form valid for a boolean. It specifies if + the track items should maintain a list of their past positions to be + displayed as trailing speckles. If this option is turned off and then + back on, the history list is erased and the collection is resumed at + the next available position. The number of position collected in the + history list is specified by the option \optref{trackmanagedhistorysize}. + When this many positions are collected, the oldest is dropped to make + room for the new one on a first in first out basis. The number of past + positions actually displayed if specified for each track by the + attribute \attrref{visiblehistorysize}. + The default value is to enable the history collection. + \end{blockindent} + + + \option{width}{width}{Width} + \begin{blockindent} + Specifies the width of the actual radar area (i.e, this dimension + does not include the border width). This value can be given in any of + the forms valid for coordinates (See \cident{Tk\_GetPixels}). The default is + 100 pixels. + \end{blockindent} + + +\chapter{Item IDs and Tags} +\concept{tagOrId} +Décrire les ids, tags, field tags et part tags. Les deux derniers +n'étant employes que par bind doit-on les décrire ici ou dans la commande ? +Parler de current, all. + + +\chapter{Coordinates and transformations} + +\chapter{Widget commands} + + The available commands are listed in alphabetical order. + + The command set for the \ident{radar} widget is much inspired by the \ident{canvas} + command set. Someone comfortable with the \ident{canvas} should not have much trouble + using the \ident{radar}'s commands. Eventually, the command set will be a superset + of the \ident{canvas} command set. + +\vspace{.5cm} +\radarcmd{add}{?type group? ?args? ?option value? ... ?option? value?} + \begin{blockindent} + This command is used to create new items in a radar. It can be called with + no parameters to return the list of all item types currently known by + the radar. It can also be called with a valid item type as first parameter + and a group item as second parameter to create a new item of this type in + the given group. The other arguments vary with the type of item. A detailed + description of these arguments is given in the sections on the individual item + types. Following the creation args the command accept any number of + attributes\ -\ values pairs to configure the newly created item. + All the configurable item type attributes are valid in this context. The + command returns the item id. + \end{blockindent} + +\radarcmd{addtag}{tag searchSpec ?arg arg ...?} + \begin{blockindent} + This command add the given tag to all items matching the + search specification. If the tag is already present on some item, + nothing is done for this item. The command has no effect if no + items satisfy the given criteria. The command returns en empty + string. The search specification an the associated arguments can + take the following forms: + \begin{description} + \item{\tt above tagOrId} \\ + Selects the item just above the one given by {\tt tagOrId}. If + {\tt tagOrId} names more than one item, the topmost of these + items in the display list will be used. If {\tt tagOrId} does + not refer to any item then nothing happen. + + \item{\tt all} \\ + Selects all the items in the radar. + + \item{\tt atpoint x y ?halo? ?start?} \\ + Selects the item under or closest to the point {\tt x - y}. If more + than one item overlaps the point, the top-most is selected. If {\tt halo} + is given, it defines the size of the point {\tt x - y}. {\tt halo} must + be a non negative integer. If {\tt start} is specified, it must be + an item tag or id. If it names a valid item (for a tag, the lowest + item with the tag is considered), the search starts with the item + below {\tt start} instead of the first item in the display + order. If {\tt start} does not name a valid item, it is ignored. + + \item{\tt atpriority priority} \\ + Selects all the items at the given priority. + + \item{\tt below tagOrId} \\ + Selects the item just below the one given by {\tt tagOrId}. If + {\tt tagOrId} names more than one item, the lowest of these + items in the display list will be used. If {\tt tagOrId} does + not refer to any item then nothing happen. + + \item{\tt enclosed xo yo xc yc} \\ + Selects all the items completely enclosed in the rectangle whose + origin is at {\tt xo - yo} and corner at {\tt xc - yc}. {\tt xc} + must be no greater than {\tt xo} and {\tt yo} must be no greater + than {\tt yc}. All coordinates must be integers. + + \item{\tt overlapping xo yo xc yc} \\ + Selects all the items that overlaps or are enclosed in the rectangle + whose origin is at {\tt xo - yo} and corner at {\tt xc - yc}. {\tt xc} + must be no greater than {\tt xo} and {\tt yo} must be no greater than + {\tt yc}. All coordinates must be integers. + + \item{\tt withtag tagOrId} \\ + Selects all the items given by {\tt tagOrId}. + + \item{\tt withtype type} \\ + Selects all the items of type {\tt type}. + \end{description} + \end{blockindent} + +\radarcmd{anchorxy}{tagOrId anchor} + \begin{blockindent} + Returns the (device) coordinate of an item anchor. If no item is + named by {\tt tagOrId} or if the item doesn't support anchors, an + error is raised. If more than one item match {\tt tagOrId}, one of + those is used, the exact one is implementation specific. + \end{blockindent} + +\radarcmd{bbox}{tagOrId ?tagOrId ...?} + \begin{blockindent} + Returns a list of 4 numbers describing the (device) coordinates of the origin + and corner of a rectangle bounding all the items named by the {\tt tagOrId} + arguments. If no items are named by the {\tt tagOrId} or if the matching items + have an empty bounding box, an empty string is returned. + \end{blockindent} + +\radarcmd{bind}{tagOrId ?sequence? ?command?} + \begin{blockindent} + This command associates {\tt command} with the item tag, item id, part tag + {\tt tagOrId}. If an event sequence matching {\tt sequence} + occurs for an item, or an item part, the command will be invoked. + If all parameters are specified a new binding between {\tt sequence} and + {\tt command} is established, overriding any existing binding for the + sequence. If the first character of {\tt command} is ``+'', then + {\tt command} augments the existing binding instead of replacing it. + In this case the command returns an empty string. If the {\tt command} + parameter is omitted, the command return the {\tt command} associated + with {\tt tagOrId} and {\tt sequence} or an error is raised if there + is no such binding. If only {\tt tagOrId} is specified the command + returns a list of all the sequences for which there are bindings for + {\tt tagOrId}. + + This widget command is similar to the \ident{bind} command except that + it operates on \ident{radar} items instead of widgets. Another difference + with the \ident{bind} command is that only mouse and keyboard related events + can be specified (such as \ident{Enter}, \ident{Leave}, \ident{ButtonPress}, + \ident{ButtonRelease}, \ident{Motion}, \ident{KeyPress}, \ident{KeyRelease}). + The \ident{bind} manual page is the most accurate place to look for a + definition of {\tt sequence} and {\tt command} and for a general understanding + of how the binding mecanism works. + + The handling of events in the \ident{radar} is done with respect to the + current item and when applicable the current item part (see + \conceptref{Item IDs and tags}{tagOrId} for a discussion of the + \ident{current} tag and the special tags used in bindings). \ident{Enter} + and \ident{Leave} events are trigerred for an item when it becomes or cease + to be the current item. Mouse related events are reported with respect to + the current item. Keyboard related events are reported with respect to the + focus item (which can be the current item or none). + + It is possible that several bindings match a particular event sequence. + When this occurs, all matching bindings are triggered. The order of + invocation is as follow: the binding associated with the tag \ident{all} + is invoked first, followed by the bindings associated with the item tags + in order, followed by the binding associated with the item id, followed + by the binding associated with the item part if relevant. + If there are more than one binding for a single tag, only the most + specific is triggered. + + If bindings have been registered for the \ident{radar} window using the + \ident{bind} command, they are invoked in addition to bindings registered + for the items using this widget command. The bindings for items will be + invoked before the bindings for the window. + \end{blockindent} + +\radarcmd{cget}{option} + \begin{blockindent} + Returns the current value of the widget option given by {\tt option}. + {\tt option} may be any of the options described in the + chapter \conceptref{Widget options}{options}. + \end{blockindent} + +\radarcmd{chggroup}{} + \begin{blockindent} + Not yet implemented. + \end{blockindent} + +\radarcmd{configure}{?option? ?value? ?option value ...?} + \begin{blockindent} + Query or modify the options of the widget. If no {\tt option} + is given, returns a list describing all the supported options (see the + chapter \conceptref{Widget options}{options}). If an {\tt option} is + specified without any {\tt value}, the command returns a list + describing the named option (this list is identical to the corresponding + sublist of the value returned if no {\tt option} is given). If some + {\tt option - value} pairs are given, then the corresponding options + are changed and the command return an empty string. + \end{blockindent} + +\radarcmd{currentpart}{} + \begin{blockindent} + Returns an integer specifying the item part over which the pointer is. + If the current item doesn't have parts or if the pointer is not over + an item (no item has the \ident{current} tag) the command return -1. + \end{blockindent} + +\radarcmd{dtag}{tagOrId ?tagToDelete?} + \begin{blockindent} + Delete the tag {\tt tagToDelete} from the list of tags associated + with each item named by {\tt tagOrId}. If an item doesn't have + the tag then it is leaved unaffected. If {\tt tagToDelete} is + omitted, {\tt tagOrId} is used instead. The command returns an + empty string as result. + \end{blockindent} + +\radarcmd{find}{searchCommand ?arg arg ...?} + \begin{blockindent} + This command returns the list of all items selected by {\tt searchCommand} + and the {\tt args}. See the \cmdref{addtag} command for an explanation of + {\tt searchCommand} and the various {\tt args}. The items are sorted in + drawing order, topmost first. + \end{blockindent} + +\radarcmd{gettags}{tagOrId} + \begin{blockindent} + This command returns the list of all the tags associated with + the item specified by {\tt tagOrdId}. If more than one item is + named by {\tt tagOrdId}, then one of these items (selection is + implementation specific) is used to return the result. If no + item is named by {\tt tagOrdId}, then the empty list is returned. + \end{blockindent} + +\radarcmd{hasanchors}{tagOrId} + \begin{blockindent} + This command returns a boolean telling if the item specified by + {\tt tagOrdId} supports anchors. If more than one item is named by + {\tt tagOrdId}, then one of these items (selection is implementation + specific) is used to return the result. If no items are named by + {\tt tagOrdId}, an error is raised. + \end{blockindent} + +\radarcmd{hasfields}{tagOrId} + \begin{blockindent} + This command returns a boolean telling if the item specified by + {\tt tagOrdId} supports fields. If more than one item is named by + {\tt tagOrdId}, then one of these items (selection is implementation + specific) is used to return the result. If no items are named by + {\tt tagOrdId}, an error is raised. + \end{blockindent} + +\radarcmd{hasparts}{tagOrId} + \begin{blockindent} + This command returns a boolean telling if the item specified by + {\tt tagOrdId} has parts. If more than one item is named by + {\tt tagOrdId}, then one of these items (selection is implementation + specific) is used to return the result. If no items are named by + {\tt tagOrdId}, an error is raised. + \end{blockindent} + +\radarcmd{hastag}{tagOrId tag} + \begin{blockindent} + This command returns a boolean telling if the item specified by + {\tt tagOrdId} has the specified tag. If more than one item is + named by {\tt tagOrdId}, then one of these items (selection is + implementation specific) is used to return the result. If no items + are named by {\tt tagOrdId}, an error is raised. + \end{blockindent} + +\radarcmd{itemcget}{tagOrId ?field? attr} + \begin{blockindent} + To be written + \end{blockindent} + +\radarcmd{itemconfigure}{tagOrId ?field? ?attr? ?value? ?attr value ...?} + \begin{blockindent} + To be written + \end{blockindent} + +\radarcmd{lower}{tagOrId ?belowThis?} + \begin{blockindent} + Reorder all the items given by {\tt tagOrId} so that they will be + under the item given by {\tt belowThis}. If {\tt tagOrId} name more + than one item, their relative order will be preserved. If + {\tt tagOrId} doesn't name an item, an error is raised. If + {\tt belowThis} name more than one item, the bottom most them is used. + If {\tt belowThis} doesn't name an item, an error is raised. If + {\tt belowThis} is omitted the items are put at the bottom most + position. The command returns an empty string. + As a side affect of this command, the \attrref{priority} attribute of + all the reordered items is ajusted to match the priority of the + {\tt belowThis} item (or the priority of the bottom most item). + \end{blockindent} + +\radarcmd{raise}{tagOrId ?aboveThis?} + \begin{blockindent} + Reorder all the items given by {\tt tagOrId} so that they will be + above the item given by {\tt aboveThis}. If {\tt tagOrId} name more + than one item, their relative order will be preserved. If + {\tt tagOrId} doesn't name an item, an error is raised. If + {\tt aboveThis} name more than one item, the top most is used. + If {\tt aboveThis} doesn't name an item, an error is raised. If + {\tt aboveThis} is omitted the items are put at the top most + position. The command returns an empty string. + As a side affect of this command, the \attrref{priority} attribute of + all the reordered items is ajusted to match the priority of the + {\tt aboveThis} item (or the priority of the top most item). + \end{blockindent} + +\radarcmd{remove}{tagOrId ?tagOrId ...?} + \begin{blockindent} + Delete all the items named by each {\tt tagOrId}. The + command returns an empty string. + \end{blockindent} + +\radarcmd{rotate}{tagOrId angle ?centerX centerY?} + \begin{blockindent} + Add a rotation to the items or the transform described by + {\tt tagOrId}. If {\tt tagOrId} describe a named transform + then this transform is used to do the operation. If {\tt tagOrId} + describe more than one item then all the items are affected by + the opration. If {\tt tagOrId} describe neither a named transform + nor an item, an error is raised. The angle is given in radians. + The optional parameters describe the center of rotation, which + defaults to the origin. + \end{blockindent} + +\radarcmd{scale}{tagOrId xFactor yFactor} + \begin{blockindent} + Add a scale factor to the items or the transform described by + {\tt tagOrId}. If {\tt tagOrId} describe a named transform + then this transform is used to do the operation. If {\tt tagOrId} + describe more than one item then all the items are affected by + the opration. If {\tt tagOrId} describe neither a named transform + nor an item, an error is raised. A separate factor is specified for + X and Y. + \end{blockindent} + +\radarcmd{tapply}{} + \begin{blockindent} + To be implemented. + \end{blockindent} + +\radarcmd{tdelete}{tName} + \begin{blockindent} + Destroy a named transform. If the given name is not found + among the named transforms, an error is raised. + \end{blockindent} + +\radarcmd{transform}{?tagOrIdFrom? tagOrIdTo coordList} +\begin{blockindent} + This command returns a list of coordinates obtained by transforming + the coordinates given in {\tt coordList} from the coordinate space + of the transform or item described by {\tt tagOrIdFrom} to the + coordinate space of the transform or item described by {\tt tagOrIdTo}. + If {\tt tagOrIdFrom} is omitted it defaults to the device coordinate + space. If either {\tt tagOrId} describe more than one item, one is + selected in a system specific way. If either {\tt tagOrId} describe + neither a transform nor an item, an error is raised. +\end{blockindent} + +\radarcmd{translate}{tagOrId xAmount yAmount} + \begin{blockindent} + Add a translation to the items or the transform described by + {\tt tagOrId}. If {\tt tagOrId} describe a named transform + then this transform is used to do the operation. If {\tt tagOrId} + describe more than one item then all the items are affected by + the opration. If {\tt tagOrId} describe neither a named transform + nor an item, an error is raised. A separate value is specified for + X and Y. + \end{blockindent} + +\radarcmd{treset}{tagOrId} + \begin{blockindent} + Set the named transform or the transform for the items described + by {\tt tagOrId} to identity. If {\tt tagOrId} describe neither + a named transform nor an item, an error is raised. + \end{blockindent} + +\radarcmd{trestore}{tagOrId tName} + \begin{blockindent} + Set the transform for the items described by {\tt tagOrId} to the + transform named by {\tt tName}. If {\tt tagOrId} doesn't describe + any item or if the transform named {\tt tName} doesn't exist, an + error is raised. + \end{blockindent} + +\radarcmd{tsave}{tagOrId tName} + \begin{blockindent} + Create (or reset) a transform associated with the name {\tt tName} + which has for initial value the transform associated with the item + {\tt tagOrId}. If {\tt tagOrId} describe more than one item, one is + selected in a system specific way. If {\tt tagOrId} doesn't describe + any item, an error is raised. If {\tt tName} already exists, the + transform is set to the new value. This command is the only way to + create a named transform. + \end{blockindent} + +\radarcmd{type}{tagOrId} + \begin{blockindent} + This command returns the type of the item specified by {\tt tagOrdId}. + If more than one item is named by {\tt tagOrdId}, then the type of + one of these items (selection is implementation specific) is returned. + If no items are named by {\tt tagOrdId}, an error is raised. + \end{blockindent} + + +\chapter{Attributes description} + +\attribute{alignment}{alignment} +\begin{blockindent} + Specifies the horizontal alignment of an entity. + The legal values are: left, right, center. +\end{blockindent} + +\attribute{anchor}{anchor} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{atomic}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{autoalignment}{autoAlignSpec} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{backcolor}{color} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{border}{edges} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{bordercolor}{color} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{brightlinecolor}{color} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{brightlinestyle}{lineStyle} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{circlehistory}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{clip}{item} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{closed}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{color}{color} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{composerotation}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{composescale}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{connecteditem}{item} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{connectionanchor}{anchor} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{connectioncolor}{color} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{connectionsensitive}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{connectionstyle}{lineStyle} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{connectionwidth}{dimension} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{extent}{integer} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{fillcolor}{color} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{filled}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{filledhistory}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{filledmarker}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{fillpattern}{bitmapName} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{firstradius}{dimension} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{font}{fontName} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{frozenlabel}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{image}{imageName} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{labelanchor}{anchor} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{labelangle}{number} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{labeldistance}{dimension} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{labeldx}{number} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{labeldy}{number} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{labelformat}{labelFormat} +\begin{blockindent} + The new format is as follow. Parameters between [] are + optional and take default values when omitted. The spaces can appear + between blocks but not inside. + + \verb+[WidthxHeight] [field0Spec] [field1Spec] [fieldnSpec]+ + + Width and Height set the size of the clipping box surrounding + the label. If it is not specified, there will be no clipping. + It it is specified alone it is the size of the only displayed + field (0). + + fieldSpec is: + \verb+sChar fieldWidth sChar fieldHeight [pChar fieldX pChar fieldY]+. + + Each field description refers to the field of same index in the field + array. + If \verb+sChar+ is \verb+'x'+, the dimension is in pixel. If \verb+sChar+ is \verb+'f'+, the + dimension is in percentage of the mean width/height of a character (in the + field font). If \verb+sChar+ is \verb+'i'+, the dimension is in percentage of the size + of the image in the field. If \verb+sChar+ is \verb+'a'+, the dimension is automatically + adjusted to match the field's content plus the given value in pixels. + + If \verb+pChar+ is \verb-'+'- the position is in pixel (possibly negative). If it is + \verb+'<'+ the position is the index of the field at the left/top of which the + current field should be attached. If it is \verb+'>'+ the position is the index + of the field at the right/bottom of which the current field should be + attached. If \verb+pChar+ is \verb+'^'+ the position is the index of the field used to + align the left/top border (left on left or top on top). If \verb+pChar+ is \verb+'$'+ the %$ + position is the index of the field used to align the right/bottom border + (right on right or bottom on bottom). + + The positional parameters can be omitted if there is only one field. +\end{blockindent} + +\attribute{leaderanchors}{leaderanchors} +\begin{blockindent} + Describe where to attach the label leader on the label. These are not + to be confused with the regular rectangular anchors. + + The format is: \verb+lChar leftLeaderAnchor [lChar rightLeaderAnchor]+ + + If \verb+lChar+ is a \verb+'|'+, \verb+leftLeaderAnchor+ and \verb+rightLeaderAnchor+ + are the indices of the fields that serve to anchor the label's leader. More + specifically the bottom left corner of the left field and the bottom right corner of + the right field are used as the anchors. + If \verb+lChar+ is \verb+'%'+, \verb+leftLeaderAnchor+ and \verb+rightLeaderAnchor+ + should be specified as \verb+valxval+, \verb+val+ being a percentage (max 100) of + the width/height of the label bounding box. If rightLeaderAnchor is not specified + it defaults to field 0. If rightLeaderField is not specified it defaults to + leftLeaderAnchor. If neither of them are specified, the center of the label + is used as an anchor. +\end{blockindent} + +\attribute{leadercolor}{color} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{leadersensitive}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{leadershape}{lineShape} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{leaderstyle}{lineStyle} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{leaderwidth}{dimension} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{linecolor}{color} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{linefirstend}{lineEnd} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{linelastend}{lineEnd} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{linepattern}{bitmapName} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{linestyle}{lineStyle} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{linewidth}{dimension} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{lockedom}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{mapinfo}{mapInfoName} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{marker}{bitmapName} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{markercolor}{color} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{markerfillpattern}{bitmapName} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{markersize}{dimension} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{markerstyle}{lineStyle} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{mask}{bitmapName} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{mixedhistory}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{numfields}{} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{numcircles}{integer} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{overlapdelta}{coords} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{overstriked}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{period}{integer} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{pieslice}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{position}{position} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{priority}{integer} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{relief}{relief} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{reliefthickness}{dimension} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{sensitive}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{smoothed}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{spacing}{dimension} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{speedvector}{position} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{speedvectorcolor}{color} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{speedvectorsensitive}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{startangle}{integer} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{stepsize}{dimension} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{symbol}{bitmapName} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{symbolcolor}{color} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{symbols}{bitmapNames} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{symbolsensitive}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{tags}{tagList} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{text}{string} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{underlined}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{visible}{boolean} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{visiblehistorysize}{integer} +\begin{blockindent} + To be written +\end{blockindent} + +\attribute{width}{dimension} +\begin{blockindent} + To be written +\end{blockindent} + + + +\chapter{Labels, fields and label formats} +\concept{label} +\concept{labelformat} +\object{field} +Applicable attributes for fields: + +\begin{tabular}{ll} + \attrref{alignment} & The horizontal alignment of both the text and the image \\ + \attrref{autoalignment} & The alignments used according to the label orientation \\ + \attrref{backcolor} & The field background color \\ + \attrref{border} & The border description, edge by edge \\ + \attrref{bordercolor} & The border color\\ + \attrref{color} & The text color \\ + \attrref{filled} & Specifies if the field background should be filled \\ + \attrref{fillpattern} & The fill pattern used when filling the background \\ + \attrref{font} & The text font \\ + \attrref{image} & An image to be displayed in the field \\ + \attrref{relief} & Specifies the relief to be drawn around the field, inside the border \\ + \attrref{reliefthickness} & Width of the relief \\ + \attrref{sensitive} & Specifies if the field should react to input events \\ + \attrref{text} & One line of text to be displayed in the field \\ + \attrref{visible} & Specifies if the field is dispalyed \\ +\end{tabular} + + + +\chapter{Item types} +\object{items} + +This chapter introduces the various items that can be used in a \ident{radar}. + + +\section{Group items} + +\object{group} +Applicable attributes for \ident{group}: + +\begin{tabular}{ll} + \attrref{atomic} & Specifies if the group should report itself or its components during a search or pointer related operations \\ + \attrref{clip} & The item used for clipping \\ + \attrref{composerotation} & Specifies if the current rotation should be composed with the local transform \\ + \attrref{composescale} & Specifies if the current scale should be composed with the local transform \\ + \attrref{priority} & The absolute position in the stacking order \\ + \attrref{sensitive} & Specifies if the item should react to events \\ + \attrref{tags} & The list of tags associated with the item \\ + \attrref{visible} & Specifies if the item is displayed \\ +\end{tabular} + + +\section{Track and WayPoint items} + +\object{track} +Applicable attributes for \ident{track}: + +\begin{tabular}{ll} + \attrref{circlehistory} & Specifies if the track history is plotted with circles \\ + \attrref{composerotation} & Specifies if the current rotation should be composed with the local transform \\ + \attrref{composescale} & Specifies if the current scale should be composed with the local transform \\ + \attrref{connecteditem} & The item ending the connection link \\ + \attrref{connectioncolor} & The color of the connection link \\ + \attrref{connectionsensitive} & Specifies if the connection link is sensitive \\ + \attrref{connectionstyle} & The line style of the connection link \\ + \attrref{connectionwidth} & The width of the connection link \\ + \attrref{filledhistory} & Specifies if the track history is filled or outlined \\ + \attrref{filledmarker} & Specifies if the circular marker is filled or outlined \\ + \attrref{frozenlabel} & Specifies if the label should be frozen at its current location \\ + \attrref{labelanchor} & The anchor used in positionning the label \\ + \attrref{labelangle} & The angle between the leader label and the normal to the speed vector \\ + \attrref{labeldistance} & The minimum distance between the track position and the label anchor \\ + \attrref{labeldx} & The X offset between the track position and the label anchor \\ + \attrref{labeldy} & The Y offset between the track position and the label anchor \\ + \attrref{labelformat} & Geometry of the label's fields \\ + \attrref{leaderanchors} & The attachments of the leader on the label side \\ + \attrref{leadercolor} & The color of the label leader \\ + \attrref{leadersensitive} & Specifies if the label leader is sensitive \\ + \attrref{leadershape} & The shape of the label leader \\ + \attrref{leaderstyle} & The line style of the label leader \\ + \attrref{leaderwidth} & The width of the label leader \\ + \attrref{markercolor} & The color of the circular marker (fill or outline) \\ + \attrref{markerfillpattern} & The pattern to use when filling the circular marker \\ + \attrref{markersize} & The (scale sensitive) size of the circular marker \\ + \attrref{markerstyle} & The line style of the marker outline \\ + \attrref{mixedhistory} & Specifies if the track history is plotted with dots every other positions \\ + \attrref{numfields} & Gives the number of fields available for the label \\ + \attrref{position} & The current location of the track \\ + \attrref{priority} & The absolute position in the stacking order \\ + \attrref{sensitive} & Specifies if the item should react to events \\ + \attrref{speedvector} & The speed vector $\Delta x$ and $\Delta y$ in unit / minute \\ + \attrref{speedvectorcolor} & The color of the trck's speed vector \\ + \attrref{speedvectorsensitive} & Specifies if the track's speed vector is sensitive \\ + \attrref{symbol} & The symbol displayed at the current position \\ + \attrref{symbolcolor} & The color of the symbol displayed at the current position \\ + \attrref{symbolsensitive} & Specifies if the current position's symbol is sensitive to events \\ + \attrref{tags} & The list of tags associated with the item \\ + \attrref{visible} & Specifies if the item is displayed \\ + \attrref{visiblehistorysize} & The number of past positions that should be displayed \\ +\end{tabular} + +\object{waypoint} +Applicable attributes for \ident{waypoint}: + +\begin{tabular}{ll} + \attrref{composerotation} & Specifies if the current rotation should be composed with the local transform \\ + \attrref{composescale} & Specifies if the current scale should be composed with the local transform \\ + \attrref{connecteditem} & \\ + \attrref{connectioncolor} & \\ + \attrref{connectionsensitive} & \\ + \attrref{connectionstyle} & \\ + \attrref{connectionwidth} & \\ + \attrref{filledmarker} & \\ + \attrref{labelanchor} & The anchor used in positionning the label \\ + \attrref{labelangle} & The angle between the leader label and the normal to the speed vector \\ + \attrref{labeldistance} & The minimum distance between the track position and the label anchor \\ + \attrref{labeldx} & The X offset between the track position and the label anchor \\ + \attrref{labeldy} & The Y offset between the track position and the label anchor \\ + \attrref{labelformat} & \\ + \attrref{leaderanchors} & The attachments of the leader on the label side \\ + \attrref{leadercolor} & \\ + \attrref{leadersensitive} & \\ + \attrref{leadershape} & \\ + \attrref{leaderstyle} & \\ + \attrref{leaderwidth} & \\ + \attrref{markercolor} & \\ + \attrref{markerfillpattern} & \\ + \attrref{markersize} & \\ + \attrref{markerstyle} & \\ + \attrref{numfields} & \\ + \attrref{position} & \\ + \attrref{priority} & The absolute position in the stacking order \\ + \attrref{sensitive} & Specifies if the item should react to events \\ + \attrref{symbol} & \\ + \attrref{symbolcolor} & \\ + \attrref{symbolsensitive} & \\ + \attrref{tags} & The list of tags associated with the item \\ + \attrref{visible} & Specifies if the item is displayed \\ +\end{tabular} + + +\section{Tabular items} + +\object{tabular} +Applicable attributes for \ident{tabular}: + +\begin{tabular}{ll} + \attrref{anchor} & The anchor used in positionning the item \\ + \attrref{composerotation} & Specifies if the current rotation should be composed with the local transform \\ + \attrref{composescale} & Specifies if the current scale should be composed with the local transform \\ + \attrref{connecteditem} & Specifies the item relative to which this item is placed \\ + \attrref{connectionanchor} & Specifies the anchor on the connected item used for the placement \\ + \attrref{labelformat} & \\ + \attrref{numfields} & \\ + \attrref{position} & The item's position relative to the anchor (if no connected item specified) \\ + \attrref{priority} & The absolute position in the stacking order \\ + \attrref{sensitive} & Specifies if the item should react to events \\ + \attrref{tags} & The list of tags associated with the item \\ + \attrref{visible} & Specifies if the item is displayed \\ +\end{tabular} + + +\section{Text items} + +\object{text} +Applicable attributes for \ident{text}: + +\begin{tabular}{ll} + \attrref{alignment} & \\ + \attrref{anchor} & The anchor used in positionning the item \\ + \attrref{color} & \\ + \attrref{composerotation} & Specifies if the current rotation should be composed with the local transform \\ + \attrref{composescale} & Specifies if the current scale should be composed with the local transform \\ + \attrref{connecteditem} & Specifies the item relative to which this item is placed \\ + \attrref{connectionanchor} & Specifies the anchor on the connected item used for the placement \\ + \attrref{fillcolor} & \\ + \attrref{fillpattern} & \\ + \attrref{font} & \\ + \attrref{overstriked} & \\ + \attrref{position} & The item's position relative to the anchor (if no connected item specified) \\ + \attrref{priority} & The absolute position in the stacking order \\ + \attrref{sensitive} & Specifies if the item should react to events \\ + \attrref{spacing} & \\ + \attrref{text} & \\ + \attrref{tags} & The list of tags associated with the item \\ + \attrref{underlined} & \\ + \attrref{visible} & Specifies if the item is displayed \\ + \attrref{width} & \\ +\end{tabular} + + +\section{Icon items} + +\object{icon} +Applicable attributes for \ident{icon}: + +\begin{tabular}{ll} + \attrref{anchor} & The anchor used in positionning the item \\ + \attrref{color} & \\ + \attrref{composerotation} & Specifies if the current rotation should be composed with the local transform \\ + \attrref{composescale} & Specifies if the current scale should be composed with the local transform \\ + \attrref{connecteditem} & Specifies the item relative to which this item is placed \\ + \attrref{connectionanchor} & Specifies the anchor on the connected item used for the placement \\ + \attrref{image} & \\ + \attrref{mask} & \\ + \attrref{position} & The item's position relative to the anchor (if no connected item specified) \\ + \attrref{priority} & The absolute position in the stacking order \\ + \attrref{sensitive} & Specifies if the item should react to events \\ + \attrref{tags} & The list of tags associated with the item \\ + \attrref{visible} & Specifies if the item is displayed \\ +\end{tabular} + + +\section{Reticle items} + +\object{reticle} +Applicable attributes for \ident{reticle}: + +\begin{tabular}{ll} + \attrref{brightlinecolor} & \\ + \attrref{composerotation} & Specifies if the current rotation should be composed with the local transform \\ + \attrref{composescale} & Specifies if the current scale should be composed with the local transform \\ + \attrref{linecolor} & \\ + \attrref{firstradius} & \\ + \attrref{numcircles} & \\ + \attrref{period} & \\ + \attrref{position} & \\ + \attrref{priority} & The absolute position in the stacking order \\ + \attrref{sensitive} & Specifies if the item should react to events \\ + \attrref{stepsize} & \\ + \attrref{linestyle} & \\ + \attrref{brightlinestyle} & \\ + \attrref{tags} & The list of tags associated with the item \\ + \attrref{visible} & Specifies if the item is displayed \\ +\end{tabular} + + +\section{Map items} + +\object{map} +Applicable attributes for \ident{map}: + +\begin{tabular}{ll} + \attrref{color} & \\ + \attrref{composerotation} & Specifies if the current rotation should be composed with the local transform \\ + \attrref{composescale} & Specifies if the current scale should be composed with the local transform \\ + \attrref{filled} & \\ + \attrref{fillpattern} & \\ + \attrref{font} & \\ + \attrref{mapinfo} & \\ + \attrref{priority} & The absolute position in the stacking order \\ + \attrref{sensitive} & Specifies if the item should react to events \\ + \attrref{symbols} & \\ + \attrref{tags} & The list of tags associated with the item \\ + \attrref{visible} & Specifies if the item is displayed \\ +\end{tabular} + + +\section{Mosaic items} + +\object{mosaic} + + +\section{Rectangle items} + +\object{rectangle} +Applicable attributes for \ident{rectangle}: + +\begin{tabular}{ll} + \attrref{composerotation} & Specifies if the current rotation should be composed with the local transform \\ + \attrref{composescale} & Specifies if the current scale should be composed with the local transform \\ + \attrref{fillcolor} & \\ + \attrref{filled} & \\ + \attrref{fillpattern} & \\ + \attrref{linecolor} & \\ + \attrref{linepattern} & \\ + \attrref{linestyle} & \\ + \attrref{linewidth} & \\ + \attrref{priority} & The absolute position in the stacking order \\ + \attrref{relief} & \\ + \attrref{sensitive} & Specifies if the item should react to events \\ + \attrref{tags} & The list of tags associated with the item \\ + \attrref{visible} & Specifies if the item is displayed \\ +\end{tabular} + + +\section{Arc items} + +\object{arc} +Applicable attributes for \ident{arc}: + +\begin{tabular}{ll} + \attrref{closed} & \\ + \attrref{composerotation} & Specifies if the current rotation should be composed with the local transform \\ + \attrref{composescale} & Specifies if the current scale should be composed with the local transform \\ + \attrref{extent} & \\ + \attrref{fillcolor} & \\ + \attrref{filled} & \\ + \attrref{fillpattern} & \\ + \attrref{linecolor} & \\ + \attrref{linepattern} & \\ + \attrref{linestyle} & \\ + \attrref{linewidth} & \\ + \attrref{pieslice} & \\ + \attrref{priority} & The absolute position in the stacking order \\ + \attrref{sensitive} & Specifies if the item should react to events \\ + \attrref{startangle} & \\ + \attrref{tags} & The list of tags associated with the item \\ + \attrref{visible} & Specifies if the item is displayed \\ +\end{tabular} + + +\section{MultiPoint items} + +\object{multipoint} +Applicable attributes for \ident{multipoint}: + +\begin{tabular}{ll} + \attrref{composerotation} & Specifies if the current rotation should be composed with the local transform \\ + \attrref{composescale} & Specifies if the current scale should be composed with the local transform \\ + \attrref{fillcolor} & \\ + \attrref{filled} & \\ + \attrref{fillpattern} & \\ + \attrref{linecolor} & \\ + \attrref{linefirstend} & \\ + \attrref{linelastend} & \\ + \attrref{linepattern} & \\ + \attrref{linestyle} & \\ + \attrref{linewidth} & \\ + \attrref{marker} & \\ + \attrref{markercolor} & \\ + \attrref{priority} & The absolute position in the stacking order \\ + \attrref{relief} & \\ + \attrref{sensitive} & Specifies if the item should react to events \\ + \attrref{smoothed} & \\ + \attrref{tags} & The list of tags associated with the item \\ + \attrref{visible} & Specifies if the item is displayed \\ +\end{tabular} + + +\chapter{Bindings} + + +\chapter{The \ident{mapinfo} command} + +\mapinfocmd{name}{create}{} + \begin{blockindent} + To be written + \end{blockindent} + +\mapinfocmd{mapInfoName}{delete}{} + \begin{blockindent} + To be written + \end{blockindent} + +\mapinfocmd{mapInfoName}{duplicate}{newName} + \begin{blockindent} + To be written + \end{blockindent} + +\mapinfocmd{name}{add}{type args} + \begin{blockindent} + To be written + \end{blockindent} + +\mapinfocmd{name}{count}{type} + \begin{blockindent} + To be written + \end{blockindent} + +\mapinfocmd{name}{get}{type index} + \begin{blockindent} + To be written + \end{blockindent} + +\mapinfocmd{name}{replace}{type index args} + \begin{blockindent} + To be written + \end{blockindent} + +\mapinfocmd{name}{remove}{type index} + \begin{blockindent} + To be written + \end{blockindent} + +\mapinfocmd{name}{scale}{factor} + \begin{blockindent} + To be written + \end{blockindent} + +\mapinfocmd{name}{translate}{xAmount yAmount} + \begin{blockindent} + To be written + \end{blockindent} + + + +\chapter{The \ident{videomap} command} + +\command{videomap}{ids}{fileName} + \begin{blockindent} + To be written + \end{blockindent} + +\command{videomap}{load}{fileName index mapInfoName} + \begin{blockindent} + To be written + \end{blockindent} + + + +\chapter{Other resources provided by the widget} + +\section{Bitmaps} + + +\latex {\tolerance 2000 %allow somewhat looser lines. +\hbadness 10000 } %don't complain about underfull lines. + +\tableofcontents +\listoftables +\listoffigures + +\printindex + +\label{interne:DernierePage} + + +\end{document} diff --git a/sandbox/controls.tcl b/sandbox/controls.tcl new file mode 100644 index 0000000..9301d1a --- /dev/null +++ b/sandbox/controls.tcl @@ -0,0 +1,158 @@ +set tlbbox [.r add group $top -sensitive f -visible f -tags currentbbox] +.r add rectangle $tlbbox "-3 -3 +3 +3" +set trbbox [.r add group $top -sensitive f -visible f -tags currentbbox] +.r add rectangle $trbbox "-3 -3 +3 +3" +set blbbox [.r add group $top -sensitive f -visible f -tags currentbbox] +.r add rectangle $blbbox "-3 -3 +3 +3" +set brbbox [.r add group $top -sensitive f -visible f -tags currentbbox] +.r add rectangle $brbbox "-3 -3 +3 +3" +.r add rectangle $top "0 0 1 1" -linecolor red -tags "lasso" -visible f -sensitive f + +# +# Controls for the window transform. +# +proc press {lx ly action} { + global x y angle + set x $lx + set y $ly + set angle [expr atan2($y, $x)] + bind .r "<Motion>" "$action %x %y" +} + +proc motion {lx ly} { + global x y + set it [.r find withtag controls] + if {$it != ""} { + set it [.r group [lindex $it 0]] + } + set res [.r transform $it "$lx $ly $x $y"] + set nx [lindex $res 0] + set ny [lindex $res 1] + set ox [lindex $res 2] + set oy [lindex $res 3] + .r translate controls [expr $nx - $ox] [expr $ny - $oy] + set x $lx + set y $ly +} + +proc zoom {lx ly} { + global x y + + if {$lx > $x} { + set maxx $lx + } else { + set maxx $x + } + if {$ly > $y} { + set maxy $ly + } else { + set maxy $y + } + set sx [expr 1.0 + double($lx - $x)/$maxx] + set sy [expr 1.0 + double($ly - $y)/$maxy] + set x $lx + set y $ly + .r scale controls $sx $sy +} + +proc rotate {lx ly} { + global angle + + set langle [expr atan2($ly, $lx)] + .r rotate controls [expr -($langle-$angle)] + set angle $langle +} + +proc release {} { + bind .r "<Motion>" "" +} + +proc start_lasso {lx ly} { + global top x y cx cy + set x $lx + set y $ly + set cx $lx + set cy $ly + set coords [.r transform $top "$x $y"] + set fx [lindex $coords 0] + set fy [lindex $coords 1] + .r coords lasso "$fx $fy $fx $fy" + .r itemconfigure lasso -visible t + .r raise lasso + bind .r "<Motion>" "lasso %x %y" +} + +proc lasso {lx ly} { + global top x y cx cy + set cx $lx + set cy $ly + set coords [.r transform $top "$x $y $lx $ly"] + set fx [lindex $coords 0] + set fy [lindex $coords 1] + set fcx [lindex $coords 2] + set fcy [lindex $coords 3] + .r coords lasso "$fx $fy $fcx $fcy" +} + +proc fin_lasso {} { + global x y cx cy + + bind .r "<Motion>" "" + .r itemconfigure lasso -visible f +# puts "x=$x, y=$y, cx=$cx, cy=$cy" + puts "enclosed='[.r find enclosed $x $y $cx $cy]', overlapping='[.r find overlapping $x $y $cx $cy]'" +} + +proc getrect {x y} { + list [expr $x-3] [expr $y-3] [expr $x+3] [expr $y+3] +} + +proc showbox {} { + global top tlbbox trbbox blbbox brbbox + + if { ! [.r hastag current currentbbox]} { + if {[catch {.r find withtag current} item] } { + return + } + set coords [.r transform $top [.r bbox current]] + set xo [lindex $coords 0] + set yo [lindex $coords 1] + set xc [lindex $coords 2] + set yc [lindex $coords 3] + + .r coords $tlbbox "$xo $yo" + .r coords $trbbox "$xc $yo" + .r coords $brbbox "$xc $yc" + .r coords $blbbox "$xo $yc" + .r itemconfigure currentbbox -visible t + } +} + +proc hidebox {lx ly} { + set next [.r find atpoint $lx $ly] + if {[llength $next] > 1} { + set next [lindex $next 0] + } + if { $next == "" || ! [.r hastag $next currentbbox] ||\ + [.r hastag current currentbbox]} { + .r itemconfigure currentbbox -visible f + } +} + + +bind .r "<ButtonPress-1>" "start_lasso %x %y" +bind .r "<ButtonRelease-1>" fin_lasso + +bind .r "<ButtonPress-2>" {puts "at point='[.r find atpoint %x %y]'"} + +bind .r "<ButtonPress-3>" "press %x %y motion" +bind .r "<ButtonRelease-3>" release + +bind .r "<Shift-ButtonPress-3>" "press %x %y zoom" +bind .r "<Shift-ButtonRelease-3>" release + +bind .r "<Control-ButtonPress-3>" "press %x %y rotate" +bind .r "<Control-ButtonRelease-3>" release + +.r bind current "<Enter>" showbox +.r bind current "<Leave>" {hidebox %x %y} diff --git a/sandbox/testpoly.tcl b/sandbox/testpoly.tcl new file mode 100644 index 0000000..0341bf9 --- /dev/null +++ b/sandbox/testpoly.tcl @@ -0,0 +1,149 @@ +#!/usr/bin/wish -f + +load tkradar3.1.so +package require Img + +set top 1 +set lw 8 +set marker AtcSymbol9 +set arrow "8 10 6" + + +# +# Cap Join Filled Border Relief Title +# +set show {\ + {round round f t flat JoinRound}\ + {round bevel f t flat JoinBevel}\ + {round miter f t flat JoinMiter}\ + {butt round f t flat CapButt}\ + {projecting round f t flat CapProjecting}\ + {round round f t sunken Sunken}\ + {round round f t raised Raised}\ + {round round f t groove Groove}\ + {round round f t ridge Ridge}\ + {round round t t sunken FilledSunken}\ + {round round t t raised FilledRaised}\ + {round round t t groove FilledGroove}\ + {round round t t ridge FilledRidge}\ + {round round f f flat Marker}\ + {round round t f flat Fill}\ + {round round t t flat FillBorder}} + +image create photo logo -file /usr/share/toccata/images/logo.gif +#image create photo papier -file /usr/share/toccata/images/dgtexture-dragstrip.xpm + +set r [radar .r -backcolor gray -relief sunken] +pack .r -expand t -fill both +.r configure -width 1024 -height 800 +.r scale $top 1 -1 +#.r configure -drawbboxes t +set view [.r add group $top -tags controls] + +# +# Create the model +# +set model [.r add group $view] +set mp [.r add curve $model "50 -150 100 -50 270 -130 220 -200 200 -180 180 -300 140 -160 70 -300" \ + -linecolor yellow -fillcolor tan -fillpattern AlphaStipple8 \ + -markercolor red -tags "poly" -linewidth $lw] +set bbox [.r transform $model [.r bbox $mp]] +set x [expr ([lindex $bbox 2] + [lindex $bbox 0]) / 2] +set y [expr [lindex $bbox 1] + 5] +.r add text $model -text "CapRound" -color blue -alignment center -anchor s -tags "title" \ + -position "$x $y" + +# +# Now clone for each variation on the polygon +# +set col 0 +set row 0 +foreach current $show { + foreach {cap join filled border relief title} $current { + set grp [.r clone $model] + .r translate $grp [expr $col * 240] [expr $row * (-290 - (2 * $lw))] + .r itemconfigure [.r find withtag "poly" $grp] \ + -capstyle $cap -joinstyle $join -filled $filled \ + -linewidth [expr $border ? $lw : 0] -relief $relief + .r itemconfigure [.r find withtag "title" $grp] -text $title + incr col + if {$col >= 4} { + set col 0 + incr row + } + } +} + +# +# Suppress the model +# +.r remove $model + + +# +# Some optional graphic features +set closed 0 +set marks 0 +set smooth 0 +set arrows none + +proc toggle_arrows { } { + global arrows arrow + if {$arrows == "none"} { + set arrows first + set f $arrow + set l "" + } elseif {$arrows == "first"} { + set arrows last + set f "" + set l $arrow + } elseif {$arrows == "last"} { + set arrows both + set f $arrow + set l $arrow + } elseif {$arrows == "both"} { + set arrows none + set f "" + set l "" + } + .r itemconfigure poly -firstend $f -lastend $l +} + +proc toggle_marks { } { + global marks marker + set marks [expr ! $marks] + if {$marks} { + .r itemconfigure poly -marker $marker + } { + .r itemconfigure poly -marker "" + } +} + +proc toggle_smooth { } { + global smooth + set smooth [expr ! $smooth] + .r itemconfigure poly -smoothed $smooth +} + +proc toggle_closed { } { + global closed + set closed [expr ! $closed] + foreach curve [.r find withtag "poly"] { + if {$closed} { + .r coords $curve add [.r coords $curve 0] + } { + .r coords $curve remove -1 + } + } + +} + +focus .r + +bind .r "<a>" toggle_arrows +bind .r "<c>" toggle_closed +bind .r "<m>" toggle_marks +bind .r "<s>" toggle_smooth + + +source "controls.tcl" diff --git a/sandbox/testzinc.pl b/sandbox/testzinc.pl new file mode 100644 index 0000000..ebcb40c --- /dev/null +++ b/sandbox/testzinc.pl @@ -0,0 +1,229 @@ +#!/usr/bin/perl + +use Tk; + +$mw = MainWindow->new; +$logo = $mw->Photo(-file => "/home/etienne/images/logo.gif"); +# $canvas = $mw->Canvas; +# $canvas->pack(-expand => t, -fill => 'both'); +# $text = $canvas->create('text', 30, 20, -width => 45, -text => "hello"); +# @listOfList = $canvas->itemconfigure($text); +# for (@listOfList) { +# ($option, $name, $class, $default, $value) = @$_; +# print "$option, $value\n"; +# } +# MainLoop; +# exit; +################################################### +# creation radar +################################################### + +#$mw->Radar()->pack; +#MainLoop; exit; +$radar = $mw->Radar(-backcolor => 'skyblue', -relief => 'sunken'); +$radar->pack(-expand => t, -fill => 'both'); + +$radar->configure(-width => 800, -height => 500); +$color = $radar->cget("-backcolor"); print "radar backcolor=$color\n"; + +################################################### +# creation track +################################################### +$track = $radar->add("track", 10); +#$radar->itemconfigure($track, -tags => 'toto'); + +$radar->itemconfigure($track, -position => [1, 1]); +$radar->itemconfigure($track, -position => [10, 10]); +$radar->itemconfigure($track, -position => [20, 20]); +$radar->itemconfigure($track, -position => [30, 30]); +$radar->itemconfigure($track, -position => [40, 40]); +$radar->itemconfigure($track, -position => [50, 50]); +$radar->itemconfigure($track, -position => [60, 50]); +$radar->itemconfigure($track, -speedvector => [20, 0]); +$radar->itemconfigure($track, -symbolcolor => 'red', -labeldistance => 60); +$radar->itemconfigure($track, -markersize => 10, -filledmarker => 1, + -markercolor => "green"); + +print "radar itemconfigure :\n\n"; +for $attr ($radar->itemconfigure($track)) { + print " ( ",join(',', @$attr)," )\n" ; +} +print "\n"; + +$size = $radar->itemcget($track, -markersize); print "track markersize=$size\n"; +(@coords) = $radar->itemcget($track, "-position"); +print "track position=",$coords[0],"+",$coords[1],"\n"; + + +$radar->itemconfigure($track, -labelformat => + "150x60|40+20|40+20|40+20,0:40x20+0+0,1:40x20+40+0,2:150x60+0+0"); + +$radar->itemconfigure($track, 0, -filled => 1 , -backcolor => "red", + -border => "contour"); +$radar->itemconfigure($track, 0, -text => "TO"); +$radar->itemconfigure($track, 1, -filled => 1 , -backcolor => "green", + -border => "contour"); +$radar->itemconfigure($track, 1, -filled => 1 , -backcolor => "green", + -border => "contour"); +$radar->itemconfigure($track, 2, -image => $logo , -alignment => "center"); +$mk = $radar->itemcget($track, -markercolor); + +$radar->itemconfigure($track, 0, -reliefthickness => 2, -relief => "sunken", + -bordercolor => "red", -border => "noborder"); + +$radar->bind($track.":-3", "<Enter>", + sub {$radar->itemconfigure($track, -speedvectorcolor => 'red')}); +$radar->bind($track.":-3", "<Leave>", + sub {$radar->itemconfigure($track, -speedvectorcolor => 'black')}); + + +################################################### +# creation way point +################################################### +print "creating way point\n"; +my $wp = $radar->add("waypoint", 10); +$radar->itemconfigure($wp, + -symbolcolor => "green", + -position => [0, 80], + -labelformat => "80x40|40+20|40+20|40+20,0:40x20+0+0,1:40x20+40+0,2:80x40+0+0" + ); +$radar->itemconfigure($wp, 0 ,-filled => 1 ,-backcolor => "tan",-text => "TO"); +$radar->itemconfigure($wp, 1 ,-filled => 1 ,-backcolor => "wheat",-text => "TO"); +$radar->itemconfigure($wp, 2 ,-border => "contour"); +$radar->bind($wp, "<Enter>", [ \&borders, "on"]); +$radar->bind($wp, "<Leave>", [ \&borders, "off"]); + +################################################### +# creation 2nd track +################################################### +print "creating second track\n"; +$track2 = $radar->add("track", 10, -speedvector => [-20, 0], -position => [0, 50]); +$radar->itemconfigure($track2, -connecteditem => $track); + +################################################### +# creation macro +################################################### +print "creating macro\n"; +$macro = $radar->add("macro", 10, + -labelformat => "80x40|40+20|40+20|40+20,0:40x20+0+0,1:40x20+40+0" + ); +$radar->itemconfigure($macro, 0 , -text => "une"); +$radar->itemconfigure($macro, 1, -text => "macro"); +$radar->itemconfigure($macro, -connecteditem => $track); +$radar->bind($macro.":0", "<Enter>", [ \&borders, "on"]); +$radar->bind($macro.":0", "<Leave>", [ \&borders, "off"]); + +################################################### +# creation ministrip +################################################### +print "creating ministrip\n"; +$ministrip = $radar->add("ministrip", 10, + -labelformat => "80x40|40+20|40+20|40+20,0:40x20+0+0,1:40x20+40+0", + -position => [100, 10] + ); +$radar->itemconfigure($ministrip, 0 , -text => 'ministrip'); + +################################################### +# creation map +################################################### +print "creating map\n"; +$mw->videomap("load", "/home/etienne/tmp/videomap_paris-w_90_2", 0, "paris-w"); +$mw->videomap("load", "/home/etienne/tmp/videomap_orly", 17, "orly"); +$mw->videomap("load", "/home/etienne/tmp/hegias_parouest_TE.vid", 0, "paris-ouest"); + +print "videomap ids : ", + join('|', $mw->videomap("ids", "/home/etienne/tmp/videomap_orly")),"\n"; +$map = $radar->add("map", -color => red); +$radar->itemconfigure($map,-mapinfo => orly); + +$map2 = $radar->add("map", -color => green, -filled => 1, -priority => 0, + -fillpattern => AlphaStipple6); +#$radar->itemconfigure($map2, -mapinfo => paris-ouest); + +$map3 = $radar->add("map", -color => orange); +$radar->itemconfigure($map3,-mapinfo => "paris-w"); + + +################################################### +#creation rectangle, arc, curve +################################################### + +$rect = $radar->add(rectangle, -50, -50, 50, -80, -linecolor => bisque); +$radar->bind($rect, '<Enter>', sub { $radar->itemconfigure($rect, -linecolor => red)}); +$radar->bind($rect, '<Leave>', sub { $radar->itemconfigure($rect, -linecolor => bisque)}); + +$arc = $radar->add(arc, -100, 80, -50, 30, -linecolor => bisque, + -tags => ["arc"]); +#$radar->addtag("fleche",'withtag', $arc); +#$radar->addtag("carquois",'withtag', $arc); +$radar->add(rectangle, -101, 81, -49, 29, -linecolor => green); +$radar->raise($arc); +$radar->bind($arc, '<Enter>', sub {$radar->itemconfigure($arc, -linecolor => red)}); +$radar->bind($arc, '<Leave>', sub {$radar->itemconfigure($arc, -linecolor => bisque)}); +print "arc tags=", join('|',$radar->gettags($arc)),"\n"; + +$radar->itemconfigure($arc, -startangle => 0, -extent => 360); + +$mp = $radar->add(curve, -300, 0, -250, 100, -80, 20); +$radar->itemconfigure($mp, -filled => 1, -linewidth => 4, -linecolor => yellow, + -fillcolor => tan, -fillpattern => AlphaStipple8); +$radar->itemconfigure($mp, -marker => AtcSymbol9 , -markercolor => red); + +################################################### +# Map info +################################################### +$mw->mapinfo('mpessai', 'create'); +$mw->mapinfo('mpessai', add, text, normal, simple, 0, 200, "Et voilà"); +$mw->mapinfo(mpessai, add, line, simple, 0, 0, 0, 0, 200); +#$mw->mapinfo('mpessai', add, line, simple, 5, -100, 100, 0, 0); +$radar->itemconfigure($map3, -mapinfo => mpessai); + +print "mapinfo count line : ", $mw->mapinfo(mpessai, count, line),"\n"; +print "mapinfo get line 3: ", join('|',$mw->mapinfo(mpessai, get, line, 0)),"\n"; +################################################### +# tests diverses methodes +################################################### + +for ($radar->find('all')) { + print $_, " -> ", $radar->type($_),"\n"; +} +$radar->Tk::bind("<2>", [sub { + print $_[1], "@" ,$_[2], ", closest: ", + join(' ',$radar->find('closest', $_[1], $_[2])),"\n"; + }, Ev('x'), Ev('y')]); + + +$radar->Tk::bind('<ButtonPress-1>', + [ sub {($origx, $origy) = ($_[1], $_[2]); }, Ev('x'), Ev('y') ]); + +$radar->Tk::bind('<ButtonRelease-1>', + [ sub {&finditems($_[1], $_[2]); }, Ev('x'), Ev('y') ]); + +$radar->Tk::bind("<2>", sub {$radar->translate('all', 10,10); }); +$radar->Tk::bind("<3>", sub {$radar->scale(1.1, 1.1); }); + + +@position = [20, 40, 50, 80]; +#@xy = $radar -> worldcoords (0, @position); +@xy = $radar -> worldcoords (0, [10, 23, 45, 65]); +print ("x = ",$xy[0]," y = ",$xy[1],"\n"); + + + +MainLoop; + +sub borders { + my($widget, $onoff) = @_; + my $part = $radar->currentpart; + my $contour = "noborder"; + $contour = "contour" if ($onoff eq 'on'); + $radar->itemconfigure('current', $part, -border => $contour) if ($part >= 0); +} + +sub finditems { + my($cornerx, $cornery) = @_; + print "--- enclosed --->", + join('|', $radar->find('enclosed',$origx, $origy, $cornerx, $cornery)),"\n"; + print "--- overlapping --->", + join('|',$radar->find('overlapping',$origx, $origy, $cornerx, $cornery)),"\n\n"; +} diff --git a/sandbox/zinc.tcl b/sandbox/zinc.tcl new file mode 100644 index 0000000..a828934 --- /dev/null +++ b/sandbox/zinc.tcl @@ -0,0 +1,258 @@ +#!/usr/bin/wish -f + +load tkradar3.1.so +package require Img + +set top 1 + +image create photo logo -file /usr/share/toccata/images/logo.gif +image create photo logosmall -file /usr/share/toccata/images/logo-small.gif +#image create photo papier -file /usr/share/toccata/images/dgtexture-dragstrip.xpm + +set r [radar .r -backcolor gray -relief sunken] +pack .r -expand t -fill both +set scale 1.0 +set centerX 0.0 +set centerY 0.0 +set radarWidth 800 +set radarHeight 500 +.r configure -width $radarWidth -height $radarHeight +#.r configure -drawbboxes t +set view [.r add group $top -tags "controls"] + +frame .rc +button .rc.up -text "Up" \ + -command {set centerY [expr $centerY+30.0]; updateTransform .r} +button .rc.down -text "Down" \ + -command {set centerY [expr $centerY-30.0]; updateTransform .r} +button .rc.left -text "Left" \ + -command {set centerX [expr $centerX+30.0]; updateTransform .r} +button .rc.right -text "Right" \ + -command {set centerX [expr $centerX-30.0]; updateTransform .r} +button .rc.expand -text "Expand" \ + -command {set scale [expr $scale*1.1]; updateTransform .r} +button .rc.shrink -text "Shrink" \ + -command {set scale [expr $scale*0.9]; updateTransform .r} +button .rc.reset -text "Reset" \ + -command {set scale 1.0; set centerX 0.0; set centerY 0.0; \ + updateTransform .r} +grid .rc.up -row 0 -column 2 -sticky ew +grid .rc.down -row 2 -column 2 -sticky ew +grid .rc.left -row 1 -column 1 +grid .rc.right -row 1 -column 3 +grid .rc.expand -row 1 -column 4 +grid .rc.shrink -row 1 -column 0 +grid .rc.reset -row 1 -column 2 -sticky ew +pack .rc + +bind .r <Configure> "RadarStyleConfig %W %w %h" + +proc RadarStyleConfig {radar w h} { + global radarWidth radarHeight + + set bw [$radar cget -borderwidth] + set radarWidth [expr $w - 2*$bw] + set radarHeight [expr $h - 2*$bw] + updateTransform $radar +} + +proc updateTransform {radar} { + global radarWidth radarHeight + global scale centerX centerY + global top + + $radar treset $top + $radar scale $top 1 -1 + $radar translate $top [expr -$centerX] [expr -$centerY] + $radar scale $top $scale $scale + $radar translate $top [expr $radarWidth/2] [expr $radarHeight/2] +} + +# +# TRACKS +# +set track [.r add track $view 5 -tags track -leaderanchors "|0|0"] +.r itemconfigure $track -position "1 1" +.r itemconfigure $track -position "10 10" +.r itemconfigure $track -position "20 20" +.r itemconfigure $track -position "30 30" +.r itemconfigure $track -position "40 40" +.r itemconfigure $track -position "50 50" +.r itemconfigure $track -position "55 60" +.r itemconfigure $track -position "60 70" +.r itemconfigure $track -speedvector "20 0" +.r itemconfigure $track -symbolcolor salmon -speedvectorcolor salmon -leadercolor salmon \ + -labeldistance 20 +.r itemconfigure $track -markersize 20 \ + -filledmarker 1 \ + -markerfillpattern AlphaStipple4 \ + -markercolor salmon +.r itemconfigure $track -labelformat "120x40 x80x20+0+0 x40x20+80+0 x40x20+0+20 x20x20>2>1 x60x20>0>0" +.r itemconfigure $track 0 -filled 1 -backcolor tan -relief groove \ + -font "cenapii-etiquette-m17" -text "AFR451" +.r itemconfigure $track 1 -text "WPY" -filled 1 -backcolor wheat -relief ridge \ + -font "cenapii-etiquette-m17" +.r itemconfigure $track 2 -text "400" -filled 1 -backcolor wheat \ + -font "cenapii-etiquette-m17" +.r itemconfigure $track 3 -text "-" -filled 1 -backcolor wheat \ + -font "cenapii-etiquette-m17" +.r itemconfigure $track 4 -text "450" -filled 1 -backcolor wheat \ + -font "cenapii-etiquette-m17" + +.r bind $track:-3 <Enter> ".r itemconfigure $track -speedvectorcolor red" +.r bind $track:-3 <Leave> ".r itemconfigure $track -speedvectorcolor salmon" + +set track2 [.r add track $view 4 -speedvector "-20 0" \ + -symbolcolor salmon -speedvectorcolor salmon -leadercolor salmon \ + -labeldistance 20 -leaderanchors "%30x30"] +.r itemconfigure $track2 -labelformat "a3f110+0+0 a3f110>0^0 a3f110^0>0 a3f110>2>0" +.r itemconfigure $track2 0 -filled 1 -backcolor tan -text "BAW452" +.r itemconfigure $track2 1 -filled 1 -backcolor wheat -text "450" +.r itemconfigure $track2 2 -filled 1 -backcolor wheat -text "KMC" +#.r itemconfigure $track2 3 -filled 1 -backcolor wheat -text "" +.r itemconfigure $track2 -connecteditem $track -connectioncolor green +.r itemconfigure $track2 -position "1 1" +.r itemconfigure $track2 -position "-10 10" +.r itemconfigure $track2 -position "-20 20" +.r itemconfigure $track2 -position "-30 30" +.r itemconfigure $track2 -position "-40 40" +.r itemconfigure $track2 -position "-50 50" +.r itemconfigure $track2 -position "-60 50" + +# +# WAY POINTS +# +puts "creating way points" +set wp [.r add waypoint $view 1 -tags borders] +.r itemconfigure $wp -symbolcolor bisque -leadercolor bisque -position "-100 120" \ + -labelformat "40x20" +.r itemconfigure $wp 0 -bordercolor bisque -text "NCY" -tile logo -filled t +set wp2 [.r add waypoint $view 1 -tags borders] +.r itemconfigure $wp2 -symbolcolor bisque \ + -leadercolor bisque \ + -position "50 160" \ + -labelformat "40x20" \ + -connectioncolor bisque \ + -connecteditem $wp +.r itemconfigure $wp2 0 -bordercolor bisque -text "MPW" +set wp3 [.r add waypoint $view 1 -tags borders] +.r itemconfigure $wp3 -symbolcolor bisque \ + -leadercolor bisque \ + -position "200 140" \ + -labelformat "40x20" \ + -connectioncolor bisque \ + -connecteditem $wp2 +.r itemconfigure $wp3 0 -bordercolor bisque -text "ART" + +# +# MACROS +# +puts "creating macros" +set macro [.r add tabular $view 10 -labelformat "x40x20+0+0 x40x20+40+0" \ + -tags f0borders -connecteditem $track] +.r itemconfigure $macro 0 -text une +.r itemconfigure $macro 1 -text macro + +# +# MINISTRIPS +# +puts "creating ministrips" +set ministrip [.r add tabular $view 1 \ + -labelformat "60x20" -position "10 10"] +.r itemconfigure $ministrip 0 -text "ministrip" -sensitive f +set ministrip2 [.r add tabular $view 1 \ + -labelformat "60x20" -connecteditem $ministrip] +.r itemconfigure $ministrip2 0 -text "ministrip2" -sensitive f +set ministrip3 [.r add tabular $view 1 \ + -labelformat "60x20" -connecteditem $ministrip2] +.r itemconfigure $ministrip3 0 -text "ministrip3" -sensitive f + +# +# MAPS +# +puts "creating maps" +videomap load "/usr/share/toccata/maps/videomap_paris-w_90_2" 0 paris-w +videomap load "/usr/share/toccata/maps/videomap_orly" 17 orly +videomap load "/usr/share/toccata/maps/hegias_parouest_TE.vid" 0 paris-ouest + +set map [.r add map $view -color darkblue] +.r itemconfigure $map -mapinfo orly + +set map2 [.r add map $view -color darkblue -filled 1 -priority 0 -fillpattern AlphaStipple1] +.r itemconfigure $map2 -mapinfo paris-ouest + +set map3 [.r add map $view -color orange] + +mapinfo mpessai create +mapinfo mpessai add text normal simple 0 200 "Et voilà" +mapinfo mpessai add line simple 5 0 0 100 100 +mapinfo mpessai add line simple 0 100 100 0 200 +mapinfo mpessai add line simple 2 -100 100 0 0 +.r itemconfigure $map3 -mapinfo mpessai + +# +# Clip +# +puts "crée les clips" +set clip [.r add rectangle $view "-100 -100 300 200" -filled t \ + -linewidth 0 -fillcolor darkgray -visible f] +#.r rotate $clip [expr 3.14159 / 4] +.r lower $clip +#.r itemconfigure $view -clip $clip + +.r add rectangle $top "-5 -5 5 5" -filled t -fillcolor red +set topclip [.r add rectangle $top "-400 -400 400 400" \ + -filled t -fillcolor lightgray -linewidth 0 -visible t] +.r lower $topclip +#.r rotate $topclip [expr 3.14159 / 4] +#.r itemconfigure $top -clip $topclip + +# +# CONTROLS +# +proc borders {onoff} { + set part [.r currentpart] + set contour noborder + if { $onoff == "on" } { + set contour "contour" + } + if { $part >= 0 } { + .r itemconfigure current $part -border $contour + } +} + +.r bind borders <Enter> "borders on" +.r bind borders <Leave> "borders off" +.r bind f0borders:0 <Enter> "borders on" +.r bind f0borders:0 <Leave> "borders off" +.r bind track <Enter> {puts "Entre dans item"} +.r bind track <Leave> {puts "Sort d'item"} +.r bind track:0 <Enter> {puts "Entre dans champ 0"} +.r bind track:0 <Leave> {puts "Sort de champ 0"} +.r bind track:1 <Enter> {puts "Entre dans champ 1"} +.r bind track:1 <Leave> {puts "Sort de champ 1"} +.r bind track:2 <Enter> {puts "Entre dans champ 2"} +.r bind track:2 <Leave> {puts "Sort de champ 2"} +.r bind track:3 <Enter> {puts "Entre dans champ 3"} +.r bind track:3 <Leave> {puts "Sort de champ 3"} + +bind .r <2> {puts "%x@%y, item: [.r find atpoint %x %y]"} + +proc finditems {cornerx cornery} { + global origx origy + + puts "--- enclosed ---" + puts "++ [.r find enclosed $origx $origy $cornerx $cornery] ++" + puts "--- overlapping ---" + puts "++ [.r find overlapping $origx $origy $cornerx $cornery] ++" + puts "" +} + +bind .r <ButtonPress-1> "set origx %x; set origy %y" +bind .r <ButtonRelease-1> "finditems %x %y" + +.r bind all <1> { if {! [catch {.r find withtag current} item] } { \ + puts "<1> in $item" } else { puts "None" } } + +source "controls.tcl" + |