FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» Aide de PANORAMIC
Systeme d'onglets PANORAMIC Emptypar papydall Aujourd'hui à 3:21

» Je teste PANORAMIC V 1 beta 1
Systeme d'onglets PANORAMIC Emptypar papydall Aujourd'hui à 3:17

» select intégrés
Systeme d'onglets PANORAMIC Emptypar jjn4 Hier à 17:33

» PANORAMIC V 1
Systeme d'onglets PANORAMIC Emptypar Klaus Hier à 8:53

» bouton dans autre form que 0
Systeme d'onglets PANORAMIC Emptypar leclode Lun 6 Mai 2024 - 12:59

» KGF_dll - nouvelles versions
Systeme d'onglets PANORAMIC Emptypar Klaus Lun 6 Mai 2024 - 10:41

» Gestion d'un système client-serveur.
Systeme d'onglets PANORAMIC Emptypar Klaus Lun 6 Mai 2024 - 9:23

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Systeme d'onglets PANORAMIC Emptypar Froggy One Jeu 2 Mai 2024 - 10:16

» @Jack
Systeme d'onglets PANORAMIC Emptypar Jack Mar 30 Avr 2024 - 19:40

» trop de fichiers en cours
Systeme d'onglets PANORAMIC Emptypar papydall Lun 29 Avr 2024 - 22:39

» Une calculatrice en une ligne de programme
Systeme d'onglets PANORAMIC Emptypar jean_debord Dim 28 Avr 2024 - 7:47

» Form(résolu)
Systeme d'onglets PANORAMIC Emptypar leclode Sam 27 Avr 2024 - 16:59

» Bataille navale SM
Systeme d'onglets PANORAMIC Emptypar jjn4 Ven 26 Avr 2024 - 16:39

» Les maths du crocodile
Systeme d'onglets PANORAMIC Emptypar jean_debord Jeu 25 Avr 2024 - 9:37

» Naissance de Crocodile Basic
Systeme d'onglets PANORAMIC Emptypar jean_debord Jeu 25 Avr 2024 - 7:45

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier
Le Deal du moment : -39%
Ordinateur portable ASUS Chromebook Vibe CX34 Flip
Voir le deal
399 €

 

 Systeme d'onglets PANORAMIC

Aller en bas 
+4
topmozika
Jicehel
Jean Claude
demenvil
8 participants
AuteurMessage
demenvil

demenvil


Nombre de messages : 171
Age : 34
Localisation : France Marseille
Date d'inscription : 30/06/2012

Systeme d'onglets PANORAMIC Empty
MessageSujet: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 12:05

Bonjour,
J'ai vu je ne sais plus ou sur le forum un système d'onglet proposer par KLAUS je crois.
Mais je n'ai pas trouvé le lien de dl de la source pour voir comment on fait cela en panoramic.

Si une personnes peut me donner un coup de main ?

Merci Smile
Revenir en haut Aller en bas
http://www.newsd3v.com
Jean Claude

Jean Claude


Nombre de messages : 5948
Age : 69
Localisation : 83 Var
Date d'inscription : 07/05/2009

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 12:59

Regarde ceci, c'est une intervention de Klaus qui me semble adaptée à ce que tu recherches.

Citation :
Pour trouver l'objet FRAME:

- tu vas sur mon site: http://membres.multimania.fr/klaus/Bienvenue.1.html
- tu choisis "Panormaic"
- tu cliques sur "Pseudo-objets"
- tu télécharges la distribution en cliquant sur ">" de la ligne FRAME (le "?" donne des infos utiles...)

Tu récupères un fichier ZIP qui contient essentiellement frame.bas, un programme de démo et un fichier de documentation...

A+
Revenir en haut Aller en bas
demenvil

demenvil


Nombre de messages : 171
Age : 34
Localisation : France Marseille
Date d'inscription : 30/06/2012

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 13:53

Je vais regarder mais du coup je pense que je vais coder un truc moi même Smile
Sa fait toujours de l'exercice ! Smile
Revenir en haut Aller en bas
http://www.newsd3v.com
demenvil

demenvil


Nombre de messages : 171
Age : 34
Localisation : France Marseille
Date d'inscription : 30/06/2012

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 15:34

Solution créée !
J'ai joué avec les containers et des boutons.
J'ai géré le tous avec des on_click et les évènements hide et show.

Voila tous fonctionne si quelqu'un veux la source qu'il le dise je la posterai ici.

(Bon j'ai pas trop creusé donc c'est largement optimisable !).

Merci.
Revenir en haut Aller en bas
http://www.newsd3v.com
Jicehel

Jicehel


Nombre de messages : 5947
Age : 51
Localisation : 77500
Date d'inscription : 18/04/2011

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 16:07

Ca dépend de ce que tu veux faire, mais tu peux toujours mettre le source, tu auras sans doute des conseils d'optimisation (si tu débute ce programme autant optimiser un peu tant que c'est 'simple', après ça risque d'être plus dur pour 'rentrer' dans ton programme et l'optimiser sans devoir modifier différentes choses.
Revenir en haut Aller en bas
demenvil

demenvil


Nombre de messages : 171
Age : 34
Localisation : France Marseille
Date d'inscription : 30/06/2012

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 16:19

Ok ok.
Alors voici le bout de source correspondant.

Code:

label go_dev,go_console,go_ftp,go_tools,go_extra_bonus
rem ## TAB SYSTEM ##
rem 100
container 100
width 100, 1000
height 100, 600
left 100, 5
top 100, 30
caption 100, "Développement"
show 100
rem bouton pour afficher 100

button 101
top  101,0
left 101,0
width 101,130
caption 101,"Développement"
on_click 101, go_dev

rem ########################


rem 200
container 200
width 200, 1000
height 200,600
left 200, 5
top 200, 30
caption 200, "Console"
hide 200
rem bouton pour afficher 200

button 201
top  201,0
left 201,130
width 201,100
caption 201,"Console"
on_click 201, go_console
rem ########################

rem 300
container 300
width 300, 1000
height 300,600
left 300, 5
top 300, 30
caption 300, "FTP"
hide 300
rem bouton pour afficher 300

button 301
top  301,0
left 301,230
width 301,100
caption 301,"FTP"
on_click 301, go_ftp
rem ########################

rem 400
container 400
width 400, 1000
height 400,600
left 400, 5
top 400, 30
caption 400,  "Outils"
hide 400
rem bouton pour afficher 400

button 401
top  401,0
left 401,330
width 401,100
caption 401,"Outils"
on_click 401, go_tools
rem ########################

rem 500
container 500
width 500, 1000
height 500,600
left 500, 5
top 500, 30
caption 500, "Extra et Bonus"
hide 500
rem bouton pour afficher 500

button 501
top  501,0
left 501,430
width 501,100
caption 501,"Extra"
on_click 501, go_extra_bonus
rem ########################

END

rem et ici la gestion basique des container qui simmule des onglets

go_dev:
  show 100
  hide 200
  hide 300
  hide 400
  hide 500
return
go_console:
  show 200
  hide 100
  hide 300
  hide 400
  hide 500
return
go_ftp:
  show 300
  hide 100
  hide 200
  hide 400
  hide 500
return
go_tools:
  show 400
  hide 100
  hide 300
  hide 200
  hide 500
return
go_extra_bonus:
  show 500
  hide 100
  hide 300
  hide 400
  hide 200
return

Voilà Smile




