aboutsummaryrefslogtreecommitdiff
path: root/exemples/exemple_Strip.pl
blob: 004580e264fce32c792cd230bea158466d5872e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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;