aboutsummaryrefslogtreecommitdiff
path: root/exemples/exemple_Strip.pl
diff options
context:
space:
mode:
Diffstat (limited to 'exemples/exemple_Strip.pl')
-rwxr-xr-xexemples/exemple_Strip.pl54
1 files changed, 54 insertions, 0 deletions
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;