Dernière édition par demenvil le Mer 4 Juil 2012 - 16:57, édité 3 fois (Raison : Rajout des label dans le code et du END. C'est mieux si vous voulez tester :) Merci.)
Revenir en haut Aller en bas
http://www.newsd3v.com
topmozika

topmozika


Nombre de messages : 79
Age : 62
Localisation : Antananarivo - Madagascar
Date d'inscription : 09/06/2012

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 16:49

@ demenvil
Salut!
Je vais essayer ton truc mais du coup je vois que t'as oublié de mettre les labels en premier temps
Bonne continuation,
A+
Revenir en haut Aller en bas
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 16:52

Salut demenvil.

En jetant un rapide coup d’œil sur ton programme, je constate que tu n’as pas déclaré les labels de tes sous-programmes : ainsi le programme ne fonctionne pas.

Il faut ajouter cette ligne, au tout début du programme, par exemple en ligne 3
Code:

label go_dev,go_console,go_ftp,go_tools ,go_extra_bonus

En suite il n’ya pas d’instruction END, ce qui fait que le programme va se poursuivre et il y aura une erreur ‘RETURN WITHOUT GOSUB’
Il faut donc ajouter End juste avant le sous-programme go_dev
lol!


A+
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/ En ligne
demenvil

demenvil


Nombre de messages : 171
Age : 34
Localisation : France Marseille
Date d'inscription : 30/06/2012

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 16:55

Oui oui Smile
Je sais tous cela Smile
C'est la portion de code de mon système chez moi j'ai tous ^^ les label, le end etc..
Ah oui pour votre form 0 il lui faut une largeur de 1024 et une hauteur de 600.

Je vais rajouter ces infos pour les autres.

Merci
Revenir en haut Aller en bas
http://www.newsd3v.com
topmozika

topmozika


Nombre de messages : 79
Age : 62
Localisation : Antananarivo - Madagascar
Date d'inscription : 09/06/2012

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 17:50

@demenvil
Je pense que c'est plus esthétique si on utilise les onglets du windows par MAIN_MENU et les SUB_MENU.
A toi de voir
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12293
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 18:39

Regarde mon pseudo-objet TAB. Il fait exactement ce qu'un attend d'un TAB:
- cliquer sur un onglet affiche cet onglet
- attacher n'importe quel objet à un onglet, y compris un autre objet TAB ayant lui-même des onglets
- avoir des onglets inactifs alors que d'autres restent actifs
- pouvoir choisir la couleur de chaque onglet
- avoir un évènement permettant de savoir qu'on change d'onglet

Voici le programme de démo:
Code:
' tab tool

' ===================== ligne à insérer au début du programme
label TAB_function, TAB_err : dim TAB_params$
label GLIST_function, GLIST_err : dim GLIST_params$
' ===================== fin d'insertion au début du programme

height 0,600

TAB_params$ = "Create|N=20|H=200|W=400|T=40|L=90|O=5|"
gosub TAB_function

TAB_params$ = "Mode|silent|"
gosub TAB_function

TAB_params$ = "Font|N=20|F=Arial Black|A=BI|"
gosub TAB_function

TAB_params$ = "Tab_font|N=20|O=3|F=Arial|A=U|"
gosub TAB_function

TAB_params$ = "Create|N=30|H=200|W=500|T=250|L=50|O=9|"
gosub TAB_function

TAB_params$ = "Color|N=30|R=255|G=255|B=0|"
gosub TAB_function

' TAB_params$ = "Tab_color|N=30|O=5|R=0|G=0|B=255|"
TAB_params$ = "Tab_color|N=30|O=5|R=78|G=190|B=230|"
gosub TAB_function

TAB_params$ = "Tab_inactive|N=30|O=6|"
gosub TAB_function

TAB_params$ = "Create|N=40|H=100|W=300|T=10|L=150|O=3|"
gosub TAB_function

' ----------- les 5 lignes suivantes sont remplacées
' TAB_params$ = "Object_add|N=30|O=5|P=40"
' gosub TAB_function
'
' TAB_params$ = "Object_add|N=30|O=5|P=41"
' gosub TAB_function
' ------------ ces deux lignes:
TAB_params$ ="TAB_add|N=30|O=5|P=40"
gosub TAB_function
' ------------ fin de remplacement

alpha 100 : top 100,10 : left 100,10 : caption 100,"Onglet 1 alpha 1"
alpha 101 : top 101,30 : left 101,30 : caption 101,"Onglet 1 alpha 2"
alpha 102 : top 102,60 : left 102,10 : caption 102,"Onglet 3 alpha 3"

edit 300 : top 300,20 : left 300,20 : text 300,"Onglet 3 edit 1"
edit 301 : top 301,50 : left 301,20 : text 301,"Onglet 3 edit 2"
edit 302 : top 302,80 : left 302,20 : text 302,"O. 1 et 3 editg 3"


TAB_params$ = "Tab_label|N=20|O=3|L=Essai|"
gosub TAB_function

TAB_params$ = "Tab_label|N=20|O=4|L=Test|"
gosub TAB_function

' TAB_params$ = "Tab_insert|N=20|O=3|"
TAB_params$ = "Tab_insert|N=20|O=2|L=Insertion"
gosub TAB_function

TAB_params$ = "Object_add|N=20|O=1|P=100"
gosub TAB_function

TAB_params$ = "Object_add|N=20|O=1|P=101"
gosub TAB_function

TAB_params$ = "Object_add|N=20|O=3|P=102"
gosub TAB_function

TAB_params$ = "Tab_delete|N=20|O=2|"
gosub TAB_function

TAB_params$ = "Object_remove|N=20|O=1|P=100"
gosub TAB_function

TAB_params$ = "Object_add|N=30|O=3|P=300"
gosub TAB_function

TAB_params$ = "Object_add|N=30|O=3|P=301"
gosub TAB_function

TAB_params$ = "Object_add|N=30|O=1|P=302"
gosub TAB_function

TAB_params$ = "Object_add|N=30|O=3|P=302"
gosub TAB_function

TAB_params$ = "Tab_select|N=30|O=3|"
gosub TAB_function

TAB_params$ = "Event_on|N=30|"
gosub TAB_function

TAB_params$ = "Event_on|N=40|"
gosub TAB_function

' ajout Nardo26

GLIST_params$ = "Create|N=50|A=8|W=90|T=10|L=190|"
gosub GLIST_function                                      : ' créer la liste
color 51,220,220,220

TAB_params$ = "GLIST_add|N=20|O=3|P=50"
gosub TAB_function

GLIST_params$ = "Create|N=60|A=8|W=90|T=10|L=190|"
gosub GLIST_function                                      : ' créer la liste

TAB_params$ = "GLIST_add|N=30|O=3|P=60"
gosub TAB_function

end

' ============== fin application (ici, programme de démo)

#INCLUDE "TAB.bas"
#INCLUDE "GLIST.bas"


Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
demenvil

demenvil


Nombre de messages : 171
Age : 34
Localisation : France Marseille
Date d'inscription : 30/06/2012

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 18:40

Bah pour le programme que je suis en train de faire je ne vise pas du tout l'aspect graphique de la chose.

Mais surtout l'aspect pratique Smile

Merci quand même !

De plus tu verras quand je publirai que j'ai prévu un truc pour tous les goûts ! I love you cheers
Revenir en haut Aller en bas
http://www.newsd3v.com
Klaus

Klaus


Nombre de messages : 12293
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 18:41

(suite du message précédent)

Voici l'objet TAB:
Code:
' ############# ici, le #INCLUDE TAB.bas contenant tout ce qui suit #########
' =============================================================================
' Gestion de TAB's
' Auteur: Klaus
' ===================== ligne à insérer au début du programme
' label TAB_function, TAB_err : dim TAB_params$
' ===================== fin d'insertion au début du programme

' =============== dipatching des fonctions ====================================
top 0,message_error_OK("TAB: on ne peut pas executer ce module directement !")
terminate
TAB_function:
on_error_goto TAB_err
label TAB_create
off_error_goto
if left$(TAB_params$,7)="Create|"
    label TAB_mode, TAB_create_err1, TAB_click_tab, TAB_change, TAB_label
    label TAB_insert, TAB_dessiner_tabs, TAB_dessiner_page, TAB_delete
    label TAB_add, TAB_remove, TAB_aff_objet, TAB_select, TAB_color
    label TAB_SearchParam, TAB_param_value, TAB_param_string_value
    label TAB_tab_color, TAB_count_object, TAB_event_on, TAB_event_off
    label TAB_onglet_choisi, TAB_active, TAB_inactive, TAB_font, TAB_tab_font
    label TAB_print_attributs, TAB_GLIST_add, TAB_TAB_add, TAB_add_x
    label TAB_add_err1, TAB_add_err2, TAB_aff_objet_err, TAB_aff_objet_err2
    label TAB_change_err, TAB_remove_err1
    dim TAB_debug%
    dim TAB_result%, TAB_active%(20,20), TAB_font$(20,1), TAB_font_onglets$(20,40)
    dim TAB_par$(10,1), TAB_LstFct$, TAB_p$, tab_zz%, TAB_xt%
    dim TAB_numero_objet%, TAB_n_onglets%(20), TAB_m%, TAB_result$
    dim TAB_top%(20), TAB_left%(20), TAB_hauteur%(20), TAB_largeur%(20), TAB_l%
    dim TAB_i%, TAB_n%, TAB_s$, TAB_v%, TAB_v$, TAB_j%, TAB_nr%(20), TAB_code%
    dim TAB_error_mode%, TAB_err%, TAB_onglet%(20), TAB_ancien_onglet%(20), TAB_index%
    dim TAB_n_tabs%, TAB_liste_tabs%(20), TAB_xx%, TAB_yy%, TAB_do_aff%, TAB_k%
    dim TAB_events%(20), TAB_etiq_onglets$(20,20), TAB_type_objet%
    dim TAB_liste_objets%(20,420)  : ' (i,o)=nombre d'objets onglet o  (i,o*20+n)=nième numéro d'objet onglet o
    dim  TAB_color_onglets%(20,84)  : ' (i,o*4)=x  (i,o*4+1)=R  (i,o*4+2)=G  (i,o*4+3)=B
    '                                        x=1: utiliser RGB onglet  x=0: utiliser RBG objet TAB
    '                                        pour o=zéro : valeurs RBG de l'objet TAB
    dim TAB_type_objets%(20,420)    : ' (i,o*20+n) = type de l'objet n onglet o TAB i
    '                                        type=1: normal Panoramic  type=2: objet TAB  type=3: objet GLIST
    '                                        type=0: objet dépendant d'un TAB ou d'un GLIST
    TAB_LstFct$ =              "CREATE|.......MODE|.........TAB_LABEL|....TAB_INSERT|..."
    TAB_LstFct$ = TAB_LstFct$ + "TAB_DELETE|...TAB_SELECT|...OBJECT_ADD|...OBJECT_REMOVE|"
    TAB_LstFct$ = TAB_LstFct$ + "COLOR|........TAB_COLOR|....EVENT_ON|.....EVENT_OFF|...."
    TAB_LstFct$ = TAB_LstFct$ + "TAB_ACTIVE|...TAB_INACTIVE|.FONT|.........TAB_FONT|....."
    TAB_LstFct$ = TAB_LstFct$ + "GLIST_ADD|....TAB_ADD|......"
end_if
TAB_err:
off_error_goto
gosub TAB_SearchParam
TAB_n% = int((instr(TAB_LstFct$,upper$(TAB_par$(0,0)))+13)/14 )
select TAB_n%
    case 1: goto TAB_create
    case 2: goto TAB_mode
    case 3: goto TAB_label
    case 4: goto TAB_insert
    case 5: goto TAB_delete
    case 6: goto TAB_select
    case 7: goto TAB_add
    case 8: goto TAB_remove
    case 9: goto TAB_color
    case 10: goto TAB_tab_color
    case 11: goto TAB_event_on
    case 12: goto TAB_event_off
    case 13: goto TAB_active
    case 14: goto TAB_inactive
    case 15: goto TAB_font
    case 16: goto TAB_tab_font
    case 17: goto TAB_GLIST_add
    case 18: goto TAB_TAB_add
end_select
TAB_params$ = "TAB: commande invalide "+left$(TAB_params$,15)
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return
TAB_create_err1:
off_error_goto
TAB_params$ = "TAB: problème avec numéro d'objet " + str$(TAB_numero_objet%)
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return

'=============== configurer le mode de fonctionnement =========================
' Syntaxe: TAB_params$ = "Mode|opt_1|...|opt_n|"
'        options: silent  verbose
TAB_mode:
if TAB_par$(1,0)="silent" then TAB_error_mode% = 0
if TAB_par$(1,0)="verbose" then TAB_error_mode% = 1
return

'=============== création des objets ==========================================================
' syntaxe: TAB_params$ = "Create|N=20|H=300|W=400|T=160|L=90|O=3|"
TAB_create:
if TAB_n_tabs%=20
    TAB_params$ = "TAB: trop d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if

TAB_p$ = "N"
gosub TAB_param_value
if TAB_result%>-1
    TAB_n% = TAB_result%
    on_error_goto TAB_create_err1
    picture TAB_n%+1
    picture TAB_n%
    off_error_goto
    TAB_numero_objet% = TAB_n%
    print_target_is TAB_numero_objet%
    on_click TAB_numero_objet%,TAB_click_tab
    TAB_n_tabs% = TAB_n_tabs% + 1
    TAB_index% = TAB_n_tabs%
    TAB_liste_tabs%(TAB_n_tabs%) = TAB_numero_objet%
    TAB_n_onglets%(TAB_n_tabs%) = 1
    TAB_liste_objets%(TAB_n_tabs%,1) = 0
    TAB_onglet%(TAB_index%) = 1              : ' par défaur: onglet actuel est 1
    TAB_ancien_onglet%(TAB_index%) = 1      : ' par défaut: ancien onglet est onglet 1
    TAB_color_onglets%(TAB_index%,0) = 0    : ' pour objet TAB
    TAB_color_onglets%(TAB_index%,1) = 255
    TAB_color_onglets%(TAB_index%,2) = 255
    TAB_color_onglets%(TAB_index%,3) = 255
    TAB_color_onglets%(TAB_index%,4) = 0    : ' pour onglet 1
    TAB_color_onglets%(TAB_index%,5) = 255
    TAB_color_onglets%(TAB_index%,6) = 255
    TAB_color_onglets%(TAB_index%,7) = 255
    TAB_events%(TAB_index%) = 0              : ' pas d'évènement
    TAB_active%(TAB_index%,1) = 1            : ' onglet 1 actif
    TAB_font$(TAB_index%,0) = "Arial"
    TAB_font$(TAB_index%,1) = ""
end_if

TAB_p$ = "H"
gosub TAB_param_value
if TAB_result%>-1
    if TAB_result%>0 then TAB_hauteur%(TAB_index%) = TAB_result%
end_if

TAB_p$ = "L"
gosub TAB_param_value
if TAB_result%>-1
    if TAB_result%>0 then TAB_left%(TAB_index%) = TAB_result%
end_if

TAB_p$ = "T"
gosub TAB_param_value
if TAB_result%>-1
    if TAB_result%>0 then TAB_top%(TAB_index%) = TAB_result%
end_if

TAB_p$ = "W"
gosub TAB_param_value
if TAB_result%>-1
    if TAB_result%>0 then TAB_largeur%(TAB_index%) = TAB_result%
end_if

TAB_p$ = "O"
gosub TAB_param_value
if TAB_result%>-1
    if TAB_result%>0 then TAB_n_onglets%(TAB_index%) = TAB_result%
else
    TAB_result% = 1
end_if
for TAB_i%=1 to TAB_result%
    TAB_etiq_onglets$(TAB_index%,TAB_i%) = str$(TAB_i%)
    TAB_color_onglets%(TAB_index%,TAB_i%*4) = 0
    TAB_color_onglets%(TAB_index%,TAB_i%*4+1) = 255
    TAB_color_onglets%(TAB_index%,TAB_i%*4+2) = 255
    TAB_color_onglets%(TAB_index%,TAB_i%*4+3) = 255
    TAB_active%(TAB_index%,TAB_i%) = 1
    TAB_font_onglets$(TAB_index%,(TAB_i%-1)*2+1) = ""
    TAB_font_onglets$(TAB_index%,(TAB_i%-1)*2+2) = ""
next TAB_i%
TAB_onglet%(TAB_index%) = 1

gosub TAB_dessiner_tabs
gosub TAB_dessiner_page
return

' syntaxe: TAB_params$ = "Tab_label|N=20|O=3|L=xxxxxxx|"
TAB_label:
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>0
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_index% = TAB_i%
            TAB_p$ = "O"
            gosub TAB_param_value
            TAB_n% = TAB_result%
            if TAB_n%>0 and TAB_n%<=TAB_n_onglets%(TAB_index%)
                TAB_p$ = "L"
                gosub TAB_param_string_value
                TAB_s$ = TAB_result$
                print_target_is TAB_liste_tabs%(TAB_index%)
                print_locate (TAB_n%-1)*int(TAB_largeur%(TAB_index%)/TAB_n_onglets%(TAB_index%)),5
                TAB_etiq_onglets$(TAB_index%,TAB_n%) = TAB_s$
                gosub TAB_print_attributs
                print TAB_s$
            end_if
            return
        end_if
    next TAB_i%
    TAB_params$ = "TAB: onglet non défini"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return

' syntaxe: TAB_params$ = "Tab_insert|N=20|O=3|L=xxxxxxx|"
TAB_insert:
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>0
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_numero_objet% = TAB_n%
            TAB_index% = TAB_i%
            TAB_p$ = "O"
            gosub TAB_param_value
            TAB_n% = TAB_result%
            if TAB_n%>=0 and TAB_n%<=TAB_n_onglets%(TAB_index%)
                TAB_s$ = "<Nouveau>"
                if TAB_n%<TAB_n_onglets%(TAB_index%)
                    for TAB_j%=TAB_n_onglets%(TAB_index%) to TAB_n%+1 step -1
                        TAB_etiq_onglets$(TAB_index%,TAB_j%+1) = TAB_etiq_onglets$(TAB_index%,TAB_j%)
                        TAB_font_onglets$(TAB_index%,(TAB_j%-1)*2+2+2) = TAB_font_onglets$(TAB_index%,(TAB_j%-1)*2+2)
                        TAB_font_onglets$(TAB_index%,(TAB_j%-1)*2+2+1) = TAB_font_onglets$(TAB_index%,(TAB_j%-1)*2+1)
                        if TAB_liste_objets%(TAB_index%,TAB_j%)>0
                            for TAB_k%=1 to TAB_liste_objets%(TAB_index%,TAB_j%)
                                TAB_liste_objets%(TAB_index%,(TAB_j%+1)*20+TAB_k%) = TAB_liste_objets%(TAB_index%,TAB_j%*20+TAB_k%)
                                TAB_type_objets%(TAB_index%,(TAB_j%+1)*20+TAB_k%) = TAB_type_objets%(TAB_index%,TAB_j%*20+TAB_k%)
                            next TAB_k%
                        end_if
                        TAB_liste_objets%(TAB_index%,TAB_j%+1) = TAB_liste_objets%(TAB_index%,TAB_j%)
                        TAB_type_objets%(TAB_index%,TAB_j%+1) = TAB_type_objets%(TAB_index%,TAB_j%)  : ' pour usage futur
                        TAB_active%(TAB_index%,TAB_j%+1) = TAB_active%(TAB_index%,TAB_j%)
                    next TAB_j%
                    for TAB_j%=TAB_n_onglets%(TAB_index%)*4 to TAB_n%*4 step -1
                        TAB_color_onglets%(TAB_index%,TAB_j%+3) = TAB_color_onglets%(TAB_index%,TAB_j%-1)
                    next TAB_j%
                end_if
                TAB_color_onglets%(TAB_index%,TAB_n%*4) = 0
                TAB_color_onglets%(TAB_index%,TAB_n%*4+1) = 255
                TAB_color_onglets%(TAB_index%,TAB_n%*4+2) = 255
                TAB_color_onglets%(TAB_index%,TAB_n%*4+3) = 255
                TAB_liste_objets%(TAB_index%,TAB_n%) = 0
                TAB_type_objets%(TAB_index%,TAB_n%) = 0
                TAB_n_onglets%(TAB_index%) = TAB_n_onglets%(TAB_index%) + 1
                TAB_active%(TAB_index%,TAB_n%+1) = 1
                TAB_p$ = "L"
                gosub TAB_param_string_value
                TAB_etiq_onglets$(TAB_index%,TAB_n%+1) = TAB_result$
                TAB_font_onglets$(TAB_index%,TAB_n%*2+1) = ""
                TAB_font_onglets$(TAB_index%,TAB_n%*2+2) = ""
                gosub TAB_dessiner_tabs
                return
            end_if
      end_if
    next TAB_i%
    TAB_params$ = "TAB: onglet non défini"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return

' syntaxe: TAB_params$ = "Tab_delete|N=20|O=3|"
TAB_delete:
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>0
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_numero_objet% = TAB_n%
            TAB_index% = TAB_i%
            TAB_p$ = "O"
            gosub TAB_param_value
            TAB_n% = TAB_result%
            if TAB_n%>0 and TAB_n%<=TAB_n_onglets%(TAB_index%)
                if TAB_n%<TAB_n_onglets%(TAB_index%)
                    for TAB_j%=TAB_n% to TAB_n_onglets%(TAB_index%)-1
                        TAB_etiq_onglets$(TAB_index%,TAB_j%) = TAB_etiq_onglets$(TAB_index%,TAB_j%+1)
                        TAB_font_onglets$(TAB_index%,(TAB_j%-1)*2+1) = TAB_font_onglets$(TAB_index%,(TAB_j%-1)*2+2+1)
                        TAB_font_onglets$(TAB_index%,(TAB_j%-1)*2+2) = TAB_font_onglets$(TAB_index%,(TAB_j%-1)*2+2+2)
                        if TAB_liste_objets%(TAB_index%,TAB_j%+1)>0
                            for TAB_k%=1 to TAB_liste_objets%(TAB_index%,TAB_j%+1)
                                TAB_liste_objets%(TAB_index%,TAB_j%*20+TAB_k%) = TAB_liste_objets%(TAB_index%,(TAB_j%+1)*20+TAB_k%)
                                TAB_type_objets%(TAB_index%,TAB_j%*20+TAB_k%) = TAB_type_objets%(TAB_index%,(TAB_j%+1)*20+TAB_k%)
                            next TAB_k%
                        end_if
                        TAB_liste_objets%(TAB_index%,TAB_j%) = TAB_liste_objets%(TAB_index%,TAB_j%+1)
                        TAB_type_objets%(TAB_index%,TAB_j%) = TAB_type_objets%(TAB_index%,TAB_j%+1)  : ' pour usage futur
                        TAB_active%(TAB_index%,TAB_j%) = TAB_active%(TAB_index%,TAB_j%+1)
                    next TAB_j%
                    for TAB_j%=TAB_n%*4 to (TAB_n_onglets%(TAB_index%)-1)*4-1
                        TAB_color_onglets%(TAB_index%,TAB_j%) = TAB_color_onglets%(TAB_index%,TAB_j%+4)
                    next TAB_j%
                end_if
                TAB_n_onglets%(TAB_index%) = TAB_n_onglets%(TAB_index%) - 1
                gosub TAB_dessiner_tabs
                return
            end_if
        end_if
    next TAB_i%
    TAB_params$ = "TAB: onglet non défini"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return

' syntaxe: TAB_params$ = "Tab_select|N=20|O=3|"
TAB_select:
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>1
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_numero_objet% = TAB_n%
            TAB_index% = TAB_i%
            TAB_p$ = "O"
            gosub TAB_param_value
            TAB_n% = TAB_result%
            if TAB_n%>0 and TAB_n%<=TAB_n_onglets%(TAB_index%)
                if TAB_n%=TAB_onglet%(TAB_index%) then return
                if TAB_active%(TAB_index%,TAB_n%)=0 then return
                TAB_ancien_onglet%(TAB_index%) = TAB_onglet%(TAB_index%)
                TAB_onglet%(TAB_index%) = TAB_n%
                gosub TAB_change
                return
            end_if
        end_if
    next TAB_i%
    TAB_params$ = "TAB: onglet non défini"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return

' syntaxe: TAB_params$ = "GLIST_add|N=20|O=3|P=17"
TAB_GLIST_add:
TAB_type_objet% = 3
goto TAB_add_x

' syntaxe: TAB_params$ = "TAB_add|N=20|O=3|P=17"
TAB_TAB_add:
TAB_type_objet% = 2
goto TAB_add_x

' syntaxe: TAB_params$ = "Object_add|N=20|O=3|P=17"
TAB_add:
TAB_type_objet% = 1
TAB_add_x:
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>0
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_numero_objet% = TAB_n%
            TAB_index% = TAB_i%
            TAB_p$ = "O"
            gosub TAB_param_value
            TAB_n% = TAB_result%
            if (TAB_n%>0) and ((TAB_liste_objets%(TAB_index%,TAB_n%) + TAB_type_objet%)<=20)
                TAB_p$ = "P"
                gosub TAB_param_value
                TAB_v% = TAB_result%
                TAB_j% = TAB_liste_objets%(TAB_index%,TAB_n%)  : ' nombre d'objets pour cet onglet
                if TAB_j%>0
                    for TAB_k%=1 to TAB_j%
                        if TAB_liste_objets%(TAB_index%,TAB_n%*20+TAB_k%)=TAB_v% then return : ' déjà membre ?
                    next TAB_k%
                end_if
                TAB_xt% = TAB_type_objet%
                if TAB_type_objet%=2
                    for TAB_j%=1 to TAB_n_tabs%
                        if TAB_liste_tabs%(TAB_j%)=TAB_v%
                            TAB_top%(TAB_j%) = TAB_top%(TAB_j%) + TAB_top%(TAB_index%) + 22
                            TAB_left%(TAB_j%) = TAB_left%(TAB_j%) + TAB_left%(TAB_index%)
                            exit_for
                        end_if
                    next TAB_j%
                end_if
                gosub TAB_count_object
                repeat
                    TAB_liste_objets%(TAB_index%,TAB_n%) = TAB_liste_objets%(TAB_index%,TAB_n%) + 1
                    TAB_liste_objets%(TAB_index%,TAB_n%*20+TAB_liste_objets%(TAB_index%,TAB_n%)) = TAB_v%  : ' mémoriser l'objet
                    if TAB_type_objet%=TAB_xt%
                        TAB_type_objets%(TAB_index%,TAB_n%*20+TAB_liste_objets%(TAB_index%,TAB_n%)) = TAB_type_objet%
                    else
                        TAB_type_objets%(TAB_index%,TAB_n%*20+TAB_liste_objets%(TAB_index%,TAB_n%)) = 0
                    end_if
                    if TAB_result%=0      : ' objet pas encode dans un TAB ?
                        on_error_goto TAB_add_err1
                        hide TAB_v%
                        TAB_j% = top(TAB_v%)
                        top TAB_v%,TAB_j% + TAB_top%(TAB_index%) + 22
                        TAB_j% = left(TAB_v%)
                        left TAB_v%,TAB_j% + TAB_left%(TAB_index%)
TAB_add_err1:
                        off_error_goto
                    end_if
                    on_error_goto TAB_add_err2
                    hide TAB_v%
TAB_add_err2:
                    off_error_goto
                    TAB_v% = TAB_v% + 1
                    TAB_xt% = TAB_xt% - 1
                until TAB_xt% = 0
                TAB_result% = 1
                for TAB_zz%=1 to TAB_n_tabs%
                    for TAB_yy%=1 to TAB_n_onglets%(TAB_zz%)
                        if TAB_liste_objets%(TAB_zz%,TAB_yy%)>0
                            for TAB_xx%=1 to TAB_liste_objets%(TAB_zz%,TAB_yy%)
                                if TAB_liste_objets%(TAB_zz%,TAB_yy%*20+TAB_xx%)=TAB_numero_objet%
                                    if TAB_onglet%(TAB_zz%)<>TAB_yy% then TAB_result% = 0
                                end_if
                            next TAB_xx%
                        end_if
                    next TAB_yy%
                next TAB_zz%
                if TAB_n%<>TAB_onglet%(TAB_index%) then TAB_result% = 0
                if TAB_result%=1
                    TAB_do_aff% = 1
                    gosub TAB_dessiner_tabs
                end_if
                return
            end_if
        end_if
    next TAB_i%
    TAB_params$ = "TAB: onglet non défini"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return

TAB_remove:
' syntaxe: TAB_params$ = "Tab_remove|N=20|O=3|P=17"
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>0
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_numero_objet% = TAB_n%
            TAB_index% = TAB_i%
            TAB_p$ = "O"
            gosub TAB_param_value
            TAB_n% = TAB_result%
            if TAB_n%>0 and TAB_n%<=TAB_n_onglets%(TAB_index%)
                TAB_p$ = "P"
                gosub TAB_param_value
                TAB_v% = TAB_result%
                TAB_j% = TAB_liste_objets%(TAB_index%,TAB_n%)  : ' nombre d'objets pour cet onglet
                if TAB_j%>0
                    for TAB_k%=1 to TAB_j%
                        if TAB_liste_objets%(TAB_index%,TAB_n%*20+TAB_k%)=TAB_v% : ' trouvé ?
                            if TAB_type_objets%(TAB_index%,TAB_n%*20+TAB_k%)=0 then return  : ' sous-type de TAB ou GLIST ?
                            gosub TAB_count_object
                            TAB_xx% = TAB_type_objets%(TAB_index%,TAB_n%*20+TAB_k%)
                            repeat
                                if TAB_result%=1
                                    on_error_goto TAB_remove_err1
                                    TAB_m% = top(TAB_v%)
                                    top TAB_v%,TAB_m% - TAB_top%(TAB_index%) - 22
                                    TAB_m% = left(TAB_v%)
                                    left TAB_v%,TAB_m% - TAB_left%(TAB_index%)
TAB_remove_err1:
                                    off_error_goto
                                end_if
                                if TAB_k%<TAB_liste_objets%(TAB_index%,TAB_n%)
                                    for TAB_l%=TAB_k% to TAB_liste_objets%(TAB_index%,TAB_n%) - 1
                                        TAB_liste_objets%(TAB_index%,TAB_n%*20+tab_l%) = TAB_liste_objets%(TAB_index%,TAB_n%*20+tab_l%+1)
                                        TAB_type_objets%(TAB_index%,TAB_n%*20+tab_l%) = TAB_type_objets%(TAB_index%,TAB_n%*20+tab_l%+1)
                                    next TAB_l%
                                end_if
                                TAB_v% = TAB_v% + 1
                                TAB_xx% = TAB_xx% - 1
                            until TAB_xx%=0
                            TAB_liste_objets%(TAB_index%,TAB_n%) = TAB_liste_objets%(TAB_index%,TAB_n%) - 1
                            TAB_type_objets%(TAB_index%,TAB_n%) = TAB_type_objets%(TAB_index%,TAB_n%) - 1    : ' pour usage futur
                            TAB_do_aff% = 1
                            gosub TAB_dessiner_tabs
                            return
                        end_if
                    next TAB_k%
                end_if
            end_if
        end_if
    next TAB_i%
    TAB_params$ = "TAB: onglet non défini"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return

' définir la couleur de la page d'affichage globalement pour l'objet TAB
TAB_color:
' syntaxe: TAB_params$ = "Color|N=20|R=255|G=255|B=0|"
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>0
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_numero_objet% = TAB_n%
            TAB_index% = TAB_i%
            TAB_p$ = "R"
            gosub TAB_param_value
            if TAB_result%=-1 then TAB_result% = 255
            TAB_par$(0,0) = str$(TAB_result%)
            TAB_p$ = "G"
            gosub TAB_param_value
            if TAB_result%=-1 then TAB_p=result% = 255
            TAB_par$(0,1) = str$(TAB_result%)
            TAB_p$ = "B"
            gosub TAB_param_value
            if TAB_result%=-1 then TAB_result% = 255
            TAB_par$(1,0) = str$(TAB_result%)
            TAB_color_onglets%(TAB_index%,0) = 0
            TAB_color_onglets%(TAB_index%,1) = val(TAB_par$(0,0))
            TAB_color_onglets%(TAB_index%,2) = val(TAB_par$(0,1))
            TAB_color_onglets%(TAB_index%,3) = val(TAB_par$(1,0))
            if TAB_color_onglets%(TAB_index%,TAB_onglet%(TAB_index%)*4)=0
                color TAB_numero_objet%+1,TAB_color_onglets%(TAB_index%,1),TAB_color_onglets%(TAB_index%,2),TAB_color_onglets%(TAB_index%,3)
                gosub TAB_dessiner_tabs
                return
            end_if
        end_if
    next TAB_i%
    TAB_params$ = "TAB: onglet non défini"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return

' définir la couleur de la page d'affichage pour un onglet spécifique
TAB_tab_color:
' syntaxe: TAB_params$ = "Tab_color|N=20|O=30|R=255|G=255|B=0|"
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>0
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_numero_objet% = TAB_n%
            TAB_index% = TAB_i%
            TAB_p$ = "O"
            gosub TAB_param_value
            TAB_v% = TAB_result%
            if (TAB_v%>0) and (TAB_V%<=TAB_n_onglets%(TAB_index%))
                TAB_p$ = "R"
                gosub TAB_param_value
                if TAB_result%=-1 then TAB_result% = 255
                TAB_par$(0,0) = str$(TAB_result%)
                TAB_p$ = "G"
                gosub TAB_param_value
                if TAB_result%=-1 then TAB_result% = 255
                TAB_par$(0,1) = str$(TAB_result%)
                TAB_p$ = "B"
                gosub TAB_param_value
                if TAB_result%=-1 then TAB_result% = 255
                TAB_par$(1,0) = str$(TAB_result%)
                TAB_i% = TAB_v%*4
                TAB_color_onglets%(TAB_index%,TAB_i%) = 1
                TAB_color_onglets%(TAB_index%,TAB_i%+1) = val(TAB_par$(0,0))
                TAB_color_onglets%(TAB_index%,TAB_i%+2) = val(TAB_par$(0,1))
                TAB_color_onglets%(TAB_index%,TAB_i%+3) = val(TAB_par$(1,0))
                if TAB_onglet%(TAB_index%)=TAB_v% then color TAB_numero_objet%+1,TAB_color_onglets%(TAB_index%,TAB_i%+1),TAB_color_onglets%(TAB_index%,TAB_i%+2),TAB_color_onglets%(TAB_index%,TAB_i%+3)
                gosub TAB_dessiner_tabs
                return
            end_if
        end_if
    next TAB_i%
    TAB_params$ = "TAB: onglet non défini"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return

' activer une routine évènement sur changement d'onglet
TAB_event_on:
' syntaxe: TAB_params$ = "Event_on|N=20|"
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>0
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_events%(TAB_i%) = 1
        end_if
    next TAB_i%
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return

' désactiver une routine évènement sur changement d'onglet
TAB_event_off:
' syntaxe: TAB_params$ = "Event_off|N=20|"
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>0
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_events%(TAB_i%) = 0
        end_if
    next TAB_i%
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return

' activer un onglet d'un objet TAB
TAB_active:
' syntaxe: TAB_params$ = "Tab_active|N=20|O=3|"
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>0
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_p$ = "O"
            gosub TAB_param_value
            if (TAB_result%>0) and (TAB_result%<=TAB_n_onglets%(TAB_n%))
                TAB_active%(TAB_i%,TAB_result%) = 1
                gosub TAB_dessiner_tabs
                return
            end_if
        end_if
    next TAB_i%
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return

' désactiver un onglet d'un objet TAB
TAB_inactive:
' syntaxe: TAB_params$ = "Tab_active|N=20|O=3|"
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>0
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_p$ = "O"
            gosub TAB_param_value
            if (TAB_result%>0) and (TAB_result%<=TAB_n_onglets%(TAB_i%))
                TAB_active%(TAB_i%,TAB_result%) = 0
                gosub TAB_dessiner_tabs
                return
            end_if
        end_if
    next TAB_i%
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return

' choisir police et attributs des libellés des onglets d'un objet TAB
TAB_font:
' syntaxe: TAB_params$ = "Font|N=20|F=xxxxx"|A=xxx|"
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>0
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_index% = TAB_i%
            TAB_numero_objet% = TAB_liste_tabs%(TAB_index%)
            TAB_p$ = "F"
            gosub TAB_param_string_value
            TAB_font$(TAB_index%,0) = TAB_result$  : ' font_name
            TAB_p$ = "A"
            gosub TAB_param_string_value
            TAB_font$(TAB_index%,1) = TAB_result$    : ' BIU
            font_name TAB_numero_objet%,TAB_font$(TAB_index%,0)
            gosub TAB_dessiner_tabs
            return
        end_if
    next TAB_i%
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
return


' choisir police et attributs des libellés d'un onglet
TAB_tab_font:
' syntaxe: TAB_params$ = "Tab_font|N=20|O=3|F=xxxxx"|A=xxx|"
if TAB_n_tabs%=0
    TAB_params$ = "TAB: pas d'objets TAB"
    if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
    return
end_if
TAB_p$ = "N"
gosub TAB_param_value
TAB_n% = TAB_result%
if TAB_n%>0
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_liste_tabs%(TAB_i%)=TAB_n%
            TAB_index% = TAB_i%
            TAB_numero_objet% = TAB_liste_tabs%(TAB_index%)
            TAB_p$ = "O"
            gosub TAB_param_value
            TAB_n% = TAB_result%
            TAB_p$ = "F"
            gosub TAB_param_string_value
            TAB_font_onglets$(TAB_index%,(TAB_n%-1)*2+1) = TAB_result$  : ' font_name
            TAB_p$ = "A"
            gosub TAB_param_string_value
            TAB_font_onglets$(TAB_index%,(TAB_n%-1)*2+2) = TAB_result$    : ' BIU
            gosub TAB_dessiner_tabs
            return
        end_if
    next TAB_i%
end_if
TAB_params$ = "TAB: objet TAB non défini"
if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
€return




' *************** routines de service

TAB_click_tab:
    TAB_n% = number_click
    for TAB_i%=1 to TAB_n_tabs%
        if TAB_n%=TAB_liste_tabs%(TAB_i%)
            TAB_index% = TAB_i%
            TAB_numero_objet% = TAB_liste_tabs%(TAB_index%)
            2d_target_is TAB_numero_objet%
            print_target_is TAB_numero_objet%
            TAB_xx% = mouse_x_left_down(TAB_numero_objet%)
            TAB_yy% = mouse_y_left_down(TAB_numero_objet%)
            TAB_n% = TAB_n_onglets%(TAB_index%)
            TAB_j% = int(TAB_largeur%(TAB_index%)/TAB_n%)
            TAB_v% = int( (TAB_xx%+TAB_j%-1) / tab_j% )
            if TAB_active%(TAB_index%,TAB_v%)=0 then return
            TAB_ancien_onglet%(TAB_index%) = TAB_onglet%(TAB_index%)
            TAB_onglet%(TAB_index%) = int( (TAB_xx%+TAB_j%-1) / tab_j% )
            if TAB_onglet%(TAB_index%)=TAB_ancien_onglet%(TAB_index%) then return
            gosub TAB_change
            TAB_params$ = "Tab "+str$(TAB_index%)+" Ancien onglet "+str$(TAB_ancien_onglet%(TAB_index%))+" Nouvel onglet "+str$(TAB_onglet%(TAB_index%))
            TAB_params$ = TAB_params$ + "="+TAB_etiq_onglets$(TAB_index%,(TAB_onglet%(TAB_index%)))
            if TAB_error_mode%=1 then TAB_err% = message_error_OK(TAB_params$)
            if TAB_events%(TAB_index%)=1 then gosub TAB_onglet_choisi
            return
        end_if
    next TAB_i%
    return


TAB_change:
' cacher les objets de l'ancien onglet
    if TAB_ancien_onglet%(TAB_index%)>0
        TAB_j% = TAB_liste_objets%(TAB_index%,TAB_ancien_onglet%(TAB_index%))
        if TAB_j%>0
            for TAB_i%=1 to TAB_j%
                on_error_goto TAB_change_err
                hide TAB_liste_objets%(TAB_index%,TAB_ancien_onglet%(TAB_index%)*20+TAB_i%)
TAB_change_err:
                off_error_goto
                for TAB_v%=1 to TAB_n_tabs%
                    if TAB_liste_objets%(TAB_index%,TAB_ancien_onglet%(TAB_index%)*20+TAB_i%)=TAB_liste_tabs%(TAB_v%)
                        if TAB_liste_objets%(TAB_v%,TAB_onglet%(TAB_v%))>0
                            for TAB_k%=1 to TAB_liste_objets%(TAB_v%,TAB_onglet%(TAB_v%))
                                hide TAB_liste_objets%(TAB_v%,TAB_onglet%(TAB_v%)*20+TAB_k%)
                            next TAB_k%
                        end_if
                        exit_for
                    end_if
                next TAB_v%
            next TAB_i%
        end_if
    end_if
' afficher les objets du nouvel onglet
    gosub TAB_aff_objet
' changer le graphisme
    TAB_j% = int(TAB_largeur%(TAB_index%)/TAB_n_onglets%(TAB_index%))
    2d_target_is TAB_numero_objet%
    2d_line 1,21,TAB_largeur%(TAB_index%)-1,21
    if TAB_color_onglets%(TAB_index%,TAB_onglet%(TAB_index%)*4)=1
        TAB_i% = TAB_onglet%(TAB_index%)*4
        color TAB_numero_objet%+1,TAB_color_onglets%(TAB_index%,TAB_i%+1),TAB_color_onglets%(TAB_index%,TAB_i%+2),TAB_color_onglets%(TAB_index%,TAB_i%+3)
    else
        color TAB_numero_objet%+1,TAB_color_onglets%(TAB_index%,1),TAB_color_onglets%(TAB_index%,2),TAB_color_onglets%(TAB_index%,3)
    end_if
    2d_pen_color color_pixel_red(TAB_numero_objet%+1,2,2),color_pixel_green(TAB_numero_objet%+1,2,2),color_pixel_blue(TAB_numero_objet%+1,2,2)
    2d_line (TAB_onglet%(TAB_index%)-1)*TAB_j%+1,21,TAB_onglet%(TAB_index%)*TAB_j%-1,21
    2d_flood (TAB_onglet%(TAB_index%)-1)*TAB_j%+5,5,color_pixel_red(TAB_numero_objet%+1,2,2),color_pixel_green(TAB_numero_objet%+1,2,2),color_pixel_blue(TAB_numero_objet%+1,2,2)
'    2d_flood (TAB_ancien_onglet%(TAB_index%)-1)*TAB_j%+5,5,220,220,220
    2d_pen_color 0,0,0
    gosub TAB_dessiner_page
    return

TAB_aff_objet:
    TAB_j% = TAB_liste_objets%(TAB_index%,TAB_onglet%(TAB_index%))
    if TAB_j%>0
        for TAB_i%=1 to TAB_j%
            on_error_goto TAB_aff_objet_err
            show TAB_liste_objets%(TAB_index%,TAB_onglet%(TAB_index%)*20+TAB_i%)
TAB_aff_objet_err:
            off_error_goto
                for TAB_v%=1 to TAB_n_tabs%
                    if TAB_liste_objets%(TAB_index%,TAB_onglet%(TAB_index%)*20+TAB_i%)=TAB_liste_tabs%(TAB_v%)
                        if TAB_liste_objets%(TAB_v%,TAB_onglet%(TAB_v%))>0
                            for TAB_k%=1 to TAB_liste_objets%(TAB_v%,TAB_onglet%(TAB_v%))
                                on_error_goto TAB_aff_objet_err2
                                show TAB_liste_objets%(TAB_v%,TAB_onglet%(TAB_v%)*20+TAB_k%)
TAB_aff_objet_err2:
                                off_error_goto
                            next TAB_k%
                        end_if
                        exit_for
                    end_if
                next TAB_v%
        next TAB_i%
    end_if
    TAB_do_aff% = 0
    return

' dessiner les TAB's
TAB_dessiner_tabs:
gosub TAB_dessiner_page
if TAB_do_aff%=1 then gosub TAB_aff_objet
2d_target_is TAB_numero_objet%
2d_fill_color 255,255,255
file_load TAB_numero_objet%,"TAB_vide.bmp"
height TAB_numero_objet%,22
top TAB_numero_objet%,TAB_top%(TAB_index%)
width TAB_numero_objet%,TAB_largeur%(TAB_index%)
left TAB_numero_objet%,TAB_left%(TAB_index%)
print_target_is TAB_numero_objet%
TAB_k% = TAB_n_onglets%(TAB_index%)
TAB_j% = int(TAB_largeur%(TAB_index%)/TAB_k%)
2d_poly_from 1,21
for TAB_i%=1 to TAB_k%
    2d_poly_to (TAB_i%-1)*TAB_j%+1,3
    2d_poly_to (TAB_i%-1)*TAB_j%+1+3,1
    if TAB_i%=TAB_k%
        2d_poly_to (TAB_i%-1)*TAB_j%+TAB_j%-2,1
        2d_poly_to TAB_largeur%(TAB_index%)-1,3
        2d_poly_to TAB_largeur%(TAB_index%)-1,21
    else
        2d_poly_to (TAB_i%-1)*TAB_j%+TAB_j%-3,1
        2d_poly_to (TAB_i%-1)*TAB_j%+TAB_j%-1,3
        2d_poly_to (TAB_i%-1)*TAB_j%+TAB_j%-1,21
        2d_poly_to (TAB_i%-1)*TAB_j%+TAB_j%+1,21
    end_if
next TAB_i%
2d_line 1,21,TAB_largeur%(TAB_index%)-1,21
if TAB_color_onglets%(TAB_index%,TAB_onglet%(TAB_index%)*4)=1
    TAB_i% = TAB_onglet%(TAB_index%)*4
    color TAB_numero_objet%+1,TAB_color_onglets%(TAB_index%,TAB_i%+1),TAB_color_onglets%(TAB_index%,TAB_i%+2),TAB_color_onglets%(TAB_index%,TAB_i%+3)
else
    color TAB_numero_objet%+1,TAB_color_onglets%(TAB_index%,1),TAB_color_onglets%(TAB_index%,2),TAB_color_onglets%(TAB_index%,3)
end_if
TAB_result% = TAB_result%  : ' pour éviter une violation d'accès...
2d_pen_color color_pixel_red(TAB_numero_objet%+1,2,2),color_pixel_green(TAB_numero_objet%+1,2,2),color_pixel_blue(TAB_numero_objet%+1,2,2)
2d_line (TAB_onglet%(TAB_index%)-1)*TAB_j%+1,21,TAB_onglet%(TAB_index%)*TAB_j%-1,21
2d_pen_color 0,0,0
for TAB_i%=1 to TAB_k%
    if TAB_active%(TAB_index%,TAB_i%)=1
        if TAB_color_onglets%(TAB_index%,TAB_i%*4)=1
            2d_flood (TAB_i%-1)*TAB_j%+3,3, TAB_color_onglets%(TAB_index%,TAB_i%*4+1),TAB_color_onglets%(TAB_index%,TAB_i%*4+2),TAB_color_onglets%(TAB_index%,TAB_i%*4+3)
        else
            2d_flood (TAB_i%-1)*TAB_j%+3,3, TAB_color_onglets%(TAB_index%,1), TAB_color_onglets%(TAB_index%,2), TAB_color_onglets%(TAB_index%,3)
        end_if
    else
        2d_flood (TAB_i%-1)*TAB_j%+3,3, 220,220,220
    end_if
    TAB_n% = TAB_i%
    gosub TAB_print_attributs
    print_locate (TAB_i%-1)*TAB_j%+3,5
    print TAB_etiq_onglets$(TAB_index%,TAB_i%)
next TAB_i%
gosub TAB_dessiner_page
return

' dessiner la page utile
TAB_dessiner_page:
2d_fill_color color_pixel_red(TAB_numero_objet%+1,2,3),color_pixel_green(TAB_numero_objet%+1,2,3),color_pixel_blue(TAB_numero_objet%+1,2,3)
height TAB_numero_objet%+1,TAB_hauteur%(TAB_index%) - 20
top TAB_numero_objet%+1,TAB_top%(TAB_index%)+20
width TAB_numero_objet%+1,TAB_largeur%(TAB_index%)
left TAB_numero_objet%+1,TAB_left%(TAB_index%)
2d_target_is TAB_numero_objet%+1
2d_fill_color color_pixel_red(TAB_numero_objet%+1,2,3),color_pixel_green(TAB_numero_objet%+1,2,3),color_pixel_blue(TAB_numero_objet%+1,2,3)
2d_rectangle 1,1,TAB_largeur%(TAB_index%),TAB_hauteur%(TAB_index%)-20
return

' analyse des paramètres par Nardo26
TAB_SearchParam:
  for TAB_i%=0 to 10:TAB_par$(TAB_i%,0)="":TAB_par$(TAB_i%,1)="":next TAB_i%
  TAB_par$(0,1)="0" : TAB_j% = 0
  for TAB_i%=1 to len(TAB_params$)
    if mid$(TAB_params$,TAB_i%,1)="|"
      TAB_par$(0,1)=str$(val(TAB_par$(0,1))+1)
      TAB_j%=0
    else
      if mid$(TAB_params$,TAB_i%,1)="="
        TAB_j%=1
      else
        TAB_par$(val(TAB_par$(0,1)),TAB_j%)=TAB_par$(val(TAB_par$(0,1)),TAB_j%)+mid$(TAB_params$,TAB_i%,1)
      end_if
    end_if
  next TAB_i%
  if RIGHT$(TAB_params$,1)="|"
    TAB_par$(0,1)=str$(val(TAB_par$(0,1))-1)
  end_if
return

' retourner un paramèetre numérique
TAB_param_value:
    for TAB_result%=1 to val(TAB_par$(0,1))
        if TAB_par$(TAB_result%,0)=TAB_p$
            TAB_result% = val(TAB_par$(TAB_result%,1))
            return
        end_if
    next TAB_result%
    TAB_result% = -1
    return
   
' retourner un paramètre string
TAB_param_string_value:
    for TAB_result%=1 to val(TAB_par$(0,1))
        if TAB_par$(TAB_result%,0)=TAB_p$
            TAB_result$ = TAB_par$(TAB_result%,1)
            return
        end_if
    next TAB_result%
    TAB_result$ = ""
    return

' compter le nombre d'affectation pour un objet Panoramic
TAB_count_object:
    TAB_result% = 0
    for TAB_zz%=1 to TAB_n_tabs%
        for TAB_yy%=1 to TAB_n_onglets%(TAB_zz%)
            if TAB_liste_objets%(TAB_zz%,TAB_yy%)>0
                for TAB_xx%=1 to TAB_liste_objets%(TAB_zz%,TAB_yy%)
                    if TAB_liste_objets%(TAB_zz%,TAB_yy%*20+TAB_xx%)=TAB_v% then TAB_result% = TAB_result% + 1
                next TAB_xx%
            end_if
        next TAB_yy%
    next TAB_zz%
    return
   
' déterminer les attributs pour écriture des libellés de l'onglet TAB_n%
TAB_print_attributs:
    if TAB_font_onglets$(TAB_index%,(TAB_n%-1)*2+1)=""
        font_name TAB_numero_objet%,TAB_font$(TAB_index%,0)
        if instr(TAB_font$(TAB_index%,1),"B" )>0
            font_bold TAB_numero_objet%
        else
            font_bold_off TAB_numero_objet%
        end_if
        if instr(TAB_font$(TAB_index%,1),"I" )>0
            font_italic TAB_numero_objet%
        else
            font_italic_off TAB_numero_objet%
        end_if
        if instr(TAB_font$(TAB_index%,1),"U" )>0
            font_underline TAB_numero_objet%
        else
            font_underline_off TAB_numero_objet%
        end_if
    else
        font_name TAB_numero_objet%,TAB_font_onglets$(TAB_index%,(TAB_n%-1)*2+1)
        if instr(TAB_font_onglets$(TAB_index%,(TAB_n%-1)*2+2),"B" )>0
            font_bold TAB_numero_objet%
        else
            font_bold_off TAB_numero_objet%
        end_if
        if instr(TAB_font_onglets$(TAB_index%,(TAB_n%-1)*2+2),"I" )>0
            font_italic TAB_numero_objet%
        else
            font_italic_off TAB_numero_objet%
        end_if
        if instr(TAB_font_onglets$(TAB_index%,(TAB_n%-1)*2+2),"U" )>0
            font_underline TAB_numero_objet%
        else
            font_underline_off TAB_numero_objet%
        end_if
    end_if
    return


' ===================== routine d'évènement on_change appelée en changement d'onglet
' Cette routine est appelée à chaque changement d'onglet, si elle a été activée
' par la fonction Event. Il suffit de copier cette routine dans le programme principal,
' après le #INCLUDE "TAB.bas" et de la mettre en commentaire dans TAB.bas.
' On peut alors adapter la routine aux besoins du programme. Lorsqu'elle est
' appelée, les variables suivantes sont disponibles:
'    TAB_numero_objet% - numero d'objet Panoramic de l'objet TAB dont un onglet a changé
'    TAB_index% - numéro d'ordre de création de l'objets TAB
'    TAB_onglets%(TAB_index%) - numéro de l'onglet activé
TAB_onglet_choisi:
    message "TAB "+str$(TAB_numero_objet%)+" Onglet "+str$(TAB_onglet%(TAB_index%))
    return

Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


Nombre de messages : 12293
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 18:41

(suite et fin du message précédent)
et voici l'objet GLIST utilisé dans la démo:
Code:
' ############# ici, le #INCLUDE GLIST.bas contenant tout ce qui suit #########
' =============================================================================
' Gestion de pseudo-listes synchronisables avec attributs grahiques (GLIST)
' Auteur: Klaus
' Idée originale: Nardo26
' Développé à l'aides des critiques constructives et précieuses de Cosmos70 et Nardo26
' ===================== ligne à insérer au début du programme
' label Glist_function, GLIST_err : dim GLIST_params$
' ===================== fin d'insertion au début du programme

' =============== dipatching des fonctions ====================================
top 0,message_error_OK("GLIST: on ne peut pas executer ce module directement !")
terminate
GLIST_function:
on_error_goto GLIST_err
label GLIST_create
off_error_goto
if left$(GLIST_params$,7)="Create|"
    label GLIST_attributs, GLIST_revelation, GLIST_file_load, GLIST_clear
    label GLIST_add, GLIST_delete, GLIST_insert, GLIST_selected, GLIST_total, GLIST_read
    label GLIST_target, GLIST_select, GLIST_display, GLIST_synchro_on, GLIST_synchro_off
    label GLIST_create_err1, GLIST_change, GLIST_changea, GLIST_changeb, GLIST_click_liste
    label GLIST_fin2, GLIST_print_line, GLIST_select_on, GLIST_select_off, GLIST_attrib_on
    label GLIST_attrib_off, GLIST_synchronize, GLIST_do_synchro, GLIST_file_save, GLIST_write
    label GLIST_mode, GLIST_free, GLIST_search, GLIST_move, GLIST_first_line
    dim GLIST_numero_objet%, GLIST_lignes_affichage%(20), GLIST_largeur_affichage%(20)
    dim GLIST_top_affichage%(20), GLIST_left_affichage%(20), GLIST_hauteur_affichage%(20)
    dim GLIST_ligne_selection%(20), GLIST_mode_selection%(20), GLIST_ligne_choisie%(20)
    dim GLIST_nombre_dans_liste%(20), GLIST_n_synchro%(20), GLIST_synchros%(20,20)
    dim GLIST_font_attributs%(200,3)    : ' 200=10*20 (,0)=flag "gras"  (,1)=R (,2)=G, (,3)=B
    dim GLIST_font_attributs_n%(20)
    dim GLIST_i%, GLIST_n%, GLIST_s$, GLIST_v%, GLIST_v$, GLIST_j%, GLIST_nr%(20), GLIST_code%
    dim GLIST_k%, GLIST_syn%, GLIST_debug%, GLIST_synchro_temp%, GLIST_synchro_s$
    dim GLIST_xx%, GLIST_yy%, GLIST_x1%, GLIST_y1%, GLIST_max%, GLIST_synchro_master%
    dim GLIST_synchro_slave%, GLIST_error_mode%, GLIST_err%, GLIST_synchro_choisie%
    dim GLIST_sens%, GLIST_org%
    dim GLIST_n_listes%, GLIST_liste_listes%(20), GLIST_index%, GLIST_scroll%(20)
    GLIST_n_listes% = 0 : GLIST_index% = 0 : GLIST_debug% = 0 : GLIST_error_mode% = 1
    GLIST_synchro_choisie% = 0
end_if
GLIST_err:
off_error_goto
if right$(GLIST_params$,1)<>"|" then GLIST_params$ = GLIST_params$ + "|"
if left$(GLIST_params$,7)="Create|" then goto GLIST_create
if left$(GLIST_params$,10)="Attributs|" then goto GLIST_attributs
if left$(GLIST_params$,11)="Revelation|" then goto GLIST_revelation
if left$(GLIST_params$,5)="Load|" then goto GLIST_file_load
if left$(GLIST_params$,5)="Save|" then goto GLIST_file_save
if left$(GLIST_params$,6)="Clear|" then goto GLIST_clear
if left$(GLIST_params$,9)="Item_add|" then goto GLIST_add
if left$(GLIST_params$,12)="Item_delete|" then goto GLIST_delete
if left$(GLIST_params$,12)="Item_insert|" then goto GLIST_insert
if left$(GLIST_params$,11)="Item_write|" then goto GLIST_write
if left$(GLIST_params$,9)="Selected|" then goto GLIST_selected
if left$(GLIST_params$,6)="Total|" then goto GLIST_total
if left$(GLIST_params$,10)="Item_read|" then goto GLIST_read
if left$(GLIST_params$,10)="Item_free|" then goto GLIST_free
if left$(GLIST_params$,10)="Target_is|" then goto GLIST_target
if left$(GLIST_params$,12)="Item_search|" then goto GLIST_search
if left$(GLIST_params$,12)="Item_select|" then goto GLIST_select
if left$(GLIST_params$,13)="Item_display|" then goto GLIST_display
if left$(GLIST_params$,15)="Synchronize_on|" then goto GLIST_synchro_on
if left$(GLIST_params$,16)="Synchronize_off|" then goto GLIST_synchro_off
if left$(GLIST_params$,5)="Mode|" then goto GLIST_mode
if left$(GLIST_params$,5)="First_line|" then goto GLIST_First_line
if left$(GLIST_params$,10)="Item_move|" then goto GLIST_move
GLIST_params$ = "GLIST: commande invalide "+left$(GLIST_params$,15)
if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
return

'=============== création des objets ==========================================================
' syntaxe: GLIST_params$ = "Create|N=20|A=8|W=400|T=160|L=90|"
GLIST_create:
if GLIST_n_listes%=20
    GLIST_params$ = "GLIST: trop d'objets GLIST"
    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return
end_if
GLIST_i% = instr(GLIST_params$,"|N=")
if GLIST_i%>0
    GLIST_s$ = right$(GLIST_params$,len(GLIST_params$)-GLIST_i%-2)
    GLIST_i% = instr(GLIST_s$,"|")
    if GLIST_i%>0
        GLIST_s$ = left$(GLIST_s$,GLIST_i%-1)
        if numeric(GLIST_s$)=1
            GLIST_n% = val(GLIST_s$)
            on_error_goto GLIST_create_err1
            dlist GLIST_n%
            dlist GLIST_n% + 1
            dlist GLIST_n% + 2
            off_error_goto
            GLIST_numero_objet% = GLIST_n%
            delete GLIST_numero_objet% + 2
            delete GLIST_numero_objet% + 1
            picture GLIST_numero_objet% + 1
            scroll_bar GLIST_numero_objet% + 2
            print_target_is GLIST_numero_objet%+1
            2d_target_is GLIST_numero_objet%+1
            on_click GLIST_numero_objet%+1,GLIST_click_liste
            vertical GLIST_numero_objet%+2
            min GLIST_numero_objet%+2,1
            max GLIST_numero_objet%+2,1
            on_change GLIST_numero_objet%+2,GLIST_change
            GLIST_n_listes% = GLIST_n_listes% + 1
            GLIST_index% = GLIST_n_listes%
            GLIST_liste_listes%(GLIST_n_listes%) = GLIST_numero_objet%
            GLIST_scroll%(GLIST_n_listes%) = 1
            GLIST_n_synchro%(GLIST_n_listes%) = 0
        end_if
    end_if
end_if
GLIST_i% = instr(GLIST_params$,"|A=")
if GLIST_i%>0
    GLIST_s$ = right$(GLIST_params$,len(GLIST_params$)-GLIST_i%-2)
    GLIST_i% = instr(GLIST_s$,"|")
    if GLIST_i%>0
        GLIST_s$ = left$(GLIST_s$,GLIST_i%-1)
        if numeric(GLIST_s$)=1
            GLIST_n% = val(GLIST_s$)
            if GLIST_n%>0 then GLIST_lignes_affichage%(GLIST_index%) = GLIST_n%
        end_if
    end_if
end_if
GLIST_hauteur_affichage%(GLIST_index%) = GLIST_lignes_affichage%(GLIST_index%)*14  : ' hauteur de l'affichage du picture et de la scroll_bar
height GLIST_numero_objet%+1,GLIST_hauteur_affichage%(GLIST_index%)
height GLIST_numero_objet%+2,GLIST_hauteur_affichage%(GLIST_index%)
GLIST_i% = instr(GLIST_params$,"|L=")
if GLIST_i%>0
    GLIST_s$ = right$(GLIST_params$,len(GLIST_params$)-GLIST_i%-2)
    GLIST_i% = instr(GLIST_s$,"|")
    if GLIST_i%>0
        GLIST_s$ = left$(GLIST_s$,GLIST_i%-1)
        if numeric(GLIST_s$)=1
            GLIST_n% = val(GLIST_s$)
            if GLIST_n%>0 then GLIST_left_affichage%(GLIST_index%) = GLIST_n%
        end_if
    end_if
end_if
GLIST_i% = instr(GLIST_params$,"|T=")
if GLIST_i%>0
    GLIST_s$ = right$(GLIST_params$,len(GLIST_params$)-GLIST_i%-2)
    GLIST_i% = instr(GLIST_s$,"|")
    if GLIST_i%>0
        GLIST_s$ = left$(GLIST_s$,GLIST_i%-1)
        if numeric(GLIST_s$)=1
            GLIST_n% = val(GLIST_s$)
            if GLIST_n%>0 then GLIST_top_affichage%(GLIST_index%) = GLIST_n%
        end_if
    end_if
end_if
top GLIST_numero_objet%+1,GLIST_top_affichage%(GLIST_index%)
top GLIST_numero_objet%+2,GLIST_top_affichage%(GLIST_index%)
GLIST_i% = instr(GLIST_params$,"|W=")
if GLIST_i%>0
    GLIST_s$ = right$(GLIST_params$,len(GLIST_params$)-GLIST_i%-2)
    GLIST_i% = instr(GLIST_s$,"|")
    if GLIST_i%>0
        GLIST_s$ = left$(GLIST_s$,GLIST_i%-1)
        if numeric(GLIST_s$)=1
            GLIST_n% = val(GLIST_s$)
            if GLIST_n%>0 then GLIST_largeur_affichage%(GLIST_index%) = GLIST_n%
        end_if
    end_if
end_if
width GLIST_numero_objet%+1,GLIST_largeur_affichage%(GLIST_index%)
left GLIST_numero_objet%+1,GLIST_left_affichage%(GLIST_index%)
left GLIST_numero_objet%+2,GLIST_left_affichage%(GLIST_index%) + GLIST_largeur_affichage%(GLIST_index%) + 4
return
GLIST_create_err1:
off_error_goto
GLIST_params$ = "GLIST: problème avec numéro d'objet " + str$(GLIST_numero_objet%)
if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
return

'=============== création des attributs ==========================================================
' Syntaxe: GLIST_params$ = "Attributs|1=255,0,0|2=G0,0,255|3=255,255,0|"
GLIST_attributs:
for GLIST_n%=1 to 9
    GLIST_i% = instr(GLIST_params$,"|"+str$(GLIST_n%)+"=")
    if GLIST_i%>0
        GLIST_s$ = right$(GLIST_params$,len(GLIST_params$)-GLIST_i%-2)
        GLIST_i% = instr(GLIST_s$,"|")
        if GLIST_i%>0
            GLIST_s$ = left$(GLIST_s$,GLIST_i%-1) + ","
            if GLIST_n%>GLIST_font_attributs_n%(GLIST_index%) then GLIST_font_attributs_n%(GLIST_index%) = GLIST_n%
            if left$(GLIST_s$,1)="G"
                GLIST_font_attributs%((GLIST_index%-1)*10+GLIST_n%,0) = 1
                GLIST_s$ = right$(GLIST_s$,len(GLIST_s$)-1)
            else
                GLIST_font_attributs%((GLIST_index%-1)*10+GLIST_n%,0) = 0
            end_if
            for GLIST_j%=1 to 3
                GLIST_i% = instr(GLIST_s$,",")
                if GLIST_i%>0
                    GLIST_v$ = left$(GLIST_s$,GLIST_i%-1)
                    GLIST_s$ = right$(GLIST_s$,len(GLIST_s$)-GLIST_i%)
                    if numeric(GLIST_v$)=1
                        GLIST_v% = val(GLIST_v$)
                        if (GLIST_v%<0) or (GLIST_v%>255)
                            GLIST_params$ = "GLIST: parametres Attributs invalides"
                            if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
                            return
                        end_if
                        GLIST_font_attributs%((GLIST_index%-1)*10+GLIST_n%,GLIST_j%) = GLIST_v%
                    end_if
                end_if
            next GLIST_j%
        end_if
    end_if
next GLIST_n%
return

'=============== chargement d'un fichier =================================================
' Syntaxe: GLIST_params$ = "Load|C:\Telechargements\glist.txt|"
GLIST_file_load:
GLIST_s$ = mid$(GLIST_params$,6,len(GLIST_params$)-6)
if file_exists(GLIST_s$)=0
    GLIST_params$ = "GLIST: fichier Load introuvable: "+GLIST_s$
    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return
end_if
clear GLIST_numero_objet%
file_load GLIST_numero_objet%,GLIST_s$
GLIST_nombre_dans_liste%(GLIST_index%) = count(GLIST_numero_objet%)
GLIST_n% = GLIST_nombre_dans_liste%(GLIST_index%) - GLIST_lignes_affichage%(GLIST_index%)+1
if GLIST_nombre_dans_liste%(GLIST_index%)<GLIST_lignes_affichage%(GLIST_index%) then GLIST_n% = 1
max GLIST_numero_objet%+2,GLIST_n%
GLIST_nr%(GLIST_index%) = 1
gosub GLIST_changeb
return

'=============== sauvegarde d'un fichier =================================================
' Syntaxe: GLIST_params$ = "Save|C:\Telechargements\glist.txt|"
GLIST_file_save:
GLIST_s$ = mid$(GLIST_params$,6,len(GLIST_params$)-6)
file_save GLIST_numero_objet%,GLIST_s$
return

'=============== choix de la méthode de révélation ==============================================
' Syntaxe: GLIST_params$ = "Revelation|4|"
GLIST_revelation:
GLIST_s$ = mid$(GLIST_params$,12,len(GLIST_params$)-12)
if numeric(GLIST_s$)=1
    GLIST_v% = val(GLIST_s$)
    if (GLIST_v%>=0) and GLIST_v%<=4
        GLIST_mode_selection%(GLIST_index%) = GLIST_v%
        return
    end_if
end_if
GLIST_params$ = "GLIST: parametres Revelation invalides"
if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
return

'=============== effacement de toute la liste =====================================================
' Syntaxe: GLIST_params$ = "Clear|"
GLIST_clear:
clear GLIST_numero_objet%
2d_clear
GLIST_scroll%(GLIST_index%) = 1
GLIST_nr%(GLIST_index%) = 1
off_change GLIST_numero_objet%+2
position GLIST_numero_objet%+2,1
on_change GLIST_numero_objet%+2,GLIST_change
max GLIST_numero_objet%+2,1
GLIST_nombre_dans_liste%(GLIST_index%) = 0
GLIST_ligne_selection%(GLIST_index%) = 0
return

'=============== ajouter un enregistrement =====================================================
' Syntaxe: GLIST_params$ = "Item_add|nouvelle ligne|"
GLIST_add:
if (len(GLIST_params$)-10) = 0
  GLIST_s$=""
else
  GLIST_s$ = mid$(GLIST_params$,10,len(GLIST_params$)-10)
end_if
GLIST_synchro_s$ = GLIST_s$                        : ' sauvegarder car modifié dans GLIST_changeb
item_add GLIST_numero_objet%,GLIST_s$
GLIST_nombre_dans_liste%(GLIST_index%) = count(GLIST_numero_objet%)
GLIST_n% = GLIST_nombre_dans_liste%(GLIST_index%) - GLIST_lignes_affichage%(GLIST_index%)+1
if GLIST_nombre_dans_liste%(GLIST_index%)<GLIST_lignes_affichage%(GLIST_index%) then GLIST_n% = 1
max GLIST_numero_objet%+2,GLIST_n%
if GLIST_nr%(GLIST_index%)=0 then GLIST_nr%(GLIST_index%) = 1
if (GLIST_nombre_dans_liste%(GLIST_index%)-GLIST_nr%(GLIST_index%))<GLIST_lignes_affichage%(GLIST_index%) then gosub GLIST_changeb
if GLIST_n_synchro%(GLIST_index%)>0                    : ' la liste a des esclaves ?
    GLIST_synchro_master% = GLIST_index%              : ' se rappeler le maître
    GLIST_synchro_temp% = GLIST_index%
    for GLIST_k%=1 to GLIST_n_synchro%(GLIST_synchro_temp%)
        GLIST_numero_objet% = GLIST_synchros%(GLIST_synchro_temp%,GLIST_k%)    : ' simuler un target_is sur l'esclave
        for GLIST_j%=1 to GLIST_n_listes%
            if GLIST_liste_listes%(GLIST_j%)=GLIST_numero_objet%
                GLIST_index% = GLIST_j%
                exit_for
            end_if
        next GLIST_j%
        2d_target_is GLIST_numero_objet% + 1
        print_target_is GLIST_numero_objet% + 1
        item_add GLIST_numero_objet%,"* "+GLIST_synchro_s$
        GLIST_nombre_dans_liste%(GLIST_index%) = count(GLIST_numero_objet%)
        GLIST_n% = GLIST_nombre_dans_liste%(GLIST_index%) - GLIST_lignes_affichage%(GLIST_index%)+1
        if GLIST_nombre_dans_liste%(GLIST_index%)<GLIST_lignes_affichage%(GLIST_index%) then GLIST_n% = 1
        max GLIST_numero_objet%+2,GLIST_n%
        if (GLIST_nombre_dans_liste%(GLIST_index%)-GLIST_nr%(GLIST_index%))<GLIST_lignes_affichage%(GLIST_index%) then gosub GLIST_changeb
    next GLIST_k%
    GLIST_index% = GLIST_synchro_master%              : ' récupérer le maître
    GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)    : ' simuler un target_is sur le maître
    2d_target_is GLIST_numero_objet% + 1
    print_target_is GLIST_numero_objet% + 1
