Mai 2024 | Lun | Mar | Mer | Jeu | Ven | Sam | Dim |
---|
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | | | Calendrier |
|
| | creer des menu pour panoramic | |
| | Auteur | Message |
---|
pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: creer des menu pour panoramic Sam 19 Avr 2014 - 12:32 | |
| je remet mon source pour creer des menus de panoramic je pense qu'il ny a plus de bug code: - Code:
-
caption 0,"Edit Menu V 0.1 14" left 0,(screen_x/2)-(width(0)/2) height 0,498 variable_label() ON_KEY_DOWN 0,touche
error_french
main_menu 2000 Sub_Menu 2010:caption 2010,"Fichier":parent 2010,2000
Sub_Menu 2015:caption 2015,"Nouveau N " parent 2015,2010 on_click 2015,nouveau_menu
Sub_Menu 2020:caption 2020,"Ouvrir O " parent 2020,2010 on_click 2020,Ouvrir_prj
Sub_Menu 2021:caption 2021,"Sauver S " parent 2021,2010 on_click 2021,Sauver_prj
Sub_menu 2022:Caption 2022,"Fermer F" parent 2022,2010 on_click 2022,Fermer
Sub_Menu 2024:caption 2024,"-" parent 2024,2010
Sub_Menu 2025:caption 2025,"Quitter Q" parent 2025,2010 on_click 2025,quitter
Sub_Menu 2030:caption 2030,"Projet":parent 2030,2000 inactive 2030 Sub_Menu 2035:caption 2035,"Executer E" parent 2035,2030 on_click 2035,execut Sub_Menu 2036:caption 2036,"Sauver en (.BAS) B" parent 2036,2030 on_click 2036,bas
Sub_menu 2040:Caption 2040,"Aide":parent 2040,2000 on_click 2040,aide
Sub_menu 2050:Caption 2050,"A Propos":parent 2050,2000 on_click 2050,Propos
form 2200 left 2200,150 height 2200,height(0)+1 width 2200,260 caption 2200,"Parametre" command_target_is 2200 font_bold 2200 list 2210 width 2210,width(2200)-16 height 2210,347 on_click 2210,a_jour
grid 2215 width 2215,width(2200)-16 grid_row 2215,5 grid_row_height 2215,17 grid_column 2215,2 grid_column_width 2215,119 top 2215,349 height 2215,95 font_bold 2215 grid_write 2215,1,1,"Réference" grid_write 2215,1,2,"Valeur" grid_write 2215,2,1,"Caption" grid_write 2215,3,1,"ID" grid_write 2215,4,1,"Parent" grid_write 2215,5,1,"On_Click" on_click 2215,procedure
edit 2220 left 2220,122 top 2220,423 width 2220,119 height 2220,17 hide 2220 on_key_down 2220,entrer set_focus 0
dossier_courant$="C:\Program Files\EditMenu" open_dialog 5200 filter 5200,"Projet|*.prj" dir_dialog 5200,dossier_courant$ save_dialog 5210 filter 5210,"Projet|*.prj" dir_dialog 5210,dossier_courant$
timer 5300: timer_interval 5300,1: on_timer 5300,parameter end
' =============================================================================================================
' NOUVEAU MENU (MAIN_MENU)
nouveau_menu: if menu$(1,1)<>"" then gosub Fermer timer_off 5300
if message_input("Main_Menu", "ID= (chiffre)" , "?")=1 if numeric(message_text$)=0 application_title "Erreur de saisie!" message " VOUS DEVEZ METRE UNE VALEUR NUMERIC !" goto nouveau_menu end_if Main_Menu%=val(message_text$) else return end_if
panel Main_Menu% top Main_Menu%,2 left Main_Menu%,0 width Main_Menu%,width(0)-16 height Main_Menu%,18 color Main_Menu%,212,219,238 parent Main_Menu%,0 font_name Main_Menu%,"arial" font_size Main_Menu%,10 caption Main_Menu%,"Cliquer ici pour commencer!"
pos_x%=pos_x%+1 menu$(pos_x%,1)="Main_Menu" :' nom menu$(pos_x%,2)="-Aucun-" :' caption menu$(pos_x%,3)=str$(Main_Menu%) :' ref id menu$(pos_x%,4)="0" :' parent id ref%=pos_x% gosub a_jour1 item_add 2210,menu$(pos_x%,1)+" "+menu$(pos_x%,3)
id_alpha%=Main_Menu% active 2030 on_click Main_Menu%,inser_menu timer_on 5300 return
' NOUVEAU MENU (MAIN_MENU) ' =============================================================================================================
' INSERT_MENU
inser_menu: timer_off 5300 hide_menu() Caption Main_Menu%,"" pos_x%=pos_x%+1 menu$(pos_x%,1)="" :' nom menu$(pos_x%,2)="" :' caption menu$(pos_x%,3)="" :' ref id menu$(pos_x%,4)="" :' parent id ref%=pos_x% gosub a_jour1
if message_input("Sub_Menu", "Caption:" , "?")=1 : ' affecter le caption Ncaption$=message_text$ else return end_if top_alpha%=1 height_panel%=25
id_alpha%=id_alpha%+1 Alpha id_alpha% left id_alpha%,6+left_alpha% top id_alpha%,2 parent id_alpha%,Main_Menu% cursor_point id_alpha%
font_name id_alpha%,"arial" font_size id_alpha%,9
caption id_alpha%,Ncaption$ left_alpha%=left(id_alpha%)+text_width(caption$(id_alpha%),id_alpha%)+8 parent_menu%=id_alpha% menu$(pos_x%,1)="Menu" :' nom menu$(pos_x%,2)=Ncaption$ :' caption menu$(pos_x%,3)=str$(id_alpha%) :' ref id menu$(pos_x%,4)=str$(Main_Menu%) :' parent id menu$(pos_x%,5)="" :' on_click gosub a_jour1 item_add 2210," "+menu$(pos_x%,1)+" "+menu$(pos_x%,3) on_click id_alpha%,NPanel timer_on 5300 return
' INSERT_MENU ' =============================================================================================================
' INSERT_SUB_MENU (MENU DEROULANT)
inser_Sub_Menu: timer_off 5300 Caption NPanel%,""
pos_x%=pos_x%+1 menu$(pos_x%,1)="" :' nom menu$(pos_x%,2)="" :' caption menu$(pos_x%,3)="" :' ref id menu$(pos_x%,4)="" :' parent id ref%=pos_x% gosub a_jour1
height Npanel%,height_panel%
if message_input("Sub_Menu", "Caption:" , str$(Npanel%))=1 : ' affecter le caption Ncaption$=message_text$ else return end_if
id_alpha%=id_alpha%+1 Alpha id_alpha% left id_alpha%,10 top id_alpha%,4+top_alpha% caption id_alpha%,Ncaption$ parent id_alpha%,NPanel% font_name id_alpha%,"arial" font_size id_alpha%,9 cursor_point id_alpha%
top_alpha%=top(id_alpha%)+text_height(caption$(id_alpha%),id_alpha%)+6 height_panel%=top_alpha%+25
menu$(pos_x%,1)="Sub_Menu" :' nom menu$(pos_x%,2)=Ncaption$ :' caption menu$(pos_x%,3)=str$(id_alpha%) :' ref id menu$(pos_x%,4)=str$(parent_menu%) :' parent id menu$(pos_x%,5)="" :' on_click menu$(pos_x%,6)=str$(NPanel%) :' Numero du panel
gosub a_jour1 item_add 2210," "+menu$(pos_x%,1)+" "+menu$(pos_x%,3) on_click id_alpha%,SubMENU timer_on 5300 return
' INSERT_SUB_MENU (MENU DEROULANT) ' =============================================================================================================
' Sub MENU
SubMENU: timer_off 5300 pos%=number_click if pos%<>id_alpha% then gosub ouvir_menu1 if pos%=id_alpha% ref%=pos_x% gosub a_jour1 end_if
timer_on 5300 return
' Sub MENU ' ============================================================================================
' OUVRIR UN PROJET
Ouvrir_prj: if menu$(1,1)<>"" then gosub Fermer timer_off 5300 cursor_hourglass 0 dlist 2225 projet$=file_name$(5210) if projet$="_" then return file_open_read 1,projet$
pos_x%=0
' compte les lignes du fichier prj et enregistre les ref dans dlist while file_eof(1) <> 1 pos%=pos%+1 item_add 2225,file_readln$(1) end_while ' enregistre le menu dans menu$(pos_x%,6) for ref%=1 to pos% step 6 objet%=ref% pos_x%=pos_x%+1 menu$(pos_x%,1)=item_read$(2225,objet%) menu$(pos_x%,2)=item_read$(2225,objet%+1) menu$(pos_x%,3)=item_read$(2225,objet%+2) menu$(pos_x%,4)=item_read$(2225,objet%+3) menu$(pos_x%,5)=item_read$(2225,objet%+4) menu$(pos_x%,6)=item_read$(2225,objet%+5) next ref% delete 2225 :' efface le stokage du menu dlist
' CREER LE MAIN_MENU main_menu%=val(menu$(1,3)) panel Main_Menu% top Main_Menu%,2 left Main_Menu%,0 width Main_Menu%,width(0)-16 height Main_Menu%,18 color Main_Menu%,212,219,238 parent Main_Menu%,0 font_name Main_Menu%,"arial" font_size Main_Menu%,10 item_add 2210,menu$(1,1)+" "+str$(Main_Menu%)
ref%=0 top_alpha%=0 left_alpha%=0
for ref%=2 to pos_x% ' CREER LES MENUS
if menu$(ref%,1)="Menu" item_add 2210," "+menu$(ref%,1)+" "+menu$(ref%,3) Ncaption$=menu$(ref%,2) id_alpha%=val(menu$(ref%,3)) alpha id_alpha% caption id_alpha%,Ncaption$ top id_alpha%,1 left id_alpha%,6+left_alpha% cursor_point id_alpha% parent id_alpha%,main_menu% on_click id_alpha%,NPanel font_name id_alpha%,"arial" font_size id_alpha%,9 left_alpha%=left(id_alpha%)+text_width(caption$(id_alpha%),id_alpha%)+8
if menu$(ref%,6)<>"" then Npanel%=val(menu$(ref%,6)) if object_exists(Npanel%)=0 then gosub NPanel1 caption Npanel%,"" hide Npanel% end_if
' CREER LES SUB_MENU if menu$(ref%,1)="Sub_Menu" objet%=Npanel% height Npanel%,height_panel% Ncaption$=menu$(ref%,2) item_add 2210," "+menu$(ref%,1)+" "+menu$(ref%,3) id_alpha%=val(menu$(ref%,3)) alpha id_alpha% left id_alpha%,10 top id_alpha%,4+top_alpha% caption id_alpha%,Ncaption$ cursor_point id_alpha% parent id_alpha%,objet% on_click id_alpha%,SubMENU font_name id_alpha%,"arial" font_size id_alpha%,9
' PLACEMENT DANS LE SUB_MENU top_alpha%=top(id_alpha%)+text_height(caption$(id_alpha%),id_alpha%)+6
height_panel%=27+(top(id_alpha%)+height(id_alpha%)+3) end_if if objet%<>Npanel% height_panel%=25 top_alpha%=0 end_if next ref%
file_close 1 cursor_default 0 active 2030 timer_on 5300 return
' OUVRIR UN PROJET ' ===========================================================================================================
' SAUVER LE PROJET POUR PANORAMIC (.BAS) bas: timer_off 5300 filter 5210,"Projet.bas|.BAS" projet$=file_name$(5210)+".bas" if projet$="_" then return file_open_write 1,projet$
file_writeln 1,"" ref%=0
repeat ref%=ref%+1 nom_model$=menu$(ref%,1)
if nom_model$="Main_Menu" file_writeln 1,"Command_target_is "+"0" file_writeln 1,menu$(ref%,1)+" "+menu$(ref%,3) end_if
if nom_model$="Menu" file_writeln 1,"Sub_menu "+menu$(ref%,3) file_writeln 1,"Caption "+menu$(ref%,3)+","+chr$(34)+menu$(ref%,2)+chr$(34) file_writeln 1,"Parent "+menu$(ref%,3)+","+menu$(ref%,4) file_writeln 1," " end_if
if nom_model$="Sub_Menu" file_writeln 1,"Sub_menu "+menu$(ref%,3) file_writeln 1,"Caption "+menu$(ref%,3)+","+chr$(34)+menu$(ref%,2)+chr$(34) file_writeln 1,"Parent "+menu$(ref%,3)+","+menu$(ref%,4) if menu$(ref%,5)<>"" then file_writeln 1,"Label "+menu$(ref%,5) if menu$(ref%,5)<>"" then file_writeln 1,"On_Click "+menu$(ref%,3)+","+menu$(ref%,5) file_writeln 1," " end_if until ref%=pos_x% file_writeln 1,"End " file_writeln 1,""
ref%=0 repeat ref%=ref%+1 if menu$(ref%,5)<>"" file_writeln 1,menu$(ref%,5)+":" file_writeln 1,"' Mettez ici votre code" file_writeln 1,"return" file_writeln 1,"" end_if until ref%=pos_x%
file_close 1 filter 5210,"Projet.prj|.prj" timer_on 5300 return
' SAUVER LE PROJET POUR PANORAMIC (.BAS) ' ===========================================================================================================
' SAUVER LE PROJET Sauver_prj: timer_off 5300 projet$=file_name$(5210)
if projet$="_" file_delete projet$ return end_if
file_open_write 1,projet$ ref%=0
repeat ref%=ref%+1
file_writeln 1,menu$(ref%,1) :' model file_writeln 1,menu$(ref%,2) :' caption file_writeln 1,menu$(ref%,3) :' ref id file_writeln 1,menu$(ref%,4) :' parent id file_writeln 1,menu$(ref%,5) :' on_click file_writeln 1,menu$(ref%,6) :' panel until ref%=pos_x% file_close 1
timer_on 5300 return
' SAUVER LE PROJET ' =============================================================================================================
' OUVRIR LE MENU (SHOWiNG LE MENU DEROULANT)
ouvir_menu: timer_off 5300 hide_menu() ouvir_menu1: ref%=0 repeat ref%=ref%+1 until val(menu$(ref%,3))=pos%
gosub a_jour1
if menu$(ref%,6)<>"" objet%=val(menu$(ref%,6)) show objet% end_if
timer_on 5300 return
' OUVRIR LE MENU (SHOWiNG LE MENU DEROULANT) ' ============================================================================================
' FERMER UN PROJET Fermer: timer_off 5300 if message_confirmation_yes_no("Vous allez perdre votre projet"+chr$(10)+" Confirmation ?")=0 then return ref%=0 repeat ref%=ref%+1 if numeric(menu$(ref%,3))=1 then id_alpha%=val(menu$(ref%,3))
if object_exists(id_alpha%)=1 then delete id_alpha%
until ref%=pos_x% Main_Menu%=-1 objet%=-1 height_panel%=25 top_alpha%=0 left_alpha%=0 Npanel%=2999 id_alpha%=0 pos_x%=0 clear 2210 inactive 2030 free menu$(1999,6):dim menu$(1999,6) gosub a_jour1 timer_on 5300 return
' FERMER UN PROJET ' =============================================================================================================
' METRE A JOUR ' c'est a dire metre a jour le grid
a_jour: if menu$(ref%,6)<>"" then hide val(menu$(ref%,6)) ref%=item_index(2210) if menu$(ref%,6)<>"" then show val(menu$(ref%,6)) a_jour1: grid_write 2215,2,2,menu$(ref%,2) grid_write 2215,3,2,menu$(ref%,3) grid_write 2215,4,2,menu$(ref%,4) grid_write 2215,5,2,menu$(ref%,5)
return
' METRE A JOUR ' =============================================================================================================
' PROCEDURE INSERER LA VALEUR "ON_CLICK"
procedure: timer_off 5300 show 2220 set_focus 2220 text 2220,grid_read$(2215,5,2) timer_on 5300 return
entrer: timer_off 5300 if key_down_code=13 hide 2220 grid_write 2215,5,2,text$(2220) menu$(pos_x%,5)=text$(2220) end_if timer_on 5300 return
' PROCEDURE INSERER LA VALEUR "ON_CLICK" ' =============================================================================================================
' EXECUTE LE PROJET
execut: timer_off 5300
timer_on 5300 return
' EXECUTE LE PROJET ' ===========================================================================================================
' PANEL A CREER DES MENU
NPanel: timer_off 5300 hide_menu() pos%=number_click if pos%<>id_alpha% then goto ouvir_menu
NPanel%=NPanel%+1 NPanel1: Panel NPanel% left NPanel%,left(id_alpha%)-5 top NPanel%,21 width NPanel%,130 height NPanel%,top(id_alpha%)+height(id_alpha%)+3 caption NPanel%,"Continuer ici" parent NPanel%,0 color NPanel%,212,219,238 font_name NPanel%,"arial" font_size NPanel%,10 menu$(pos_x%,6)=str$(Npanel%) on_click NPanel%,inser_Sub_Menu timer_on 5300 return
' PANEL A CREER DES MENU ' ===========================================================================================================
' << SOUS PROGRAMME >>
' VARIABLE ET LABEL
sub variable_label()
' VALEUR DES DIMENSION DIM top_panel% , left_panel% , width_panel% , height_panel% DIM parent_menu% , top_alpha% , left_alpha% , width_alpha% , left%
' VALEUR DU MENU ET CAPTION DIM pos%,pos_x%, Main_Menu% , Npanel% , id_alpha% , ref% , objet% , alpha_sel% DIM dossier_courant$ , nom_model$ , menu$(1999,6) , Ncaption$ , projet$
' LABEL LABEL inser_Sub_Menu , inser_menu , nouveau_menu , touche , Ouvrir_prj , bas LABEL Sauver_prj , Fermer , quitter , execut , a_jour , a_jour1 , procedure , entrer LABEL parameter , NPanel , ouvir_menu , aide , Propos , SubMENU , ouvir_menu1 , NPanel1
Npanel%=2999 Main_Menu%=-1 objet%=-1 height_panel%=25 top_alpha%=0 end_sub
' ID_CAPTION
sub id_caption() if message_input("Sub_Menu", "Caption:" , "?")=1 : ' affecter le caption Ncaption$=message_text$ else delete id_alpha% :' efface le Sub_Menu s'il n'a pas de nom (caption) id_alpha%=id_alpha%-1 return end_if caption id_alpha%,Ncaption$ :' inscrit le caption du nouveau menu end_sub
sub hide_menu() if object_exists(Npanel%)=1 if show(Npanel%)=1 then hide Npanel% end_if
if object_exists(objet%)=1 if show(objet%)=1 then hide objet% end_if end_sub
' << SOUS PROGRAMME >>
' VARIABLE ET LABEL ' =============================================================================================================
' DIVERS
touche: if (key_down_code=78) then gosub Creer_menu if (key_down_code=79) then gosub Ouvrir_prj if (key_down_code=81) then gosub quitter if (key_down_code=69) then gosub execut if (key_down_code=83) then gosub Sauver_prj if (key_down_code=67) then gosub inser_menu if (key_down_code=70) then gosub Fermer if (key_down_code=65) then gosub aide if (key_down_code=66) then gosub bas return
aide: timer_off 5300 application_title "Aide" message "Cliquer sur les panel pour creer"+chr$(10)+"les menus de votre choix" timer_on 5300 return
Propos: timer_off 5300 application_title "A Propos Edit_Menu" message " Edit_Menu 0.1 14"+chr$(10)+chr$(10)+"Programme specialement"+chr$(10)+"conçu pour Panoramic"+chr$(10)+chr$(10)+"Programmation P.Paulet"+chr$(10)+"Copyright "+chr$(169)+"2014" timer_on 5300 return
parameter: ' diminution ou agrandissement du panel selon la grandeur du form0 if object_exists(Main_Menu%)=1 then width Main_Menu%,width(0)-16 return
quitter: terminate return
Dernière édition par pascal10000 le Jeu 24 Avr 2014 - 13:54, édité 3 fois | |
| | | pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: Re: creer des menu pour panoramic Sam 19 Avr 2014 - 12:41 | |
| ah j'oubliai j'ai pas encore trouver la parade pour exécuter le source soit avec chain ou avec une commande! | |
| | | pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: Re: creer des menu pour panoramic Jeu 24 Avr 2014 - 12:00 | |
| svp donnez moi votre avis et des commentaires même si vous trouvez le projet anodin je suis sur que certain d'entre vous est intéresse pour ce logiciel mais à la première publication personne n'a donné son avis comme si il passait comme inaperçu et pourtant ce post a été visité plusieurs fois Maintenant si vous incriminez l'un d'entre nous il faut lui en faire part sur ce passé une bonne journée
| |
| | | papydall
Nombre de messages : 7002 Age : 73 Localisation : Moknine (Tunisie) Entre la chaise et le clavier Date d'inscription : 03/03/2012
| Sujet: Re: creer des menu pour panoramic Jeu 24 Avr 2014 - 12:50 | |
| - pascal10000 a écrit:
- Maintenant si vous incriminez l'un d'entre nous il faut lui en faire part
Non, Pascal, personne n’incrimine personne à ce que je sache. Ton projet est sûrement intéressant puisque tu y as passé du temps à le confectionner. Il est intéressant pour les autres aussi en ce sens qu’il y a certainement des astuces ou des méthodes de coder qu’on pourrait s’approprier pour enrichir nos connaissances et nous donner des idées. J’ai testé ton programme : c’est vrai que l’aide est un peu succincte. Ton programme y gagnera beaucoup si tu développes mieux cette aide. Remarque : Je vois que tu as essayé de mettre ton code entre les balises code, mais ça n’a pas marché. Pour utiliser ces balises, tu dois mettre ton code entre [ code ] et [ /code].Aucun espace ne doit se trouver entre les crochets. Voila, je remets le code en ordre. - Code:
-
caption 0,"Edit Menu V 0.1 14" left 0,(screen_x/2)-(width(0)/2) height 0,498 variable_label() ON_KEY_DOWN 0,touche
error_french
main_menu 2000 Sub_Menu 2010:caption 2010,"Fichier":parent 2010,2000
Sub_Menu 2015:caption 2015,"Nouveau N " parent 2015,2010 on_click 2015,nouveau_menu
Sub_Menu 2020:caption 2020,"Ouvrir O " parent 2020,2010 on_click 2020,Ouvrir_prj
Sub_Menu 2021:caption 2021,"Sauver S " parent 2021,2010 on_click 2021,Sauver_prj
Sub_menu 2022:Caption 2022,"Fermer F" parent 2022,2010 on_click 2022,Fermer
Sub_Menu 2024:caption 2024,"-" parent 2024,2010
Sub_Menu 2025:caption 2025,"Quitter Q" parent 2025,2010 on_click 2025,quitter
Sub_Menu 2030:caption 2030,"Projet":parent 2030,2000 inactive 2030 Sub_Menu 2035:caption 2035,"Executer E" parent 2035,2030 on_click 2035,execut Sub_Menu 2036:caption 2036,"Sauver en (.BAS) B" parent 2036,2030 on_click 2036,bas
Sub_menu 2040:Caption 2040,"Aide":parent 2040,2000 on_click 2040,aide
Sub_menu 2050:Caption 2050,"A Propos":parent 2050,2000 on_click 2050,Propos
form 2200 left 2200,150 height 2200,height(0)+1 width 2200,260 caption 2200,"Parametre" command_target_is 2200 font_bold 2200 list 2210 width 2210,width(2200)-16 height 2210,347 on_click 2210,a_jour
grid 2215 width 2215,width(2200)-16 grid_row 2215,5 grid_row_height 2215,17 grid_column 2215,2 grid_column_width 2215,119 top 2215,349 height 2215,95 font_bold 2215 grid_write 2215,1,1,"Réference" grid_write 2215,1,2,"Valeur" grid_write 2215,2,1,"Caption" grid_write 2215,3,1,"ID" grid_write 2215,4,1,"Parent" grid_write 2215,5,1,"On_Click" on_click 2215,procedure
edit 2220 left 2220,122 top 2220,423 width 2220,119 height 2220,17 hide 2220 on_key_down 2220,entrer set_focus 0
dossier_courant$="C:\Program Files\EditMenu" open_dialog 5200 filter 5200,"Projet|*.prj" dir_dialog 5200,dossier_courant$ save_dialog 5210 filter 5210,"Projet|*.prj" dir_dialog 5210,dossier_courant$
timer 5300: timer_interval 5300,1: on_timer 5300,parameter end
' =============================================================================================================
' NOUVEAU MENU (MAIN_MENU)
nouveau_menu: if menu$(1,1)<>"" then gosub Fermer timer_off 5300
if message_input("Main_Menu", "ID= (chiffre)" , "?")=1 if numeric(message_text$)=0 application_title "Erreur de saisie!" message " VOUS DEVEZ METRE UNE VALEUR NUMERIC !" goto nouveau_menu end_if Main_Menu%=val(message_text$) else return end_if
panel Main_Menu% top Main_Menu%,2 left Main_Menu%,0 width Main_Menu%,width(0)-16 height Main_Menu%,18 color Main_Menu%,212,219,238 parent Main_Menu%,0 font_name Main_Menu%,"arial" font_size Main_Menu%,10 caption Main_Menu%,"Cliquer ici pour commencer!"
pos_x%=pos_x%+1 menu$(pos_x%,1)="Main_Menu" :' nom menu$(pos_x%,2)="-Aucun-" :' caption menu$(pos_x%,3)=str$(Main_Menu%) :' ref id menu$(pos_x%,4)="0" :' parent id ref%=pos_x% gosub a_jour1 item_add 2210,menu$(pos_x%,1)+" "+menu$(pos_x%,3)
id_alpha%=Main_Menu% active 2030 on_click Main_Menu%,inser_menu timer_on 5300 return
' NOUVEAU MENU (MAIN_MENU) ' =============================================================================================================
' INSERT_MENU
inser_menu: timer_off 5300 hide_menu() Caption Main_Menu%,"" pos_x%=pos_x%+1 menu$(pos_x%,1)="" :' nom menu$(pos_x%,2)="" :' caption menu$(pos_x%,3)="" :' ref id menu$(pos_x%,4)="" :' parent id ref%=pos_x% gosub a_jour1
if message_input("Sub_Menu", "Caption:" , "?")=1 : ' affecter le caption Ncaption$=message_text$ else return end_if top_alpha%=1 height_panel%=25
id_alpha%=id_alpha%+1 Alpha id_alpha% left id_alpha%,6+left_alpha% top id_alpha%,2 parent id_alpha%,Main_Menu% cursor_point id_alpha%
font_name id_alpha%,"arial" font_size id_alpha%,9
caption id_alpha%,Ncaption$ left_alpha%=left(id_alpha%)+text_width(caption$(id_alpha%),id_alpha%)+8 parent_menu%=id_alpha% menu$(pos_x%,1)="Menu" :' nom menu$(pos_x%,2)=Ncaption$ :' caption menu$(pos_x%,3)=str$(id_alpha%) :' ref id menu$(pos_x%,4)=str$(Main_Menu%) :' parent id menu$(pos_x%,5)="" :' on_click gosub a_jour1 item_add 2210," "+menu$(pos_x%,1)+" "+menu$(pos_x%,3) on_click id_alpha%,NPanel timer_on 5300 return
' INSERT_MENU ' =============================================================================================================
' INSERT_SUB_MENU (MENU DEROULANT)
inser_Sub_Menu: timer_off 5300 Caption NPanel%,""
pos_x%=pos_x%+1 menu$(pos_x%,1)="" :' nom menu$(pos_x%,2)="" :' caption menu$(pos_x%,3)="" :' ref id menu$(pos_x%,4)="" :' parent id ref%=pos_x% gosub a_jour1
height Npanel%,height_panel%
if message_input("Sub_Menu", "Caption:" , str$(Npanel%))=1 : ' affecter le caption Ncaption$=message_text$ else return end_if
id_alpha%=id_alpha%+1 Alpha id_alpha% left id_alpha%,10 top id_alpha%,4+top_alpha% caption id_alpha%,Ncaption$ parent id_alpha%,NPanel% font_name id_alpha%,"arial" font_size id_alpha%,9 cursor_point id_alpha%
top_alpha%=top(id_alpha%)+text_height(caption$(id_alpha%),id_alpha%)+6 height_panel%=top_alpha%+25
menu$(pos_x%,1)="Sub_Menu" :' nom menu$(pos_x%,2)=Ncaption$ :' caption menu$(pos_x%,3)=str$(id_alpha%) :' ref id menu$(pos_x%,4)=str$(parent_menu%) :' parent id menu$(pos_x%,5)="" :' on_click menu$(pos_x%,6)=str$(NPanel%) :' Numero du panel
gosub a_jour1 item_add 2210," "+menu$(pos_x%,1)+" "+menu$(pos_x%,3) on_click id_alpha%,SubMENU timer_on 5300 return
' INSERT_SUB_MENU (MENU DEROULANT) ' =============================================================================================================
' Sub MENU
SubMENU: timer_off 5300 pos%=number_click if pos%<>id_alpha% then gosub ouvir_menu1 if pos%=id_alpha% ref%=pos_x% gosub a_jour1 end_if
timer_on 5300 return
' Sub MENU ' ============================================================================================
' OUVRIR UN PROJET
Ouvrir_prj: if menu$(1,1)<>"" then gosub Fermer timer_off 5300 cursor_hourglass 0 dlist 2225 projet$=file_name$(5210) if projet$="_" then return file_open_read 1,projet$
pos_x%=0
' compte les lignes du fichier prj et enregistre les ref dans dlist while file_eof(1) <> 1 pos%=pos%+1 item_add 2225,file_readln$(1) end_while ' enregistre le menu dans menu$(pos_x%,6) for ref%=1 to pos% step 6 objet%=ref% pos_x%=pos_x%+1 menu$(pos_x%,1)=item_read$(2225,objet%) menu$(pos_x%,2)=item_read$(2225,objet%+1) menu$(pos_x%,3)=item_read$(2225,objet%+2) menu$(pos_x%,4)=item_read$(2225,objet%+3) menu$(pos_x%,5)=item_read$(2225,objet%+4) menu$(pos_x%,6)=item_read$(2225,objet%+5) next ref% delete 2225 :' efface le stokage du menu dlist
' CREER LE MAIN_MENU main_menu%=val(menu$(1,3)) panel Main_Menu% top Main_Menu%,2 left Main_Menu%,0 width Main_Menu%,width(0)-16 height Main_Menu%,18 color Main_Menu%,212,219,238 parent Main_Menu%,0 font_name Main_Menu%,"arial" font_size Main_Menu%,10 item_add 2210,menu$(1,1)+" "+str$(Main_Menu%)
ref%=0 top_alpha%=0 left_alpha%=0
for ref%=2 to pos_x% ' CREER LES MENUS
if menu$(ref%,1)="Menu" item_add 2210," "+menu$(ref%,1)+" "+menu$(ref%,3) Ncaption$=menu$(ref%,2) id_alpha%=val(menu$(ref%,3)) alpha id_alpha% caption id_alpha%,Ncaption$ top id_alpha%,1 left id_alpha%,6+left_alpha% cursor_point id_alpha% parent id_alpha%,main_menu% on_click id_alpha%,NPanel font_name id_alpha%,"arial" font_size id_alpha%,9 left_alpha%=left(id_alpha%)+text_width(caption$(id_alpha%),id_alpha%)+8
if menu$(ref%,6)<>"" then Npanel%=val(menu$(ref%,6)) if object_exists(Npanel%)=0 then gosub NPanel1 caption Npanel%,"" hide Npanel% end_if
' CREER LES SUB_MENU if menu$(ref%,1)="Sub_Menu" objet%=Npanel% height Npanel%,height_panel% Ncaption$=menu$(ref%,2) item_add 2210," "+menu$(ref%,1)+" "+menu$(ref%,3) id_alpha%=val(menu$(ref%,3)) alpha id_alpha% left id_alpha%,10 top id_alpha%,4+top_alpha% caption id_alpha%,Ncaption$ cursor_point id_alpha% parent id_alpha%,objet% on_click id_alpha%,SubMENU font_name id_alpha%,"arial" font_size id_alpha%,9
' PLACEMENT DANS LE SUB_MENU top_alpha%=top(id_alpha%)+text_height(caption$(id_alpha%),id_alpha%)+6
height_panel%=27+(top(id_alpha%)+height(id_alpha%)+3) end_if if objet%<>Npanel% height_panel%=25 top_alpha%=0 end_if next ref%
file_close 1 cursor_default 0 active 2030 timer_on 5300 return
' OUVRIR UN PROJET ' ===========================================================================================================
' SAUVER LE PROJET POUR PANORAMIC (.BAS) bas: timer_off 5300 filter 5210,"Projet.bas|.BAS" projet$=file_name$(5210)+".bas" if projet$="_" then return file_open_write 1,projet$
file_writeln 1,"" ref%=0
repeat ref%=ref%+1 nom_model$=menu$(ref%,1)
if nom_model$="Main_Menu" file_writeln 1,"Command_target_is "+"0" file_writeln 1,menu$(ref%,1)+" "+menu$(ref%,3) end_if
if nom_model$="Menu" file_writeln 1,"Sub_menu "+menu$(ref%,3) file_writeln 1,"Caption "+menu$(ref%,3)+","+chr$(34)+menu$(ref%,2)+chr$(34) file_writeln 1,"Parent "+menu$(ref%,3)+","+menu$(ref%,4) file_writeln 1," " end_if
if nom_model$="Sub_Menu" file_writeln 1,"Sub_menu "+menu$(ref%,3) file_writeln 1,"Caption "+menu$(ref%,3)+","+chr$(34)+menu$(ref%,2)+chr$(34) file_writeln 1,"Parent "+menu$(ref%,3)+","+menu$(ref%,4) if menu$(ref%,5)<>"" then file_writeln 1,"Label "+menu$(ref%,5) if menu$(ref%,5)<>"" then file_writeln 1,"On_Click "+menu$(ref%,3)+","+menu$(ref%,5) file_writeln 1," " end_if until ref%=pos_x% file_writeln 1,"End " file_writeln 1,""
ref%=0 repeat ref%=ref%+1 if menu$(ref%,5)<>"" file_writeln 1,menu$(ref%,5)+":" file_writeln 1,"' Mettez ici votre code" file_writeln 1,"return" file_writeln 1,"" end_if until ref%=pos_x%
file_close 1 filter 5210,"Projet.prj|.prj" timer_on 5300 return
' SAUVER LE PROJET POUR PANORAMIC (.BAS) ' ===========================================================================================================
' SAUVER LE PROJET Sauver_prj: timer_off 5300 projet$=file_name$(5210)
if projet$="_" file_delete projet$ return end_if
file_open_write 1,projet$ ref%=0
repeat ref%=ref%+1
file_writeln 1,menu$(ref%,1) :' model file_writeln 1,menu$(ref%,2) :' caption file_writeln 1,menu$(ref%,3) :' ref id file_writeln 1,menu$(ref%,4) :' parent id file_writeln 1,menu$(ref%,5) :' on_click file_writeln 1,menu$(ref%,6) :' panel until ref%=pos_x% file_close 1
timer_on 5300 return
' SAUVER LE PROJET ' =============================================================================================================
' OUVRIR LE MENU (SHOWiNG LE MENU DEROULANT)
ouvir_menu: timer_off 5300 hide_menu() ouvir_menu1: ref%=0 repeat ref%=ref%+1 until val(menu$(ref%,3))=pos%
gosub a_jour1
if menu$(ref%,6)<>"" objet%=val(menu$(ref%,6)) show objet% end_if
timer_on 5300 return
' OUVRIR LE MENU (SHOWiNG LE MENU DEROULANT) ' ============================================================================================
' FERMER UN PROJET Fermer: timer_off 5300 if message_confirmation_yes_no("Vous allez perdre votre projet"+chr$(10)+" Confirmation ?")=0 then return ref%=0 repeat ref%=ref%+1 if numeric(menu$(ref%,3))=1 then id_alpha%=val(menu$(ref%,3))
if object_exists(id_alpha%)=1 then delete id_alpha%
until ref%=pos_x% Main_Menu%=-1 objet%=-1 height_panel%=25 top_alpha%=0 left_alpha%=0 Npanel%=2999 id_alpha%=0 pos_x%=0 clear 2210 inactive 2030 free menu$(1999,6):dim menu$(1999,6) gosub a_jour1 timer_on 5300 return
' FERMER UN PROJET ' =============================================================================================================
' METRE A JOUR ' c'est a dire metre a jour le grid
a_jour: if menu$(ref%,6)<>"" then hide val(menu$(ref%,6)) ref%=item_index(2210) if menu$(ref%,6)<>"" then show val(menu$(ref%,6)) a_jour1: grid_write 2215,2,2,menu$(ref%,2) grid_write 2215,3,2,menu$(ref%,3) grid_write 2215,4,2,menu$(ref%,4) grid_write 2215,5,2,menu$(ref%,5)
return
' METRE A JOUR ' =============================================================================================================
' PROCEDURE INSERER LA VALEUR "ON_CLICK"
procedure: timer_off 5300 show 2220 set_focus 2220 text 2220,grid_read$(2215,5,2) timer_on 5300 return
entrer: timer_off 5300 if key_down_code=13 hide 2220 grid_write 2215,5,2,text$(2220) menu$(pos_x%,5)=text$(2220) end_if timer_on 5300 return
' PROCEDURE INSERER LA VALEUR "ON_CLICK" ' =============================================================================================================
' EXECUTE LE PROJET
execut: timer_off 5300
timer_on 5300 return
' EXECUTE LE PROJET ' ===========================================================================================================
' PANEL A CREER DES MENU
NPanel: timer_off 5300 hide_menu() pos%=number_click if pos%<>id_alpha% then goto ouvir_menu
NPanel%=NPanel%+1 NPanel1: Panel NPanel% left NPanel%,left(id_alpha%)-5 top NPanel%,21 width NPanel%,130 height NPanel%,top(id_alpha%)+height(id_alpha%)+3 caption NPanel%,"Continuer ici" parent NPanel%,0 color NPanel%,212,219,238 font_name NPanel%,"arial" font_size NPanel%,10 menu$(pos_x%,6)=str$(Npanel%) on_click NPanel%,inser_Sub_Menu timer_on 5300 return
' PANEL A CREER DES MENU ' ===========================================================================================================
' << SOUS PROGRAMME >>
' VARIABLE ET LABEL
sub variable_label()
' VALEUR DES DIMENSION DIM top_panel% , left_panel% , width_panel% , height_panel% DIM parent_menu% , top_alpha% , left_alpha% , width_alpha% , left%
' VALEUR DU MENU ET CAPTION DIM pos%,pos_x%, Main_Menu% , Npanel% , id_alpha% , ref% , objet% , alpha_sel% DIM dossier_courant$ , nom_model$ , menu$(1999,6) , Ncaption$ , projet$
' LABEL LABEL inser_Sub_Menu , inser_menu , nouveau_menu , touche , Ouvrir_prj , bas LABEL Sauver_prj , Fermer , quitter , execut , a_jour , a_jour1 , procedure , entrer LABEL parameter , NPanel , ouvir_menu , aide , Propos , SubMENU , ouvir_menu1 , NPanel1
Npanel%=2999 Main_Menu%=-1 objet%=-1 height_panel%=25 top_alpha%=0 end_sub
' ID_CAPTION
sub id_caption() if message_input("Sub_Menu", "Caption:" , "?")=1 : ' affecter le caption Ncaption$=message_text$ else delete id_alpha% :' efface le Sub_Menu s'il n'a pas de nom (caption) id_alpha%=id_alpha%-1 return end_if caption id_alpha%,Ncaption$ :' inscrit le caption du nouveau menu end_sub
sub hide_menu() if object_exists(Npanel%)=1 if show(Npanel%)=1 then hide Npanel% end_if
if object_exists(objet%)=1 if show(objet%)=1 then hide objet% end_if end_sub
' << SOUS PROGRAMME >>
' VARIABLE ET LABEL ' =============================================================================================================
' DIVERS
touche: if (key_down_code=78) then gosub Creer_menu if (key_down_code=79) then gosub Ouvrir_prj if (key_down_code=81) then gosub quitter if (key_down_code=69) then gosub execut if (key_down_code=83) then gosub Sauver_prj if (key_down_code=67) then gosub inser_menu if (key_down_code=70) then gosub Fermer if (key_down_code=65) then gosub aide if (key_down_code=66) then gosub bas return
aide: timer_off 5300 application_title "Aide" message "Cliquer sur les panel pour creer"+chr$(10)+"les menus de votre choix" timer_on 5300 return
Propos: timer_off 5300 application_title "A Propos Edit_Menu" message " Edit_Menu 0.1 14"+chr$(10)+chr$(10)+"Programme specialement"+chr$(10)+"conçu pour Panoramic"+chr$(10)+chr$(10)+"Programmation P.Paulet"+chr$(10)+"Copyright "+chr$(169)+"2014" timer_on 5300 return
parameter: ' diminution ou agrandissement du panel selon la grandeur du form0 if object_exists(Main_Menu%)=1 then width Main_Menu%,width(0)-16 return
quitter: terminate return
| |
| | | pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: Re: creer des menu pour panoramic Jeu 24 Avr 2014 - 13:04 | |
| bjr papydall pour poste les source comme tu me le dit j'ai essaye par tous les moyen et apparemment cela ne fonctionne pas chez moi je suis sur "Mozilla" pour l'aide je vais essayé autre chose tout en gardant le code "message" et merci pour tes remarques | |
| | | papydall
Nombre de messages : 7002 Age : 73 Localisation : Moknine (Tunisie) Entre la chaise et le clavier Date d'inscription : 03/03/2012
| Sujet: Re: creer des menu pour panoramic Jeu 24 Avr 2014 - 13:21 | |
| Je ne pense pas que c’est mozilla qui est en cause. Il se peut que le BBCode est inactif chez toi. Voici comment faire : Clique sur Profil en haut de la page du Forum PréférencesCherche Toujours autoriser le BBCodeChoisis l’option OuiEnregistrerEt ça marchera (j'espère) Puis fais ce test : En haut et à droite de ton 1er post, tu vois le bouton editer à droite de citer ? Clique sur editerTu te retrouves dans Editer le sujetClique sur PrévisualiserSi tout va bien, ton code se trouvera entre les balises code, alors clique sur Envoyer | |
| | | pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: Re: creer des menu pour panoramic Jeu 24 Avr 2014 - 13:56 | |
| merci tu as raison ce n’était qu'une raison de configuration autant pour moi | |
| | | papydall
Nombre de messages : 7002 Age : 73 Localisation : Moknine (Tunisie) Entre la chaise et le clavier Date d'inscription : 03/03/2012
| Sujet: Re: creer des menu pour panoramic Jeu 24 Avr 2014 - 18:09 | |
| Je suis content pour toi. | |
| | | Invité Invité
| Sujet: Re: creer des menu pour panoramic Jeu 24 Avr 2014 - 20:20 | |
| - Citation :
- !!! LE SAVOIR NE VAUT RIEN S'IL N'EST PAS PARTAGE !!!
J'essaye de faire partager le vaurien, mais il ne veut pas le savoir!!! (ma note d'humour, après l'énervement que j'ai contre mon anti-virus!) |
| | | Jean Claude
Nombre de messages : 5948 Age : 69 Localisation : 83 Var Date d'inscription : 07/05/2009
| | | | papydall
Nombre de messages : 7002 Age : 73 Localisation : Moknine (Tunisie) Entre la chaise et le clavier Date d'inscription : 03/03/2012
| Sujet: Re: creer des menu pour panoramic Ven 25 Avr 2014 - 1:56 | |
| - cosmos70 a écrit:
- J'essaye de faire partager le vaurien, mais il ne veut pas le savoir!!!
Ah bon ! Tu es donc l'heureux possesseur d'un Vaurien ? Serait-ce celui-ci par hasard | |
| | | Invité Invité
| Sujet: Re: creer des menu pour panoramic Ven 25 Avr 2014 - 8:18 | |
| Ah oui! Tu as été gentil à mon égard. Tu aurais pu dire que le vaurien ce pouvait-être moi. En réalité, pour ce qui en reste de ce que je fais, c'est peut-être un vrai critère. |
| | | papydall
Nombre de messages : 7002 Age : 73 Localisation : Moknine (Tunisie) Entre la chaise et le clavier Date d'inscription : 03/03/2012
| Sujet: Re: creer des menu pour panoramic Ven 25 Avr 2014 - 23:52 | |
| @cosmos70 Ah non ! Jamais je n’oserais !
@pascal10000 J’arrête de spammer ton post. | |
| | | Contenu sponsorisé
| Sujet: Re: creer des menu pour panoramic | |
| |
| | | | creer des menu pour panoramic | |
|
Sujets similaires | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |