diff options
author | ribet | 2007-03-21 10:19:39 +0000 |
---|---|---|
committer | ribet | 2007-03-21 10:19:39 +0000 |
commit | c5866f304210618979d03c561b1e3f6f83200bce (patch) | |
tree | 7c81ae161f78cdf952f3d3a33184f8bf322c9bd8 /exemples | |
parent | a023d10b564d8c29566304f7777b4ec87c5b7b4d (diff) | |
download | mtc-c5866f304210618979d03c561b1e3f6f83200bce.zip mtc-c5866f304210618979d03c561b1e3f6f83200bce.tar.gz mtc-c5866f304210618979d03c561b1e3f6f83200bce.tar.bz2 mtc-c5866f304210618979d03c561b1e3f6f83200bce.tar.xz |
Import initial
Diffstat (limited to 'exemples')
25 files changed, 2363 insertions, 0 deletions
diff --git a/exemples/Comete.pm b/exemples/Comete.pm new file mode 100644 index 0000000..bb86c66 --- /dev/null +++ b/exemples/Comete.pm @@ -0,0 +1,75 @@ +package Comete; +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +use strict; + +use MTools; + +use vars qw /@ISA/; + +use MTools::MGroup; +use MTools::Comp::MMover; + + +BEGIN +{ + @ISA = qw /MTools::MGroup/; +} + +sub new { + my ($class, $parent, $name, $x, $y) = @_; + my $self = new MTools::MGroup ($parent); + bless $self, $class; + + $self -> recordProperty ('x', $x); + $self -> recordProperty ('y', $y); + $self -> recordProperty ('name', $name); + $self -> recordProperty ('cautrax', 0); + $self -> recordProperty ('cautray', 0); + + $self -> plisten ('x', sub { + my ($src, $key, $value) = @_; + $self -> mconfigure ('cautrax' => $value / 25); + } + ); + + $self -> plisten ('y', sub { + my ($src, $key, $value) = @_; + $self -> mconfigure ('cautray' => $value / 25); + } + ); + + + my $target = minstanciate ('comete.svg#comete', 1); + $target -> translate ($x, $y); + plink ([$self, 'name'], [mfind ($target, 'callsign'), '-text']); + + my $mover = new MTools::Comp::MMover ($target, $target, 1, x_max => 800, y_max => 600, y_min => 0, x_min => 0); + + plink ([$self, 'x'], [$mover, 'x']); + plink ([$self, 'y'], [$mover, 'y']); + + return $self; +} + +sub addRattrapage { +} + +sub removeRattrapage { +} + +1; diff --git a/exemples/Lien.pm b/exemples/Lien.pm new file mode 100644 index 0000000..d8665bc --- /dev/null +++ b/exemples/Lien.pm @@ -0,0 +1,115 @@ +package Lien; +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +use strict; + +use MTools; +use MTools::MGroup; +use MTools::GUI::MCurve; + +use vars qw /@ISA/; + + +BEGIN +{ + @ISA = qw /MTools::MGroup/; +} + +sub new { + my ($class, $parent, $comete_1, $comete_2, %options) = @_; + my $self = new MTools::MGroup ($parent); + bless $self, $class; + + $self -> recordProperty ('comete_1', $comete_1); + $self -> recordProperty ('comete_2', $comete_2); + $self -> recordProperty ('distance', 100); + $self -> recordProperty ('c_x', 0); + $self -> recordProperty ('c_y', 0); + $self -> recordProperty ('warning', 0); + + $self -> {__lien} = new MTools::GUI::MCurve ($self, [[0, 0], [0, 0]], + -linecolor => defined $options {color} ? $options {color} : '#243033;60', + -linestyle => 'dashed', + -linewidth => defined $options {width} ? $options {width} : 2, + -filled => 0, -visible => 1, -sensitive => 0 + ); + $self -> plisten ('warning', sub { + my ($src, $key, $val, $old) = @_; + if ($val) + { + $self -> {__lien} -> mconfigure ( + -linecolor => 'red', + -linewidth => 8, + -linestyle => 'simple', + ); + } + else + { + $self -> {__lien} -> mconfigure ( + -linecolor => '#243033;60', + -linestyle => 'dashed', + -linewidth => defined $options {width} ? $options {width} : 2, + ); + } + }); + $self -> {__c1_x} = $comete_1 -> plisten ('x', [$self, 'redraw']); + $self -> {__c1_y} = $comete_1 -> plisten ('y', [$self, 'redraw']); + $self -> {__c2_x} = $comete_2 -> plisten ('x', [$self, 'redraw']); + $self -> {__c2_y} = $comete_2 -> plisten ('y', [$self, 'redraw']); + + $comete_1 -> addRattrapage ($self); + $comete_2 -> addRattrapage ($self); + + return $self; +} + +sub mdelete { + my ($self) = @_; + my $comete_1 = $self -> mget ('comete_1'); + my $comete_2 = $self -> mget ('comete_2'); + $comete_1 -> unplisten ('x', $self -> {__c1_x}); + $comete_1 -> unplisten ('y', $self -> {__c1_y}); + $comete_2 -> unplisten ('x', $self -> {__c2_x}); + $comete_2 -> unplisten ('y', $self -> {__c2_y}); + $comete_1 -> removeRattrapage ($self); + $comete_2 -> removeRattrapage ($self); + MTools::mdelete ($self); +} + +sub redraw { + my ($self) = @_; + my $comete_1 = $self -> mget ('comete_1'); + my $comete_2 = $self -> mget ('comete_2'); + my $x0 = $comete_1 -> mget ('x'); + my $y0 = $comete_1 -> mget ('y'); + my $x1 = $comete_2 -> mget ('x'); + my $y1 = $comete_2 -> mget ('y'); + $self -> {__lien} -> coords ([$x0, $y0, $x1, $y1]); + my $cautra_x0 = $comete_1 -> mget ('cautrax'); + my $cautra_y0 = $comete_1 -> mget ('cautray'); + my $cautra_x1 = $comete_2 -> mget ('cautrax'); + my $cautra_y1 = $comete_2 -> mget ('cautray'); + my $dist = sqrt (($cautra_x1 - $cautra_x0) ** 2 + ($cautra_y1 - $cautra_y0) ** 2); + $self -> mconfigure ( + distance => int ($dist * 10) / 10, + c_x => ($x0 + $x1) / 2, + c_y => ($y0 + $y1) / 2, + ); + +} + +1; diff --git a/exemples/Rattrapage.pm b/exemples/Rattrapage.pm new file mode 100644 index 0000000..c6ec0bc --- /dev/null +++ b/exemples/Rattrapage.pm @@ -0,0 +1,181 @@ +package Rattrapage; +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +use strict; + +use vars qw /@ISA/; + +use MTools; +use MTools::MGroup; +use MTools::Widget::MToggleBouton; +use MTools::Widget::MBouton; +use Lien; + +use Tk; + +BEGIN +{ + @ISA = qw /MTools::MGroup/; +} + +sub new { + my ($class, $parent, $comete1, $comete2, $manager, %options) = @_; + my $lien = new Lien ($parent, $comete1, $comete2); + my $self = new MTools::MGroup ($parent); + bless $self, $class; + + $self -> {__lien} = $lien; + $self -> {__manager} = $manager; + + $self -> recordProperty ('seuil', 8); + $self -> recordProperty ('mesure', 10); + $self -> recordProperty ('statut', 'editable'); + $self -> mconfigure (%options); + $self -> recordProperty ('warning', 0); + + $self -> {__listener} = $manager -> plisten ('-visible', sub { + my ($src, $key, $val, $old) = @_; + $self -> mconfigure ('statut' => $val ? 'editable':'non_editable'); + }); + + plink ([$lien, 'distance'], [$self, 'mesure']); + $lien -> plisten ('c_x', sub { + my ($src, $key, $val, $old) = @_; + $self -> translate ($val - $old, 0); + }); + $lien -> plisten ('c_y', sub { + my ($src, $key, $val, $old) = @_; + $self -> translate (0, $val - $old); + }); + $self -> translate ($lien -> mget ('c_x'), $lien -> mget ('c_y')); + + my $bck = minstanciate ('rattrapage.svg#bck', $self); + + my $evolution = new MTools::MSwitch ( + $self, + stable => ['rattrapage.svg#stable'], + montee => ['rattrapage.svg#croissant'], + descente => ['rattrapage.svg#decroissant'], + ); + $self -> plisten ('mesure', sub { + my ($src, $key, $val, $old) = @_; + $self -> {__old_val} = $self -> {__old_val_wait}; + my $tval = $self -> {__old_val}; + if ($val < $tval) + { + $evolution -> mconfigure (state => 'descente'); + } + elsif ($val > $tval) + { + $evolution -> mconfigure (state => 'montee'); + } + $self -> {__old_val_wait} = $old; + if ($val <= $self -> mget ('seuil')) + { + $self -> mconfigure (warning => 1); + } + else + { + $self -> mconfigure (warning => 0); + } + }); + $self -> plisten ('seuil', sub { + my ($src, $key, $val, $old) = @_; + if ($val >= $self -> mget ('mesure')) + { + $self -> mconfigure (warning => 1); + } + else + { + $self -> mconfigure (warning => 0); + } + }); + + my $mesure = minstanciate ('rattrapage.svg#mesure', $self); + my $seuil = minstanciate ('rattrapage.svg#seuil', $self); + minstanciate ('rattrapage.svg#cdr_seuil_h', $self); + minstanciate ('rattrapage.svg#cdr_seuil_b', $self); + + my $bouton_cloche = new MTools::Widget::MToggleBouton ( + parent => $self, + g_on => 'rattrapage.svg#cloche', + g_off => 'rattrapage.svg#cloche_fantome', + e_press => 'CLOCHE', + e_release => 'PAS_CLOCHE' + ); + + my $bouton_delete = new MTools::Widget::MBouton ( + parent => $self, + g_on => 'rattrapage.svg#delete_on', + g_off => 'rattrapage.svg#delete_off', + e_release => 'DELETE' + ); + + my $gp_mask = new MTools::MGroup ($self); + $self -> {__down} = minstanciate ('rattrapage.svg#mask_seuil_down', $gp_mask); + $self -> {__down} -> mconfigure (-visible => 0); + $self -> {__up} = minstanciate ('rattrapage.svg#mask_seuil', $gp_mask); + my $seuil_mask = minstanciate ('rattrapage.svg#seuil', $gp_mask); + minstanciate ('rattrapage.svg#cdr_seuil_h_edit', $gp_mask); + minstanciate ('rattrapage.svg#cdr_seuil_b_edit', $gp_mask); + + my $editable = new MTools::MSwitch ( + $self, + editable => [$bouton_delete, $gp_mask, $bouton_cloche], + non_editable => [], + ); + + $gp_mask -> binding ('<Button-1>', ['pressed', $self, Ev ('y')]); + $gp_mask -> binding ('<Button1-Motion>', ['motion', $self, Ev ('y')]); + $gp_mask -> binding ('<ButtonRelease-1>', ['released', $self, Ev ('y')]); + $bouton_delete -> binding ('DELETE', ['mdelete', $self]); + + plink ([$self, 'mesure'], [$mesure, '-text']); + plink ([$self, 'seuil'], [$seuil, '-text'], [$seuil_mask, '-text']); + plink ([$self, 'statut'], [$editable, 'state']); + plink ([$self, 'warning'], [$lien, 'warning']); + + return $self; +} + +sub mdelete { + my ($self) = @_; + $self -> {__manager} -> unplisten ('-visible', $self -> {__listener}); + $self -> {__lien} -> mdelete (); + MTools::mdelete ($self); +} + +sub pressed { + my ($self, $y) = @_; + $self -> {__y} = $y; + $self -> {__init_value} = $self -> mget ('seuil'); + $self -> {__down} -> mconfigure (-visible => 1); + $self -> {__up} -> mconfigure (-visible => 0); +} + +sub motion { + my ($self, $y) = @_; + $self -> mconfigure ('seuil', $self -> {__init_value} - int (($y - $self -> {__y}) / 20) * 0.5); +} + +sub released { + my ($self, $y) = @_; + $self -> {__down} -> mconfigure (-visible => 0); + $self -> {__up} -> mconfigure (-visible => 1); +} + +1; diff --git a/exemples/Selec.pm b/exemples/Selec.pm new file mode 100644 index 0000000..28237ac --- /dev/null +++ b/exemples/Selec.pm @@ -0,0 +1,91 @@ +package Selec; +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +use strict; + +use MTools; + +use vars qw /@ISA/; + +use MTools::MGroup; + +use MTools::GUI::MRect; +use MTools::GUI::MCircle; + +BEGIN +{ + @ISA = qw /MTools::MGroup/; +} + +sub new { + my ($class, $parent, $style, $x, $y) = @_; + my $self = new MTools::MGroup ($parent); + bless $self, $class; + + $self -> recordProperty ('barycentre_x' => 0); + $self -> recordProperty ('barycentre_y' => 0); + $self -> recordProperty ('x' => $x); + $self -> recordProperty ('y' => $y); + $self -> recordProperty ('selected' => 0); + + my $obj; + + if ($style eq 'rectangle') + { + $obj = new MTools::GUI::MRect ($self, $x - 5, $y -5, 10, 10, -filled => 1); + } + elsif ($style eq 'circle') + { + $obj = new MTools::GUI::MCircle ($self, $x, $y, 6, -filled => 1); + } + elsif ($style eq 'point') + { + $obj = new MTools::GUI::MCircle ($self, $x, $y, 3, -filled => 1); + } + + $self -> plisten ('selected', sub { + my ($src, $key, $val) = @_; + if ($val) + { + $obj -> mconfigure ( + -fillcolor => 'red', + -linecolor => 'red', + ); + } + else + { + $obj -> mconfigure ( + -fillcolor => 'black', + -linecolor => 'black', + ); + } + }); + + return $self; +} + +sub setSelected { + my ($self, $val) = @_; + $self -> mconfigure ('selected' => $val); +} + +sub isSelected { + my ($self) = @_; + return $self -> mget ('selected'); +} + +1; diff --git a/exemples/Strip.pm b/exemples/Strip.pm new file mode 100644 index 0000000..2997e25 --- /dev/null +++ b/exemples/Strip.pm @@ -0,0 +1,199 @@ +package Strip; +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +use strict; + +use vars qw /@ISA/; + +use MTools; +use MTools::MGroup; +use MTools::Widget::MToggleBouton; +use MTools::Comp::MMover; +use MTools::Comp::MReconizer; +use MTools::Comp::MInertie; + +BEGIN +{ + @ISA = qw /MTools::MGroup/; +} + +sub new { + my ($class, $parent, %options) = @_; + my $self = new MTools::MGroup ($parent); + bless $self, $class; + + $self -> recordEvent ('SET_FOCUS'); + $self -> recordEvent ('GET_FOCUS'); + $self -> recordProperty ('x', 0); + $self -> recordProperty ('y', 0); + + my $gp1 = new MTools::MGroup ($self); + my $gp2 = new MTools::MGroup ($self); + my $gp3 = new MTools::MGroup ($self); + my $gp4 = new MTools::MGroup ($self); + + # Instanciation d'un petit bouton rouge qui aura pour objectif + # de fixer ou non le strip (desactiver le comportement de mover) + my $bouton1 = new MTools::Widget::MToggleBouton ( + parent => $self, + g_on => 'strip.svg#alarme_on', + g_off => 'strip.svg#alarme_off', + e_press => 'ALARME_PRESS', + e_release => 'ALARME_RELEASE' + ); + + # Instanciation des objets textes situe sur la premiere partie du strip + # Disparaitra lorsque le strip est shoote + minstanciate ('strip.svg#vitesse', $gp2); + minstanciate ('strip.svg#fl', $gp2); + + # Instanciation des objets textes situ? sur la deuxieme partie du strip + # Disparaitra lorsque le strip est deplace + minstanciate ('strip.svg#balise1', $gp3); + minstanciate ('strip.svg#fl1', $gp3); + minstanciate ('strip.svg#balise2', $gp3); + minstanciate ('strip.svg#fl2', $gp3); + + # Instanciation du callsign toujours visible + my $callsign = minstanciate ('strip.svg#callsign', $self); + mconfigure ($callsign, -text => $options {callsign}); + + # Instanciation de la fleche de tendance qui peut avoir trois etat different + $self -> {evolution} = new MTools::MSwitch ( + $gp2, + stable => ['strip.svg#evolution_stable'], + montee => ['strip.svg#evolution_monte'], + descente => ['strip.svg#evolution_descend'], + ); + $self -> {evolution} -> mconfigure (state => 'montee'); + + # Definition des trois etats des strips + $self -> {strip} = new MTools::MSwitch ( + $gp1, + grand => ['strip.svg#strip_grand', $gp2, $gp3, $callsign, $bouton1], + mini => ['strip.svg#strip_mini', $gp2, $callsign, $bouton1], + shoote => ['strip.svg#strip_shoote', $callsign], + ); + $self -> {strip} -> setState ('grand'); + + # Instanciation du comportement de prehensible + $self -> {mover} = my $mover = new MTools::Comp::MMover($self -> {strip}, $self, 1, + x_min => 0, + y_min => 0, + x_max => 700, + y_max => 300, + ); + + # Instanciation du comportement d'inertie + new MTools::Comp::MInertie ($self -> {mover}); + + # On modifie la valeur des propriete x et y sur deplacement + $mover -> binding ('MOVED', sub { + my ($x, $y) = @_; + mconfigure ($self, x => $x); + mconfigure ($self, y => $y); + }); + + # Instanciation des mask pour la reco de geste + $self -> {mask} = new MTools::MSwitch ( + $gp4, + grand => ['strip.svg#mask_grand'], + mini => ['strip.svg#mask_mini'], + shoote => [], + ); + $self -> {mask} -> setState ('grand'); + + # Lorsque la propriete y est modifiee, on appel la fonction 'moved' + # Cette fonction modifiera l'etat du strip en fonction de la position de celui-ci + $self -> plisten ('y', ['moved', $self]); + + # Instanciation de la reco de geste + new MTools::Comp::MReconizer ($self -> {mask}, 1, callback => [$self, \&geste_reconnu]); + + # Activation et desactivation du comportement prehensible sur pression sur le petit bouton rouge + $bouton1 -> binding ('ALARME_PRESS', sub { + $mover -> mconfigure (-visible => 0); + }); + $bouton1 -> binding ('ALARME_RELEASE', sub { + $mover -> mconfigure (-visible => 1); + }); + + # Feedback de selection + $self -> {selected} = new MTools::MSwitch ( + $self, + selected => ['strip.svg#selected'], + unselected => [], + ); + $self -> {selected} -> setState ('unselected'); + + # Mise ? jour du focus sur pression (capt?e par le MMover) + $mover -> binding ('PRESSED', sub { + $self -> {selected} -> setState ('selected'); + $self -> notify ('GET_FOCUS', $self); + }); + + # Mise ? jour du focus par message externe + $self -> binding ('SET_FOCUS', sub { + $self -> {selected} -> setState ('unselected'); + }); + + return $self; +} + +sub geste_reconnu { + my ($self, $geste) = @_; + print "geste : $geste\n"; +} + +sub moved { + my ($self) = @_; + my $x = $self -> mget ('x'); + my $y = $self -> mget ('y'); + + if ($x < 50) + { + $self -> {strip} -> setState ('grand'); + $self -> {mask} -> setState ('grand'); + $self -> {evolution} -> setState ('montee'); + } + if (($x >= 50) && ($x < 100)) + { + $self -> {strip} -> setState ('grand'); + $self -> {mask} -> setState ('grand'); + $self -> {evolution} -> setState ('stable'); + } + if (($x >= 100) && ($x < 300)) + { + $self -> {strip} -> setState ('mini'); + $self -> {mask} -> setState ('mini'); + $self -> {evolution} -> setState ('stable'); + } + if (($x >= 300) && ($x < 600)) + { + $self -> {strip} -> setState ('mini'); + $self -> {mask} -> setState ('mini'); + $self -> {evolution} -> setState ('descente'); + } + if (($x >= 600) && ($x < 700)) + { + $self -> {strip} -> setState ('shoote'); + $self -> {mask} -> setState ('shoote'); + $self -> {evolution} -> setState ('descente'); + } +} + +1; diff --git a/exemples/StripAntiRecouvre.pm b/exemples/StripAntiRecouvre.pm new file mode 100644 index 0000000..4e2c001 --- /dev/null +++ b/exemples/StripAntiRecouvre.pm @@ -0,0 +1,71 @@ +########################################################### +# UN STRIP Q'on peut Bouger par le CallSIGN ############### +########################################################### + +package StripAntiRecouvre; +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +use strict; + +use MTools; + +use vars qw /@ISA/; + +use MTools; +use MTools::MGroup; +use MTools::Comp::MMover; +use MTools::Comp::MInertie; +use MTools::GUI::MAntiRecouvrementGroup; +use Data::Dumper; + +BEGIN +{ + @ISA = qw /MTools::GUI::MAntiRecouvrementGroup/; +} + +sub new { + my ($class, $parent, $frame, %options) = @_; + my $self = new MTools::GUI::MAntiRecouvrementGroup ($parent, height => 91, width => 351, xmin => 0, ymin => 0, xmax=>800, ymax => 600); + bless $self, $class; + + $self -> recordProperty('callsign', $options{callsign}); + $self -> recordProperty('color', 'grey'); + + my $gp1 = new MTools::MGroup ($self); + my $gp2 = new MTools::MGroup ($self); + my $gp3 = new MTools::MGroup ($self); + my $gp4 = new MTools::MGroup ($self); + my $gp5 = new MTools::MGroup ($self); + $self -> {cadre} = minstanciate ("strip_approche_arrival.svg#cadre_strip", $gp1); + plink([$self, 'color'], [mfind($self->{cadre},'cadre'),'-fillcolor']); + $self -> {infosavion} = minstanciate ("strip_approche_arrival.svg#infosavion", $gp2); + $self -> {header} = minstanciate ("strip_approche_arrival.svg#header", $gp3); + $self -> {instruction_zone} = minstanciate ("strip_approche_arrival.svg#instruction_zone", $gp4); + $self -> {coordination_zone} = minstanciate ("strip_approche_arrival.svg#coordination_zone", $gp5); + $self -> {ecriture_zone} = minstanciate ("strip_approche_arrival.svg#ecriture_zone", $gp5); + $self -> {QFU_zone} = minstanciate ("strip_approche_arrival.svg#QFU_zone", $gp5); + $self -> {IAF_zone} = minstanciate ("strip_approche_arrival.svg#IAF_zone", $gp5); + + plink ([$self, 'callsign'], [mfind ($self->{header}, 'callsign'), '-text']); + mconfigure($self,'color',"RGB:FF/98/FF"); + $self -> {mover} = my $mover = new MTools::Comp::MMover($self, $self, 1); + $self -> {inertie} = new MTools::Comp::MInertie($self -> {mover}); + + return $self; +} + +1; diff --git a/exemples/Target.pm b/exemples/Target.pm new file mode 100644 index 0000000..c2fb566 --- /dev/null +++ b/exemples/Target.pm @@ -0,0 +1,69 @@ +package Target; +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +use strict; + +use MTools; + +use vars qw /@ISA/; + +use MTools::MGroup; + +use MTools::GUI::MText; +use MTools::GUI::MCircle; + +BEGIN +{ + @ISA = qw /MTools::MGroup/; +} + +sub new { + my ($class, $parent, $x, $y) = @_; + my $self = new MTools::MGroup ($parent, -atomic => 1); + bless $self, $class; + + my $ob = new MTools::GUI::MCircle ($self, $x, $y, 20, -filled => 1); + my $txt = new MTools::GUI::MText ($self, '', $x - 100, $y + 30); + + $self -> recordEvent ('DRAGENTER'); + $self -> recordEvent ('DRAGLEAVE'); + $self -> recordEvent ('RELEASEDOVER'); + + binding ($self, 'DRAGENTER', sub { + $ob -> mconfigure ('-fillcolor' => 'blue'); + } + ); + binding ($self, 'DRAGLEAVE', sub { + $ob -> mconfigure ('-fillcolor' => 'black'); + } + ); + binding ($self, 'RELEASEDOVER', sub { + my ($multi) = @_; + $ob -> mconfigure ('-fillcolor' => 'black'); + my $selected_plan = $multi -> getSelectedPlan (); + my @selection = $multi -> getSelection (); + $txt -> mconfigure ('-text' => @selection.' elements du plan '.$selected_plan); + } + ); + + + + + return $self; +} + +1; diff --git a/exemples/Visage.pm b/exemples/Visage.pm new file mode 100644 index 0000000..67c0064 --- /dev/null +++ b/exemples/Visage.pm @@ -0,0 +1,50 @@ +package Visage; +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +use strict; + +use vars qw /@ISA/; + +use MTools; +use MTools::MGroup; +use MTools::GUI::MText; + +BEGIN +{ + @ISA = qw /MTools::MGroup/; +} + +sub new { + my ($class, $parent, $file) = @_; + my $self = new MTools::MGroup ($parent); + bless $self, $class; + + $self -> recordProperty ('nom', $file); + + my $visage = minstanciate ("$file#litso", $self); + my $pupille = minstanciate ("$file#pupille", $self); + + my $txt = new MTools::GUI::MText ($self, "", 500, 500); + + plink ([$self, 'nom'], [$txt, '-text']); + + return $self; +} + + + +1; diff --git a/exemples/data/Ampoule.svg b/exemples/data/Ampoule.svg new file mode 100644 index 0000000..6f0866e --- /dev/null +++ b/exemples/data/Ampoule.svg @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 11.0, SVG Export Plug-In . SVG Version: 6.0.0 Build 78) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
+ <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+ <!ENTITY ns_svg "http://www.w3.org/2000/svg">
+ <!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
+]>
+<svg xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+ width="52" height="55" viewBox="0 0 52 55" overflow="visible" enable-background="new 0 0 52 55" xml:space="preserve">
+ <g id="Layer_1">
+ <ellipse id="bck" fill="#FFFFFF" stroke="#9B9A9A" stroke-width="4" cx="26" cy="27.5" rx="24" ry="25.5"/>
+ <circle id="on" fill="#1A8400" stroke="#FFFFFF" stroke-width="4" cx="25.5" cy="27" r="17.5"/>
+ <circle id="off" fill="#7C1919" stroke="#FFFFFF" stroke-width="4" cx="25.5" cy="27" r="17.5"/>
+ </g>
+ </svg>
diff --git a/exemples/data/Malouco.svg b/exemples/data/Malouco.svg new file mode 100644 index 0000000..1307282 --- /dev/null +++ b/exemples/data/Malouco.svg @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" +"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> +<!-- Created with Sodipodi ("http://www.sodipodi.com/") --> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:xlink="http://www.w3.org/1999/xlink" + xml:space="preserve" + id="svg609" + sodipodi:version="0.34" + width="210mm" + height="297mm" + sodipodi:docname="Malouco.svg"><defs + id="defs611" /><sodipodi:namedview + id="base" /><g + id="litso"><path + style="font-size:12;fill:#808080;fill-rule:evenodd;" + d="M 200.8451 235.7026 C 172.3384 235.7026 149.389 258.652 149.389 287.1587 C 149.389 315.6655 281.8903 361.8531 310.397 361.8531 L 426.5886 361.8531 C 455.0952 361.8531 574.3176 315.6655 574.3176 287.1587 C 574.3176 258.652 554.6878 235.7027 526.1813 235.7027 C 459.2328 299.8846 438.761 291.0319 378.4521 288.8187 C 324.7827 288.8187 284.3923 308.7372 200.8451 235.7026 C 200.8451 235.7026 200.8451 235.7026 200.8451 235.7026 L 200.8451 235.7026 L 200.8451 235.7026 z " + id="path620" + sodipodi:nodetypes="ccccccccsc" /><path + sodipodi:type="arc" + style="fill-rule:evenodd;stroke:none;fill:gray;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + id="path621" + d="M 351.894 116.1914 A 91.29325 66.39511 0 1 0 169.3075 116.1914 A 91.29325 66.39511 0 1 0 351.894 116.1914 z" + sodipodi:cx="260.600739" + sodipodi:cy="116.191376" + sodipodi:rx="91.293251" + sodipodi:ry="66.3951111" /><path + sodipodi:type="arc" + style="fill-rule:evenodd;stroke:none;fill:gray;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + id="path622" + d="M 494.6434 146.0692 A 53.11607 92.95315 0 1 0 388.4113 146.0692 A 53.11607 92.95315 0 1 0 494.6434 146.0692 z" + sodipodi:cx="441.527344" + sodipodi:cy="146.069183" + sodipodi:rx="53.1160736" + sodipodi:ry="92.9531479" /><path + sodipodi:type="arc" + style="fill-rule:evenodd;stroke:none;fill:gray;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + id="path624" + d="M 424.9286 381.7718 A 92.95313 59.75558 0 1 0 239.0223 381.7718 A 92.95313 59.75558 0 1 0 424.9286 381.7718 z" + sodipodi:cx="331.975464" + sodipodi:cy="381.771759" + sodipodi:rx="92.953125" + sodipodi:ry="59.7555847" + transform="translate(-3.31974,-23.23835)" /></g><g + id="pupille"><path + sodipodi:type="arc" + style="fill-rule:evenodd;stroke:none;fill:#00a900;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + id="pupille_" + d="M 521.2015 514.5619 A 26.55804 36.5173 0 1 0 468.0854 514.5619 A 26.55804 36.5173 0 1 0 521.2015 514.5619 z" + sodipodi:cx="494.643433" + sodipodi:cy="514.56189" + sodipodi:rx="26.5580444" + sodipodi:ry="36.5173035" + transform="translate(-66.39507,-355.2138)" /><text + style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + x="410.760696" + y="161.248383" + id="tilt"><tspan + id="tspan612">Tilt</tspan></text></g></svg> diff --git a/exemples/data/VisageNormal.svg b/exemples/data/VisageNormal.svg new file mode 100644 index 0000000..31ccc67 --- /dev/null +++ b/exemples/data/VisageNormal.svg @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" +"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> +<!-- Created with Sodipodi ("http://www.sodipodi.com/") --> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:xlink="http://www.w3.org/1999/xlink" + xml:space="preserve" + id="svg609" + sodipodi:version="0.34" + width="210mm" + height="297mm" + sodipodi:docname="/home/merlin/projets/mtools/exemples/data/VisageNormal.svg" + sodipodi:docbase="/home/merlin/projets/mtools/exemples/data/"><defs + id="defs611" /><sodipodi:namedview + id="base" /><g + id="litso"><path + style="font-size:12;fill:#808080;fill-rule:evenodd;" + d="M 200.8451 235.7026 C 172.3384 235.7026 149.389 258.652 149.389 287.1587 C 149.389 315.6655 281.8903 361.8531 310.397 361.8531 L 426.5886 361.8531 C 455.0952 361.8531 574.3176 315.6655 574.3176 287.1587 C 574.3176 258.652 554.6878 235.7027 526.1813 235.7027 C 459.2328 299.8846 438.761 291.0319 378.4521 288.8187 C 324.7827 288.8187 284.3923 308.7372 200.8451 235.7026 C 200.8451 235.7026 200.8451 235.7026 200.8451 235.7026 L 200.8451 235.7026 L 200.8451 235.7026 z " + id="path620" + sodipodi:nodetypes="ccccccccsc" /><path + sodipodi:type="arc" + style="fill-rule:evenodd;stroke:none;fill:gray;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + id="path621" + d="M 351.894 116.1914 A 91.29325 66.39511 0 1 0 169.3075 116.1914 A 91.29325 66.39511 0 1 0 351.894 116.1914 z" + sodipodi:cx="260.600739" + sodipodi:cy="116.191376" + sodipodi:rx="91.293251" + sodipodi:ry="66.3951111" /><path + sodipodi:type="arc" + style="fill-rule:evenodd;stroke:none;fill:gray;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + id="path615" + d="M 351.894 116.1914 A 91.29325 66.39511 0 1 0 169.3075 116.1914 A 91.29325 66.39511 0 1 0 351.894 116.1914 z" + sodipodi:cx="260.600739" + sodipodi:cy="116.191376" + sodipodi:rx="91.293251" + sodipodi:ry="66.3951111" + transform="translate(203.6831,-3.051758e-5)" /></g><g + id="pupille"><path + sodipodi:type="arc" + style="fill-rule:evenodd;stroke:none;fill:#00a900;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + id="path617" + d="M 521.2015 514.5619 A 26.55804 36.5173 0 1 0 468.0854 514.5619 A 26.55804 36.5173 0 1 0 521.2015 514.5619 z" + sodipodi:cx="494.643433" + sodipodi:cy="514.56189" + sodipodi:rx="26.5580444" + sodipodi:ry="36.5173035" + transform="translate(-236.131,-389.1609)" /><path + sodipodi:type="arc" + style="fill-rule:evenodd;stroke:none;fill:#00a900;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + id="pupille_" + d="M 521.2015 514.5619 A 26.55804 36.5173 0 1 0 468.0854 514.5619 A 26.55804 36.5173 0 1 0 521.2015 514.5619 z" + sodipodi:cx="494.643433" + sodipodi:cy="514.56189" + sodipodi:rx="26.5580444" + sodipodi:ry="36.5173035" + transform="translate(-32.44791,-389.1609)" /></g></svg> diff --git a/exemples/data/comete.svg b/exemples/data/comete.svg new file mode 100644 index 0000000..d2b280e --- /dev/null +++ b/exemples/data/comete.svg @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Sodipodi ("http://www.sodipodi.com/") --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://web.resource.org/cc/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="84.503pt" + height="107.214pt" + viewBox="0 0 84.503 107.214" + xml:space="preserve" + id="svg602" + sodipodi:version="0.32" + sodipodi:docname="comete.svg" + sodipodi:docbase="C:\Documents and Settings\HP_Administrateur\Bureau\Aster\mtools\exemples\data" + inkscape:version="0.43"><metadata + id="metadata161"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs + id="defs642"><linearGradient + id="aigrd1" + gradientUnits="userSpaceOnUse" + x1="84.5034" + y1="11.5" + x2="46.5034" + y2="11.5"><stop + offset="0.2809" + style="stop-color:#FFFFFF" + id="stop606" /><stop + offset="0.7" + style="stop-color:#666666" + id="stop607" /></linearGradient></defs><sodipodi:namedview + id="base" + inkscape:zoom="2.7832186" + inkscape:cx="79.134964" + inkscape:cy="140.89619" + inkscape:window-width="811" + inkscape:window-height="542" + inkscape:window-x="44" + inkscape:window-y="58" + inkscape:current-layer="svg602" /><g + id="comete"><rect + style="opacity:0;fill:#484848;fill-opacity:1;stroke:#484848;stroke-opacity:1" + id="rect1498" + width="66.972824" + height="21.270338" + x="-6.3236141" + y="-8.3356762" + rx="0" + ry="0" /><text + transform="scale(1.11556,1.077756)" + id="callsign" + y="-44.205013" + x="46.612549" + style="font-size:12px;font-style:normal;font-weight:normal;fill:#243033;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:helvetica"><tspan + id="tspan922">CALLSIGN</tspan></text> +<path + style="font-size:12px;fill:#243033" + id="head" + d="M 3.780412,3.772367 L -1.219588,3.772367 L -1.219588,-1.227633 L 3.780412,-1.227633 L 3.780412,3.772367 z " + knockout="Off" /><g + transform="translate(4.841921,-31.81835)" + id="queue"><path + style="font-size:12px;fill:none;stroke:#243033;stroke-width:2" + transform="translate(-66.40351,26.97643)" + id="path732" + d="M 70.399,0 L 70.399,13.996" + knockout="Off" /><path + style="font-size:12px;fill:none;stroke:#243033;stroke-width:2" + transform="translate(-66.40351,26.97643)" + id="path733" + d="M 77.95,1.006 L 77.95,12.602" + knockout="Off" /><path + style="font-size:12px;fill:none;stroke:#243033;stroke-width:2" + transform="translate(-66.40351,26.97643)" + id="path734" + d="M 85.502,2.01 L 85.502,11.207" + knockout="Off" /><path + style="font-size:12px;fill:none;stroke:#243033;stroke-width:2" + transform="translate(-66.40351,26.97643)" + id="path735" + d="M 93.054,3.016 L 93.054,9.813" + knockout="Off" /><path + style="font-size:12px;fill:none;stroke:#243033;stroke-width:2" + transform="translate(-66.40351,26.97643)" + id="path626" + d="M 100.604,4.02 L 100.604,8.418" + knockout="Off" /><path + style="font-size:12px;fill:none;stroke:#243033;stroke-width:2" + transform="translate(-66.40351,26.97643)" + id="path737" + d="M 108.155,5.025 L 108.155,7.023" + knockout="Off" /></g><g + id="leader"><path + id="leader_o" + d="M 36.93733,-42.11364 L 7.322792,-5.75802" + style="font-size:12px;fill:none;stroke:#243033;stroke-width:1.00999999;stroke-dasharray:4.04, 4.04;stroke-dashoffset:0" /><path + style="font-size:12px;fill:#243033;stroke:#243033" + transform="matrix(-0.635603,0.772016,-0.772016,-0.635603,48.46176,-44.62106)" + id="path730" + d="M 5,6.806 C 5,8.187 3.881,9.306 2.5,9.306 C 1.119,9.306 0,8.187 0,6.806 C 0,5.425 1.119,4.306 2.5,4.306 C 3.881,4.306 5,5.425 5,6.806 z " + knockout="Off" /></g></g></svg>
\ No newline at end of file diff --git a/exemples/data/fond_etiquette.png b/exemples/data/fond_etiquette.png Binary files differnew file mode 100644 index 0000000..3cfde5d --- /dev/null +++ b/exemples/data/fond_etiquette.png diff --git a/exemples/data/miniclochet.png b/exemples/data/miniclochet.png Binary files differnew file mode 100644 index 0000000..32976b8 --- /dev/null +++ b/exemples/data/miniclochet.png diff --git a/exemples/data/miniclochev.png b/exemples/data/miniclochev.png Binary files differnew file mode 100644 index 0000000..07b5a3c --- /dev/null +++ b/exemples/data/miniclochev.png diff --git a/exemples/data/rattrapage.svg b/exemples/data/rattrapage.svg new file mode 100644 index 0000000..b162bcc --- /dev/null +++ b/exemples/data/rattrapage.svg @@ -0,0 +1,256 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ id="svg2"
+ sodipodi:version="0.34"
+ inkscape:version="0.43"
+ width="210mm"
+ height="297mm"
+ sodipodi:docname="C:\Documents and Settings\HP_Administrateur\Bureau\Aster\mtools\exemples\data\rattrapage.svg">
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs5" />
+ <sodipodi:namedview
+ inkscape:window-height="542"
+ inkscape:window-width="811"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="3.4909416"
+ inkscape:cx="94.566031"
+ inkscape:cy="1051.5619"
+ inkscape:window-x="52"
+ inkscape:window-y="30"
+ inkscape:current-layer="svg2" />
+ <g
+ id="delete_off">
+ <rect
+ ry="1.994993"
+ rx="1.9949931"
+ y="-26.750669"
+ x="-27.500832"
+ height="22.488489"
+ width="22.187796"
+ id="rect5827"
+ style="fill:#dcdcdc;fill-opacity:1;stroke:#484848;stroke-opacity:1" />
+ <g
+ transform="matrix(0.569746,0,0,0.614012,-24.04364,-55.58208)"
+ id="g8331">
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#484848;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M -1.8613944,51.164678 L 27.455567,79.783616"
+ id="path8333" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#484848;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 27.455567,51.397352 L -1.6287201,79.550942"
+ id="path8335" />
+ </g>
+ </g>
+ <rect
+ style="opacity:1;fill:#dcdcdc;fill-opacity:0.90196078;stroke:#d2d2d2;stroke-opacity:1"
+ id="bck_edition"
+ width="119.63235"
+ height="28.019344"
+ x="-29.889215"
+ y="2.702137"
+ ry="1.9949931"
+ rx="1.9949931" />
+ <rect
+ style="opacity:1;fill:#f0f0f0;fill-opacity:0.90196078;stroke:#d2d2d2;stroke-opacity:1"
+ id="bck"
+ width="60.419991"
+ height="28.019344"
+ x="-0.31540614"
+ y="-29.282354"
+ ry="1.9949931"
+ rx="1.9949931" />
+ <rect
+ style="opacity:1;fill:#dcdcdc;fill-opacity:0.90196078;stroke:#d2d2d2;stroke-opacity:1"
+ id="mask_seuil"
+ width="27.008207"
+ height="28.019344"
+ x="33.380226"
+ y="-29.424318"
+ ry="1.9949931"
+ rx="1.9949931" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#484848;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="46.680595"
+ y="-10.898833"
+ id="seuil"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan4017"
+ x="46.6805954"
+ y="-10.8988333">7.5</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#484848;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="15.719942"
+ y="-5.9084311"
+ id="mesure"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan4021"
+ x="15.7199421"
+ y="-5.90843105">7.5</tspan></text>
+ <g
+ id="decroissant"
+ transform="translate(-30.43747,-61.8405)">
+ <path
+ id="path4025"
+ d="M 42.041374,39.56339 C 50.195646,39.56339 50.374861,39.56339 50.374861,39.56339 L 50.374861,39.56339"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#484848;stroke-width:0.68857652px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="ccc"
+ id="rect4027"
+ d="M 37.045026,35.954069 L 41.76391,39.657882 L 37.045026,43.361696"
+ style="fill:none;fill-opacity:1;stroke:#484848;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="ccc"
+ id="path4030"
+ d="M 54.898733,35.859576 L 50.179849,39.563389 L 54.898733,43.267203"
+ style="fill:none;fill-opacity:1;stroke:#484848;stroke-opacity:1" />
+ </g>
+ <g
+ id="croissant"
+ transform="translate(-31.57141,-67.88819)">
+ <path
+ id="path4039"
+ d="M 37.410658,45.563832 C 57.863404,45.563832 58.312916,45.563832 58.312916,45.563832 L 58.312916,45.563832"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#484848;stroke-width:1.09052444px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="ccc"
+ id="path4041"
+ d="M 53.817916,41.954511 L 58.5368,45.658324 L 53.817916,49.362138"
+ style="fill:none;fill-opacity:1;stroke:#484848;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="ccc"
+ id="path4043"
+ d="M 40.866211,41.860018 L 36.147327,45.563831 L 40.866211,49.267645"
+ style="fill:none;fill-opacity:1;stroke:#484848;stroke-opacity:1" />
+ </g>
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#484848;stroke-width:0.88920337px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 8.3968645,-22.324364 C 21.995116,-22.324364 22.293979,-22.324364 22.293979,-22.324364 L 22.293979,-22.324364"
+ id="stable" />
+ <g
+ id="delete_on"
+ transform="translate(0,26)">
+ <rect
+ ry="1.994993"
+ rx="1.9949931"
+ y="-52.750668"
+ x="-27.50083"
+ height="22.488489"
+ width="22.187796"
+ id="rect4946"
+ style="fill:#f0f0f0;fill-opacity:1;stroke:#484848;stroke-opacity:1" />
+ <g
+ transform="matrix(0.569746,0,0,0.614012,-23.84551,-81.64157)"
+ id="g8323">
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#484848;stroke-width:3px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M -1.8613944,51.164678 L 27.455567,79.783616"
+ id="path1329" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#484848;stroke-width:3px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 27.455567,51.397352 L -1.6287201,79.550942"
+ id="path1331" />
+ </g>
+ </g>
+ <g
+ id="cloche"
+ transform="translate(-32,0)">
+ <image
+ y="-28.685808"
+ x="93.393875"
+ xlink:href="miniclochev.png"
+ sodipodi:absref="C:\Documents and Settings\HP_Administrateur\Bureau\miniclochev.png"
+ width="27"
+ height="27"
+ id="cloche_" />
+ <rect
+ ry="1.9949931"
+ rx="1.9949932"
+ y="-30.150965"
+ x="93.748695"
+ height="28.145544"
+ width="26.562963"
+ id="rect9230"
+ style="opacity:1;fill:#000000;fill-opacity:0;stroke:none;stroke-opacity:1" />
+ </g>
+ <g
+ id="cloche_fantome">
+ <rect
+ ry="1.9949931"
+ rx="1.9949932"
+ y="-29.569281"
+ x="62.570343"
+ height="28.145544"
+ width="26.562963"
+ id="rect8349"
+ style="opacity:1;fill:#000000;fill-opacity:0;stroke:none;stroke-opacity:1" />
+ <image
+ y="-28.752613"
+ x="61.393883"
+ xlink:href="miniclochet.png"
+ sodipodi:absref="C:\Documents and Settings\HP_Administrateur\Bureau\miniclochet.png"
+ width="27"
+ height="27"
+ id="cloche_fantome_" />
+ </g>
+ <rect
+ style="opacity:1;fill:#aaaaaa;fill-opacity:0.90196079;stroke:#d2d2d2;stroke-opacity:1"
+ id="mask_seuil_down"
+ width="27.008207"
+ height="28.019344"
+ x="32.79808"
+ y="-29.157169"
+ ry="1.9949931"
+ rx="1.9949931" />
+ <path
+ style="fill:#484848;fill-opacity:1;stroke:#484848;stroke-opacity:1;"
+ d="M 35.418054,-3.3173678 L 57.966491,-3.3173678 L 46.692271,-8.8656118 L 35.418054,-3.3173678 z "
+ id="cdr_seuil_b_edit"
+ sodipodi:nodetypes="cccc" />
+ <path
+ style="fill:#484848;fill-opacity:1;stroke:#484848;stroke-opacity:1;"
+ d="M 34.845138,-27.628457 L 57.393575,-27.628457 L 46.119355,-22.080213 L 34.845138,-27.628457 z "
+ id="cdr_seuil_h_edit"
+ sodipodi:nodetypes="cccc" />
+ <path
+ style="fill:#888888;fill-opacity:1;stroke:#888888;stroke-opacity:1;"
+ d="M 35.418054,-3.3173678 L 57.966491,-3.3173678 L 46.692271,-8.8656118 L 35.418054,-3.3173678 z "
+ id="cdr_seuil_b"
+ sodipodi:nodetypes="cccc" />
+ <path
+ style="fill:#888888;fill-opacity:1;stroke:#888888;stroke-opacity:1;"
+ d="M 34.845138,-27.628457 L 57.393575,-27.628457 L 46.119355,-22.080213 L 34.845138,-27.628457 z "
+ id="cdr_seuil_h"
+ sodipodi:nodetypes="cccc" />
+</svg>
diff --git a/exemples/data/strip.svg b/exemples/data/strip.svg new file mode 100644 index 0000000..0f5bdb6 --- /dev/null +++ b/exemples/data/strip.svg @@ -0,0 +1,197 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" +"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> +<!-- Created with Sodipodi ("http://www.sodipodi.com/") --> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:xlink="http://www.w3.org/1999/xlink" + xml:space="preserve" + id="svg602" + sodipodi:version="0.34" + width="210mm" + height="297mm" + sodipodi:docname="data/strip.svg" + sodipodi:docbase="data/"><defs + id="defs604"><linearGradient + id="linearGradient606"><stop + style="stop-color:#008f00;stop-opacity:1;" + offset="0" + id="stop607" /><stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="1" + id="stop608" /></linearGradient><linearGradient + xlink:href="#linearGradient606" + id="linearGradient609" /><linearGradient + xlink:href="#linearGradient606" + id="linearGradient610" /></defs><sodipodi:namedview + id="base" /><g + id="strip_grand"><rect + style="font-size:12;fill:url(#linearGradient610);fill-rule:evenodd;stroke:url(#linearGradient609);stroke-width:0.286993;" + id="rect605" + width="52.1727683" + height="55.5258764" + x="187.395115" + y="2.32864244" /><rect + style="font-size:12;fill:#008f00;fill-rule:evenodd;stroke:#008f00;stroke-width:0.677974;" + id="rect611" + width="184.297703" + height="55.5258581" + x="1.54872027" + y="2.32908892" /><rect + style="font-size:12;fill:#80b580;fill-rule:evenodd;stroke:none;stroke-width:0.904462;fill-opacity:1;" + id="intersection" + width="1.57340338" + height="41.8513044" + x="77.6619016" + y="9" /></g><g + id="strip_mini"><rect + style="font-size:12;fill:url(#linearGradient610);fill-rule:evenodd;stroke:url(#linearGradient609);stroke-width:0.286993;" + id="rect666" + width="52.172734" + height="55.5258413" + x="75.4392426" + y="59.8217254" + transform="translate(1.387231,-57.74915)" /><rect + style="font-size:12;fill:#008f00;fill-rule:evenodd;stroke:#008f00;stroke-width:0.42551;" + id="rect667" + width="72.595981" + height="55.5258451" + x="1.54872447" + y="59.8224502" + transform="translate(1.387231,-57.74915)" /></g><rect + style="font-size:12;fill:#648012;fill-rule:evenodd;" + id="strip_shoote" + width="71.1825214" + height="18.0694474" + x="3.67623235" + y="21.9542921" + ry="9.0347237" /><text + style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + x="8.86942084" + y="35.1616205" + id="callsign"><tspan + id="tspan621">AFR6178A</tspan></text><text + style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + x="9.33554868" + y="49.080153" + id="vitesse"><tspan + id="tspan627">48</tspan></text><text + style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + x="154.237381" + y="50.259361" + id="fl2"><tspan + id="tspan637">110</tspan></text><rect + style="font-size:12;fill:#000000;fill-rule:evenodd;stroke-width:1;fill-opacity:1;" + id="evolution_stable" + width="13.6888753" + height="3.28528265" + x="9.41719369" + y="14.5749251" /><text + style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + x="28.5816899" + y="20.5989955" + id="fl"><tspan + id="tspan652">160</tspan></text><text + style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + x="90.114941" + y="20.2603928" + id="balise1"><tspan + id="tspan655">DIJ</tspan></text><text + style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + x="110.432841" + y="50.2589338" + id="fl1"><tspan + id="tspan658">230</tspan></text><text + style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + x="133.919481" + y="20.26082" + id="balise2"><tspan + id="tspan634">OMAKO</tspan></text><path + sodipodi:type="arc" + style="fill-rule:evenodd;stroke:none;fill:#ff0000;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + id="alarme_on" + d="M 68.05501 16.18321 A 4.149696 3.734741 0 1 0 59.75562 16.18321 A 4.149696 3.734741 0 1 0 68.05501 16.18321 z" + sodipodi:cx="63.9053116" + sodipodi:cy="16.1832123" + sodipodi:rx="4.14969635" + sodipodi:ry="3.73474121" /><path + sodipodi:type="arc" + style="fill-rule:evenodd;stroke:none;fill:#628260;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" + id="alarme_off" + d="M 68.05501 16.18321 A 4.149696 3.734741 0 1 0 59.75562 16.18321 A 4.149696 3.734741 0 1 0 68.05501 16.18321 z" + sodipodi:cx="63.9053116" + sodipodi:cy="16.1832123" + sodipodi:rx="4.14969635" + sodipodi:ry="3.73474121" /><g + id="evolution_descend"><rect + style="font-size:12;fill-rule:evenodd;" + id="rect640" + width="13.6889136" + height="3.28529223" + x="108.33198" + y="42.9338176" + transform="matrix(0.738668,0.67407,-0.67407,0.738668,-39.31526,-94.34453)" /><path + style="font-size:12;fill-rule:evenodd;" + d="M 51.47034 116.5875 L 61.32635 116.5875 L 61.32635 107.279 L 51.47034 116.5875 L 51.47034 116.5875 z " + id="path642" + sodipodi:nodetypes="cccc" + transform="translate(-39.31526,-94.34453)" /></g><g + id="evolution_monte"><rect + style="font-size:12;fill:#808080;fill-rule:evenodd;" + id="rect648" + width="0" + height="4.64614868" + x="43.3641853" + y="20.9140472" + transform="matrix(0.107479,-0.994207,0.994207,0.107479,-99.06663,59.74802)" /><rect + style="font-size:12;fill-rule:evenodd;" + id="rect649" + width="13.6889136" + height="3.28529223" + x="108.33198" + y="42.9338176" + transform="matrix(0.749556,-0.661941,0.661941,0.749556,-99.06663,59.74802)" /><path + style="font-size:12;fill-rule:evenodd;" + d="M 51.47034 116.5875 L 61.32635 116.5875 L 61.32635 107.279 L 51.47034 116.5875 L 51.47034 116.5875 z " + id="path650" + sodipodi:nodetypes="cccc" + transform="matrix(0.107479,-0.994207,0.994207,0.107479,-99.06663,59.74802)" /></g><g + id="selected" + transform="translate(0,-3.051758e-5)"><rect + style="font-size:12;fill:#ff0000;fill-rule:evenodd;stroke-width:1;fill-opacity:1;" + id="rect650" + width="26.8117603" + height="7.540813" + x="-10.0544122" + y="-10.8932096" /><rect + style="font-size:12;fill:#ff0000;fill-rule:evenodd;stroke-width:1;fill-opacity:1;" + id="rect652" + width="7.54079345" + height="29.3254591" + x="-11.7301428" + y="-10.0555899" /><rect + style="font-size:12;fill:#ff0000;fill-rule:evenodd;stroke-width:1;fill-opacity:1;" + id="rect653" + width="26.8117431" + height="7.54080871" + x="-10.0544037" + y="62.0008062" /><rect + style="font-size:12;fill:#ff0000;fill-rule:evenodd;stroke-width:1;fill-opacity:1;" + id="rect654" + width="7.54079106" + height="27.649655" + x="-11.7301381" + y="41.8919707" /></g><rect + style="font-size:12;fill:#808080;fill-rule:evenodd;stroke-width:1;fill-opacity:0;" + id="mask_grand" + width="187.199234" + height="59.0267181" + x="-2.52971935" + y="0.84208679" /><rect + style="font-size:12;fill:#808080;fill-rule:evenodd;stroke-width:1;fill-opacity:0;" + id="mask_mini" + width="77.578064" + height="57.3403185" + x="-0.84323978" + y="0.8421019" /></svg> diff --git a/exemples/data/strip_approche_arrival.svg b/exemples/data/strip_approche_arrival.svg new file mode 100644 index 0000000..ecb9fe5 --- /dev/null +++ b/exemples/data/strip_approche_arrival.svg @@ -0,0 +1,437 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:xml="http://www.w3.org/XML/1998/namespace"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="210mm"
+ height="297mm"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.41.1"
+ sodipodi:docbase="/home/saal/dev/StripApp/src/data/svg"
+ sodipodi:docname="strip_approche_arrival.svg">
+ <defs
+ id="defs3" />
+ <sodipodi:namedview
+ gridempspacing="5"
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="3.0314331"
+ inkscape:cx="161.78122"
+ inkscape:cy="953.44410"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showguides="false"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1406"
+ inkscape:window-height="992"
+ inkscape:window-x="77"
+ inkscape:window-y="27"
+ showgrid="true" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF
+ id="RDF5">
+ <cc:Work
+ rdf:about=""
+ id="Work6">
+ <dc:format
+ id="format7">image/svg+xml</dc:format>
+ <dc:type
+ id="type9"
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <g
+ id="cadre_strip">
+ <rect
+ style="opacity:0.15053762;fill:#000000;fill-opacity:1.0000000;fill-rule:evenodd"
+ id="cadre"
+ x="0.017290320"
+ y="0.12135064"
+ width="350.00000"
+ height="90.000000"
+ inkscape:label="#cadre" />
+ <image
+ xlink:href="cadre_strip.png"
+ sodipodi:absref="/home/saal/dev/StripApp/src/data/svg/cadre_strip.png"
+ width="350.00000"
+ height="90.000000"
+ id="image1488"
+ x="0.017522980"
+ y="-0.084024586" />
+ </g>
+ <g
+ id="infosavion"
+ inkscape:label="#infosavion"
+ transform="matrix(0.924892,0.000000,0.000000,1.000000,-8.903326,-113.7165)">
+ <rect
+ style="opacity:0.0000000;fill:#000000;fill-opacity:1.0000000;fill-rule:evenodd"
+ id="infosavion_fond"
+ x="12.724554"
+ y="156.95230"
+ width="102.35831"
+ height="42.500000"
+ inkscape:label="#infosavion_fond" />
+ <text
+ xml:space="preserve"
+ x="16.544676"
+ y="170.15265"
+ id="typeavion"
+ inkscape:label="#typeavion"
+ sodipodi:linespacing="100%"
+ style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:bleriot radar;text-anchor:start;writing-mode:lr-tb"><tspan
+ sodipodi:role="line"
+ id="tspan1394"
+ x="16.544676"
+ y="170.15265">TYPA</tspan><tspan
+ sodipodi:role="line"
+ id="tspan1396"
+ x="16.544676"
+ y="182.15265"></tspan></text>
+ <text
+ xml:space="preserve"
+ x="78.679977"
+ y="170.15265"
+ id="category"
+ inkscape:label="#category"
+ sodipodi:linespacing="100%"
+ style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:bleriot radar;text-anchor:start;writing-mode:lr-tb"><tspan
+ sodipodi:role="line"
+ id="tspan1418"
+ x="78.679977"
+ y="170.15265">M</tspan></text>
+ <text
+ xml:space="preserve"
+ x="14.845457"
+ y="195.93387"
+ id="airport_departure"
+ inkscape:label="#airport_departure"
+ sodipodi:linespacing="100%"
+ style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:bleriot radar;text-anchor:start;writing-mode:lr-tb"><tspan
+ sodipodi:role="line"
+ id="tspan1440"
+ x="14.845457"
+ y="195.93387">DEPT</tspan></text>
+ <text
+ xml:space="preserve"
+ x="66.618385"
+ y="196.12587"
+ id="airport_arrival"
+ inkscape:label="#airport_arrival"
+ sodipodi:linespacing="100%"
+ style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:bleriot radar;text-anchor:start;writing-mode:lr-tb"><tspan
+ sodipodi:role="line"
+ id="tspan1444"
+ x="66.618385"
+ y="196.12587">DEST</tspan></text>
+ </g>
+ <rect
+ style="fill:#515151;fill-opacity:0.66666669;opacity:0.12903226"
+ id="ecriture_zone"
+ width="137.67014"
+ height="25.000004"
+ x="99.000000"
+ y="15.884446" />
+ <g
+ id="IAF_zone"
+ transform="matrix(0.915209,0.000000,0.000000,1.000000,8.014889,0.427559)">
+ <text
+ id="balise_iaf"
+ y="12.444214"
+ x="98.410156"
+ style="font-size:12.000000;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:bleriot radar"
+ xml:space="preserve"><tspan
+ y="12.444214"
+ x="98.410156"
+ id="tspan1402"
+ sodipodi:role="line">BALISE</tspan></text>
+ <text
+ id="hap"
+ y="12.269655"
+ x="155.10931"
+ style="font-size:12.000000;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:bleriot radar"
+ xml:space="preserve"><tspan
+ y="12.269655"
+ x="155.10931"
+ id="tspan1406"
+ sodipodi:role="line">HAP</tspan></text>
+ <text
+ id="hap_delai_separation"
+ y="12.042892"
+ x="182.93408"
+ style="font-size:12.000000;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:bleriot radar"
+ xml:space="preserve"><tspan
+ y="12.042892"
+ x="182.93408"
+ id="tspan1410"
+ sodipodi:role="line">/</tspan></text>
+ <text
+ id="delai"
+ y="12.269655"
+ x="191.37358"
+ style="font-size:12.000000;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:bleriot radar"
+ xml:space="preserve"><tspan
+ y="12.269655"
+ x="191.37358"
+ id="tspan1414"
+ sodipodi:role="line">DL</tspan></text>
+ </g>
+ <g
+ id="QFU_zone"
+ inkscape:label="#QFU_zone"
+ transform="matrix(0.915209,0.000000,0.000000,1.000000,6.728648,-116.8888)">
+ <rect
+ y="119.22351"
+ x="252.04315"
+ height="38.819168"
+ width="60.000000"
+ id="QFU_reco_zone"
+ style="fill:#515151;fill-opacity:0.66666669;opacity:0.15053763" />
+ <text
+ id="QFU_label"
+ y="143.45589"
+ x="270.16019"
+ style="font-size:16.000000;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:bleriot radar;text-anchor:start;writing-mode:lr-tb"
+ xml:space="preserve"
+ sodipodi:linespacing="100%"><tspan
+ y="143.45589"
+ x="270.16019"
+ id="tspan1419"
+ sodipodi:role="line">QFU</tspan></text>
+ </g>
+ <g
+ id="coordination_zone"
+ transform="matrix(0.915209,0.000000,0.000000,1.000000,155.7120,-278.4541)">
+ <rect
+ style="fill:#7d7d7d;fill-opacity:0.66666669;opacity:0.15000000"
+ id="coordination_cadre"
+ width="60.000000"
+ height="68.010315"
+ x="150.37901"
+ y="279.80597" />
+ <text
+ xml:space="preserve"
+ style="font-size:10.000000;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:bleriot radar"
+ x="153.08107"
+ y="292.66437"
+ id="cap_coordination"><tspan
+ sodipodi:role="line"
+ id="tspan1504"
+ x="153.08107"
+ y="292.66437">C</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:10.000000;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:bleriot radar"
+ x="152.66115"
+ y="309.96472"
+ id="flight_level_coordination"><tspan
+ sodipodi:role="line"
+ id="tspan1508"
+ x="152.66115"
+ y="309.96472">FL</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:10.000000;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:bleriot radar"
+ x="153.56447"
+ y="327.41394"
+ id="vitesse_coordination"><tspan
+ sodipodi:role="line"
+ id="tspan1512"
+ x="153.56447"
+ y="327.41394">Vi</tspan></text>
+ <rect
+ y="331.37247"
+ x="151.38989"
+ height="15.443814"
+ width="55.434994"
+ id="transfert_position_zone"
+ style="fill:#515151;fill-opacity:0.66666669" />
+ </g>
+ <g
+ id="instruction_zone"
+ transform="matrix(0.915209,0.000000,0.000000,1.000000,55.14498,-189.9219)">
+ <rect
+ y="231.76956"
+ x="47.918037"
+ height="45.000000"
+ width="211.56883"
+ id="instruction_reco_cadre"
+ style="fill:#515151;fill-opacity:0.66666669;opacity:0.15000000"
+ inkscape:label="instruction_reco_cadre" />
+ <text
+ xml:space="default"
+ x="75.899834"
+ y="242.99031"
+ id="cap_label"
+ style="font-size:8.0000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:bleriot radar;text-anchor:start;writing-mode:lr-tb"
+ sodipodi:linespacing="100%"><tspan
+ sodipodi:role="line"
+ id="tspan1492"
+ x="75.899834"
+ y="242.99031">C</tspan></text>
+ <text
+ id="cap"
+ y="274.76956"
+ x="62.509846"
+ xml:space="preserve"
+ sodipodi:linespacing="100%"
+ style="font-size:14.000000;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:bleriot radar;text-anchor:start;writing-mode:lr-tb"><tspan
+ y="274.76956"
+ x="62.509846"
+ id="tspan1454"
+ sodipodi:role="line">XXX</tspan></text>
+ <text
+ xml:space="default"
+ x="223.77307"
+ y="243.12302"
+ id="vitesse_label"
+ style="font-size:8.0000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:bleriot radar;text-anchor:start;writing-mode:lr-tb"
+ sodipodi:linespacing="100%"><tspan
+ sodipodi:role="line"
+ id="tspan2108"
+ x="223.77307"
+ y="243.12302">Vi</tspan></text>
+ <text
+ xml:space="default"
+ x="148.77254"
+ y="242.9944"
+ id="flight_level_label"
+ style="font-size:8.0000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:bleriot radar;text-anchor:start;writing-mode:lr-tb"
+ sodipodi:linespacing="100%"><tspan
+ sodipodi:role="line"
+ id="tspan2112"
+ x="148.77254"
+ y="242.99440">FL</tspan></text>
+ <text
+ id="flight_level"
+ y="274.76956"
+ x="137.48592"
+ xml:space="preserve"
+ sodipodi:linespacing="100%"
+ style="font-size:14.000000;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:bleriot radar;text-anchor:start;writing-mode:lr-tb"><tspan
+ y="274.76956"
+ x="137.48592"
+ id="tspan2116"
+ sodipodi:role="line">XXX</tspan></text>
+ <text
+ id="vitesse"
+ y="274.76956"
+ x="210.99817"
+ xml:space="preserve"
+ sodipodi:linespacing="100%"
+ style="font-size:14.000000;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:bleriot radar;text-anchor:start;writing-mode:lr-tb"><tspan
+ y="274.76956"
+ x="210.99817"
+ id="tspan2120"
+ sodipodi:role="line">XXX</tspan></text>
+ </g>
+ <g
+ id="header"
+ inkscape:label="#header"
+ transform="matrix(0.915209,0.000000,0.000000,1.000000,-155.5724,-168.1455)">
+ <text
+ xml:space="preserve"
+ style="font-size:12.000002;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:bleriot radar"
+ x="261.41452"
+ y="189.41954"
+ id="chevron_sortant"><tspan
+ sodipodi:role="line"
+ id="tspan2674"
+ x="261.41452"
+ y="189.41954">>></tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12.543571;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:bleriot radar"
+ x="168.33838"
+ y="197.62244"
+ id="chevron_entrant"
+ transform="scale(1.045298,0.956665)"><tspan
+ sodipodi:role="line"
+ id="tspan2670"
+ x="168.33838"
+ y="197.62244">>></tspan></text>
+ <text
+ xml:space="preserve"
+ x="189.8475"
+ y="191.66393"
+ id="callsign"
+ inkscape:label="#callsign"
+ sodipodi:linespacing="100%"
+ style="font-size:16.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:bleriot radar;text-anchor:start;writing-mode:lr-tb"><tspan
+ sodipodi:role="line"
+ id="tspan7478"
+ x="189.84750"
+ y="191.66393">CallSign</tspan></text>
+ <image
+ inkscape:label="#header_cadre"
+ y="168.51799"
+ x="172.84236"
+ id="header_cadre"
+ height="43.000000"
+ width="104"
+ sodipodi:absref="/home/saal/dev/StripApp/src/data/svg/fond_etiquette.png"
+ xlink:href="fond_etiquette.png" />
+ <text
+ xml:space="preserve"
+ x="190.35287"
+ y="203.70299"
+ id="company"
+ sodipodi:linespacing="100%"
+ inkscape:label="#company"
+ style="font-size:7.0000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:bleriot radar;text-anchor:start;writing-mode:lr-tb"><tspan
+ sodipodi:role="line"
+ id="tspan7482"
+ x="190.35287"
+ y="203.70299">Company xxxxx</tspan></text>
+ </g>
+ <g
+ transform="matrix(0.323997,0.000000,0.000000,0.337375,268.8792,-11.58455)"
+ id="bouton_zoom_inverse">
+ <path
+ id="bouton_zoom_inverse_cadre"
+ d="M 190.30595,293.10961 C 245.18697,238.31223 245.18697,238.31223 245.18697,238.31223 L 245.18697,293.31223 L 190.30595,293.10961 z "
+ style="opacity:0.53763443;fill:#000000;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000" />
+ <path
+ id="bouton_zoom_inverse_fond"
+ d="M 190.08831,293.32725 L 245.18697,238.31223 L 245.18697,293.31223 L 190.08831,293.32725 z "
+ style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000" />
+ <path
+ id="bouton_zoom_inverse_fleche"
+ d="M 218.51730,286.23169 L 238.58196,266.00470 L 238.58196,286.00470 L 218.51730,286.23169 z "
+ style="opacity:0.43010750;fill:#000000;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000" />
+ </g>
+ <g
+ transform="matrix(0.323997,0.000000,0.000000,0.337375,268.8792,-11.58455)"
+ id="bouton_zoom">
+ <path
+ id="bouton_zoom_fond"
+ d="M 190.30595,293.10961 C 245.18697,238.31223 245.18697,238.31223 245.18697,238.31223 L 245.18697,293.31223 L 190.30595,293.10961 z "
+ style="opacity:0.28000000;fill:#000000;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000" />
+ <path
+ id="bouton_zoom_contour"
+ d="M 190.08831,293.32725 L 245.18697,238.31223 L 245.18697,293.31223 L 190.08831,293.32725 z "
+ style="fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000" />
+ <path
+ id="bouton_zoom_fleche"
+ d="M 218.51730,286.23169 L 238.58196,266.00470 L 238.58196,286.00470 L 218.51730,286.23169 z "
+ style="opacity:0.43010750;fill:#000000;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000" />
+ </g>
+ </g>
+</svg>
diff --git a/exemples/exemple_MMover_MInertie.pl b/exemples/exemple_MMover_MInertie.pl new file mode 100755 index 0000000..fd1f4f1 --- /dev/null +++ b/exemples/exemple_MMover_MInertie.pl @@ -0,0 +1,69 @@ +#!/usr/bin/perl +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +BEGIN { + unshift @INC, ".", "./data", "../src"; +} + +use MTools; +use MTools::Comp::MMover; +use MTools::GUI::MRect; +use MTools::Comp::MInertie; + +# Creation de la frame +new MTools (800, 600, 'Exemple MMover et MInertie'); + +# Creation des objets delimitant l'espace +new MTools::GUI::MRect (1, 0, 0, 650, 450, -fillcolor => "=axial 90 | #526266 | #667C80", -filled => 1); +new MTools::GUI::MRect (1, 250, 300, 400, 150, -linecolor => 'black'); + +# Creation de l'objet deplace +my $target = minstanciate ('Ampoule.svg#on', 1); + +# Ajout du comportement MMover à l'objet +my $mover = new MTools::Comp::MMover($target, $target, 1, x_max => 600, y_max => 400, y_min => 0, x_min => 0, allower => \&allowmove); +# Ajout du comportement MInertie au comportement de mover +new MTools::Comp::MInertie ($mover); + + +# RUN +mrun; + +# La fonction permet de conserver l'objet dans un espace controle +# Elle recoit en parametre l'ancienne position de l'objet ainsi que le deplacement suggerer +# Elle retourne un vecteur correspondant a la correction effectuee sur le deplacement +sub allowmove { + my ($x, $y, $dx, $dy) = @_; + if ($x > 200) + { + if ($y + $dy > 250) + { + $dy = $y + $dy - 250; + return (0, $dy); + } + } + elsif ($x + $dx > 200) + { + if ($y + $dy > 250) + { + $dx = $x + $dx - 200; + return ($dx, 0); + } + } + return (0, 0); +} + diff --git a/exemples/exemple_Rattrapage.pl b/exemples/exemple_Rattrapage.pl new file mode 100755 index 0000000..ca2b0f2 --- /dev/null +++ b/exemples/exemple_Rattrapage.pl @@ -0,0 +1,52 @@ +#!/usr/bin/perl +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +BEGIN { + unshift @INC, ".", "./data", "../src"; +} + +use MTools; +use Rattrapage; +use Comete; +use MTools::MTimer; + +new MTools (800, 600, 'Exemple SVG'); + +my $com1 = new Comete (1, 'AFR6830', 180, 200); +my $com2 = new Comete (1, 'BAW753', 400, 180); +my $com3 = new Comete (1, 'AZA322', 350, 340); + +my $manager = new MTools::MGroup (1); +$manager -> mconfigure (-visible => 0); + +new Rattrapage (1, $com1, $com2, $manager); +new Rattrapage (1, $com2, $com3, $manager); + +my $bouton = new MTools::Widget::MToggleBouton ( + parent => 1, + g_on => 'rattrapage.svg#delete_on', + g_off => 'rattrapage.svg#delete_off', + e_press => 'EDIT', + e_release => 'NON_EDIT' +); + +$bouton -> translate (50, 50); + +$bouton -> binding ('EDIT', sub { $manager -> mconfigure ('-visible' => 1); }); +$bouton -> binding ('NON_EDIT', sub { $manager -> mconfigure ('-visible' => 0); }); + +mrun; diff --git a/exemples/exemple_SVG.pl b/exemples/exemple_SVG.pl new file mode 100755 index 0000000..f19e856 --- /dev/null +++ b/exemples/exemple_SVG.pl @@ -0,0 +1,59 @@ +#!/usr/bin/perl +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +BEGIN { + unshift @INC, ".", "./data", "../src"; +} + +use MTools; +use MTools::Comp::MMover; +use MTools::GUI::MRect; +use MTools::Comp::MInertie; + + +# Creation de la frame +new MTools (800, 600, 'Exemple SVG'); + + +# Creation des objets 'litso' et 'pupille' depuis le fichier Malouco.svg +my $visage = minstanciate ('Malouco.svg#litso', 1); +my $pupille = minstanciate ('Malouco.svg#pupille', 1); +MTools::MObjet::recordEvent ($pupille, 'PING'); +# Recherche du sous arbre 'tilt' dans l'objet pupille +my $tilt = mfind ($pupille, 'tilt'); +# On rend l'objet tilt invisible +mconfigure ($tilt, -visible => 0); + +# Quelques interactions sur les objets instancies +$visage -> binding ('<Button-1>', sub {$pupille -> mconfigure (-visible => 0); $pupille -> notify ('PING')}); +$visage -> binding ('<ButtonRelease-1>', sub {$pupille -> mconfigure (-visible => 1)}); +$pupille -> binding ('<Button-1>', sub {mconfigure (mfind ($pupille, 'tilt'), -visible => 1)}); +$pupille -> binding ('<ButtonRelease-1>', sub {mconfigure (mfind ($pupille, 'tilt'), -visible => 0)}); + +my $cb = [\&unb, $pupille]; +$pupille -> binding ('PING', $cb); + +# RUN +mrun; + +sub unb { + my ($self) = @_; + print "UNBINDING !!!\n"; + $self -> unbinding ('PING', $cb); + $self -> notify ('PING'); + print "YOUPIE HOURrA, pas de boucle !\n"; +} diff --git a/exemples/exemple_Strip.pl b/exemples/exemple_Strip.pl new file mode 100755 index 0000000..004580e --- /dev/null +++ b/exemples/exemple_Strip.pl @@ -0,0 +1,54 @@ +#!/usr/bin/perl +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +BEGIN { + unshift @INC, ".", "./data", "../src"; +} + +use MTools; +use Strip; +use MTools::Comp::MFocuser; + +# Instanciation d'une frame +new MTools (800, 600, "Exemple de strips"); + +# Instanciation de trois composants strips +my $strip1 = new Strip (1, callsign => "AFR6845"); +my $strip2 = new Strip (1, callsign => "BAW45D"); +my $strip3 = new Strip (1, callsign => "RAE458X"); + +# Gestion du focus entre les differents objets +my $strip_focuser = new MTools::Comp::MFocuser ($strip1, $strip2, $strip3); + +# Instanication d'un petit bouton rouge +my $bouton1 = new MTools::Widget::MToggleBouton ( + parent => 1, + g_on => 'strip.svg#alarme_on', + g_off => 'strip.svg#alarme_off', + e_press => 'PRENDRE_FOCUS', + e_release => 'PRENDRE_FOCUS' +); +$bouton1 -> recordEvent('SET_FOCUS'); +$bouton1 -> recordEvent('GET_FOCUS'); +$bouton1 -> binding ('PRENDRE_FOCUS', sub {$bouton1 -> notify ('GET_FOCUS', $bouton1)}); +$bouton1 -> translate (100, 500); + +# Gestion du focus entre l'objet de focus principal et le petit bouton rouge +new MTools::Comp::MFocuser ($strip_focuser, $bouton1); + + +mrun; diff --git a/exemples/exemple_anti_recouvrement.pl b/exemples/exemple_anti_recouvrement.pl new file mode 100755 index 0000000..4a6b9e4 --- /dev/null +++ b/exemples/exemple_anti_recouvrement.pl @@ -0,0 +1,39 @@ +#!/usr/bin/perl +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +BEGIN { + unshift @INC, ".", "./data", "../src"; +} + +use strict; +use MTools; +use MTools::MGroup; +use MTools::Comp::MAntiRecouvrement; +use StripAntiRecouvre; + +my $frame = new MTools (1280, 1024, "Test"); +my $antirecouvrementgroup = new MTools::Comp::MAntiRecouvrement (); +my $strip1 = new StripAntiRecouvre (1, $frame, callsign => "AFR6845"); +my $strip2 = new StripAntiRecouvre (1, $frame, callsign => "CTM5285"); +my $strip3 = new StripAntiRecouvre (1, $frame, callsign => "AF850HJ"); +my $strip4 = new StripAntiRecouvre (1, $frame, callsign => "DLH8285"); +$antirecouvrementgroup -> addObject($strip1); +$antirecouvrementgroup -> addObject($strip2); +$antirecouvrementgroup -> addObject($strip3); +$antirecouvrementgroup -> addObject($strip4); + +mrun; diff --git a/exemples/exemple_multi_selection.pl b/exemples/exemple_multi_selection.pl new file mode 100755 index 0000000..389233c --- /dev/null +++ b/exemples/exemple_multi_selection.pl @@ -0,0 +1,72 @@ +#!/usr/bin/perl +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +BEGIN { + unshift @INC, ".", "./data", "../src"; +} + +use MTools; +use MTools::GUI::MRect; +use Selec; +use MTools::GUI::MText; +use MTools::Comp::MMultiSelection; +use Target; + +my $frame = new MTools (800, 600, 'Exemple SVG'); + +my $bck = new MTools::GUI::MRect (1, 0, 0, 800, 600, -filled => 1, -fillcolor => '#aaaaaa'); + +my $objs = new MTools::MGroup (1); + +my $multi = new MTools::Comp::MMultiSelection ( + $bck, + 1, + $frame, + 0, +); + +new MTools::GUI::MText ($objs, '1er plan', 5, 90); +new MTools::GUI::MText ($objs, '2ieme plan', 5, 190); +new MTools::GUI::MText ($objs, '3ieme plan', 5, 290); + +my $ob = new Selec ($objs, 'rectangle', 110, 100); +$multi -> addObject ($ob, 0); +my $ob = new Selec ($objs, 'circle', 110, 200); +$multi -> addObject ($ob, 1); +my $ob = new Selec ($objs, 'point', 110, 300); +$multi -> addObject ($ob, 2); + +my $ob = new Selec ($objs, 'rectangle', 210, 100); +$multi -> addObject ($ob, 0); +my $ob = new Selec ($objs, 'circle', 210, 200); +$multi -> addObject ($ob, 1); +my $ob = new Selec ($objs, 'point', 210, 300); +$multi -> addObject ($ob, 2); + +my $ob = new Selec ($objs, 'rectangle', 310, 100); +$multi -> addObject ($ob, 0); +my $ob = new Selec ($objs, 'circle', 310, 200); +$multi -> addObject ($ob, 1); +my $ob = new Selec ($objs, 'point', 310, 300); +$multi -> addObject ($ob, 2); + +my $drop_target = new Target ($ob, 700, 500); +$multi -> addDropTarget ($drop_target); + + +mrun; + diff --git a/exemples/exemple_skin_plink.pl b/exemples/exemple_skin_plink.pl new file mode 100755 index 0000000..fdb6fec --- /dev/null +++ b/exemples/exemple_skin_plink.pl @@ -0,0 +1,38 @@ +#!/usr/bin/perl +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +BEGIN { + unshift @INC, ".", "./data", "../src"; +} + +use MTools; +use Visage; + + +# Creation de la frame +new MTools (1200, 600, 'Exemple SVG'); + +my $fou = new Visage (1, 'Malouco.svg'); +my $normal = new Visage (1, 'VisageNormal.svg'); +$fou -> translate (500, 0); + +$normal -> mconfigure ('nom', 'Avant la reunion'); +$fou -> mconfigure ('nom', 'Apres'); + +# RUN +mrun; + |