end_if
return

'=============== supprimer un enregistrement =====================================================
' Syntaxe: GLIST_params$ = "Item_delete|12|"
GLIST_delete:
' ici, synchroniser ?
GLIST_s$ = mid$(GLIST_params$,13,len(GLIST_params$)-13)
if numeric(GLIST_s$)=1
' supprimer la ligne du maître
    GLIST_v% = val(GLIST_s$)
    if (GLIST_v%>0) and (GLIST_v%<=count(GLIST_numero_objet%))
        item_delete GLIST_numero_objet%,GLIST_v%
        GLIST_nombre_dans_liste%(GLIST_index%) = count(GLIST_numero_objet%)
        if GLIST_nombre_dans_liste%(GLIST_index%)=0              : ' liste maître vide ?
            2d_clear
            GLIST_ligne_choisie%(GLIST_index%) = 0
            max GLIST_numero_objet%+2,1
            if GLIST_n_synchro%(GLIST_index%)>0                    : ' la liste a des esclaves ?
                GLIST_synchro_master% = GLIST_index%              : ' se rappeler le maître
                GLIST_synchro_temp% = GLIST_index%
                for GLIST_k%=1 to GLIST_n_synchro%(GLIST_synchro_temp%)
                    GLIST_numero_objet% = GLIST_synchros%(GLIST_synchro_temp%,GLIST_k%)    : ' simuler un target_is sur l'esclave
                    for GLIST_j%=1 to GLIST_n_listes%
                        if GLIST_liste_listes%(GLIST_j%)=GLIST_numero_objet%
                            GLIST_index% = GLIST_j%
                            exit_for
                        end_if
                    next GLIST_j%
                    2d_target_is GLIST_numero_objet% + 1
                    print_target_is GLIST_numero_objet% + 1
                    clear GLIST_numero_objet%          : ' il ne restait plus qu'un seul enregistrement
                    2d_clear
                    GLIST_nombre_dans_liste%(GLIST_index%) = 0
                    GLIST_ligne_choisie%(GLIST_index%) = 0
                    max GLIST_numero_objet%+2,1
                    GLIST_index% = GLIST_synchro_master%              : ' récupérer le maître
                    GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)    : ' simuler un target_is sur le maître
                    2d_target_is GLIST_numero_objet% + 1
                    print_target_is GLIST_numero_objet% + 1
