From fe01d7c8e50f93761c617537cdd0fa3ce88f0788 Mon Sep 17 00:00:00 2001 From: ribet Date: Mon, 14 May 2007 10:41:25 +0000 Subject: La documentation progresse... --- doc/exemple_texte.pl | 29 +++++++++++++++++++++++++++++ doc/exemple_texture.pl | 37 +++++++++++++++++++++++++++++++++++++ doc/user_manual.txt | 47 ++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 108 insertions(+), 5 deletions(-) create mode 100755 doc/exemple_texte.pl create mode 100755 doc/exemple_texture.pl diff --git a/doc/exemple_texte.pl b/doc/exemple_texte.pl new file mode 100755 index 0000000..031ca1c --- /dev/null +++ b/doc/exemple_texte.pl @@ -0,0 +1,29 @@ +#!/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, ".", "../src"; +} + +use MTools; +use MTools::GUI::MText; + +new MTools (800, 600, "Exemple de texte"); + +my $message = new MTools::GUI::MText(1, "Texte d'exemple", 100, 100, -color => gray); + +mrun; diff --git a/doc/exemple_texture.pl b/doc/exemple_texture.pl new file mode 100755 index 0000000..a2fa156 --- /dev/null +++ b/doc/exemple_texture.pl @@ -0,0 +1,37 @@ +#!/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, ".", "../src"; +} + +use MTools; +use MTools::GUI::MCurve; +use MTools::GUI::MTexture; + +new MTools (800, 600, "Exemple de texture"); + +my $surface = new MTools::GUI::MCurve (1, [[150, 50], + [400, 100, 'c'], + [750, 50], + [750, 550], + [400, 500, 'c'], + [50, 550]]); + +my $texture = new MTools::GUI::MTexture(1, $surface, "plan.png"); + +mrun; diff --git a/doc/user_manual.txt b/doc/user_manual.txt index 59faad9..b3889d0 100644 --- a/doc/user_manual.txt +++ b/doc/user_manual.txt @@ -16,8 +16,8 @@ Cette partie de la documentation est principalement extraite de MTools.pm MTools exporte des fonctions destinées principalement à : - activer des fonctions propres à la librairie mtools - - assurer la compatibilité entre la manipulation des objets mtools et des - objets zincs + - assurer la compatibilité entre la manipulation des objets mtools et + des objets zinc Ainsi, d'une manière générale, toutes fonctions exportées s'appliquent aussi bien à des objets zinc qu'à des objets mtools. L'unique restriction est dans la @@ -195,7 +195,8 @@ La cr - path : description de l'objet clippant - soit une descrition sous forme [_type, _coords] créant un objet zinc de type _type et de coordonnées _coords - - soit un objet existant qui prendra pour père le groupe $clipped. + - soit un objet existant qui prendra pour père le groupe + $clipped. Exemple d'utilisation : use MTools; @@ -227,7 +228,6 @@ my $b = new MTools::GUI::MCurve(1, [[100, 100], [100, 300], # barre verticale [200, 200, 'c'], # haut de l'arrondi [100, 250]],-linewidth=>3);#point d'accroche mrun; - _________ MImage.pm : l'objet image permet de charger une image à partir d'un fichier. Actuellement, MImage gère les images au format png. Les autres formats marchent @@ -245,9 +245,46 @@ new MTools (800, 600, "Exemple d'image"); my $image = new MTools::GUI::MImage (1, "plan.png"); mrun; ________ -MText.pm : +MText.pm : l'objet texte permet d'afficher des caractères. +La création nécessite les arguments suivants : + - parent : père de l'objet. + - text : le texte à afficher + - x, y : coordonnées de l'emplacement de l'objet + - %options : table de hash passée en paramètre de la création de l'objet + zinc text + +Exemple d'utilisation : +use MTools; +use MTools::GUI::MText; +new MTools (800, 600, "Exemple de texte"); +my $message = new MTools::GUI::MText(1,"Texte d'exemple",100,100,-color=>gray); +mrun; ___________ MTexture.pm : +Permet d'appliquer une texture à un objet. Une texture est une image qui sert de +motif au remplissage d'une figure. Comme pour une tapisserie, la texture est +répétée autant de fois que nécessaire pour couvrir toute la surface. Le coin en +haut à gauche de la texture est aligné avec le coin en haut à gauche de la bbox +de la figure à remplir. +La création nécessite les arguments suivants : + - parent : père de l'objet. + - target : groupe zinc définissant le contour de la figure. + - image_name : nom de l'image texture (fichier png) Tester avec les + autres formats*** + +Exemple d'utilisation : +use MTools; +use MTools::GUI::MCurve; +use MTools::GUI::MTexture; +new MTools (800, 600, "Exemple de texture"); +my $surface = new MTools::GUI::MCurve (1, [[150, 50], + [400, 100, 'c'], + [750, 50], + [750, 550], + [400, 500, 'c'], + [50, 550]]); +my $texture = new MTools::GUI::MTexture(1, $surface, "plan.png"); +mrun; _________________________ MAntiRecouvrementGroup.pm : -- cgit v1.1