Marc
Nombre de messages : 2466 Age : 63 Localisation : TOURS (37) Date d'inscription : 17/03/2014
| Sujet: Idée de menu Ven 24 Aoû 2018 - 10:39 | |
| Bonjour à tous ! Voici une trame extraite d’un de mes programmes en cours qui peut apporter une idée de menu. Il suffit de survoler l’icône avec la souris pour déployer le corps du menu. A adapter, à personnaliser... - Code:
-
' ------------------------------------------------------------------------------ ' Idée de menu géré par le survol de la souris ' Marc - Aout 2018 - Panoramic v0.9.28 ' http://panoramic-language.pagesperso-orange.fr/French/index.html ' http://panoramic.1fr1.net/ ' ------------------------------------------------------------------------------
Init() END ' ------------------------------------------------------------------------------ SUB Init() LABEL Quit LABEL Affiche_menu_principal, Cache_menu_principal, Click LABEL Choix0_Selected, Choix1_Selected, Choix2_Selected, Choix3_Selected, Choix4_Selected LABEL Choix5_Selected, Choix6_Selected, Choix7_Selected, Choix8_Selected, Choix9_Selected DIM Choix%, ChoixSelect%,m%,i% MAXIMIZE 0 ON_CLOSE 0, Quit FULL_SPACE 0 COLOR 0,25,50,100 Bouton_Principal() Menu_Principal() ON_MOUSE_MOVE 21, Affiche_menu_principal ON_MOUSE_MOVE 0, Cache_menu_principal END_SUB ' ------------------------------------------------------------------------------ Affiche_menu_principal: SHOW 22 ON_MOUSE_MOVE 0, Cache_menu_principal RETURN ' ------------------------------------------------------------------------------ Cache_menu_principal: HIDE 22 OFF_MOUSE_MOVE 0 RETURN ' ------------------------------------------------------------------------------ SUB Bouton_Principal() COMMAND_TARGET_IS 0 PICTURE 21 WIDTH 21,30 HEIGHT 21,30 LEFT 21,15 TOP 21,15 COLOR 21,255,255,255 2D_TARGET_IS 21 2D_PEN_COLOR 0,0,0 2D_PEN_WIDTH 1 2D_LINE 5,8,25,8 2D_LINE 5,15,25,15 2D_LINE 5,22,25,22 END_SUB ' ------------------------------------------------------------------------------ SUB Menu_Principal() COMMAND_TARGET_IS 0 PANEL 22 TOP 22,15 LEFT 22,15 WIDTH 22,150 HEIGHT 22,300 COLOR 22,255,255,255 COMMAND_TARGET_IS 22 Choix1(0,5) Choix2(0,30) Choix3(0,55) Choix4(0,80) Choix5(0,105) Choix6(0,130) Choix7(0,155) Choix8(0,180) Choix9(0,270) ON_MOUSE_MOVE 22, Choix0_Selected HIDE 22 END_SUB ' ------------------------------------------------------------------------------ SUB Choix1(x,y) PICTURE 23 WIDTH 23,150 HEIGHT 23,24 LEFT 23,x TOP 23,y COLOR 23,255,255,255 2D_TARGET_IS 23 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 23 FONT_NAME 23,"Arial" FONT_SIZE 23,12 PRINT_LOCATE 25,3 PRINT "Choix 1" ON_MOUSE_MOVE 23, Choix1_Selected ON_CLICK 23,Click END_SUB ' ------------------------------------------------------------------------------ SUB Choix2(x,y) PICTURE 24 WIDTH 24,150 HEIGHT 24,24 LEFT 24,x TOP 24,y COLOR 24,255,255,255 2D_TARGET_IS 24 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 24 FONT_NAME 24,"Arial" FONT_SIZE 24,12 PRINT_LOCATE 25,3 PRINT "Choix 2" ON_MOUSE_MOVE 24, Choix2_Selected ON_CLICK 24,Click END_SUB ' ------------------------------------------------------------------------------ SUB Choix3(x,y) PICTURE 25 WIDTH 25,150 HEIGHT 25,24 LEFT 25,x TOP 25,y COLOR 25,255,255,255 2D_TARGET_IS 25 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 25 FONT_NAME 25,"Arial" FONT_SIZE 25,12 PRINT_LOCATE 25,3 PRINT "Choix 3" ON_MOUSE_MOVE 25, Choix3_Selected ON_CLICK 25,Click END_SUB ' ------------------------------------------------------------------------------ SUB Choix4(x,y) PICTURE 26 WIDTH 26,150 HEIGHT 26,24 LEFT 26,x TOP 26,y COLOR 26,255,255,255 2D_TARGET_IS 26 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 26 FONT_NAME 26,"Arial" FONT_SIZE 26,12 PRINT_LOCATE 25,3 PRINT "Choix 4" ON_MOUSE_MOVE 26, Choix4_Selected ON_CLICK 26,Click END_SUB ' ------------------------------------------------------------------------------ SUB Choix5(x,y) PICTURE 27 WIDTH 27,150 HEIGHT 27,24 LEFT 27,x TOP 27,y COLOR 27,255,255,255 2D_TARGET_IS 27 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 27 FONT_NAME 27,"Arial" FONT_SIZE 27,12 PRINT_LOCATE 25,3 PRINT "Choix 5" ON_MOUSE_MOVE 27, Choix5_Selected ON_CLICK 27,Click END_SUB ' ------------------------------------------------------------------------------ SUB Choix6(x,y) PICTURE 28 WIDTH 28,150 HEIGHT 28,24 LEFT 28,x TOP 28,y COLOR 28,255,255,255 2D_TARGET_IS 28 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 28 FONT_NAME 28,"Arial" FONT_SIZE 28,12 PRINT_LOCATE 25,3 PRINT "Choix 6" ON_MOUSE_MOVE 28, Choix6_Selected ON_CLICK 28,Click END_SUB ' ------------------------------------------------------------------------------ SUB Choix7(x,y) PICTURE 29 WIDTH 29,150 HEIGHT 29,24 LEFT 29,x TOP 29,y COLOR 29,255,255,255 2D_TARGET_IS 29 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 29 FONT_NAME 29,"Arial" FONT_SIZE 29,12 PRINT_LOCATE 25,3 PRINT "Choix 7" ON_MOUSE_MOVE 29, Choix7_Selected ON_CLICK 29,Click END_SUB ' ------------------------------------------------------------------------------ SUB Choix8(x,y) PICTURE 30 WIDTH 30,150 HEIGHT 30,24 LEFT 30,x TOP 30,y COLOR 30,255,255,255 2D_TARGET_IS 30 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 30 FONT_NAME 30,"Arial" FONT_SIZE 30,12 PRINT_LOCATE 25,3 PRINT "Choix 8" ON_MOUSE_MOVE 30, Choix8_Selected ON_CLICK 30,Click END_SUB ' ------------------------------------------------------------------------------ SUB Choix9(x,y) PICTURE 31 HEIGHT 31,24 WIDTH 31,150 LEFT 31,x TOP 31,y COLOR 31,255,255,255 2D_TARGET_IS 31 PRINT_TARGET_IS 31 2D_FILL_COLOR 255,255,255 FONT_NAME 31,"Arial" FONT_SIZE 31,12 PRINT_LOCATE 25,3 PRINT "Quitter" ON_MOUSE_MOVE 31, Choix8_Selected ON_CLICK 31,Quit END_SUB ' ------------------------------------------------------------------------------ Choix0_Selected: IF ChoixSelect% = 0 THEN RETURN ChoixSelect% = 0 Change_Color() RETURN ' ------------------------------------------------------------------------------ Choix1_Selected: IF ChoixSelect% = 1 THEN RETURN ChoixSelect% = 1 Change_Color() RETURN ' ------------------------------------------------------------------------------ Choix2_Selected: IF ChoixSelect% = 2 THEN RETURN ChoixSelect% = 2 Change_Color() RETURN ' ------------------------------------------------------------------------------ Choix3_Selected: IF ChoixSelect% = 3 THEN RETURN ChoixSelect% = 3 Change_Color() RETURN ' ------------------------------------------------------------------------------ Choix4_Selected: IF ChoixSelect% = 4 THEN RETURN ChoixSelect% = 4 Change_Color() RETURN ' ------------------------------------------------------------------------------ Choix5_Selected: IF ChoixSelect% = 5 THEN RETURN ChoixSelect% = 5 Change_Color() RETURN ' ------------------------------------------------------------------------------ Choix6_Selected: IF ChoixSelect% = 6 THEN RETURN ChoixSelect% = 6 Change_Color() RETURN ' ------------------------------------------------------------------------------ Choix7_Selected: IF ChoixSelect% = 7 THEN RETURN ChoixSelect% = 7 Change_Color() RETURN ' ------------------------------------------------------------------------------ Choix8_Selected: IF ChoixSelect% = 8 THEN RETURN ChoixSelect% = 8 Change_Color() RETURN ' ------------------------------------------------------------------------------ Choix9_Selected: IF ChoixSelect% = 9 THEN RETURN ChoixSelect% = 9 Change_Color() RETURN ' ------------------------------------------------------------------------------ SUB Change_Color() FOR i%=22 to 31 OFF_MOUSE_MOVE i% NEXT i% Cancel_Change_Color() SELECT ChoixSelect% CASE 0 m%=0 CASE 1 m%=1 COLOR 23,230,230,230 2D_TARGET_IS 23 2D_FILL_COLOR 230,230,230 PRINT_TARGET_IS 23 FONT_NAME 23,"Arial" FONT_SIZE 23,12 PRINT_LOCATE 25,3 PRINT "Choix 1" CASE 2 m%=2 COLOR 24,230,230,230 2D_TARGET_IS 24 2D_FILL_COLOR 230,230,230 PRINT_TARGET_IS 24 FONT_NAME 24,"Arial" FONT_SIZE 24,12 PRINT_LOCATE 25,3 PRINT "Choix 2" CASE 3 m%=3 COLOR 25,230,230,230 2D_TARGET_IS 25 2D_FILL_COLOR 230,230,230 PRINT_TARGET_IS 25 FONT_NAME 25,"Arial" FONT_SIZE 25,12 PRINT_LOCATE 25,3 PRINT "Choix 3" CASE 4 m%=4 COLOR 26,230,230,230 2D_TARGET_IS 26 2D_FILL_COLOR 230,230,230 PRINT_TARGET_IS 26 FONT_NAME 26,"Arial" FONT_SIZE 26,12 PRINT_LOCATE 25,3 PRINT "Choix 4" CASE 5 m%=5 COLOR 27,230,230,230 2D_TARGET_IS 27 2D_FILL_COLOR 230,230,230 PRINT_TARGET_IS 27 FONT_NAME 27,"Arial" FONT_SIZE 27,12 PRINT_LOCATE 25,3 PRINT "Choix 5" CASE 6 m%=6 COLOR 28,230,230,230 2D_TARGET_IS 28 2D_FILL_COLOR 230,230,230 PRINT_TARGET_IS 28 FONT_NAME 28,"Arial" FONT_SIZE 28,12 PRINT_LOCATE 25,3 PRINT "Choix 6" CASE 7 m%=7 COLOR 29,230,230,230 2D_TARGET_IS 29 2D_FILL_COLOR 230,230,230 PRINT_TARGET_IS 29 FONT_NAME 29,"Arial" FONT_SIZE 29,12 PRINT_LOCATE 25,3 PRINT "Choix 7" CASE 8 m%=8 COLOR 30,230,230,230 2D_TARGET_IS 30 2D_FILL_COLOR 230,230,230 PRINT_TARGET_IS 30 FONT_NAME 30,"Arial" FONT_SIZE 30,12 PRINT_LOCATE 25,3 PRINT "Choix 8" CASE 9 m%=9 COLOR 31,230,230,230 2D_TARGET_IS 31 PRINT_TARGET_IS 31 2D_FILL_COLOR 230,230,230 FONT_NAME 31,"Arial" FONT_SIZE 31,12 PRINT_LOCATE 25,3 PRINT "Quitter" END_SELECT ON_MOUSE_MOVE 22, Choix0_Selected ON_MOUSE_MOVE 23, Choix1_Selected ON_MOUSE_MOVE 24, Choix2_Selected ON_MOUSE_MOVE 25, Choix3_Selected ON_MOUSE_MOVE 26, Choix4_Selected ON_MOUSE_MOVE 27, Choix5_Selected ON_MOUSE_MOVE 28, Choix6_Selected ON_MOUSE_MOVE 29, Choix7_Selected ON_MOUSE_MOVE 30, Choix8_Selected ON_MOUSE_MOVE 31, Choix9_Selected END_SUB ' ------------------------------------------------------------------------------ Sub Cancel_Change_Color() SELECT m% CASE 1 COLOR 23,255,255,255 2D_TARGET_IS 23 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 23 FONT_NAME 23,"Arial" FONT_SIZE 23,12 PRINT_LOCATE 25,3 PRINT "Choix 1" CASE 2 COLOR 24,255,255,255 2D_TARGET_IS 24 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 24 FONT_NAME 24,"Arial" FONT_SIZE 24,12 PRINT_LOCATE 25,3 PRINT "Choix 2" CASE 3 COLOR 25,255,255,255 2D_TARGET_IS 25 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 25 FONT_NAME 25,"Arial" FONT_SIZE 25,12 PRINT_LOCATE 25,3 PRINT "Choix 3" CASE 4 COLOR 26,255,255,255 2D_TARGET_IS 26 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 26 FONT_NAME 26,"Arial" FONT_SIZE 26,12 PRINT_LOCATE 25,3 PRINT "Choix 4" CASE 5 COLOR 27,255,255,255 2D_TARGET_IS 27 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 27 FONT_NAME 27,"Arial" FONT_SIZE 27,12 PRINT_LOCATE 25,3 PRINT "Choix 5" CASE 6 COLOR 28,255,255,255 2D_TARGET_IS 28 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 28 FONT_NAME 28,"Arial" FONT_SIZE 28,12 PRINT_LOCATE 25,3 PRINT "Choix 6" CASE 7 COLOR 29,255,255,255 2D_TARGET_IS 29 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 29 FONT_NAME 29,"Arial" FONT_SIZE 29,12 PRINT_LOCATE 25,3 PRINT "Choix 7" CASE 8 COLOR 30,255,255,255 2D_TARGET_IS 30 2D_FILL_COLOR 255,255,255 PRINT_TARGET_IS 30 FONT_NAME 30,"Arial" FONT_SIZE 30,12 PRINT_LOCATE 25,3 PRINT "Choix 8" CASE 9 COLOR 31,255,255,255 2D_TARGET_IS 31 PRINT_TARGET_IS 31 2D_FILL_COLOR 255,255,255 FONT_NAME 31,"Arial" FONT_SIZE 31,12 PRINT_LOCATE 25,3 PRINT "Quitter" END_SELECT END_SUB ' ------------------------------------------------------------------------------ Click: Choix%=Number_Click PRINT_TARGET_IS 0 FONT_NAME 0,"Times New Roamn" FONT_SIZE 0,50 FONT_COLOR 0,255,255,255 PRINT_LOCATE 300,300 SELECT Choix% CASE 23 PRINT "Choix 1" CASE 24 PRINT "Choix 2" CASE 25 PRINT "Choix 3" CASE 26 PRINT "Choix 4" CASE 27 PRINT "Choix 5" CASE 28 PRINT "Choix 6" CASE 29 PRINT "Choix 7" CASE 30 PRINT "Choix 8" END_SELECT RETURN ' ------------------------------------------------------------------------------ Quit: TERMINATE RETURN
Bonne programmation à tous ! | |
|