'                    return
                next GLIST_k%
            end_if
        end_if
' réactiver la ligne suivante si la suppression de la ligne sélectionnée doit annuler la sélection !
'        if GLIST_v%=GLIST_ligne_choisie%(GLIST_index%) then GLIST_ligne_choisie%(GLIST_index%) = 0
        if GLIST_v%<GLIST_ligne_choisie%(GLIST_index%) then GLIST_ligne_choisie%(GLIST_index%) = GLIST_ligne_choisie%(GLIST_index%) - 1
        if GLIST_v%<GLIST_nr%(GLIST_index%)+GLIST_lignes_affichage%(GLIST_index%)
            if GLIST_v%>=GLIST_nr%(GLIST_index%)
                if GLIST_nr%(GLIST_index%)>0
                    gosub GLIST_changeb
                else
                    2d_clear
                end_if
            end_if
        end_if
        GLIST_n% = GLIST_nombre_dans_liste%(GLIST_index%) - GLIST_lignes_affichage%(GLIST_index%)+1
        if GLIST_nombre_dans_liste%(GLIST_index%)<GLIST_lignes_affichage%(GLIST_index%) then GLIST_n% = 1
        max GLIST_numero_objet%+2,GLIST_n%
' supprimer la ligne de l'esclave
        if GLIST_n_synchro%(GLIST_index%)>0                    : ' la liste a des esclaves ?
            GLIST_synchro_master% = GLIST_index%              : ' se rappeler le maître
            GLIST_synchro_temp% = GLIST_index%
            for GLIST_k%=1 to GLIST_n_synchro%(GLIST_synchro_temp%)
                GLIST_numero_objet% = GLIST_synchros%(GLIST_synchro_temp%,GLIST_k%)    : ' simuler un target_is sur l'esclave
                for GLIST_j%=1 to GLIST_n_listes%
                    if GLIST_liste_listes%(GLIST_j%)=GLIST_numero_objet%
                        GLIST_index% = GLIST_j%
                        exit_for
                    end_if
                next GLIST_j%
                2d_target_is GLIST_numero_objet% + 1
                print_target_is GLIST_numero_objet% + 1
                item_delete GLIST_numero_objet%,GLIST_v%
                GLIST_nombre_dans_liste%(GLIST_index%) = count(GLIST_numero_objet%)
