Page 1 sur 1

Calendrier républicain

Publié : lun. 04/avr./2016 14:22
par Micoute
Bonjour à tous,
pour ceux que ça intéresse, je vous offre ce calendrier républicain qui m'a donné un grand plaisir à programmer.

Code + images : http://s000.tinyupload.com/?file_id=041 ... 7185359964

Code seul :

Code : Tout sélectionner

Enumeration Fenetres
	#Fenetre_principale
EndEnumeration

Enumeration Gadgets
    #Txt_SelRep
    #Txt_ou
    #Txt_SelComp
    #Cmb_JcompInt
    #Btn_ConvGreg
    #Txt_SelGre
    #Btn_ConvRep    
    #Txt_Res
    #Str_Jres
    #Str_Mres
    #Str_Ares
    #Cmb_Jrep
    #Cmb_Mrep
    #Cmb_Arep
    #Cmb_Jgre
    #Cmb_Mgre
    #Cmb_Agre
    #Btn_ConvJComp
    #Img_Germinal
    #Img_Floreal
    #Img_Prairial
    #Img_Messidor
    #Img_Thermidor
    #Img_Fructidor
    #Img_Vendemiaire
    #Img_Brumaire
    #Img_Frimaire
    #Img_Nivose
    #Img_Pluviose
    #Img_Ventose
EndEnumeration

Enumeration Polices
    #Fnt_Texte_SelRep
    #Fnt_Texte_ou
    #Fnt_Texte_SelComp
    #Fnt_Bouton_ConvGreg
    #Fnt_Texte_SelGre
    #Fnt_Texte_Res
    #Fnt_Bouton_ConvJComp
    #Fnt_Bouton_ConvRep
    #Fnt_Combo_JcompInt
    #Fnt_Combo_Jrep
    #Fnt_Combo_Mrep
    #Fnt_Combo_Arep
    #Fnt_Combo_Jgre
    #Fnt_Combo_Mgre
    #Fnt_Combo_Agre
    #Fnt_Str_Jres
    #Fnt_Str_Mres
    #Fnt_Str_Ares
EndEnumeration


;}
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
Global JcompInt.s ,	JRep.s, Mrep.s, Arep.s, Jgre.i, Mgre.i, MoisGre$, Agre.i, Resultat
Global Dim Tableau.i(30,18)
;}
x = 0 : y = 0
Restore conversion
For x = 0 To 30
	For y = 0 To 18
		Read.i Tableau(x,y)
	Next
Next

UseJPEGImageDecoder()

Procedure Impossible()
	Jrep = "----"
	Mrep = "Impossible"
	Arep = "----"
EndProcedure

