Calendrier républicain

Programmation d'applications complexes
Avatar de l’utilisateur
Micoute
Messages : 2584
Inscription : dim. 02/oct./2011 16:17
Localisation : 35520 La Mézière

Calendrier républicain

Message par Micoute »

Voici un calendrier républicain qui peut être très utile pour ceux qui font de la généalogie

Tapez l'adresse suivante : http://dl.free.fr/q2vhZGQF8

J’espère qu'il vous plaira

Ligne 111 remplacer "Germinam" par "Germinal"
Veuillez m'excuser pour ce désagrément !!!
Microsoft Windows 10 Famille 64 bits : Carte mère : ASRock 970 Extreme3 R2.0 : Carte Graphique NVIDIA GeForce RTX 3080 : Processeur AMD FX 6300 6 cœurs 12 threads 3,50 GHz PB 6.20 LTS (x64)
Un homme doit être poli, mais il doit aussi être libre !
Avatar de l’utilisateur
Micoute
Messages : 2584
Inscription : dim. 02/oct./2011 16:17
Localisation : 35520 La Mézière

Re: Calendrier républicain

Message par Micoute »

Voici le code de mon calendrier républicain

Code : Tout sélectionner

;{- Enumerations / DataSections
;{ Windows
Enumeration
	#Fenetre_principale
EndEnumeration
;}
;{ Gadgets
Enumeration
    #Texte_SelRep
    #Texte_ou
    #Texte_SelComp
    #Combo_JcompInt
    #Frame3D_Rep
    #Bouton_ConvGreg
    #Texte_SelGre
    #Bouton_ConvRep
    #Frame3D_Gre
    #Texte_Res
    #Chaine_Jres
    #Chaine_Mres
    #Chaine_Ares
    #Frame3D_Res
    #Combo_Jrep
    #Combo_Mrep
    #Combo_Arep
    #Combo_Jgre
    #Combo_Mgre
    #Combo_Agre
    #Bouton_ConvJComp
    #Image_Germinal
    #Image_Floreal
    #Image_Prairial
    #Image_Messidor
    #Image_Thermidor
    #Image_Fructidor
    #Image_Vendemiaire
    #Image_Brumaire
    #Image_Frimaire
    #Image_Nivose
    #Image_Pluviose
    #Image_Ventose
EndEnumeration
;{ Fonts
Enumeration
    #Font_Texte_SelRep
    #Font_Texte_ou
    #Font_Texte_SelComp
    #Font_Bouton_ConvGreg
    #Font_Texte_SelGre
    #Font_Texte_Res
    #Font_Bouton_ConvJComp
EndEnumeration


;}
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
Global JcompInt.s ,	jourRep.s, moisRep.s, anRep.s, jourGre.i, moisGre.i, MoisGre$, anGre.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()
	jourRep = "----"
	moisRep = "Impossible"
	anRep = "----"
EndProcedure

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

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

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

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

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

Procedure Ouvrir_Fenetre_principale()
    If OpenWindow(#Fenetre_principale, 550, 140, 420, 466, "Calendrier républicain par Michel Lye", #PB_Window_SystemMenu|#PB_Window_TitleBar|#PB_Window_ScreenCentered)
        TextGadget(#Texte_SelRep, 90, 20, 240, 41, "Sélectionnez la date du calendrier républicain", #PB_Text_Center)
        TextGadget(#Texte_ou, 195, 140, 27, 20, "OU", #PB_Text_Center)
        TextGadget(#Texte_SelComp, 90, 165, 240, 35, "Sélectionnez le jour complèmentaire ou intercalaire", #PB_Text_Center)
        ComboBoxGadget(#Combo_JcompInt, 95, 210, 150, 20)
		AddGadgetItem(#Combo_JcompInt, -1, "fête de la vertu") 
		AddGadgetItem(#Combo_JcompInt, -1, "fête du génie")
		AddGadgetItem(#Combo_JcompInt, -1, "fête du travail")
		AddGadgetItem(#Combo_JcompInt, -1, "fête de l'opinion")
		AddGadgetItem(#Combo_JcompInt, -1, "fête des récompenses")
		AddGadgetItem(#Combo_JcompInt, -1, "fête de la révolution")
        Frame3DGadget(#Frame3D_Rep, 85, 10, 250, 235, "")
        ButtonGadget(#Bouton_ConvGreg, 140, 110, 140, 25, "Convertir en grégorien")
        TextGadget(#Texte_SelGre, 90, 260, 240, 45, "Selectionnez la date du calendrier grégorien", #PB_Text_Center)
        ButtonGadget(#Bouton_ConvRep, 140, 340, 140, 25, "Convertir en républicain")
        Frame3DGadget(#Frame3D_Gre, 85, 250, 250, 130, "")
        TextGadget(#Texte_Res, 175, 395, 60, 20, "Résultat", #PB_Text_Center)
        StringGadget(#Chaine_Jres, 95, 425, 50, 20, "", #PB_String_ReadOnly)
        StringGadget(#Chaine_Mres, 165, 425, 80, 20, "", #PB_String_ReadOnly)
        StringGadget(#Chaine_Ares, 275, 425, 50, 20, "", #PB_String_ReadOnly)
        Frame3DGadget(#Frame3D_Res, 85, 385, 250, 75, "")
        ComboBoxGadget(#Combo_Jrep, 95, 70, 50, 20)
		For i = 1 To 30
			AddGadgetItem(#Combo_jrep, -1, Str(i))
		Next
        ComboBoxGadget(#Combo_Mrep, 165, 70, 90, 20)
		AddGadgetItem(#Combo_Mrep, -1, "Vendémiaire")
		AddGadgetItem(#Combo_Mrep, -1, "Brumaire")
		AddGadgetItem(#Combo_Mrep, -1, "Frimaire")
		AddGadgetItem(#Combo_Mrep, -1, "Nivôse")
		AddGadgetItem(#Combo_Mrep, -1, "Pluviôse")
		AddGadgetItem(#Combo_Mrep, -1, "Ventôse")
		AddGadgetItem(#Combo_Mrep, -1, "Germinal")
		AddGadgetItem(#Combo_Mrep, -1, "Floréal")
		AddGadgetItem(#Combo_Mrep, -1, "Prairial")
		AddGadgetItem(#Combo_Mrep, -1, "Messidor")
		AddGadgetItem(#Combo_Mrep, -1, "Thermidor")
		AddGadgetItem(#Combo_Mrep, -1, "Fructidor")
        ComboBoxGadget(#Combo_Arep, 275, 70, 50, 20)
		AddGadgetItem(#Combo_Arep, -1, "an I")
		AddGadgetItem(#Combo_Arep, -1, "an II")
		AddGadgetItem(#Combo_Arep, -1, "an III")
		AddGadgetItem(#Combo_Arep, -1, "an IV")
		AddGadgetItem(#Combo_Arep, -1, "an V")
		AddGadgetItem(#Combo_Arep, -1, "an VI")
		AddGadgetItem(#Combo_Arep, -1, "an VII")
		AddGadgetItem(#Combo_Arep, -1, "an VIII")
		AddGadgetItem(#Combo_Arep, -1, "an IX")
		AddGadgetItem(#Combo_Arep, -1, "an X")
		AddGadgetItem(#Combo_Arep, -1, "an XI")
		AddGadgetItem(#Combo_Arep, -1, "an XII")
		AddGadgetItem(#Combo_Arep, -1, "an XIII")
		AddGadgetItem(#Combo_Arep, -1, "an XIV")
        ComboBoxGadget(#Combo_Jgre, 95, 310, 50, 20)
		For i = 1 To 31
			AddGadgetItem(#Combo_Jgre, -1, Str(i))
		Next
        ComboBoxGadget(#Combo_Mgre, 165, 310, 90, 20)
		AddGadgetItem(#Combo_Mgre, -1, "Janvier")
		AddGadgetItem(#Combo_Mgre, -1, "Février")
		AddGadgetItem(#Combo_Mgre, -1, "Mars")
		AddGadgetItem(#Combo_Mgre, -1, "Avril")
		AddGadgetItem(#Combo_Mgre, -1, "Mai")
		AddGadgetItem(#Combo_Mgre, -1, "Juin")
		AddGadgetItem(#Combo_Mgre, -1, "Juillet")
		AddGadgetItem(#Combo_Mgre, -1, "Août")
		AddGadgetItem(#Combo_Mgre, -1, "Septembre")
		AddGadgetItem(#Combo_Mgre, -1, "Octobre")
		AddGadgetItem(#Combo_Mgre, -1, "Novembre")
		AddGadgetItem(#Combo_Mgre, -1, "Décembre")
        ComboBoxGadget(#Combo_Agre, 275, 310, 50, 20)
		For i = 1793 To 1806
			AddGadgetItem(#Combo_Agre, -1, Str(i))
		Next
		ButtonGadget(#Bouton_ConvJComp, 265, 210, 59, 20, "Convertir")
		
		LoadImage(#Image_Germinal, #PB_Compiler_FilePath+"Germinal.jpg")
		ResizeImage(#Image_Germinal, 50,75)
		ImageGadget(#Image_Germinal, 350, 5, 50, 75, ImageID(#Image_Germinal))
		
		LoadImage(#Image_Floreal, #PB_Compiler_FilePath+"Floreal.jpg")
		ResizeImage(#Image_Floreal, 50,75)
		ImageGadget(#Image_Floreal, 350, 80, 50, 75, ImageID(#Image_Floreal))
		
		LoadImage(#Image_Prairial, #PB_Compiler_FilePath+"Prairial.jpg")
		ResizeImage(#Image_Prairial, 50, 75)
		ImageGadget(#Image_Prairial, 350, 155, 50, 75, ImageID(#Image_Prairial))
		
		LoadImage(#Image_Messidor, #PB_Compiler_FilePath+"Messidor.jpg")
		ResizeImage(#Image_Messidor, 50, 75)		
        ImageGadget(#Image_Messidor, 350, 230, 50, 75, ImageID(#Image_Messidor))
		
		LoadImage(#Image_Thermidor, #PB_Compiler_FilePath+"Thermidor.jpg")
		ResizeImage(#Image_Thermidor, 50, 75)
        ImageGadget(#Image_Thermidor, 350, 310, 50, 75, ImageID(#Image_Thermidor))
		
		LoadImage(#Image_Fructidor, #PB_Compiler_FilePath+"Fructidor.jpg")
		ResizeImage(#Image_Fructidor, 50, 75)
        ImageGadget(#Image_Fructidor, 350, 385, 50, 75, ImageID(#Image_Fructidor))
		
		LoadImage(#Image_Vendemiaire, #PB_Compiler_FilePath+"Vendemiaire.jpg")
		ResizeImage(#Image_Vendemiaire, 50, 75)
        ImageGadget(#Image_Vendemiaire, 20, 5, 50, 75, ImageID(#Image_Vendemiaire))
		
		LoadImage(#Image_Brumaire, #PB_Compiler_FilePath+"Brumaire.jpg")
		ResizeImage(#Image_Brumaire, 50, 75)
        ImageGadget(#Image_Brumaire, 20, 80, 50, 75, ImageID(#Image_Brumaire))
		
		LoadImage(#Image_Frimaire, #PB_Compiler_FilePath+"Frimaire.jpg")
		ResizeImage(#Image_Frimaire, 50, 75)
        ImageGadget(#Image_Frimaire, 20, 155, 50, 75, ImageID(#Image_Frimaire))
		
		LoadImage(#Image_Nivose, #PB_Compiler_FilePath+"Nivose.jpg")
		ResizeImage(#Image_Nivose, 50, 75)
        ImageGadget(#Image_Nivose, 20, 230, 50, 75, ImageID(#Image_Nivose))
		
		LoadImage(#Image_Pluviose, #PB_Compiler_FilePath+"Pluviose.jpg")
		ResizeImage(#Image_Pluviose, 50, 75)
        ImageGadget(#Image_Pluviose, 20, 305, 50, 75, ImageID(#Image_Pluviose))
		
		LoadImage(#Image_Ventose, #PB_Compiler_FilePath+"Ventose.jpg")
		ResizeImage(#Image_Ventose, 50, 75)
        ImageGadget(#Image_Ventose, 20, 385, 50, 75, ImageID(#Image_Ventose))
        ; Gadget Fonts
        SetGadgetFont(#Texte_SelRep, LoadFont(#Font_Texte_SelRep, "Segoe UI", 12, 16))
        SetGadgetFont(#Texte_ou, LoadFont(#Font_Texte_ou, "Segoe UI", 12, 272))
        SetGadgetFont(#Texte_SelComp, LoadFont(#Font_Texte_SelComp, "Segoe UI", 10, 16))
        SetGadgetFont(#Bouton_ConvGreg, LoadFont(#Font_Bouton_ConvGreg, "Segoe UI", 10, 16))
        SetGadgetFont(#Texte_SelGre, LoadFont(#Font_Texte_SelGre, "Segoe UI", 12, 16))
        SetGadgetFont(#Texte_Res, LoadFont(#Font_Texte_Res, "Segoe UI", 12, 16))
        SetGadgetFont(#Bouton_ConvJComp, LoadFont(#Font_Bouton_ConvJComp, "Segoe UI", 10, 16))
    EndIf
EndProcedure

Ouvrir_Fenetre_principale()

;{- Event loop
Repeat
	Event = WaitWindowEvent()
	Select Event
			; ///////////////////
		Case #PB_Event_Gadget
			EventGadget = EventGadget()
			EventType = EventType()
			If EventGadget = #Bouton_ConvGreg ; convertir en grégorien
				Convertir_en_gregorien()
				If moisGre$ <> "Impossible"
					SetGadgetText(#Chaine_Jres, Str(jourGre))
					SetGadgetText(#Chaine_Mres,moisGre$)
					SetGadgetText(#Chaine_Ares,Str(anGre))
				Else
					SetGadgetText(#Chaine_Jres, "-")
					SetGadgetText(#Chaine_Mres,moisGre$)
					SetGadgetText(#Chaine_Ares,"-")
				EndIf				
				jourGre = 0 : MoisGre$ = "" : anGre = 0
			ElseIf EventGadget = #Bouton_ConvRep ; convertir en républicain
				Convertir_en_republicain()
				SetGadgetText(#Chaine_Jres, jourRep)
				SetGadgetText(#Chaine_Mres, moisRep)
				SetGadgetText(#Chaine_Ares, anRep)
			ElseIf EventGadget = #Bouton_ConvJComp
				JoursComplementaires()
				SetGadgetText(#Chaine_Jres, Str(jourGre))
				SetGadgetText(#Chaine_Mres,moisGre$)
				SetGadgetText(#Chaine_Ares,Str(anGre))
			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,00,24,25,25,26,26,27,25,26,27,28,26,27,28,29,29,30,30
	Data.i 8,00,25,26,26,27,27,28,26,27,28,29,27,28,29,30,30,31,1
	Data.i 9,00,26,27,27,28,28,29,27,28,29,30,28,29,30,31,1,1,2
	Data.i 10,00,27,28,28,29,29,30,28,29,30,31,1,1,1,1,2,2,3
	Data.i 11,00,28,29,29,30,30,31,1,1,1,1,2,2,2,2,3,3,4
	Data.i 12,00,29,30,30,31,1,1,2,2,2,2,3,3,3,3,4,4,5
	Data.i 13,00,30,31,1,1,2,2,3,3,3,3,4,4,4,4,5,5,6
	Data.i 14,00,31,1,2,2,3,3,4,4,4,4,5,5,5,5,6,6,7
	Data.i 15,00,1,2,3,3,4,4,5,5,5,5,6,6,6,6,7,7,8
	Data.i 16,00,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,9
	Data.i 17,00,3,4,5,5,6,6,7,7,7,7,8,8,8,8,9,9,10
	Data.i 18,00,4,5,6,6,7,7,8,8,8,8,9,9,9,9,10,10,11
	Data.i 19,00,5,6,7,7,8,8,9,9,9,9,10,10,10,10,11,11,12
	Data.i 20,00,6,7,8,8,9,9,10,10,10,10,11,11,11,11,12,12,13
	Data.i 21,00,7,8,9,9,10,10,11,11,11,11,12,12,12,12,13,13,14
	Data.i 22,00,8,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,15
	Data.i 23,00,9,10,11,11,12,12,13,13,13,13,14,14,14,14,15,15,16
	Data.i 24,00,10,11,12,12,13,13,14,14,14,14,15,15,15,15,16,16,17
	Data.i 25,00,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,18
	Data.i 26,00,12,13,14,14,15,15,16,16,16,16,17,17,17,17,18,18,19
	Data.i 27,00,13,14,15,15,16,16,17,17,17,17,18,18,18,18,19,19,20
	Data.i 28,00,14,15,16,16,17,17,18,18,18,18,19,19,19,19,20,20,21
	Data.i 29,00,15,16,17,17,18,18,19,19,19,19,20,20,20,20,21,21,22
	Data.i 30,00,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,23
Si mes codes vous plaisent, je peux bien sûr les poster, c'est un peu à cause de vous que je progresse en PureBasic, alors n'hésitez pas à me conseiller !

PS : pour les images elle sont dans le zip du premier post.
Microsoft Windows 10 Famille 64 bits : Carte mère : ASRock 970 Extreme3 R2.0 : Carte Graphique NVIDIA GeForce RTX 3080 : Processeur AMD FX 6300 6 cœurs 12 threads 3,50 GHz PB 6.20 LTS (x64)
Un homme doit être poli, mais il doit aussi être libre !
Répondre