' réactiver la ligne suivante si la suppression de la ligne sélectionnée doit annuler la sélection !
'                if GLIST_v%=GLIST_ligne_choisie%(GLIST_index%) then GLIST_ligne_choisie%(GLIST_index%) = 0
                if GLIST_v%<GLIST_ligne_choisie%(GLIST_index%) then GLIST_ligne_choisie%(GLIST_index%) = GLIST_ligne_choisie%(GLIST_index%) - 1
                if GLIST_v%<GLIST_nr%(GLIST_index%)+GLIST_lignes_affichage%(GLIST_index%)
                    if GLIST_v%>=GLIST_nr%(GLIST_index%)
                        if GLIST_nr%(GLIST_index%)>0
                            gosub GLIST_changeb
                        else
                            2d_clear
                        end_if
                    end_if
                end_if
                GLIST_n% = GLIST_nombre_dans_liste%(GLIST_index%) - GLIST_lignes_affichage%(GLIST_index%)+1
                if GLIST_nombre_dans_liste%(GLIST_index%)<GLIST_lignes_affichage%(GLIST_index%) then GLIST_n% = 1
                max GLIST_numero_objet%+2,GLIST_n%
            next GLIST_k%
        end_if
        GLIST_index% = GLIST_synchro_master%              : ' récupérer le maître
        GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)    : ' simuler un target_is sur le maître
        2d_target_is GLIST_numero_objet% + 1
        print_target_is GLIST_numero_objet% + 1
        return
    end_if