Procedure Convertir_en_gregorien()
	Jrep = GetGadgetText(#Cmb_Jrep)
	Mrep.s = GetGadgetText(#Cmb_Mrep)
	Arep.s = GetGadgetText(#Cmb_Arep)
	If Mrep = "Vendémiaire" Or Mrep = "Brumaire" Or Mrep = "Frimaire" Or Mrep = "Nivôse"
		Select Arep
			Case "an I"
				Agre = 1792
			Case "an II"
				Agre = 1793
			Case "an III"
				Agre = 1794
			Case "an IV"
				Agre = 1795
			Case "an V"
				Agre = 1796
			Case "an VI"
				Agre = 1797
			Case "an VII"
				Agre = 1798
			Case "an VIII"
				Agre = 1799
			Case "an IX"
				Agre = 1800
			Case "an X"
				Agre = 1801
			Case "an XI"
				Agre = 1802
			Case "an XII"
				Agre = 1803
			Case "an XIII"
				Agre = 1804
			Case "an XIV"
				Agre = 1805
		EndSelect
	ElseIf Mrep = "Pluviôse" Or Mrep = "Ventôse" Or Mrep = "Germinal" Or Mrep = "Floréal" Or Mrep = "Prairial" Or Mrep = "Messidor" Or Mrep ="Thermidor" Or Mrep = "Fructidor"
		Select Arep
			Case "an I"
				Agre = 1793
			Case "an II"
				Agre = 1794
			Case "an III"
				Agre = 1795
			Case "an IV"
				Agre = 1796
			Case "an V"
				Agre = 1797
			Case "an VI"
				Agre = 1798
			Case "an VII"
				Agre = 1799
			Case "an VIII"
				Agre = 1800
			Case "an IX"
				Agre = 1801
			Case "an X"
				Agre = 1802
			Case "an XI"
				Agre = 1803
			Case "an XII"
				Agre = 1804
			Case "an XIII"
				Agre = 1805
			Case "an XIV"
				Agre = 1806
		EndSelect
	EndIf
	
	Select Mrep
		Case "Vendémiaire" ;-Vendémiaire
			Select Agre
				Case 1792 To 1794, 1796 To 1798
					Resultat = 14
					If Val(Jrep) <= 9
						moisGre$ = "septembre"
					Else
						moisGre$ = "octobre"
					EndIf
				Case 1795
					Resultat = 16
					If Val(Jrep) <= 8
						moisGre$ = "septembre"
					Else
						moisGre$ = "octobre"
					EndIf
				Case 1799 To 1802, 1804, 1805
					Resultat = 16
					If Val(Jrep) <= 8
						moisGre$ = "septembre"
					Else
						moisGre$ = "octobre"
					EndIf
				Case 1803
					Resultat = 18
					If Val(Jrep) <= 7
						moisGre$ = "septembre"
					Else
						moisGre$ = "octobre"
					EndIf
					
			EndSelect
			
		Case "Brumaire" ;- Brumaire
			Select Agre
				Case 1792 To 1794, 1796 To 1798
					Resultat = 11
					If Val(Jrep) <= 10
						moisGre$ = "octobre"
					Else
						moisGre$ = "novembre"
					EndIf
				Case 1795
					Resultat =15
					If Val(Jrep) <= 9
						moisGre$ = "octobre"
					Else
						moisGre$ = "novembre"
					EndIf
				Case 1799 To 1802, 1804, 1805
					Resultat = 15
					If Val(Jrep) <= 9
						moisGre$ = "octobre"
					Else
						moisGre$ = "novembre"
					EndIf
				Case 1803
					Resultat = 17
					If Val(Jrep) <= 8
						moisGre$ = "octobre"
					Else
						moisGre$ = "novembre"
					EndIf
			EndSelect
		Case "Frimaire" ;- Frimaire
			Select Agre
				Case 1792 To 1794, 1796 To 1798
					Resultat = 10
					If Val(Jrep) <= 10
						moisGre$ = "novembre"
					Else
						moisGre$ = "décembre"
					EndIf
				Case 1795
					Resultat =14
					If Val(Jrep) <= 8
						moisGre$ = "novembre"
					Else
						moisGre$ = "décembre"
					EndIf
				Case 1799 To 1802, 1804, 1805
					Resultat = 14
					If Val(Jrep) <= 9
						moisGre$ = "novembre"
					Else
						moisGre$ = "décembre"
					EndIf
				Case 1803
					Resultat = 16
					If Val(Jrep) <= 8
						moisGre$ = "novembre"
					Else
						moisGre$ = "décembre"
					EndIf
			EndSelect
		Case "Nivôse" ;- Nivôse
			Select Agre 
				Case 1792 To 1794, 1796 To 1798
					Resultat = 7
					If Val(Jrep) <= 11
						moisGre$ = "décembre"
					Else
						moisGre$ = "janvier"
						Agre + 1
					EndIf
				Case 1795
					Resultat =11
					If Val(Jrep) <= 11
						moisGre$ = "décembre"
					Else
						moisGre$ = "janvier"
						Agre + 1
					EndIf
				Case 1799 To 1802, 1804, 1805
					Resultat = 11
					If Val(Jrep) <= 10
						moisGre$ = "décembre"
					Else
						moisGre$ = "janvier"
						Agre + 1
					EndIf
				Case 1803
					Resultat = 15
					If Val(Jrep) <= 10
						moisGre$ = "décembre"
					Else
						moisGre$ = "janvier"
						Agre + 1
					EndIf
			EndSelect
		Case "Pluviôse" ;- Pluviôse			
			Select Agre
				Case 1793 To 1795, 1797 To 1799
					Resultat = 5
					If Val(Jrep) <= 12
						moisGre$ = "janvier"
					Else
						moisGre$ = "février"
					EndIf
				Case 1796 ; bissextile
					Resultat = 7
					If Val(Jrep) <= 11
						moisGre$ = "janvier"
					Else
						moisGre$ = "février"
					EndIf
				Case 1800 To 1803, 1805
					Resultat = 7
					If Val(Jrep) <= 11
						moisGre$ = "janvier"
					Else
						moisGre$ = "février"
					EndIf
				Case 1804 ; bissextile
					Resultat = 11
					If Val(Jrep) <= 10
						moisGre$ = "janvier"
					Else
						moisGre$ = "février"
					EndIf
				Default ;1806
					MoisGre$ = "Impossible"
					Jgre = 0
			EndSelect
		Case "Ventôse" ;- Ventôse
			Select Agre
				Case 1793 To 1795, 1797 To 1799
					Resultat = 8
					If Val(Jrep) <= 10
						moisGre$ = "février"
					Else
						moisGre$ = "mars"
					EndIf
				Case 1796 ; bissextile
					Resultat = 9
					If Val(Jrep) <= 10
						moisGre$ = "février"
					Else
						moisGre$ = "mars"
					EndIf
				Case 1800 To 1803, 1805
					Resultat = 12
					If Val(Jrep) <= 9
						moisGre$ = "février"
					Else
						moisGre$ = "mars"
					EndIf
				Case 1804 ; bissextile
					Resultat = 13
					If Val(Jrep) <= 9
						moisGre$ = "février"
					Else
						moisGre$ = "mars"
					EndIf
				Default ;1806
					MoisGre$ = "Impossible"
					Jgre = 0			
			EndSelect
		Case "Germinal" ;- Germinal
			Select Agre
				Case 1793 To 1795, 1797 To 1799
					Resultat = 7
					If Val(Jrep) <= 11
						moisGre$ = "mars"
					Else
						moisGre$ = "avril"
					EndIf
				Case 1796 ; bissextile
					Resultat = 7
					If Val(Jrep) <= 11
						moisGre$ = "mars"
					Else
						moisGre$ = "avril"
					EndIf
				Case 1800 To 1803, 1805
					Resultat = 11
					If Val(Jrep) <= 10
						moisGre$ = "mars"
					Else
						moisGre$ = "avril"
					EndIf
				Case 1804 ; bissextile
					Resultat = 11
					If Val(Jrep) <= 10
						moisGre$ = "mars"
					Else
						moisGre$ = "avril"
					EndIf
				Default ;1806
					MoisGre$ = "Impossible"
					Jgre = 0
			EndSelect
		Case "Floréal" ;- Floréal
			Select Agre
				Case 1793 To 1795, 1797 To 1799
					Resultat = 6
					If Val(Jrep) <= 11
						moisGre$ = "avril"
					Else
						moisGre$ = "mai"
					EndIf
				Case 1796 ; bissextile
					Resultat = 6
					If Val(Jrep) <= 11
						moisGre$ = "avril"
					Else
						moisGre$ = "mai"
					EndIf
				Case 1800 To 1803, 1805
					Resultat = 10
					If Val(Jrep) <= 10
						moisGre$ = "avril"
					Else
						moisGre$ = "mai"
					EndIf
				Case 1804 ; bissextile
					Resultat = 10
					If Val(Jrep) <= 10
						moisGre$ = "avril"
					Else
						moisGre$ = "mai"
					EndIf
				Default ;1806
					MoisGre$ = "Impossible"
					Jgre = 0
			EndSelect
		Case "Prairial" ;- Prairial
			Select Agre
				Case 1793 To 1795, 1797 To 1799
					Resultat = 5
					If Val(Jrep) <= 12
						moisGre$ = "mai"
					Else
						moisGre$ = "juin"
					EndIf
				Case 1796 ; bissextile
					Resultat = 5
					If Val(Jrep) <= 12
						moisGre$ = "mai"
					Else
						moisGre$ = "juin"
					EndIf
				Case 1800 To 1803, 1805
					Resultat = 7
					If Val(Jrep) <= 11
						moisGre$ = "mai"
					Else
						moisGre$ = "juin"
					EndIf
				Case 1804 ; bissextile
					Resultat = 7
					If Val(Jrep) <= 11
						moisGre$ = "mai"
					Else
						moisGre$ = "juin"
					EndIf
				Default ;1806
					MoisGre$ = "Impossible"
					Jgre = 0
			EndSelect
		Case "Messidor" ;- Messidor
			Select Agre
				Case 1793 To 1795, 1797 To 1799
					Resultat = 4
					If Val(Jrep) <= 12
						moisGre$ = "juin"
					Else
						moisGre$ = "juillet"
					EndIf
				Case 1796 ; bissextile
					Resultat = 4
					If Val(Jrep) <= 12
						moisGre$ = "juin"
					Else
						moisGre$ = "juillet"
					EndIf
				Case 1800 To 1803, 1805
					Resultat = 6
					If Val(Jrep) <= 11
						moisGre$ = "juin"
					Else
						moisGre$ = "juillet"
					EndIf
				Case 1804 ; bissextile
					Resultat = 6
					If Val(Jrep) <= 11
						moisGre$ = "juin"
					Else
						moisGre$ = "juillet"
					EndIf
				Default ;1806
					MoisGre$ = "Impossible"
					Jgre = 0
			EndSelect
		Case "Thermidor" ;- Thermidor
			Select Agre
				Case 1793 To 1795, 1797 To 1799
					Resultat = 3
					If Val(Jrep) <= 13
						moisGre$ = "juillet"
					Else
						moisGre$ = "août"
					EndIf
				Case 1796 ; bissextile
					Resultat = 3
					If Val(Jrep) <= 13
						moisGre$ = "juillet"
					Else
						moisGre$ = "août"
					EndIf
				Case 1800 To 1803, 1805
					Resultat = 5
					If Val(Jrep) <= 12
						moisGre$ = "juillet"
					Else
						moisGre$ = "août"
					EndIf
				Case 1804 ; bissextile
					Resultat = 5
					If Val(Jrep) <= 12
						moisGre$ = "juillet"
					Else
						moisGre$ = "août"
					EndIf
				Default ;1806
					MoisGre$ = "Impossible"
					Jgre = 0
			EndSelect
		Case "Fructidor" ;- Fructidor
			Select Agre
				Case 1793 To 1795, 1797 To 1799
					Resultat = 2
					If Val(Jrep) <= 14
						moisGre$ = "août"
					Else
						moisGre$ = "septembre"
					EndIf
				Case 1796 ; bissextile
					Resultat = 2
					If Val(Jrep) <= 14
						moisGre$ = "août"
					Else
						moisGre$ = "septembre"
					EndIf
				Case 1800 To 1803, 1805
					Resultat = 3
					If Val(Jrep) <= 13
						moisGre$ = "août"
					Else
						moisGre$ = "septembre"
					EndIf
				Case 1804 ; bissextile
					Resultat = 3
					If Val(Jrep) <= 13
						moisGre$ = "août"
					Else
						moisGre$ = "septembre"
					EndIf
				Default ;1806
					MoisGre$ = "Impossible"
					Jgre = 0
			EndSelect ; Agre Fructidor
	EndSelect ; Mrep
	Jgre = Tableau(Val(Jrep),Resultat)
EndProcedure

Procedure JoursComplementaires()
	JcompInt.s =GetGadgetText(#Cmb_JcompInt)
	Jrep = GetGadgetText(#Cmb_Jrep)
	Mrep.s = GetGadgetText(#Cmb_Mrep)
	Arep.s = GetGadgetText(#Cmb_Arep)
	Mrep = "Fructidor"
	Select Arep
		Case "an I"
			Agre = 1793
		Case "an II"
			Agre = 1794
		Case "an III"
			Agre = 1795
		Case "an IV"
			Agre = 1796
		Case "an V"
			Agre = 1797
		Case "an VI"
			Agre = 1798
		Case "an VII"
			Agre = 1799
		Case "an VIII"
			Agre = 1800
		Case "an IX"
			Agre = 1801
		Case "an X"
			Agre = 1802
		Case "an XI"
			Agre = 1803
		Case "an XII"
			Agre = 1804
		Case "an XIII"
			Agre = 1805
		Case "an XIV"
			Agre = 1806
	EndSelect
	
	Select JcompInt
		Case "fête de la vertu" ;-Vertu an I à an VII
			Select Agre
				Case 1793 To 1799 ;"an I" To "an VII"
					Resultat = 1
					Jrep = "1"
					MoisGre$ = "septembre"
				Case 1800 To 1806 ;-Vertu an VIII à an XIV
					Resultat = 2
					Jrep = "1"
					MoisGre$ = "septembre"
			EndSelect
		Case "fête du génie" ;-Génie
			Select Agre
				Case 1793 To 1799 ;"an I" To "an VII"
					Resultat = 1
					Jrep = "2"
					MoisGre$ = "septembre"
				Case 1800 To 1806 ;"an VIII" To "an XIV"
					Resultat = 2
					Jrep = "2"
					MoisGre$ = "septembre"
			EndSelect
		Case "fête du travail" ;-Travail
			Select Agre
				Case 1793 To 1799 ;"an I" To "an VII"
					Resultat = 1
					Jrep = "3"
					MoisGre$ = "septembre"
				Case 1800 To 1806 ;"an VIII" To "an XIV"
					Resultat = 2
					Jrep = "3"
					MoisGre$ = "septembre"
			EndSelect
		Case "fête de l'opinion" ;-opinion
			Select Agre
				Case 1793 To 1799 ;"an I" To "an VII"
					Resultat = 1
					Jrep = "4"
					MoisGre$ = "septembre"
				Case 1800 To 1806 ;"an VIII" To "an XIV"
					Resultat = 2
					Jrep = "4"
					MoisGre$ = "septembre"
			EndSelect
		Case "fête des récompenses" ;- récompense an II
			Select Agre
				Case 1793 To 1799;"an I" à "an VII"
					Resultat = 1
					Jrep = "5"
					MoisGre$ = "septembre"
				Case 1800 To 1806 ; an VIII à an XIV
					Resultat = 2
					Jrep = "5"
					MoisGre$ = "septembre"
			EndSelect
		Case "fête de la révolution"
			Select Agre
				Case 1795, 1799, 1803 ;"an III", "an VII", "an XI"
					Resultat = 2
					Jrep = "6"
					MoisGre$ = "septembre"
			EndSelect
	EndSelect ; JcompInt
	Jgre = Tableau(Val(Jrep),Resultat)
EndProcedure

Procedure Conv1793()	
	If Agre = 1793	
		Arep = "an I"
	ElseIf Agre = 1794
		Arep = "an II"
	ElseIf Agre = 1795
		Arep = "an III"
	ElseIf Agre = 1796
		Arep = "an IV"
	ElseIf Agre = 1797
		Arep = "an V"
	ElseIf Agre = 1798
		Arep = "an VI"
	ElseIf Agre = 1799
		Arep = "an VII"
	ElseIf Agre = 1800
		Arep = "an VIII"
	ElseIf Agre = 1801
		Arep = "an IX"
	ElseIf Agre = 1802
		Arep = "an X"
	ElseIf Agre = 1803
		Arep = "an XI"
	ElseIf Agre = 1804
		Arep = "an XII"
	ElseIf Agre = 1805
		Arep = "an XIII"
	ElseIf Agre = 1806
		Jrep = "----"
		Mrep = "Impossible"
		Arep = "----"
	EndIf
EndProcedure

Procedure conv1792()
	If Agre = 1792
		Arep = "an I"
	ElseIf Agre = 1793	
		Arep = "an II"
	ElseIf Agre = 1794
		Arep = "an III"
	ElseIf Agre = 1795
		Arep = "an IV"
	ElseIf Agre = 1796
		Arep = "an V"
	ElseIf Agre = 1797
		Arep = "an VI"
	ElseIf Agre = 1798
		Arep = "an VII"
	ElseIf Agre = 1799
		Arep = "an VIII"
	ElseIf Agre = 1800
		Arep = "an IX"
	ElseIf Agre = 1801
		Arep = "an X"
	ElseIf Agre = 1802
		Arep = "an XI"
	ElseIf Agre = 1803
		Arep = "an XII"
	ElseIf Agre = 1804
		Arep = "an XIII"
	ElseIf Agre = 1805
		Arep = "an XIV"	
	EndIf
EndProcedure

Procedure Convertir_en_republicain()
	Jgre = Val(GetGadgetText(#Cmb_Jgre))
	;moisGre = Val(GetGadgetText(#Cmb_Mgre))
	MoisGre$ = GetGadgetText(#Cmb_Mgre)
	Agre = Val(GetGadgetText(#Cmb_Agre))
	
	
	;Select moisGre
	;	Case 1 ;- janvier
	Select MoisGre$
		Case "Janvier"
			Conv1793()
			Select Arep
				Case "an I","an II","an III", "an V","an VI", "an VII" ; 1793, 94, 95, 97 à 99
					If Jgre < 20 ; 1er jour du mois -1 soit 21-1 mois républicain
						Mrep = "Nivôse"
						Jrep = Str(Jgre+11) ; 20+11 nbre de jours mois grégorien
					Else
						Mrep = "Pluviôse"
						Jrep = Str(Jgre-19) ; 19+11 nbre de jours mois républicain
					EndIf			
				Case "an IV" ; 1796 bissextile
					If Jgre < 21
						Mrep = "Nivôse"
						Jrep = Str(Jgre+10)
					Else
						Mrep = "Pluviôse"
						Jrep = Str(Jgre-20) ; ok
					EndIf
				Case "an VIII","an IX","an X","an XI","an XIII" ; 1800 à 1803, 1805
					If Jgre < 21
						Mrep = "Nivôse"
						Jrep = Str(Jgre+10)
					Else
						Mrep = "Pluviôse"
						Jrep = Str(Jgre-20)
					EndIf
				Case "an XII"
					If Jgre < 22
						Mrep = "Nivôse"
						Jrep = Str(Jgre+9)
					Else
						Mrep = "Pluviôse"
						Jrep = Str(Jgre-21) ;ok
					EndIf
			EndSelect ; Arep
			
		;Case 2 ;- février
		Case "Février"
			Conv1793()
			Select Arep
				Case "an I","an II","an III", "an V","an VI", "an VII" ; 1793, 94, 95, 97 à 99
					If Jgre < 19
						Mrep = "Pluviôse"
						Jrep = Str(Jgre+12) ; 19+12 = 31 ok
					Else
						If Jgre <= 28
							Mrep = "Ventôse"
							Jrep = Str(Jgre-18) ; 12+18 = 30 ok
						Else
							Impossible()
						EndIf
					EndIf
				Case "an IV", "an VIII" ; 1796, 1800 bissextile
					If Jgre < 20
						Mrep = "Pluviôse"
						Jrep = Str(Jgre+11) ;20+11 = 31 ok
					Else
						If Jgre <= 29
							Mrep = "Ventôse"
							Jrep = Str(Jgre-19) ; 11+19 = 30 ok
						Else
							Impossible()
						EndIf
					EndIf
				Case "an VIII", "an IX", "an X", "an XI", "an XIII"
					If Jgre < 20
						Mrep = "Pluviôse"
						Jrep = Str(Jgre+11) ; 20+11=31 ok
					Else
						If Jgre <= 28
							Mrep = "Ventôse"
							Jrep = Str(Jgre-19) ; 11+19=30 ok
						Else
							Impossible()
						EndIf
					EndIf
				Case "an XII" ; 1804 bissextile
					If Jgre < 21
						Mrep = "Pluviôse"
						Jrep = Str(Jgre+10) ; 21+10= 31ok
					Else
						If Jgre <= 29
							Mrep = "Ventôse"
							Jrep = Str(Jgre-20) ;10+20 = 30 ok
						Else
							Impossible()
						EndIf
					EndIf
			EndSelect
		;Case 3 ;- mars
		Case "Mars"
			Conv1793()
			Select Arep
				Case "an I","an II","an III","an V","an VI","an VII"
					If Jgre < 21
						Mrep = "Ventôse"
						Jrep = Str(Jgre+10) ; 21+10=31 ok
					Else
						Mrep = "Germinal"
						Jrep = Str(Jgre-20) ; 10+20=30 ok
					EndIf
				Case "an IV"
					If Jgre < 21
						Mrep = "Ventôse"
						Jrep = Str(Jgre+10) ; 21+10=31
					Else
						Mrep = "Germinal"
						Jrep = Str(Jgre-20) ; 10+20=30
					EndIf
				Case "an VIII","an IX","an X","an XI","an XIII"
					If Jgre < 22
						Mrep = "Ventôse"
						Jrep = Str(Jgre+9) ; 22+9=31
					Else
						Mrep = "Germinal"
						Jrep = Str(Jgre-21) ; 9+21 =30
					EndIf
				Case "an XII"
					If Jgre < 22
						Mrep = "Ventôse"
						Jrep = Str(Jgre+9) ; 22+9=31
					Else
						Mrep = "Germinal"
						Jrep = Str(Jgre-21) ; 9+21=30
					EndIf
			EndSelect
		;Case 4 ;- avril
		Case "Avril"	
			Conv1793()
			Select Arep
				Case "an I","an II","an III","an V","an VI","an VII"
					If Jgre < 20
						Mrep = "Germinal"
						Jrep = Str(Jgre+11) ; 20+11=31
					Else
						If Jgre <= 30
							Mrep = "Floréal"
							Jrep = Str(Jgre-19) ; 11+19=30
						Else
							Impossible()
						EndIf
					EndIf
				Case "an IV"
					If Jgre < 20
						Mrep = "Germinal"
						Jrep = Str(Jgre+11) ; 20+11=31
					Else
						If Jgre <= 30
							Mrep = "Floréal"
							Jrep = Str(Jgre-19) ; 11+19=30
						Else
							Impossible()
						EndIf
					EndIf
				Case "an VIII","an IX","an X","an XI","an XIII"
					If Jgre < 21
						Mrep ="Germinal"
						Jrep = Str(Jgre+10) ; 21+10=31
					Else
						If Jgre <= 30
							Mrep = "Floréal"
							Jrep = Str(Jgre-20) ; 10+20=30
						Else
							Impossible()
						EndIf
					EndIf
				Case "an XII"
					If Jgre < 21
						Mrep ="Germinal"
						Jrep = Str(Jgre+10) ; 21+10=31
					Else
						If Jgre <= 30
							Mrep = "Floréal"
							Jrep = Str(Jgre-20) ; 10+20=30
						Else
							Impossible()
						EndIf
					EndIf
			EndSelect
		;Case 5 ;- mai
		Case "Mai"	
			Conv1793()
			Select Arep
				Case "an I","an II","an III","an V","an VI","an VII"
					If Jgre < 20
						Mrep = "Floréal"
						Jrep = Str(Jgre+11) ; 20+11=31
					Else
						Mrep = "Prairial"
						Jrep = Str(Jgre-19) ; 11+19=30
					EndIf
				Case "an IV"
					If Jgre < 20
						Mrep = "Floréal"
						Jrep = Str(Jgre+11) ;20+11=31
					Else
						If Jgre <= 30
							Mrep = "Prairial"
							Jrep = Str(Jgre-19) ; 11+19=30
						EndIf
					EndIf
				Case "an VIII","an IX","an X","an XI","an XIII"
					If Jgre < 21
						Mrep = "Floréal"
						Jrep = Str(Jgre+10) ;21+10=31
					Else
						If Jgre <= 30
							Mrep = "Prairial"
							Jrep = Str(Jgre-20) ; 10+20=30
						EndIf
					EndIf
				Case "an XII"
					If Jgre < 21
						Mrep = "Floréal"
						Jrep = Str(Jgre+10) ;21+10=31
					Else
						If Jgre <= 30
							Mrep = "Prairial"
							Jrep = Str(Jgre-20) ; 10+20=30
						EndIf
					EndIf
			EndSelect
		;Case 6 ;- juin
		Case "Juin"	
			Conv1793()
			Select Arep
				Case "an I","an II","an III","an V","an VI","an VII"
					If Jgre < 19
						Mrep = "Prairial"
						Jrep = Str(Jgre+12) ;19+12=31
					Else
						If Jgre <= 30
							Mrep = "Messidor"
							Jrep = Str(Jgre-18) ;12+18=30
						Else
							Impossible()
						EndIf
					EndIf
				Case "an IV"
					If Jgre < 19
						Mrep = "Prairial"
						Jrep = Str(Jgre+12) ; 19+12=31
					Else
						If Jgre <= 30
							Mrep = "Messidor"
							Jrep = Str(Jgre-18) ; 12+18=30
						Else
							Impossible()
						EndIf
					EndIf
				Case "an VIII","an IX","an X","an XI","an XIII"
					If Jgre < 20
						Mrep = "Prairial"
						Jrep = Str(Jgre+11) ; 20+11=31
					Else
						If Jgre <= 30
							Mrep = "Messidor"
							Jrep = Str(Jgre-19) ; 11+19=30
						Else
							Impossible()
						EndIf
					EndIf
				Case "an XII"
					If Jgre < 20
						Mrep = "Prairial"
						Jrep = Str(Jgre+11) ; 20+11=31
					Else
						If Jgre <= 30
							Mrep = "Messidor"
							Jrep = Str(Jgre-19) ; 11+19=30
						Else
							Impossible()
						EndIf
					EndIf
			EndSelect
		;Case 7 ;- juillet
		Case "Juillet"	
			Conv1793()
			Select Arep
				Case "an I","an II","an III","an V","an VI","an VII"
					If Jgre < 19
						Mrep = "Messidor"
						Jrep = Str(Jgre+12) ;19+12=31
					Else
						Mrep = "Thermidor"
						Jrep = Str(Jgre-18) ;12+18=30
					EndIf
				Case "an IV"
					If Jgre < 19
						Mrep = "Messidor"
						Jrep = Str(Jgre+12) ;19+12=31
					Else
						Mrep = "Thermidor"
						Jrep = Str(Jgre-18) ;12+18=30
					EndIf
				Case "an VIII","an IX","an X","an XI","an XIII"
					If Jgre < 20
						Mrep = "Messidor"
						Jrep = Str(Jgre+11) ;20+11=31
					Else
						Mrep = "Thermidor"
						Jrep = Str(Jgre-19) ;11+19=30
					EndIf
				Case "an XII"
					If Jgre < 20
						Mrep = "Messidor"
						Jrep = Str(Jgre+11) ;20+11=31
					Else
						Mrep = "Thermidor"
						Jrep = Str(Jgre-19) ;11+19=30
					EndIf
				Case "an VIII","an IX","an X","an XI","an XIII"
					If Jgre < 19
						Mrep = "Messidor"
						Jrep = Str(Jgre+12) ;19+12=31
					Else
						Mrep = "Thermidor"
						Jrep = Str(Jgre-18) ;12+18=30
					EndIf
				Case "an XII"
					If Jgre < 19
						Mrep = "Messidor"
						Jrep = Str(Jgre+12) ;19+12=31
					Else
						Mrep = "Thermidor"
						Jrep = Str(Jgre-18) ;12+18=30
					EndIf
			EndSelect
			;Case 8 ;- août
		Case "Août"
			Conv1793()
			Select Arep
				Case "an I","an II","an III","an V","an VI","an VII"
					If Jgre < 18
						Mrep = "Thermidor"
						Jrep = Str(Jgre+13) ;18+13=31
					Else
						Mrep = "Fructidor"
						Jrep = Str(Jgre-17) ;13+17=30
					EndIf
				Case "an IV"
					If Jgre < 18
						Mrep = "Thermidor"
						Jrep = Str(Jgre+13) ;18+13=31
					Else
						Mrep = "Fructidor"
						Jrep = Str(Jgre-17) ;13+17=30
					EndIf
				Case "an VIII","an IX","an X","an XI","an XIII"
					If Jgre < 19
						Mrep = "Thermidor"
						Jrep = Str(Jgre+12) ;19+12=31
					Else
						Mrep = "Fructidor"
						Jrep = Str(Jgre-18) ;12+18=30
					EndIf
				Case "an XII"
					If Jgre < 19
						Mrep = "Thermidor"
						Jrep = Str(Jgre+12) ;19+12=31
					Else
						Mrep = "Fructidor"
						Jrep = Str(Jgre-18) ;12+18=30
					EndIf
			EndSelect
			;Case 9 ;- septembre
		Case "Septembre"
			Conv1793()
			Select Arep
				Case "an I", "an II","an VI", "an V","an VI" ; 1793, 94, 96, 97, 98
					If Jgre < 22
						Mrep = "Fructidor"
						Jrep = Str(Jgre+9) ; 22+9=31
						If Jgre <= 16
							Jrep = Str(Jgre+14) ;16+14=30
						ElseIf Jgre = 17 ;- fêtes 17 (années normales)
							Jrep = "fête de"
							Mrep = "la Vertu"
						ElseIf Jgre = 18
							Jrep = "fête du"
							Mrep = "génie"
						ElseIf Jgre = 19
							Jrep = "fête du"
							Mrep = "travail"
						ElseIf Jgre = 20
							Jrep = "fête de"
							Mrep = "l'opinion"
						ElseIf Jgre = 21
							Jrep = "fête des"
							Mrep = "récompenses"
						EndIf
					Else
						If Jgre >= 22 And Jgre <= 30
							conv1792()
							Mrep = "Vendémiaire"
							Jrep = Str(Jgre-21) ;9+21=30
						Else
							Impossible()
						EndIf
					EndIf
				Case "an III", "an VII" ; 1795, 99
					If Jgre < 23
						Mrep = "Fructidor"
						Jrep = Str(Jgre+8) ; 23+8=31
						If Jgre <= 16
							Jrep = Str(Jgre+14) ;16+14=30
						ElseIf Jgre = 17 ;- fêtes 17 (années bissextiles)
							Jrep = "fête de"
							Mrep = "la Vertu"
						ElseIf Jgre = 18
							Jrep = "fête du"
							Mrep = "génie"
						ElseIf Jgre = 19
							Jrep = "fête du"
							Mrep = "travail"
						ElseIf Jgre = 20
							Jrep = "fête de"
							Mrep = "l'opinion"
						ElseIf Jgre = 21
							Jrep = "fête des"
							Mrep = "récompenses"
						ElseIf Jgre = 22
							Jrep = "fête de"
							Mrep = "la révolution"
						EndIf
					Else
						If Jgre >= 23 And Jgre <= 30
							Conv1793()
							Mrep = "Vendémiaire"
							Jrep = Str(Jgre-22) ;8+22=30
						Else
							Impossible()
						EndIf
					EndIf
				Case "an VIII", "an IX", "an X", "an XII", "an XIII", "an XIV" ; 1800, 01, 02, 04, 05, 06
					If Jgre < 23
						Mrep = "Fructidor"
						Jrep = Str(Jgre+8) ; 23+8=31
						If Jgre <= 17
							Jrep = Str(Jgre+13) ;17+13=30
						ElseIf Jgre = 18 ;- fêtes 18 (années normales)
							conv1792()
							Jrep = "fête de"
							Mrep = "la Vertu"
						ElseIf Jgre = 19
							Jrep = "fête du"
							Mrep = "génie"
						ElseIf Jgre = 20
							Jrep = "fête du"
							Mrep = "travail"
						ElseIf Jgre = 21
							Jrep = "fête de"
							Mrep = "l'opinion"
						ElseIf Jgre = 22
							Jrep = "fête des"
							Mrep = "récompenses"
						EndIf
					Else
						If Jgre >= 23 And Jgre <= 30
							conv1793()
							Mrep = "Vendémiaire"
							Jrep = Str(Jgre-22) ;8+22=30
						Else
							Impossible()
						EndIf
					EndIf
				Case "an XI" ; 1803
					If Jgre < 24
						Mrep = "Fructidor"
						Jrep = Str(Jgre+7) ; 24+7=31
						If Jgre <= 17
							Jrep = Str(Jgre+13) ;17+13=30
						ElseIf Jgre = 18 ;- fêtes 18 (années normales)
							conv1792()
							Jrep = "fête de"
							Mrep = "la Vertu"
						ElseIf Jgre = 19
							Jrep = "fête du"
							Mrep = "génie"
						ElseIf Jgre = 20
							Jrep = "fête du"
							Mrep = "travail"
						ElseIf Jgre = 21
							Jrep = "fête de"
							Mrep = "l'opinion"
						ElseIf Jgre = 22
							Jrep = "fête des"
							Mrep = "récompenses"
						ElseIf Jgre = 23
							Jrep = "fête de"
							Mrep = "la révolution"
						EndIf
					Else
						If Jgre >= 24 And Jgre <= 30
							conv1793()
							Mrep = "Vendémiaire"
							Jrep = Str(Jgre-24) ;7+24=30
						Else
							Impossible()
						EndIf
					EndIf
			EndSelect
			;Case 10 ;- octobre
		Case "Octobre"
			conv1792()
			Select Arep
				Case "an I","an II","an III","an V","an VI","an VII"
					If Jgre < 22
						Mrep = "Vendémiaire"
						Jrep = Str(Jgre+9) ;29+9=31
					Else
						Mrep = "Brumaire"
						Jrep = Str(Jgre-21) ;9+21=30
					EndIf
				Case "an IV"
					If Jgre < 23
						Mrep = "Vendémiaire"
						Jrep = Str(Jgre+8) ;23+8+31
					Else
						Mrep = "Brumaire"
						Jrep = Str(Jgre-22) ;8+22=30
					EndIf
				Case "an VIII","an IX","an X","an XI","an XII","an XIV"
					If Jgre < 23
						Mrep = "Vendémiaire"
						Jrep = Str(Jgre+8) ;23+8+31
					Else
						Mrep = "Brumaire"
						Jrep = Str(Jgre-22) ;8+22=30
					EndIf
				Case "an XII"
					If Jgre < 24
						Mrep = "Vendémiaire"
						Jrep = Str(Jgre+7) ;27+7+31
					Else
						Mrep = "Brumaire"
						Jrep = Str(Jgre-23) ;7+23=30
					EndIf
			EndSelect
			;Case 11 ;- novembre
		Case "Novembre"
			conv1792()
			Select Arep
				Case "an I","an II","an III","an V","an VI","an VII"
					If Jgre < 21
						Mrep = "Brumaire"
						Jrep = Str(Jgre+10) ;21+10=31
					Else
						If Jgre <= 30
							Mrep = "Frimaire"
							Jrep = Str(Jgre-20) ;10+20=30
						Else
							Impossible()
						EndIf
					EndIf
				Case "an IV"
					If Jgre < 22
						Mrep = "Brumaire"
						Jrep = Str(Jgre+9) ; 22+9=31
					Else
						If Jgre <= 30
							Mrep = "Frimaire"
							Jrep = Str(Jgre-21) ;9+21=30
						Else
							Impossible()
						EndIf
					EndIf
				Case "an VIII","an IX","an X","an XI","an XIII","an XIV"
					If Jgre < 22
						Mrep = "Brumaire"
						Jrep = Str(Jgre+9) ;22+9=31
					Else
						If Jgre <= 30
							Mrep = "Frimaire"
							Jrep = Str(Jgre-21) ;9+21=30
						Else
							Impossible()
						EndIf
					EndIf
				Case "an XII" ;1803
					If Jgre < 23
						Mrep = "Brumaire"
						Jrep = Str(Jgre+8) ;23+8=31
					Else
						If Jgre <= 30
							Mrep = "Frimaire"
							Jrep = Str(Jgre-22) ;8+22=30
						Else
							Impossible()
						EndIf
					EndIf
			EndSelect
			;Case 12 ;- décembre
		Case "Décembre"
			conv1792()
			Select Arep
				Case "an I","an II","an III","an V","an VI","an VII"
					If Jgre < 21
						Mrep = "Frimaire"
						Jrep = Str(Jgre+10) ;21+10=31
					Else
						Mrep = "Nivôse"
						Jrep = Str(Jgre-20) ;10+20=30
					EndIf
				Case "an IV"
					If Jgre < 22
						Mrep = "Frimaire"
						Jrep = Str(Jgre+9) ; 22+9=31
					Else
						Mrep = "Nivôse"
						Jrep = Str(Jgre-21) ;9+21=30
					EndIf
				Case "an VIII","an IX","an X","an XI","an XII","an XIV"
					If Jgre < 22
						Mrep = "Frimaire"
						Jrep = Str(Jgre+9) ;22+9=31
					Else
						Mrep = "Nivôse"
						Jrep = Str(Jgre-21) ;9+21=30
					EndIf
				Case "an XII"
					If Jgre < 23
						Mrep = "Frimaire"
						Jrep = Str(Jgre+8) ;23+8=31
					Else
						Mrep = "Nivôse"
						Jrep = Str(Jgre-22) ;8+22=30
					EndIf
			EndSelect			
	EndSelect 
EndProcedure

Procedure OpenWindow_Fenetre_principale()
  If OpenWindow(#Fenetre_principale, 505, 54, 840, 930, "Calendrier républicain par Michel Lye", #PB_Window_SystemMenu|#PB_Window_TitleBar|#PB_Window_ScreenCentered)
    TextGadget(#Txt_SelRep, 210, 20, 420, 70, "Sélectionnez la date du calendrier républicain", #PB_Text_Center)
    TextGadget(#Txt_ou, 405, 265, 40, 40, "OU", #PB_Text_Center)
    TextGadget(#Txt_SelComp, 197, 330, 445, 65, "Sélectionnez le jour complèmentaire ou intercalaire", #PB_Text_Center)
    ComboBoxGadget(#Cmb_JcompInt, 195, 430, 300, 40)
		AddGadgetItem(#Cmb_JcompInt, -1, "fête de la vertu") 
		AddGadgetItem(#Cmb_JcompInt, -1, "fête du génie")
		AddGadgetItem(#Cmb_JcompInt, -1, "fête du travail")
		AddGadgetItem(#Cmb_JcompInt, -1, "fête de l'opinion")
		AddGadgetItem(#Cmb_JcompInt, -1, "fête des récompenses")
		AddGadgetItem(#Cmb_JcompInt, -1, "fête de la révolution")
    ButtonGadget(#Btn_ConvGreg, 280, 190, 280, 40, "Convertir en grégorien")
    TextGadget(#Txt_SelGre, 210, 495, 420, 75, "Selectionnez la date du calendrier grégorien", #PB_Text_Center)
    ButtonGadget(#Btn_ConvRep, 275, 680, 290, 40, "Convertir en républicain")
    TextGadget(#Txt_Res, 360, 770, 120, 40, "Résultat", #PB_Text_Center)
    StringGadget(#Str_Jres, 195, 850, 100, 40, "", #PB_String_ReadOnly)
    StringGadget(#Str_Mres, 340, 850, 180, 40, "", #PB_String_ReadOnly)
    StringGadget(#Str_Ares, 540, 850, 100, 40, "", #PB_String_ReadOnly)
    ComboBoxGadget(#Cmb_Jrep, 200, 120, 100, 40)
		For i = 1 To 30
			AddGadgetItem(#Cmb_jrep, -1, Str(i))
		Next
    ComboBoxGadget(#Cmb_Mrep, 330, 120, 180, 40)
		AddGadgetItem(#Cmb_Mrep, -1, "Vendémiaire")
		AddGadgetItem(#Cmb_Mrep, -1, "Brumaire")
		AddGadgetItem(#Cmb_Mrep, -1, "Frimaire")
		AddGadgetItem(#Cmb_Mrep, -1, "Nivôse")
		AddGadgetItem(#Cmb_Mrep, -1, "Pluviôse")
		AddGadgetItem(#Cmb_Mrep, -1, "Ventôse")
		AddGadgetItem(#Cmb_Mrep, -1, "Germinal")
		AddGadgetItem(#Cmb_Mrep, -1, "Floréal")
		AddGadgetItem(#Cmb_Mrep, -1, "Prairial")
		AddGadgetItem(#Cmb_Mrep, -1, "Messidor")
		AddGadgetItem(#Cmb_Mrep, -1, "Thermidor")
		AddGadgetItem(#Cmb_Mrep, -1, "Fructidor")
    ComboBoxGadget(#Cmb_Arep, 540, 120, 110, 40)
		AddGadgetItem(#Cmb_Arep, -1, "an I")
		AddGadgetItem(#Cmb_Arep, -1, "an II")
		AddGadgetItem(#Cmb_Arep, -1, "an III")
		AddGadgetItem(#Cmb_Arep, -1, "an IV")
		AddGadgetItem(#Cmb_Arep, -1, "an V")
		AddGadgetItem(#Cmb_Arep, -1, "an VI")
		AddGadgetItem(#Cmb_Arep, -1, "an VII")
		AddGadgetItem(#Cmb_Arep, -1, "an VIII")
		AddGadgetItem(#Cmb_Arep, -1, "an IX")
		AddGadgetItem(#Cmb_Arep, -1, "an X")
		AddGadgetItem(#Cmb_Arep, -1, "an XI")
		AddGadgetItem(#Cmb_Arep, -1, "an XII")
		AddGadgetItem(#Cmb_Arep, -1, "an XIII")
		AddGadgetItem(#Cmb_Arep, -1, "an XIV")
    ComboBoxGadget(#Cmb_Jgre, 195, 600, 100, 40)
		For i = 1 To 31
			AddGadgetItem(#Cmb_Jgre, -1, Str(i))
		Next
    ComboBoxGadget(#Cmb_Mgre, 330, 600, 180, 40)
		AddGadgetItem(#Cmb_Mgre, -1, "Janvier")
		AddGadgetItem(#Cmb_Mgre, -1, "Février")
		AddGadgetItem(#Cmb_Mgre, -1, "Mars")
		AddGadgetItem(#Cmb_Mgre, -1, "Avril")
		AddGadgetItem(#Cmb_Mgre, -1, "Mai")
		AddGadgetItem(#Cmb_Mgre, -1, "Juin")
		AddGadgetItem(#Cmb_Mgre, -1, "Juillet")
		AddGadgetItem(#Cmb_Mgre, -1, "Août")
		AddGadgetItem(#Cmb_Mgre, -1, "Septembre")
		AddGadgetItem(#Cmb_Mgre, -1, "Octobre")
		AddGadgetItem(#Cmb_Mgre, -1, "Novembre")
		AddGadgetItem(#Cmb_Mgre, -1, "Décembre")
    ComboBoxGadget(#Cmb_Agre, 540, 600, 100, 40)
		For i = 1793 To 1806
			AddGadgetItem(#Cmb_Agre, -1, Str(i))
		Next
		ButtonGadget(#Btn_ConvJComp, 520, 430, 120, 40, "Convertir")
		;Images
		LoadImage(#Img_Vendemiaire, #PB_Compiler_FilePath+"Vendemiaire.jpg")
		ResizeImage(#Img_Vendemiaire, 100,150)
    ImageGadget(#Img_Vendemiaire, 20, 5, 100, 150, ImageID(#Img_Vendemiaire))
		LoadImage(#Img_Brumaire, #PB_Compiler_FilePath+"Brumaire.jpg")
		ResizeImage(#Img_Brumaire, 100,150)
    ImageGadget(#Img_Brumaire, 20, 155, 100, 150, ImageID(#Img_Brumaire))
		LoadImage(#Img_Frimaire, #PB_Compiler_FilePath+"Frimaire.jpg")
		ResizeImage(#Img_Frimaire, 100,150)
    ImageGadget(#Img_Frimaire, 20, 305, 100, 150, ImageID(#Img_Frimaire))
		LoadImage(#Img_Nivose, #PB_Compiler_FilePath+"Nivose.jpg")
		ResizeImage(#Img_Nivose, 100,150)
    ImageGadget(#Img_Nivose, 20, 455, 100, 150, ImageID(#Img_Nivose))
		LoadImage(#Img_Pluviose, #PB_Compiler_FilePath+"Pluviose.jpg")
		ResizeImage(#Img_Pluviose, 100,150)
    ImageGadget(#Img_Pluviose, 20, 605, 100, 150, ImageID(#Img_Pluviose))
		LoadImage(#Img_Ventose, #PB_Compiler_FilePath+"Ventose.jpg")
		ResizeImage(#Img_Ventose, 100,150)
    ImageGadget(#Img_Ventose, 20, 755, 100, 150, ImageID(#Img_Ventose))
		LoadImage(#Img_Germinal, #PB_Compiler_FilePath+"Germinal.jpg")
		ResizeImage(#Img_Germinal, 100,150)
    ImageGadget(#Img_Germinal, 720, 5, 100, 150, ImageID(#Img_Germinal))
		LoadImage(#Img_Floreal, #PB_Compiler_FilePath+"Floreal.jpg")
		ResizeImage(#Img_Floreal, 100,150)
    ImageGadget(#Img_Floreal, 720, 155, 100, 150, ImageID(#Img_Floreal))
		LoadImage(#Img_Prairial, #PB_Compiler_FilePath+"Prairial.jpg")
		ResizeImage(#Img_Prairial, 100,150)
    ImageGadget(#Img_Prairial, 720, 305, 100, 150, ImageID(#Img_Prairial))
		LoadImage(#Img_Messidor, #PB_Compiler_FilePath+"Messidor.jpg")
		ResizeImage(#Img_Messidor, 100,150)
    ImageGadget(#Img_Messidor, 720, 455, 100, 150, ImageID(#Img_Messidor))
		LoadImage(#Img_Thermidor, #PB_Compiler_FilePath+"Thermidor.jpg")
		ResizeImage(#Img_Thermidor, 100,150)
    ImageGadget(#Img_Thermidor, 720, 605, 100, 150, ImageID(#Img_Thermidor))
		LoadImage(#Img_Fructidor, #PB_Compiler_FilePath+"Fructidor.jpg")
		ResizeImage(#Img_Fructidor, 100,150)
    ImageGadget(#Img_Fructidor, 720, 755, 100, 150, ImageID(#Img_Fructidor))
    ; Gadget Fonts
    SetGadgetFont(#Txt_SelRep, LoadFont(#Fnt_Texte_SelRep, "Arial", 20, #PB_Font_HighQuality))
    SetGadgetFont(#Txt_ou, LoadFont(#Fnt_Texte_ou, "Arial", 20, #PB_Font_Bold|#PB_Font_HighQuality))
    SetGadgetFont(#Txt_SelComp, LoadFont(#Fnt_Texte_SelComp, "Arial", 20, #PB_Font_HighQuality))
    SetGadgetFont(#Cmb_JcompInt, LoadFont(#Fnt_Combo_JcompInt, "Arial", 20, #PB_Font_HighQuality))
    SetGadgetFont(#Btn_ConvGreg, LoadFont(#Fnt_Bouton_ConvGreg, "Arial", 20, #PB_Font_HighQuality))
    SetGadgetFont(#Txt_SelGre, LoadFont(#Fnt_Texte_SelGre, "Arial", 20, #PB_Font_HighQuality))
    SetGadgetFont(#Btn_ConvRep, LoadFont(#Fnt_Bouton_ConvRep, "Arial", 20, #PB_Font_HighQuality))
    SetGadgetFont(#Txt_Res, LoadFont(#Fnt_Texte_Res, "Arial", 20, #PB_Font_HighQuality))
    SetGadgetFont(#Cmb_Jrep, LoadFont(#Fnt_Combo_Jrep, "Arial", 20, #PB_Font_HighQuality))
    SetGadgetFont(#Cmb_Mrep, LoadFont(#Fnt_Combo_Mrep, "Arial", 20, #PB_Font_HighQuality))
    SetGadgetFont(#Cmb_Arep, LoadFont(#Fnt_Combo_Arep, "Arial", 20, #PB_Font_HighQuality))
    SetGadgetFont(#Cmb_Jgre, LoadFont(#Fnt_Combo_Jgre, "Arial", 20, #PB_Font_HighQuality))
    SetGadgetFont(#Cmb_Mgre, LoadFont(#Fnt_Combo_Mgre, "Arial", 20, #PB_Font_HighQuality))
    SetGadgetFont(#Cmb_Agre, LoadFont(#Fnt_Combo_Agre, "Arial", 20, #PB_Font_HighQuality))
    SetGadgetFont(#Btn_ConvJComp, LoadFont(#Fnt_Bouton_ConvJComp, "Arial", 20, #PB_Font_HighQuality))    
  SetGadgetFont(#Str_Jres, LoadFont(#Fnt_Str_Jres, "Arial", 20, #PB_Font_Bold|#PB_Font_HighQuality))
  SetGadgetFont(#Str_Mres, LoadFont(#Fnt_Str_Mres, "Arial", 20, #PB_Font_Bold|#PB_Font_HighQuality))
  SetGadgetFont(#Str_Ares, LoadFont(#Fnt_Str_Ares, "Arial", 20, #PB_Font_Bold|#PB_Font_HighQuality))
  EndIf
EndProcedure

OpenWindow_Fenetre_principale()

;- Boucle événementielle
Repeat
	Event = WaitWindowEvent()
	Select Event
			; ///////////////////
		Case #PB_Event_Gadget
			EventGadget = EventGadget()
			EventType = EventType()
			If EventGadget = #Btn_ConvGreg ; convertir en grégorien
				Convertir_en_gregorien()
				If moisGre$ <> "Impossible"
					SetGadgetText(#Str_Jres, Str(Jgre))
					SetGadgetText(#Str_Mres,moisGre$)
					SetGadgetText(#Str_Ares,Str(Agre))
				Else
					SetGadgetText(#Str_Jres, "-")
					SetGadgetText(#Str_Mres,moisGre$)
					SetGadgetText(#Str_Ares,"-")
				EndIf				
				Jgre = 0 : MoisGre$ = "" : Agre = 0
			ElseIf EventGadget = #Btn_ConvRep ; convertir en républicain
				Convertir_en_republicain()
				SetGadgetText(#Str_Jres, Str(Jgre))
				SetGadgetText(#Str_Mres,Mrep)
				SetGadgetText(#Str_Ares, Arep)
			ElseIf EventGadget = #Btn_ConvJComp
				JoursComplementaires()
				SetGadgetText(#Str_Jres, Str(Jgre))
				SetGadgetText(#Str_Mres,moisGre$)
				SetGadgetText(#Str_Ares,Str(Agre))
			EndIf
			; ////////////////////////
		Case #PB_Event_CloseWindow
			EventWindow = EventWindow()
			If EventWindow = #Fenetre_principale
				CloseWindow(#Fenetre_principale)
				Break
			EndIf
	EndSelect
ForEver

DataSection
	conversion:
	Data.i  0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18
	Data.i  1,17,18,19,19,20,20,21,19,20,21,22,20,21,22,23,23,24,24
	Data.i  2,18,19,20,20,21,21,22,20,21,22,23,21,22,23,24,24,25,25
	Data.i  3,19,20,21,21,22,22,23,21,22,23,24,22,23,24,25,25,26,26
	Data.i  4,20,21,22,22,23,23,24,22,23,24,25,23,24,25,26,26,27,27
	Data.i  5,21,22,23,23,24,24,25,23,24,25,26,24,25,26,27,27,28,28
	Data.i  6,22,23,24,24,25,25,26,24,25,26,27,25,26,27,28,28,29,29
	Data.i  7, 0,24,25,25,26,26,27,25,26,27,28,26,27,28,29,29,30,30
	Data.i  8, 0,25,26,26,27,27,28,26,27,28,29,27,28,29,30,30,31, 1
	Data.i  9, 0,26,27,27,28,28,29,27,28,29,30,28,29,30,31, 1, 1, 2
	Data.i 10, 0,27,28,28,29,29,30,28,29,30,31, 1, 1, 1, 1 ,2, 2, 3
	Data.i 11, 0,28,29,29,30,30,31, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4
	Data.i 12, 0,29,30,30,31, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5
	Data.i 13, 0,30,31, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6
	Data.i 14, 0,31, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7
	Data.i 15, 0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 8
	Data.i 16, 0, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 9
	Data.i 17, 0, 3, 4, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9,10
	Data.i 18, 0, 4, 5, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11
	Data.i 19, 0, 5, 6, 7, 7, 8, 8, 9, 9, 9, 9,10,10,10,10,11,11,12
	Data.i 20, 0, 6, 7, 8, 8, 9, 9,10,10,10,10,11,11,11,11,12,12,13
	Data.i 21, 0, 7, 8, 9, 9,10,10,11,11,11,11,12,12,12,12,13,13,14
	Data.i 22, 0, 8, 9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,15
	Data.i 23, 0, 9,10,11,11,12,12,13,13,13,13,14,14,14,14,15,15,16
	Data.i 24, 0,10,11,12,12,13,13,14,14,14,14,15,15,15,15,16,16,17
	Data.i 25, 0,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,18
	Data.i 26, 0,12,13,14,14,15,15,16,16,16,16,17,17,17,17,18,18,19
	Data.i 27, 0,13,14,15,15,16,16,17,17,17,17,18,18,18,18,19,19,20
	Data.i 28, 0,14,15,16,16,17,17,18,18,18,18,19,19,19,19,20,20,21
	Data.i 29, 0,15,16,17,17,18,18,19,19,19,19,20,20,20,20,21,21,22
	Data.i 30, 0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,23

Re: Calendrier républicain

Publié : lun. 04/avr./2016 16:54
par Kwai chang caine
Merci MICOUTE du partage 8)
C'est sympa en vue de la sortie des visiteurs 3 et la révolution Française de sortir ce programme :wink:
J'ai toujours aimé leur maniere de parler 8)

J'espere que je peux le dire ça.... ARS :mrgreen:

Re: Calendrier républicain

Publié : lun. 04/avr./2016 18:00
par Micoute
C'est une façon de voir les choses, mais en fait dans la vraie vie, ils ne parlaient pas comme dans le film car il y avait des consonnes muettes, par exemple j'habite à Coutances qui n'a pas changé de nom, mais seulement d'orthographe et ça s'écrivait Coustance, on a juste changé le s de place, hôpital, s'écrivait hospital, c'est pour ça qu'on dit hospitalité et je connaît bien d'autres exemples.

Re: Calendrier républicain

Publié : mar. 05/avr./2016 11:35
par Kwai chang caine
Oooookaaaaayyyyy !!!! :wink:

Re: Calendrier républicain

Publié : mar. 05/avr./2016 18:10
par Micoute
Okay vient de l'américain Ok qui signifie zéro killing (aucun mort) donc c'est que tout va bien !

Re: Calendrier républicain

Publié : mer. 06/avr./2016 8:20
par Kwai chang caine
Oui je le savais, c'était même les aviateurs américains pour être plus précis, en faisant le signe zero avec le pouce et l'index a chaque atterrissage à la base et de retour de mission, de ce que j'avais appris.

Auparavant je croyais que cela provenait de "André le pâté" :mrgreen: , acteur fort célèbre des américains ci dessus précités, mais plus connu chez nous par le doux patronyme de "JACOUILLE LA FRIPOUILLE".
Ce nom ayant été jugé trop vulgaire par nos amis de la bannière étoilée, aux vues de leurs us et coutumes, si puritaines :lol:

Re: Calendrier républicain

Publié : mer. 06/avr./2016 10:43
par Micoute
Les américains qu'on dit puritains, si tu connaissais vraiment leurs us et coutumes, tu en resterais sur ton fondement !

Re: Calendrier républicain

Publié : mer. 06/avr./2016 15:13
par Kwai chang caine
Tu as raison, c'est tout le charme des "youesseaye".
Les extrêmes, tout et son contraire :lol:

Re: Calendrier républicain

Publié : mer. 06/avr./2016 15:28
par Huitbit
Merci pour ce joli programme :P !

:idea: Une idée d'amélioration, mettre les belles images en arrière plan en fonction du mois choisi.


Pour "ok", je connaissais la version de la guerre de sécession (zero killed) mais apparemment, il y a beaucoup de variantes :
https://fr.wikipedia.org/wiki/OK_(expression)


Hasta la vista !