aboutsummaryrefslogtreecommitdiff
path: root/Perl/demos
diff options
context:
space:
mode:
authorvinot2003-07-07 12:20:11 +0000
committervinot2003-07-07 12:20:11 +0000
commit56f20aa72a5c34c0a2f4ec637d89e16803e5ed17 (patch)
treef9acd2b3fc951c31c896e022ec591bb2fd3e53a0 /Perl/demos
parent9fd9b731eccb4d81f53aa915073355aa82a8c548 (diff)
downloadtkzinc-56f20aa72a5c34c0a2f4ec637d89e16803e5ed17.zip
tkzinc-56f20aa72a5c34c0a2f4ec637d89e16803e5ed17.tar.gz
tkzinc-56f20aa72a5c34c0a2f4ec637d89e16803e5ed17.tar.bz2
tkzinc-56f20aa72a5c34c0a2f4ec637d89e16803e5ed17.tar.xz
ajout de textes type 'Zinc doc' � la demo TabBox
Diffstat (limited to 'Perl/demos')
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/testGraphics.pl107
1 files changed, 68 insertions, 39 deletions
diff --git a/Perl/demos/Tk/demos/zinc_lib/testGraphics.pl b/Perl/demos/Tk/demos/zinc_lib/testGraphics.pl
index 272d1cc..108cdd0 100644
--- a/Perl/demos/Tk/demos/zinc_lib/testGraphics.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/testGraphics.pl
@@ -1036,8 +1036,15 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
},
},
- 'TabBox' => {'bo1' => {-itemtype => 'tabbox',
- -coords => [[-240, -140], [240, 120]],
+ 'TabBox' => {'consigne' => {-itemtype => 'text',
+ -coords => [-285, 170],
+ -params => {-font => $font_9b,
+ -text => "Click hippo Buttons with mouse button 1.\n",
+ -color => '#2222cc',
+ },
+ },
+ 'bo1' => {-itemtype => 'tabbox',
+ -coords => [[-240, -150], [240, 110]],
-radius => 8,
-tabwidth => 72,
-tabheight => 28,
@@ -1057,7 +1064,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
},
'back' => {-itemtype => 'roundedrectangle',
- -coords => [[-242, -142], [242, 122]],
+ -coords => [[-242, -152], [242, 112]],
-radius => 10,
-params => {-closed => 1,
-filled => 1,
@@ -1068,7 +1075,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
},
'anchor' => {-itemtype => 'text',
- -coords => [-120, 138],
+ -coords => [-120, 125],
-params => {-text => 'tabs anchor',
-color => '#2222cc',
-font => $font_9b,
@@ -1079,7 +1086,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
},
'anchorN' => {-itemtype => 'hippodrome',
- -coords => [[-210, 150], [-165, 176]],
+ -coords => [[-210, 135], [-165, 161]],
-params => {-closed => 1,
-filled => 1,
-fillcolor => 'pushbtn4',
@@ -1091,7 +1098,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
-trunc => 'right',
},
'txtanN' => {-itemtype => 'text',
- -coords => [-187, 163],
+ -coords => [-187, 148],
-params => {-text => 'N',
-color => '#000000',
-font => $font_9b,
@@ -1103,7 +1110,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
},
'anchorE' => {-itemtype => 'hippodrome',
- -coords => [[-163, 150], [-120, 176]],
+ -coords => [[-163, 135], [-120, 161]],
-params => {-closed => 1,
-filled => 1,
-fillcolor => 'pushbtn4',
@@ -1115,7 +1122,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
-trunc => 'both',
},
'txtanE' => {-itemtype => 'text',
- -coords => [-141.5, 163],
+ -coords => [-141.5, 148],
-params => {-text => 'E',
-color => '#000000',
-font => $font_9b,
@@ -1127,7 +1134,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
},
'anchorS' => {-itemtype => 'hippodrome',
- -coords => [[-118, 150], [-75, 176]],
+ -coords => [[-118, 135], [-75, 161]],
-params => {-closed => 1,
-filled => 1,
-fillcolor => 'pushbtn4',
@@ -1139,7 +1146,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
-trunc => 'both',
},
'txtanS' => {-itemtype => 'text',
- -coords => [-96.5, 163],
+ -coords => [-96.5, 148],
-params => {-text => 'S',
-color => '#000000',
-font => $font_9b,
@@ -1150,7 +1157,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
},
},
'anchorW' => {-itemtype => 'hippodrome',
- -coords => [[-73, 150], [-28, 176]],
+ -coords => [[-73, 135], [-28, 161]],
-params => {-closed => 1,
-filled => 1,
-fillcolor => 'pushbtn4',
@@ -1162,7 +1169,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
-trunc => 'left',
},
'txtanW' => {-itemtype => 'text',
- -coords => [-52, 163],
+ -coords => [-52, 148],
-params => {-text => 'W',
-color => '#000000',
-font => $font_9b,
@@ -1173,7 +1180,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
},
},
'alignment' => {-itemtype => 'text',
- -coords => [120, 138],
+ -coords => [120, 125],
-params => {-text => 'tabs alignment',
-color => '#2222cc',
-font => $font_9b,
@@ -1183,7 +1190,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
},
},
'alignG' => {-itemtype => 'hippodrome',
- -coords => [[30, 150], [90, 176]],
+ -coords => [[30, 135], [90, 161]],
-params => {-closed => 1,
-filled => 1,
-fillcolor => 'pushbtn4',
@@ -1195,7 +1202,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
-trunc => 'right',
},
'txtalG' => {-itemtype => 'text',
- -coords => [60, 163],
+ -coords => [60, 148],
-params => {-text => 'left',
-color => '#000000',
-font => $font_9b,
@@ -1206,7 +1213,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
},
},
'alignC' => {-itemtype => 'hippodrome',
- -coords => [[92, 150], [148, 176]],
+ -coords => [[92, 135], [148, 161]],
-params => {-closed => 1,
-filled => 1,
-fillcolor => 'pushbtn4',
@@ -1218,7 +1225,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
-trunc => 'both',
},
'txtalC' => {-itemtype => 'text',
- -coords => [120, 163],
+ -coords => [120, 148],
-params => {-text => 'center',
-color => '#000000',
-font => $font_9b,
@@ -1229,7 +1236,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
},
},
'alignD' => {-itemtype => 'hippodrome',
- -coords => [[150, 150], [210, 176]],
+ -coords => [[150, 135], [210, 161]],
-params => {-closed => 1,
-filled => 1,
-fillcolor => 'pushbtn4',
@@ -1241,7 +1248,7 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
-trunc => 'left',
},
'txtalD' => {-itemtype => 'text',
- -coords => [180, 163],
+ -coords => [180, 148],
-params => {-text => 'right',
-color => '#000000',
-font => $font_9b,
@@ -1367,32 +1374,54 @@ my %pagesconf = ('Rectangle' => {'consigne' => {-itemtype => 'text',
my %tabtable = ('n' => {-numpages => 8,
-titles => ['A','B','C','D','E','F','G','H'],
- -names => ['Avant Garde','Bodini','Clarendon','Didot',
- 'Eras','Frutiger','Garamond','Helvetica'],
- -images => ['avantgarde.gif','bodini.gif','clarendon.gif','didot.gif',
- 'eras.gif','frutiger.gif','garamond.gif','helvetica.gif'],
+ -names => ['ATOMIC GROUP :','BIND COMMAND :','CURVE ITEMS :','DISPLAY LIST :',
+ 'EVENTS SENSITIVITY :','FIT COMMAND :','GROUP ITEMS','HASTAG COMMAND'],
+ -texts => ["It may seem at first that there is a contradiction in this title, but there is not. [...] So groups have a feature, the atomic attribute, that is used to seal a group so that events cannot propagate past it downward. If an item part of an atomic group is under the pointer, TkZinc will try to trigger bindings associated with the atomic group not with the item under the pointer. This improves greatly the metaphor of an indivisible item.",
+ "This widget command is similar to the Tk bind command except that it operates on TkZinc items instead of widgets. Another difference with the bind command is that only mouse and keyboard related events can be specified (such as Enter, Leave, ButtonPress, ButtonRelease, Motion, KeyPress, KeyRelease). The bind manual page is the most accurate place to look for a definition of sequence and command and for a general understanding of how the binding mecanism works.",
+ "Items of type curve display pathes of line segments and/or cubic bezier connected by their end points. A cubic Bezier is defined by four points. The first and last ones are the extremities of the cubic Bezier. The second and the third ones are control point (i.e. they must have a third ``coordinate'' with the value 'c'). If both control points are identical, one may be omitted. As a consequence, it is an error to have more than two succcessive control points or to start or finish a curve with a control point.",
+ "The items are arranged in a display list for each group. The display list imposes a total ordering among its items. The group display lists are connected in a tree identical to the group tree and form a hierarchical display list. The items are drawn by traversing the display list from the least visible item to the most visible one.The search to find the item that should receive an event is done in the opposite direction. In this way, items are drawn according to their relative stacking order and events are dispatched to the top-most item at a given location.",
+ "An item will catch an event if all the following conditions are satisfied: * the item -sensitive must be set to true (this is the default). * the item must be under the pointer location. * the item must be on top of the display list (at the pointer location). Beware that an other item with its -visible set to false DOES catch event before any underneath items. * the item must not be clipped (at the pointer location) * the item must not belong to an atomic group, since an atomic group catchs the event instead of the item.",
+ "This command fits a sequence of Bezier segments on the curve described by the vertices in coordList and returns a list of lists describing the points and control points for the generated segments. All the points on the fitted segments will be within error distance from the given curve. coordList should be either a flat list of an even number of coordinates in x, y order or a list of lists of point coordinates X, Y. The returned list can be directly used to create or change a curve item contour.",
+ "Groups are very powerful items. They have no graphics of their own but are used to bundle items together so that they can be manipulated easily as a whole. Groups can modify in several way how items are displayed and how they react to events. They have many uses in TkZinc. The main usages are to bundle items, to interpose a new coordinate system in a hierarchy of items, to compose some specific attributes, to apply a clipping to their children items, to manage display",
+ "This command returns a boolean telling if the item specified by tagOrId has the specified tag. If more than one item is named by tagOrId, then the topmost in display list order is used to return the result. If no items are named by tagOrId, an error is raised.",
+ ],
},
'e' => {-numpages => 5,
-titles => ['I','J','K','L','M'],
- -names => ['Impact','Jenson','Kabel','Lubalin Graph','Matura'],
- -images => ['impact.gif','jenson.gif','kabel.gif','lubalingraph.gif','matura.gif'],
+ -names => ['ITEM IDS','JOINSTYLE ATTRIBUTE','K :','LOWER COMMAND','MAP ITEM :'],
+ -texts => ["Each item is associated with a unique numerical id which is returned by the add or clone commands. All commands on items accept those ids as (often first) parameter in order to uniquely identify on which item they should operate. When an id has been allocated to an item, it is never collected even after the item has been destroyed, in a TkZinc session two items cannot have the same id. This property can be quite useful when used in conjonction with tags, which are described below.",
+ "Specifies the form of the joint between the curve segments. This attribute is only applicable if the curve outline relief is flat. The default value is round.",
+ "No TkZinc KeyWord with K initial letter...",
+ "Reorder all the items given by tagOrId so that they will be under the item given by belowThis. If tagOrId name more than one item, their relative order will be preserved. If tagOrId doesn't name an item, an error is raised. If belowThis name more than one item, the bottom most them is used. If belowThis doesn't name an item, an error is raised. If belowThis is omitted the items are put at the bottom most position of their respective groups.",
+ "Map items are typically used for displaying maps on a radar display view. Maps are not be sensitive to mouse or keyboard events, but have been designed to efficiently display large set of points, segments, arcs, and simple texts. A map item is associated to a mapinfo. This mapinfo entity can be either initialized with the videomap command or more generally created and edited with a set of commands described in the The mapinfo related commands section.",
+ ],
},
's' => {-numpages => 8,
-titles => ['N','O','P','Q','R','S','T','U'],
- -names => ['New Century Scoolbook','Optima','Peignot','Quorum',
- 'Revue','Souvenir','Times New Roman', 'Univers'],
- -images => ['newcenturyscoolbook.gif','optima.gif','peignot.gif','quorum.gif',
- 'revue.gif','souvenir.gif','timesnewroman.gif','univers.gif'],
+ -names => ['NUMPARTS COMMAND :','OVERLAP MANAGER :','PICKAPERTURE WIDGET OPTION :','Q :',
+ 'RENDER WIDGET OPTION :','SMOOTH COMMAND','TAGS :', 'UNDERLINED ATTRIBUTE :'],
+ -texts => ["This command tells how many fieldId are available for event bindings or for field configuration commands in the item specified by tagOrId. If more than one item is named by tagOrId, the topmost in display list order is used to return the result. If no items are named by tagOrId, an error is raised. This command returns always 0 for items which do not support fields. The command hasfields may be used to decide whether an item has fields.",
+ "his option accepts an item id. It specifies if the label overlapping avoidance algorithm should be allowed to do its work on the track labels and which group should be considered to look for tracks. The default is to enable the avoidance algorithm in the root group (id 1). To disable the algorithm this option should be set to 0.",
+ "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.",
+ "No TkZinc KeyWord with Q initial letter...",
+ "Specifies whether to use or not the openGL rendering. When True, requires the GLX extension to the X server. Must be defined at widget creation time. This option is readonly and can be used to ask if the widget is drawing with the GLX extension or in plain X (to adapt the application code for example). The default value is false.",
+ "This command computes a sequence of Bezier segments that will smooth the polygon described by the vertices in coordList and returns a list of lists describing thr points and control points for the generated segments. coordList should be either a flat list of an even number of coordinates in x, y order, or a list of lists of point coordinates X, Y. The returned list can be used to create or change the contour of a curve item.",
+ "Apart from an id, an item can be associated with as many symbolic names as it may be needed by an application. Those names are called tags and can be any string which does not form a valid id (an integer). However the following characters may not be used to form a tag: . * ! ( ) & | :. Tags exists, and may be used in commands, even if no item are associated with them. In contrast an item id doesn't exist if its item is no longer around and thus it is illegal to use it.",
+ "Item Text attribute. If true, a thin line will be drawn under the text characters. The default value is false.",
+ ],
},
'w' => {-numpages => 5,
-titles => ['V','W','X','Y','Z'],
- -names => ['Veljovic','Warnock','X-files','Yellow Submarine','zapf Chancery'],
- -images => ['veljovic.gif','warnock.gif','xfiles.gif','yellowsubmarine.gif','zapfchancery.gif'],
+ -names => ['VERTEXAT COMMAND :','WAYPOINT ITEM :','X11, OpenGL and Windows :','Y...','ZINC an advanced scriptable Canvas :'],
+ -texts => ["Return a list of values describing the vertex and edge closest to the window coordinates x and y in the item described by tagOrId. If tagOrId describes more than one item, the first item in display list order that supports vertex picking is used. The list consists of the index of the contour containing the returned vertices, the index of the closest vertex and the index of a vertex next to the closest vertex that identify the closest edge (located between the two returned vertices).",
+ "Waypoints items have been initially designed for figuring out typical fixed position objects (i.e. beacons or fixes in the ATC vocabulary) with associated block of texts on a radar display for Air Traffic Control. They supports mouse event handling and interactions. However they may certainly be used by other kinds of radar view or even by other kind of plan view with many geographical objects and associated textual information.",
+ "TkZinc was firstly designed for X11 server. Since the 3.2.2 version, TkZinc also offers as a runtime option, the support for openGL rendering, giving access to features such as antialiasing, transparency, color gradients and even a new, openGL oriented, item type : triangles . In order to use the openGL features, you need the support of the GLX extension on your X11 server. We also succeeded in using TkZinc with openGL on the Exceed X11 server (running on windows and developped by Hummingbird) with the 3D extension. ",
+ "No TkZinc KeyWord with Y initial letter...",
+ "TkZinc widgets are very similar to Tk Canvases in that they support structured graphics. But unlike the Canvas, TkZinc can structure the items in a hierarchy, has support for affine 2D transforms, clipping can be set for sub-trees of the item hierarchy, the item set is quite more powerful including field specific items for Air Traffic systems and new rendering techniques such as transparency and gradients. If needed, it is also possible to extend the item set in an additionnal dynamic library through the use of a C api.",
+ ],
},
);
-
-
# creation de la fenetre principale
my $mw = MainWindow->new();
$mw->geometry("700x560+0+0");
@@ -1610,11 +1639,10 @@ sub selectDivider {
if ($divname eq 'div2') {
my $fontname = $tabtable{$tabanchor}->{'-names'}->[$numpage];
- my $firstLetter = substr($fontname,0,1);
- my $lcFirstLetter = lc($firstLetter);
+ my $explain = $tabtable{$tabanchor}->{'-texts'}->[$numpage];
+ my $text = $fontname."\n\n".$explain;
$zinc->itemconfigure("($divname && fontname)",
- -text => $fontname.
- ("\n".($firstLetter x 20)."\n". ($lcFirstLetter x 20))x4);
+ -text => $text);
$zinc->raise("($divname && fontname)");
}
}
@@ -1652,7 +1680,7 @@ sub clickSelector {
-overlap => 3,
);
- my ($shapes, $tcoords) = &tabBoxCoords([[-240, -140], [240, 120]], %tabparams);
+ my ($shapes, $tcoords) = &tabBoxCoords([[-240, -150], [240, 110]], %tabparams);
for (my $index = 7; $index >= 0; $index--) {
my $divgroup = $zinc->group("(div2 && $index && intercalaire)");
@@ -1816,13 +1844,14 @@ sub buildTabBox {
# exemple fonte
if ($tindex == 0) {
$zinc->add('text', $parentgroup,
- -position => [-130, -84],
+ -position => [-165, -84],
-text => $table->{'-names'}->[0],
-font => $font_9b,
-alignment => 'left',
-anchor => 'nw',
-color => '#000000',
-priority => 500,
+ -width => 350,
-tags => [$tags[0], 'fontname'],
);