end_if
GLIST_params$ = "GLIST: parametres Item_delete invalides"
if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
return

'=============== insérer un enregistrement =====================================================
' Syntaxe: GLIST_params$ = "Item_insert|12|nouveau_texte|"
GLIST_insert:
GLIST_s$ = right$(GLIST_params$,len(GLIST_params$)-12)
GLIST_i% = instr(GLIST_s$,"|")
if GLIST_i%=0
    GLIST_params$ = "GLIST: parametres Item_insert invalides")
    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return
end_if
GLIST_v$ = left$(GLIST_s$,GLIST_i%-1)
if numeric(GLIST_v$)=0
    GLIST_params$ = "GLIST: parametres Item_insert invalides"
    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return
end_if
GLIST_v% = val(GLIST_v$)
if GLIST_v%<1 or GLIST_v%>GLIST_nombre_dans_liste%(GLIST_index%)
    GLIST_params$ = "GLIST: parametres Item_insert invalides"
    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return
end_if
GLIST_s$ = mid$(GLIST_s$,GLIST_i%+1,len(GLIST_s$)-GLIST_i%-1)
GLIST_synchro_s$ = GLIST_s$                        : ' sauvegarder car modifié dans GLIST_changeb
item_insert GLIST_numero_objet%,GLIST_v%,GLIST_s$
GLIST_nombre_dans_liste%(GLIST_index%) = GLIST_nombre_dans_liste%(GLIST_index%) + 1
if GLIST_v%<=GLIST_ligne_choisie%(GLIST_index%) then GLIST_ligne_choisie%(GLIST_index%) = GLIST_ligne_choisie%(GLIST_index%) + 1
GLIST_n% = GLIST_nombre_dans_liste%(GLIST_index%) - GLIST_lignes_affichage%(GLIST_index%)+1
if GLIST_nombre_dans_liste%(GLIST_index%)<GLIST_lignes_affichage%(GLIST_index%) then GLIST_n% = 1
max GLIST_numero_objet%+2,GLIST_n%
if GLIST_v%<GLIST_nr%(GLIST_index%)+GLIST_lignes_affichage%(GLIST_index%) then gosub GLIST_changeb
if GLIST_n_synchro%(GLIST_index%)>0                    : ' la liste a des esclaves ?
    GLIST_synchro_master% = GLIST_index%              : ' se rappeler le maître
    GLIST_synchro_temp% = GLIST_index%
    for GLIST_k%=1 to GLIST_n_synchro%(GLIST_synchro_temp%)
        GLIST_numero_objet% = GLIST_synchros%(GLIST_synchro_temp%,GLIST_k%)    : ' simuler un target_is sur l'esclave
        for GLIST_j%=1 to GLIST_n_listes%
            if GLIST_liste_listes%(GLIST_j%)=GLIST_numero_objet%
                GLIST_index% = GLIST_j%
                exit_for
            end_if
        next GLIST_j%
        2d_target_is GLIST_numero_objet% + 1
        print_target_is GLIST_numero_objet% + 1
        item_insert GLIST_numero_objet%,GLIST_v%,"* "+GLIST_synchro_s$
        GLIST_nombre_dans_liste%(GLIST_index%) = count(GLIST_numero_objet%)
        if GLIST_v%<=GLIST_ligne_choisie%(GLIST_index%) then GLIST_ligne_choisie%(GLIST_index%) = GLIST_ligne_choisie%(GLIST_index%) + 1
        GLIST_n% = GLIST_nombre_dans_liste%(GLIST_index%) - GLIST_lignes_affichage%(GLIST_index%)+1
        if GLIST_nombre_dans_liste%(GLIST_index%)<GLIST_lignes_affichage%(GLIST_index%) then GLIST_n% = 1
        max GLIST_numero_objet%+2,GLIST_n%
        if GLIST_v%<GLIST_nr%(GLIST_index%)+GLIST_lignes_affichage%(GLIST_index%) then gosub GLIST_changeb
    next GLIST_k%
    GLIST_index% = GLIST_synchro_master%              : ' récupérer le maître
    GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)    : ' simuler un target_is sur le maître
    2d_target_is GLIST_numero_objet% + 1
    print_target_is GLIST_numero_objet% + 1
end_if

return

'=============== mise à jour d'un enregistrement =====================================================
' Syntaxe: GLIST_params$ = "Item_write|12|nouveau_texte|"
GLIST_write:
GLIST_s$ = right$(GLIST_params$,len(GLIST_params$)-11)
GLIST_i% = instr(GLIST_s$,"|")
if GLIST_i%=0
    GLIST_ = "GLIST: parametres Item_write invalides"
    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return
end_if
GLIST_v$ = left$(GLIST_s$,GLIST_i%-1)
if numeric(GLIST_v$)=0
    GLIST_params$ = "GLIST: parametres Item_write invalides"
    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return
end_if
GLIST_v% = val(GLIST_v$)
if GLIST_v%<1 or GLIST_v%>GLIST_nombre_dans_liste%(GLIST_index%)
    GLIST_params$ = "GLIST: parametres Item_write invalides"
    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return
end_if
GLIST_s$ = mid$(GLIST_s$,GLIST_i%+1,len(GLIST_s$)-GLIST_i%-1)
item_delete GLIST_numero_objet%, GLIST_v%                      : ' supprimer, puis
item_insert GLIST_numero_objet%,GLIST_v%,GLIST_s$              : ' insérer à nouveau !
if GLIST_v%<GLIST_nr%(GLIST_index%)+GLIST_lignes_affichage%(GLIST_index%) then gosub GLIST_changeb
return

'=============== retourner le numéro d'enregistrement sélectionné =============
' Syntaxe: GLIST_params$ = "Selected|"
GLIST_selected:
    GLIST_params$ = str$(GLIST_ligne_choisie%(GLIST_index%))
    return

'=============== retourner le nombre d'enregistrements au total ===============
' Syntaxe: GLIST_params$ = "Total|"
GLIST_total:
    GLIST_params$ = str$(GLIST_nombre_dans_liste%(GLIST_index%))
    return

'=============== lire un enregistrement =======================================
' Syntaxe: GLIST_params$ = "Item_read|12|"
GLIST_read:
GLIST_s$ = mid$(GLIST_params$,11,len(GLIST_params$)-11)
if numeric(GLIST_s$)=1
    GLIST_v% = val(GLIST_s$)
    if (GLIST_v%>0) and (GLIST_v%<=count(GLIST_numero_objet%))
        GLIST_params$ = item_read$(GLIST_numero_objet%,GLIST_v%)
        return
    end_if
end_if
GLIST_params$ = "GLIST: parametres Item_read invalides"
if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
return

'=============== libérer la sélection d'un enregistrement =====================
' Syntaxe: GLIST_params$ = "GLIST_free|"
GLIST_free:
    GLIST_ligne_choisie%(GLIST_index%) = 0
    gosub GLIST_changeb
' ici synchroniser s'il le faut
    if GLIST_n_synchro%(GLIST_index%)>0                    : ' la liste a des esclaves ?
        GLIST_synchro_master% = GLIST_index%              : ' se rappeler le maître
        GLIST_synchro_temp% = GLIST_index%
        for GLIST_k%=1 to GLIST_n_synchro%(GLIST_synchro_temp%)
            GLIST_numero_objet% = GLIST_synchros%(GLIST_synchro_temp%,GLIST_k%)    : ' simuler un target_is sur l'esclave
            for GLIST_j%=1 to GLIST_n_listes%
                if GLIST_liste_listes%(GLIST_j%)=GLIST_numero_objet%
                    GLIST_index% = GLIST_j%
                    exit_for
                end_if
            next GLIST_j%
            2d_target_is GLIST_numero_objet% + 1
            print_target_is GLIST_numero_objet% + 1
            GLIST_ligne_choisie%(GLIST_index%) = 0
            gosub GLIST_changeb
            GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)    : ' simuler un target_is sur le maître
            2d_target_is GLIST_numero_objet% + 1
            print_target_is GLIST_numero_objet% + 1
'            return
        next GLIST_k%
    end_if
    return

'=============== cibler une autre GLIST =======================================
'Syntaxe: GLIST_params$ = "Target_is|20["
GLIST_target:
GLIST_s$ = mid$(GLIST_params$,11,len(GLIST_params$)-11)
if numeric(GLIST_s$)=1
    GLIST_v% = val(GLIST_s$)
    for GLIST_i%=1 to GLIST_n_listes%
        if GLIST_liste_listes%(GLIST_i%)=GLIST_v%
            GLIST_index% = GLIST_i%
            GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)
            2d_target_is GLIST_numero_objet% + 1
            print_target_is GLIST_numero_objet% + 1
            return
        end_if
    next GLIST_i%
end_if
GLIST_params$ = "GLIST: parametres Item_delete invalides"
if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return

'=============== selectionner un enregistrement ==============================
' Syntaxe: GLIST_params$ = "Item_select|12|"
GLIST_select:
if right$(GLIST_params$,1)<>"|"
    GLIST_params$ = "GLIST: parametres Item_select invalides"
    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return
end_if
GLIST_s$ = mid$(GLIST_params$,13,len(GLIST_params$)-13)
if numeric(GLIST_s$)=1
    GLIST_v% = val(GLIST_s$)
    if (GLIST_v%>0) and (GLIST_v%<=count(GLIST_numero_objet%))
        GLIST_ligne_choisie%(GLIST_index%) = GLIST_v%
        if GLIST_v%>GLIST_nr%(GLIST_index%) then gosub GLIST_changeb
    end_if
