CalendarGadget()

Syntax

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 identifier will be returned as 'Result'. #Gadget will be the number returned by EventGadgetID() 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(): Set a minimum/maximum date that the user can choose.
- GetGadgetAttribute(): Get the minimum/maximum date for that gadget.

Example:
  If OpenWindow(0, 0, 0, 220, 200, #PB_Window_SystemMenu|#PB_Window_Screencentered,"CalendarGadget()")
    If CreateGadgetList(WindowID())
      CalendarGadget(0, 10, 10, 200, 180)
      Repeat: Until WaitWindowEvent() = #PB_Event_CloseWindow
    EndIf
  EndIf

Supported OS

Windows, Linux, MacOS X

<- ButtonImageGadget() - Gadget Index - ChangeListIconGadgetDisplay() ->