#include ONCE "window9.bi"

Function GetStateCalendar(iGadget As long , bFlag As Byte=5) As long Export
	
	dim as guint year_, month_, day_
	
	gtk_calendar_get_date (cast(any ptr,gadgetid(iGadget)) , @year_, @month_, @day_)
	
	select case bFlag
		
		Case 1
		
			return year_
		
		case 2
		
			return month_ +1
		
		case 3
		
			return 0
		
		case 4
		
			return day_
		
		case 5
		
			Return Val(Year_ & (Month_+1) &  Day_)
		
	End Select
	
End Function