#!/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_on1 => 'strip.svg#alarme_on', g_off1 => 'strip.svg#alarme_off', g_on2 => 'strip.svg#alarme_on', g_off2 => 'strip.svg#alarme_off', e_press1 => 'PRENDRE_FOCUS', e_release1 => '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;