CalendarGadget()
Syntax
Result = CalendarGadget(#Gadget, x, y, Width, Height [, Date [, Flags]])Description
Create a calendar gadget in the current GadgetList. This gadget displays a month calendar and lets the user select a date. The dates used by this gadget and the commands for it use the same date format as the PB date library.
If #PB_Any is used as '#Gadget' parameter, the new gadget number will be returned as 'Result'. #Gadget will be the number returned by EventGadget() command.
The Date parameter can optionally be used to select a certain date, if not specified, the current date is selected.
You can specify #PB_Calendar_Borderless in the Flags parameter if you want the gadget to be created without a border.
You can add a 'mini help' to this gadget by using GadgetToolTip().
The following commands can be used for this gadget:
- SetGadgetState(): Set the currently displayed date.
- GetGadgetState(): Get the currently displayed date.
- SetGadgetItemState(): Make a specific date appear bold.
- GetGadgetItemState(): Get the bold state of a specific date.
- SetGadgetAttribute(): With the following attributes:#PB_Calendar_Minimum: Set the minimum selectable date #PB_Calendar_Maximum: Set the maximum selectable date this gadget.- GetGadgetAttribute(): With the following attributes:#PB_Calendar_Minimum: Get the minimum selectable date #PB_Calendar_Maximum: Get the maximum selectable date this gadget.
This gadget supports the SetGadgetColor() and GetGadgetColor() commands with the following values as 'ColorType':#PB_Gadget_BackColor : backgroundcolor #PB_Gadget_FrontColor : textcolor for displayed days #PB_Gadget_TitleBackColor : backgroundcolor of the month title #PB_Gadget_TitleFrontColor: textcolor of the month title #PB_Gadget_GrayTextColor : textcolor for days not of the current monthExample:If OpenWindow(0, 0, 0, 220, 200, "CalendarGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) If CreateGadgetList(WindowID(0)) CalendarGadget(0, 10, 10, 200, 180) Repeat: Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf EndIf
Supported OS
All