' ici synchroniser s'il le faut
if GLIST_n_synchro%(GLIST_index%)>0                    : ' la liste a des esclaves ?
    GLIST_synchro_master% = GLIST_index%              : ' se rappeler le maître
    GLIST_synchro_temp% = GLIST_index%
    for GLIST_k%=1 to GLIST_n_synchro%(GLIST_synchro_temp%)
        GLIST_numero_objet% = GLIST_synchros%(GLIST_synchro_temp%,GLIST_k%)    : ' simuler un target_is sur l'esclave
        for GLIST_j%=1 to GLIST_n_listes%
            if GLIST_liste_listes%(GLIST_j%)=GLIST_numero_objet%
                GLIST_index% = GLIST_j%
                exit_for
            end_if
        next GLIST_j%
        2d_target_is GLIST_numero_objet% + 1
        print_target_is GLIST_numero_objet% + 1
        if (GLIST_v%>0) and (GLIST_v%<=count(GLIST_numero_objet%))
            GLIST_ligne_choisie%(GLIST_index%) = GLIST_v%
            if GLIST_v%>GLIST_nr%(GLIST_index%) then gosub GLIST_changeb
        end_if
        GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)    : ' simuler un target_is sur le maître
        2d_target_is GLIST_numero_objet% + 1
        print_target_is GLIST_numero_objet% + 1
        return    : ' déplacer en (a) ???????
    next GLIST_k%
' (a) return ???????????????
end_if
    return
end_if
GLIST_params$ = "GLIST: parametres Item_select invalides"
if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
return

'=============== safficher à partir d'un enregistrement ====================
' Syntaxe: GLIST_params$ = "Item_display|12|"
GLIST_display:
GLIST_s$ = mid$(GLIST_params$,14,len(GLIST_params$)-14)
if numeric(GLIST_s$)=1
    GLIST_v% = val(GLIST_s$)
    if (GLIST_v%>0) and (GLIST_v%<=count(GLIST_numero_objet%))
        GLIST_nr%(GLIST_index%) = GLIST_v%
        off_change GLIST_numero_objet%+2
        position GLIST_numero_objet%+2,GLIST_v%
        on_change GLIST_numero_objet%+2,GLIST_change
        gosub GLIST_changeb
        gosub GLIST_do_synchro
        return
    end_if
end_if
GLIST_params$ = "GLIST: parametres Item_display invalides"
if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
return

'=============== synchronisezr avec une autre GLIST ================================================
'Syntaxe: GLIST_params$ = "Synchronize_on|30["
GLIST_synchro_on:
GLIST_s$ = mid$(GLIST_params$,16,len(GLIST_params$)-16)
if numeric(GLIST_s$)=1
    GLIST_v% = val(GLIST_s$)
  if GLIST_v%<>GLIST_numero_objet%
        for GLIST_i%=1 to GLIST_n_listes%
            if GLIST_liste_listes%(GLIST_i%)=GLIST_v%
' ici, GLIST_i% pointe sur l'esclave
                if GLIST_n_synchro%(GLIST_i%)>0
                    for GLIST_j%=1 to GLIST_n_synchro%(GLIST_i%)
                        if GLIST_synchros%(GLIST_i%,GLIST_j%)=GLIST_numero_objet% then return  : ' déja synchronisé
                    next GLIST_j%
                end_if
                if GLIST_nombre_dans_liste%(GLIST_index%)=GLIST_nombre_dans_liste%(GLIST_i%)    : ' on doit avoir le même nombre de lignes !
                    GLIST_n_synchro%(GLIST_i%) = GLIST_n_synchro%(GLIST_i%) + 1
                    GLIST_synchros%(GLIST_i%,GLIST_n_synchro%(GLIST_i%)) = GLIST_numero_objet% : ' mémoriser Glist actuelle dans cible synchro
                    GLIST_n_synchro%(GLIST_index%) = GLIST_n_synchro%(GLIST_index%) + 1
                    GLIST_synchros%(GLIST_index%,GLIST_n_synchro%(GLIST_index%)) = GLIST_v%    : ' mémoriser cible synchro dans GLIST actuelle
                    GLIST_synchro_master% = GLIST_index% : GLIST_synchro_slave% = GLIST_i%
                    gosub GLIST_synchronize  : ' synchronier l'esclave par rapport au maître
                    return
                end_if
            end_if
        next GLIST_i%
    end_if
end_if
GLIST_params$ = "GLIST: parametres Synchronize_on invalides"
if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return

'=============== désynchronisezr avec une autre GLIST ================================================
'Syntaxe: GLIST_params$ = "Synchronize_off|30["
GLIST_synchro_off:
GLIST_s$ = mid$(GLIST_params$,17,len(GLIST_params$)-17)
if numeric(GLIST_s$)=1
    GLIST_v% = val(GLIST_s$)
    if GLIST_v%<>GLIST_numero_objet%
        for GLIST_i%=1 to GLIST_n_listes%
            if GLIST_liste_listes%(GLIST_i%)=GLIST_v%
                if GLIST_n_synchro%(GLIST_i%)>0            : ' est-ce que l'esclave a un maître ?
                    for GLIST_j%=1 to GLIST_n_synchro%(GLIST_i%)      : ' chercher le maître chez l'esclave
                        if GLIST_synchros%(GLIST_i%,GLIST_j%)=GLIST_numero_objet%
                            if GLIST_j%<GLIST_n_synchro%(GLIST_i%) : ' faut-il tasser la liste de l'esclave
                                for GLIST_k%=GLIST_j% to GLIST_n_synchro%(GLIST_i%)-1
                                    GLIST_synchros%(GLIST_i%,GLIST_k%) = GLIST_synchros%(GLIST_i%,GLIST_k%+1)
                                next GLIST_k%
                            end_if
                            GLIST_n_synchro%(GLIST_i%) = GLIST_n_synchro%(GLIST_i%) - 1  : ' oublier le maître de l'esclave
                        end_if
                    next GLIST_j%
                end_if
                if GLIST_n_synchro%(GLIST_index%)>0        : ' est-ce que le mâitre a un esclave ?
                    for GLIST_j%=1 to GLIST_n_synchro%(GLIST_index%)  : ' chercher l'esclave chez le maître
                        if GLIST_synchros%(GLIST_index%,GLIST_j%)=GLIST_v%
                            if GLIST_j%<GLIST_n_synchro%(GLIST_index%) : ' faut-il tasser la liste du maître ?
                                for GLIST_k%=GLIST_j% to GLIST_n_synchro%(GLIST_index%)-1
                                    GLIST_synchros%(GLIST_index%,GLIST_k%) = GLIST_synchros%(GLIST_index%,GLIST_k%+1)
                                next GLIST_k%
                            end_if
                            GLIST_n_synchro%(GLIST_index%) = GLIST_n_synchro%(GLIST_index%) - 1  : ' oublier l'esclave
                        end_if
                    next GLIST_j%
                end_if
                return
            end_if
        next GLIST_i%
    end_if
end_if
GLIST_params$ = "GLIST: parametres Synchronize_on invalides"
if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
return
   
'=============== configurer le mode de fonctionnement =========================
' Syntaxe: GLIST_params$ = "Mode|opt_1|...|opt_n|"
'        options: silent  verbose
GLIST_mode:
GLIST_s$ = right$(GLIST_params$,len(GLIST_params$)-5)
if instr(GLIST_s$,"silent|")>0 then GLIST_error_mode% = 0
if instr(GLIST_s$,"verbose|")>0 then GLIST_error_mode% = 1
return

'=============== chercher un enregistrement contenant une chaîne ==============
' Syntaxe: GLIST_params$ = "Item_search|debut|chaîne|"
GLIST_search:
    if GLIST_nombre_dans_liste%(GLIST_index%)>0
        GLIST_s$ = right$(GLIST_params$,len(GLIST_params$)-12)
        GLIST_i% = instr(GLIST_s$,"|")
        if GLIST_i%>0
            GLIST_v$ = left$(GLIST_s$,GLIST_i%-1)                      : ' ligne de départ
            GLIST_s$ = right$(GLIST_s$,len(GLIST_s$)-GLIST_i%)
            if numeric(GLIST_v$)=1                                    : ' valeur numérique ligne de dé&part
                GLIST_v% = val(GLIST_v$)
                if GLIST_v%>1 then GLIST_v% = 1
                if GLIST_v%<-2 then GLIST_v% = -2
                GLIST_v% = GLIST_v% + 3                                : ' pour select
                select GLIST_v%
                case 1:                                                  ' en arrière à partir de la fin
                    GLIST_i% = 1
                    GLIST_x1% = GLIST_nombre_dans_liste%(GLIST_index%)
                    GLIST_y1% = 1
                    GLIST_yy% = -1
                case 2:                                                  ' en arrière à partir de la sélection
                    GLIST_i% = 1
                    GLIST_x1% = GLIST_ligne_choisie%(GLIST_index%) - 1
                    GLIST_y1% = 1
                    GLIST_yy% = -1
                case 3:                                                  ' en avant à partir de la sélection
                    GLIST_i% = 0
                    GLIST_x1% = GLIST_ligne_choisie%(GLIST_index%) + 1
                    GLIST_y1% = GLIST_nombre_dans_liste%(GLIST_index%)
                    GLIST_yy% = 1
                case 4:                                                  ' en avant à partir du début
                    GLIST_i% = 0
                    GLIST_x1% = 1
                    GLIST_y1% = GLIST_nombre_dans_liste%(GLIST_index%)
                    GLIST_yy% = 1
                end_select
                if GLIST_x1%>GLIST_nombre_dans_liste%(GLIST_index%) or GLIST_x1%=0
                    GLIST_params$ = "GLIST: Item_search non trouvé"
                    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
                    return
                end_if
                if len(GLIST_s$)>1                                    : ' critère non vide ?
                    GLIST_v$ = left$(GLIST_s$,len(GLIST_s$)-1)    : ' critère de recherche
                    for GLIST_n%=GLIST_x1% to GLIST_y1% step GLIST_yy%
                        GLIST_s$ = item_read$(GLIST_liste_listes%(GLIST_index%),GLIST_n%)
                        if instr(GLIST_s$,GLIST_v$)>0
                            GLIST_ligne_choisie%(GLIST_index%) = GLIST_n%
                            GLIST_synchro_choisie% = GLIST_n%
                            GLIST_j% = GLIST_n% - 3
                            if GLIST_j%<1 then GLIST_j% = 1
                            GLIST_nr%(GLIST_index%) = GLIST_j%
                            off_change GLIST_numero_objet%+2
                            position GLIST_numero_objet%+2,GLIST_nr%(GLIST_index%)
                            on_change GLIST_numero_objet%+2,GLIST_change
                            gosub GLIST_changeb
                            gosub GLIST_do_synchro
                        return
                        end_if
                    next GLIST_n%
                    GLIST_params$ = "GLIST: Item_search non trouvé"
                    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
                    return
                end_if
            end_if
        end_if
    end_if
    GLIST_params$ = "GLIST: paramètres Item_search invalides"
    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return

'=============== déplacer la ligne choisie vers le haut ou vers le bas ========
' Syntaxe: GLIST_params$ = "Item_move|sens|"  sens:  1=vers le haut  0=vers le bas
GLIST_move:
    GLIST_s$ = mid$(GLIST_params$,11,len(GLIST_params$)-11)
    if numeric(GLIST_s$)=1
        GLIST_sens% = val(GLIST_s$)
        if GLIST_sens%=0 or GLIST_sens%=1
            GLIST_org% = GLIST_ligne_choisie%(GLIST_index%)
            if GLIST_org%>0
                if GLIST_sens%=1      : ' vers le haut
                    if GLIST_org%>1
                        GLIST_s$ = item_read$(GLIST_numero_objet%,GLIST_org%)
                        ITEM_delete GLIST_numero_objet%,GLIST_org%
                        GLIST_ligne_choisie%(GLIST_index%) = GLIST_org% - 1
                        item_insert GLIST_numero_objet%,GLIST_org%-1,GLIST_s$
                        if GLIST_nr%(GLIST_index%)>1
                            GLIST_nr%(GLIST_index%)= GLIST_nr%(GLIST_index%) - 1
                            GLIST_scroll%(GLIST_index%) = GLIST_scroll%(GLIST_index%) - 1
                        end_if
                        off_change GLIST_numero_objet%+2
                        position GLIST_numero_objet%+2,GLIST_org%-1
                        on_change GLIST_numero_objet%+2,GLIST_change
                        gosub GLIST_changeb
' ici synchroniser s'il le faut
                        if GLIST_n_synchro%(GLIST_index%)>0                    : ' la liste a des esclaves ?
                            GLIST_synchro_master% = GLIST_index%              : ' se rappeler le maître
                            GLIST_synchro_temp% = GLIST_index%
                            for GLIST_k%=1 to GLIST_n_synchro%(GLIST_synchro_temp%)
                                GLIST_numero_objet% = GLIST_synchros%(GLIST_synchro_temp%,GLIST_k%)    : ' simuler un target_is sur l'esclave
                                for GLIST_j%=1 to GLIST_n_listes%
                                    if GLIST_liste_listes%(GLIST_j%)=GLIST_numero_objet%
                                        GLIST_index% = GLIST_j%
                                        exit_for
                                    end_if
                                next GLIST_j%
                                2d_target_is GLIST_numero_objet% + 1
                                print_target_is GLIST_numero_objet% + 1
                                GLIST_s$ = item_read$(GLIST_numero_objet%,GLIST_org%)
                                ITEM_delete GLIST_numero_objet%,GLIST_org%
                                GLIST_ligne_choisie%(GLIST_index%) = GLIST_org% - 1
                                item_insert GLIST_numero_objet%,GLIST_org%-1,GLIST_s$
                                if GLIST_nr%(GLIST_index%)>1
                                    GLIST_nr%(GLIST_index%)= GLIST_nr%(GLIST_index%) - 1
                                    GLIST_scroll%(GLIST_index%) = GLIST_scroll%(GLIST_index%) - 1
                                end_if
                                off_change GLIST_numero_objet%+2
                                position GLIST_numero_objet%+2,GLIST_org%-1
                                on_change GLIST_numero_objet%+2,GLIST_change
                                gosub GLIST_changeb
                            next GLIST_k%
                            GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)    : ' simuler un target_is sur le maître
                            2d_target_is GLIST_numero_objet% + 1
                            print_target_is GLIST_numero_objet% + 1
                        end_if
                        return
                    end_if
                else                : ' vers le bas
                    if GLIST_org%<GLIST_nombre_dans_liste%(GLIST_index%)

                        GLIST_s$ = item_read$(GLIST_numero_objet%,GLIST_org%)
                        ITEM_delete GLIST_numero_objet%,GLIST_org%
                        GLIST_ligne_choisie%(GLIST_index%) = GLIST_org% + 1
                        item_insert GLIST_numero_objet%,GLIST_org%+1,GLIST_s$
                        if GLIST_nr%(GLIST_index%)<(GLIST_nombre_dans_liste%(GLIST_index%)-GLIST_lignes_affichage%(GLIST_index%)+1)
                            GLIST_nr%(GLIST_index%)= GLIST_nr%(GLIST_index%) + 1
                            GLIST_scroll%(GLIST_index%) = GLIST_scroll%(GLIST_index%) + 1
                        end_if
                        off_change GLIST_numero_objet%+2
                        position GLIST_numero_objet%+2,GLIST_org%+1
                        on_change GLIST_numero_objet%+2,GLIST_change
                        gosub GLIST_changeb
' ici synchroniser s'il le faut
                        if GLIST_n_synchro%(GLIST_index%)>0                    : ' la liste a des esclaves ?
                            GLIST_synchro_master% = GLIST_index%              : ' se rappeler le maître
                            GLIST_synchro_temp% = GLIST_index%
                            for GLIST_k%=1 to GLIST_n_synchro%(GLIST_synchro_temp%)
                                GLIST_numero_objet% = GLIST_synchros%(GLIST_synchro_temp%,GLIST_k%)    : ' simuler un target_is sur l'esclave
                                for GLIST_j%=1 to GLIST_n_listes%
                                    if GLIST_liste_listes%(GLIST_j%)=GLIST_numero_objet%
                                        GLIST_index% = GLIST_j%
                                        exit_for
                                    end_if
                                next GLIST_j%
                                2d_target_is GLIST_numero_objet% + 1
                                print_target_is GLIST_numero_objet% + 1
                                GLIST_s$ = item_read$(GLIST_numero_objet%,GLIST_org%)
                                ITEM_delete GLIST_numero_objet%,GLIST_org%
                                GLIST_ligne_choisie%(GLIST_index%) = GLIST_org% + 1
                                item_insert GLIST_numero_objet%,GLIST_org%+1,GLIST_s$
                                if GLIST_nr%(GLIST_index%)<(GLIST_nombre_dans_liste%(GLIST_index%)-GLIST_lignes_affichage%(GLIST_index%)+1)
                                    GLIST_nr%(GLIST_index%)= GLIST_nr%(GLIST_index%) + 1
                                    GLIST_scroll%(GLIST_index%) = GLIST_scroll%(GLIST_index%) + 1
                                end_if
                                off_change GLIST_numero_objet%+2
                                position GLIST_numero_objet%+2,GLIST_org%-1
                                on_change GLIST_numero_objet%+2,GLIST_change
                                gosub GLIST_changeb
                            next GLIST_k%
                            GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)    : ' simuler un target_is sur le maître
                            2d_target_is GLIST_numero_objet% + 1
                            print_target_is GLIST_numero_objet% + 1
                        end_if
                        return

                    end_if
                end_if
            end_if
        end_if
    end_if
    GLIST_params$ = "GLIST: paramètres Item_move invalides"
    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return
   
' =============== retourner le numéro de la première ligne d'affichage
GLIST_first_line:
    if GLIST_index%>0
        GLIST_params$ = str$(GLIST_nr%(GLIST_index%))
        return
    end_if
    GLIST_params$ = "GLIST: aucune GLIST active"
    if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
    return

' =============== routines internes de service =================================

' ============== synchroniser une liste esclave par rapport à une liste maître
GLIST_synchronize:
    GLIST_n% = GLIST_nr%(GLIST_synchro_master%)
    if GLIST_nombre_dans_liste%(GLIST_synchro_slave%)<GLIST_n% then return  : ' pas assez de lignes ?
    GLIST_nr%(GLIST_synchro_slave%) = GLIST_n%                  : ' forcer le positionnement
    GLIST_index% = GLIST_synchro_slave%                          : ' simuler un target_is sur l'esclave
    GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)
    2d_target_is GLIST_numero_objet% + 1
    print_target_is GLIST_numero_objet% + 1
    gosub GLIST_changeb                                          : ' et afficher l'esclave
    GLIST_index% = GLIST_synchro_master%                          : ' simuler un target_is sur le maître
    GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)
    2d_target_is GLIST_numero_objet% + 1
    print_target_is GLIST_numero_objet% + 1
    return
   
' ============== synchroniser tous les esclaves pour le maître actuel
GLIST_do_synchro:
    if GLIST_n_synchro%(GLIST_index%)>0
        GLIST_synchro_master% = GLIST_index%                  : ' se rappeler le maître
        for GLIST_syn%=1 to GLIST_n_synchro%(GLIST_synchro_master%)    : ' pour tous les esclaves
            GLIST_numero_objet% = GLIST_synchros%(GLIST_synchro_master%,GLIST_syn%) : ' simuler un target_is sur l'esclave
            for GLIST_j%=1 to GLIST_n_listes%
                if GLIST_liste_listes%(GLIST_j%)=GLIST_numero_objet%
                    GLIST_index% = GLIST_j%
                    exit_for
                end_if
            next GLIST_j%
            2d_target_is GLIST_numero_objet% + 1
            print_target_is GLIST_numero_objet% + 1
            GLIST_nr%(GLIST_index%) = GLIST_nr%(GLIST_synchro_master%)
            GLIST_scroll%(GLIST_index%) = GLIST_nr%(GLIST_index%)
            off_change GLIST_numero_objet%+2
            position GLIST_numero_objet%+2,GLIST_nr%(GLIST_index%)
            on_change GLIST_numero_objet%+2,GLIST_change
            if GLIST_synchro_choisie%>0 then GLIST_ligne_choisie%(GLIST_index%) = GLIST_synchro_choisie%
            gosub GLIST_changeb                                : ' et afficher l'esclave
        next GLIST_syn%
        GLIST_index% = GLIST_synchro_master%                  : ' simuler un target_is sur le maître
        GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)
        2d_target_is GLIST_numero_objet% + 1
        print_target_is GLIST_numero_objet% + 1
    end_if
    GLIST_synchro_choisie% = 0
    return

GLIST_print_line:
    if GLIST_ligne_selection%(GLIST_index%)=1 then gosub GLIST_select_on
    GLIST_n% = instr(GLIST_s$,"|")
    GLIST_code% = 0
    if GLIST_n%>0
        if numeric(left$(GLIST_s$,GLIST_n%-1))=1 then GLIST_code% = val(left$(GLIST_s$,GLIST_n%-1))
    end_if
    GLIST_s$ = right$(GLIST_s$,len(GLIST_s$)-GLIST_n%) : GLIST_n% = instr(GLIST_s$,"[")
    if GLIST_n%=0
        gosub GLIST_attrib_on : print GLIST_s$ : gosub GLIST_attrib_off : gosub GLIST_select_off
        return
    end_if
    if GLIST_n%>1
        print left$(GLIST_s$,GLIST_n%-1); : GLIST_s$ = right$(GLIST_s$,len(GLIST_s$)-GLIST_n%)
    else
        GLIST_s$ = right$(GLIST_s$,len(GLIST_s$)-1)
    end_if
    gosub GLIST_attrib_on : GLIST_n% = instr(GLIST_s$,"]") : print left$(GLIST_s$,GLIST_n%-1); : gosub GLIST_attrib_off : if GLIST_n%<len(GLIST_s$) then print right$(GLIST_s$,len(GLIST_s$)-GLIST_n%-1);
    gosub GLIST_select_off : print
    return

GLIST_select_on:
    select GLIST_mode_selection%(GLIST_index%)
        case 0                                          : ' rien à faire dans ce cas
        case 1: print "=> ";                            : ' révéler par une flèche
        case 2: font_bold GLIST_numero_objet%+1          : ' révéler par le gras
        case 3: font_underline GLIST_numero_objet%+1    : ' révéler par le sousligné
        case 4                                          : ' révélation par écriture blanche sur fond bleu
            GLIST_x1% = 0 : GLIST_y1% = (GLIST_i%-1)*14 : 2d_fill_color 0,0,255 : 2d_pen_color 0,0,255
            2d_rectangle GLIST_x1%,GLIST_y1%,GLIST_x1%+GLIST_largeur_affichage%(GLIST_index%),GLIST_y1%+14 : font_color GLIST_numero_objet%+1,255,255,255
' *** ici, d'autres modes de révélation de la ligne sélectionnée peuvent être définis
    end_select
    return

GLIST_select_off:
    select GLIST_mode_selection%(GLIST_index%)
        case 0                                            : ' rien à faire dans ce cas
        case 1                                            : ' rien à faire dans ce cas
        case 2: font_bold_off GLIST_numero_objet%+1      : ' enlever le gras
        case 3: font_underline_off GLIST_numero_objet%+1  : ' enlever le sousligné
        case 4                                            : ' enlever écriture blanche sur fond bleu
            2d_fill_color 255,255,255 : 2d_pen_color 255,255,255 : font_color GLIST_numero_objet%+1,0,0,0
' *** ici, d'autres modes de révélation de la ligne sélectionnée peuvent être définis
    end_select
    return

' ************* forcer les attributs
GLIST_attrib_on:
    if GLIST_ligne_selection%(GLIST_index%)=0
        font_color GLIST_numero_objet%+1,GLIST_font_attributs%((GLIST_index%-1)*10+GLIST_code%,1),GLIST_font_attributs%((GLIST_index%-1)*10+GLIST_code%,2),GLIST_font_attributs%((GLIST_index%-1)*10+GLIST_code%,3)
        if GLIST_font_attributs%((GLIST_index%-1)*10+GLIST_code%,0)=1 then font_bold GLIST_numero_objet%+1
    end_if
    return

' annuler tous les attributs
' ************* annuler ici tous les nouveaux attributs créés
GLIST_attrib_off:
    if GLIST_ligne_selection%(GLIST_index%)=0
        font_color GLIST_numero_objet%+1,0,0,0
        font_bold_off GLIST_numero_objet%+1
    end_if
    return

' ************* changement des ascenseurs
' gestion de la scroll_bar
GLIST_change:
    for GLIST_i%=1 to GLIST_n_listes%
        if position(GLIST_liste_listes%(GLIST_i%)+2)<>GLIST_scroll%(GLIST_i%)
            GLIST_index% = GLIST_i%
            GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)
            GLIST_scroll%(GLIST_index%) = position(GLIST_numero_objet%+2)
            2d_target_is GLIST_numero_objet%+1
            print_target_is GLIST_numero_objet%+1
            GLIST_nr%(GLIST_index%) = position(GLIST_numero_objet%+2)
            GLIST_scroll%(GLIST_index%) = GLIST_nr%(GLIST_index%)
            gosub GLIST_do_synchro
            exit_for
        end_if
    next GLIST_i%
GLIST_changeb:
    2d_clear
GLIST_changea:
    print_locate 0,0
    GLIST_max% = GLIST_lignes_affichage%(GLIST_index%)
    if GLIST_nombre_dans_liste%(GLIST_index%)<GLIST_max% then GLIST_max% = GLIST_nombre_dans_liste%(GLIST_index%)
    for GLIST_i%=1 to GLIST_max%
        if (GLIST_nr%(GLIST_index%)+GLIST_i%-1)>GLIST_nombre_dans_liste%(GLIST_index%) then exit_for
        GLIST_s$ = item_read$(GLIST_numero_objet%,GLIST_nr%(GLIST_index%)+GLIST_i%-1)
        GLIST_ligne_selection%(GLIST_index%) = 0
        on_error_goto GLIST_fin2
        if GLIST_nr%(GLIST_index%)+GLIST_i%-1=GLIST_ligne_choisie%(GLIST_index%) then GLIST_ligne_selection%(GLIST_index%) = 1
        off_error_goto
        gosub GLIST_print_line
    next GLIST_i%
GLIST_fin2:
    off_error_goto
    return

GLIST_click_liste:
    for GLIST_i%=1 to GLIST_n_listes%
        if clicked(GLIST_liste_listes%(GLIST_i%)+1)=1
            GLIST_index% = GLIST_i%
            GLIST_numero_objet% = GLIST_liste_listes%(GLIST_index%)
            2d_target_is GLIST_numero_objet%+1
            print_target_is GLIST_numero_objet%+1
            GLIST_xx% = mouse_x_left_down(GLIST_numero_objet%+1)
            GLIST_yy% = mouse_y_left_down(GLIST_numero_objet%+1)
            GLIST_v% = GLIST_nr%(GLIST_index%) + int((GLIST_yy%+13)/14) - 1
            if GLIST_v%>GLIST_nombre_dans_liste%(GLIST_index%) then return
            GLIST_ligne_choisie%(GLIST_index%) = GLIST_v%
            GLIST_synchro_choisie% = GLIST_v%
            gosub GLIST_changeb
            gosub GLIST_do_synchro
            GLIST_params$ = "Liste "+str$(GLIST_index%)+"  ligne "+str$(GLIST_ligne_choisie%(GLIST_index%))
            if GLIST_error_mode%=1 then GLIST_err% = message_error_OK(GLIST_params$)
            return
        end_if
    next GLIST_i%
    return
Place dem__tab.bas, tab_bas et glist.bas dans le même répertoire et lance demo_tab.bas. Clique sur chaque onglet et découvre...
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
demenvil

demenvil


Nombre de messages : 171
Age : 34
Localisation : France Marseille
Date d'inscription : 30/06/2012

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyMer 4 Juil 2012 - 18:44

Un sacré bout de code ^^
Je vais dl et regarder cela Smile
Revenir en haut Aller en bas
http://www.newsd3v.com
Severin




Nombre de messages : 547
Localisation : Braunschweig / Germany
Date d'inscription : 13/12/2010

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyJeu 5 Juil 2012 - 21:36

@demenvil

Schönes outfit. Ein Menü wäre nicht schlecht.
Die Form 0, einstellen auf die Ansicht und fast perfekt.
Severin

Belle tenue. Un menu ne serait pas mal.
La forme de 0, défini sur la vue et presque parfait.
Severin
Revenir en haut Aller en bas
demenvil

demenvil


Nombre de messages : 171
Age : 34
Localisation : France Marseille
Date d'inscription : 30/06/2012

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptyJeu 5 Juil 2012 - 22:17

Merci Smile
Je vais voir pour faire une nouvelle source avec un vrai menu Wink
Revenir en haut Aller en bas
http://www.newsd3v.com
ambroise




Nombre de messages : 264
Localisation : Haute-Savoie
Date d'inscription : 29/04/2012

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptySam 14 Juil 2012 - 9:32

Bonjour Klaus,

J'ai obtenu cette erreur :

Systeme d'onglets PANORAMIC Onglets

J'ai, bien sûr, mis les 3 fichiers dans le même dossier.
Revenir en haut Aller en bas
http://genealogie.cwebh.org/index.html
Klaus

Klaus


Nombre de messages : 12293
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptySam 14 Juil 2012 - 11:46

As-tu essayé de simplement relancer le programme ? C'est le genre d'erreur qui arrive souvent, au premire lancement d'un programme Panoramic.

Sinon, essaie de copier tout le contenu du fichier innclu par #INCLUDE, en lieu et place de cette directive. Tu verras alors à quelle ligne il y a le problème, et je pourrai mieux intervenir.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
ambroise




Nombre de messages : 264
Localisation : Haute-Savoie
Date d'inscription : 29/04/2012

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptySam 14 Juil 2012 - 12:01

La ligne incriminée était : file_load TAB_numero_objet%,"TAB_vide.bmp"

J'ai donc créé le fichier image TAB_vide.bmp et maintenant ça marche.

Le résultat est magnifique !

Revenir en haut Aller en bas
http://genealogie.cwebh.org/index.html
Klaus

Klaus


Nombre de messages : 12293
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC EmptySam 14 Juil 2012 - 13:57

Très bien !

Ce problème avec les modules #INCLUDE, c'est souvent d'iddentifier la ligne qui génère l'erreur. L'astuce que je t'ai donnée, permet de vaincre cette difficulté. Tu t'en es bien sorti - bravo !

Je suis très content que le résultat te plaise. J'ai investi pas mal de temps dans le développement de ce pseudo-objet, et je suis content de voir que ça sert à quelque chose.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Contenu sponsorisé





Systeme d'onglets PANORAMIC Empty
MessageSujet: Re: Systeme d'onglets PANORAMIC   Systeme d'onglets PANORAMIC Empty

Revenir en haut Aller en bas
 
Systeme d'onglets PANORAMIC
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Un système expert en Panoramic
» [Résolu] Récuperer les fonctions systeme de Panoramic
» Logithèque : une base de données en Panoramic pour Panoramic
» Caractéristiques système
» Système expert.

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: A l'aide!-
Sauter vers: