datebrowser.gadget Reference

Comprehensive function reference for datebrowser.gadget, synthesised from the AmigaOS NDK 3.2 Release 4 (Autodocs/datebrowser).

This page documents 5 functions of datebrowser.gadget. Each function entry follows the canonical autodoc format. struct Name, union Name, enum Name are clickable links to the type definition in the types reference.

Function index


datebrowser.gadget()

**datebrowser.gadget -- Monthly calendar gadget

SUPERCLASS
    gadgetclass

DESCRIPTION
    The datebrowser gadget class is used to display a month-based array
    of days in the visual style of traditional calendarss.

METHODS
    OM_NEW--Create the gadget.  Passed to superclass, then OM_SET.

    OM_SET--Set object attributes.  Passed to superclass first.

    OM_UPDATE--Set object notification attributes.  Passed to superclass
        first.

    GM_LAYOUT--Calculate relative gadget coordinates.  Passed to
        superclass first.  Requires V39 or beyond of Intuition.

    GM_RENDER--Renders the gadget imagry.  Overrides the superclass.

    GM_HITTEST--Determines if mouse is within the gadget rectangle.
        Overrides the superclass.

    GM_GOACTIVE--Handles activation, mutual-exclusion and date-select.
        Overrides the superclass.

    GM_HANDLEINPUT--Handles input events once active. Overrides the 
        superclass.

    GM_GOINACTIVE--Deselects the button.  Overrides the superclass.

    GM_DOMAIN--Obtain the minimum, nominal and maximum size of a
        datebrowser object.

    GM_KEYACTIVE--private method for handling keyboard control
        activation.

    GM_KEYINACTIVE--private method for handling keyboard control 
        termination.

    GM_CLIPRECT--method needed to use this gadget in virtual groups. New 
        for v45.

    All other methods are passed to the superclass, including OM_DISPOSE.

ATTRIBUTES
    GA_Disabled (BOOL) -- Determines whether the datebrowser is disabled
        or not.  Changing disable state will invoke GM_RENDER.  A
        disabled datebrowser's border and label are all rendered in
        SHADOWPEN and then dusted in a ghosting pattern that is rendered
        in SHADOWPEN.  Defaults to FALSE.

    GA_TextAttr (struct TextAttr *) -- Text attribute for the font to
        use for the labels.

    GA_ReadOnly (BOOL) -- Indicate whether datebrowser has selectable
        days or is for display only.  Defaults to FALSE (selectable
        days).

    DATEBROWSER_Day (UWORD) -- Set the current day of the month. Defaults
        to 1. Applicability is (OM_NEW,OM_SET,OM_UPDATE,OM_GET).

    DATEBROWSER_Month (UWORD) -- Set the current month of the year. 
        Defaults to 1. Applicability is (OM_NEW,OM_SET,OM_UPDATE,OM_GET).

    DATEBROWSER_Year (LONG) -- Calendar year to display. Defaults to
        1978. Applicability is (OM_NEW,OM_SET,OM_UPDATE,OM_GET).

    DATEBROWSER_SelectedDays (ULONG) -- A 32 bit value, each bit
        represents a day of the month.  If set, the corresponding
        calendar day is selected. This is useful for multi-select mode to
        find out what days are selected via one packed value.
        Applicability is (OM_NEW,OM_SET,OM_UPDATE,OM_GET).

    DATEBROWSER_FirstWDay (LONG) -- Gets the first day of the week. 0 is 
        Sunday. Applicability is (OM_GET).

    DATEBROWSER_NumDays (UWORD) -- Returns the number of days in the
        currently set month. A better solution may be using datebrowser's
        public julian date functions.
        Applicability is (OM_GET).

    DATEBROWSER_WeekDay (UWORD) -- Returns the day of the week for the
        currently selected 'DATEBROWSER_Day'. A better solution may be
        using datebrowser's public julian date functions.
        Applicability is (OM_GET).

    DATEBROWSER_ShowTitle (BOOL) -- Enables display of the week-day title
        bar. NOTE: If turned on after layout group creation, you must be
        sure to FlushLayoutDomainCache() and RethinkDisplay(), and 
        potentionally increase the window size to accomodate the possibly
        larger layout. Simply toggling iconify on/off, or close & open of
        the window class will archieve similiar results.
        Applicability is (OM_NEW,OM_SET).

    DATEBROWSR_MultiSelect (BOOL) -- Enables multi-selection of calendar
        days. Applicability is (OM_NEW,OM_SET).

    DATEBROWSER_DayTitles (STRPTR *) -- Pointer to an array of STRPTR
        containing day titles. Defaults to non-localized internal "Mon",
        "Tue", etc., if locale.library cannot be opened.
        Applicability is (OM_NEW,OM_SET,OM_UPDATE,OM_GET).**

Notes

    Relative support requires V39 and beyond of Intuition.

DATEBROWSER_GetClass()

DATEBROWSER_GetClass -- Gets the pointer to the datebrowser class.

Synopsis

datebrowser_class = DATEBROWSER_GetClass();
D0

Class * DATEBROWSER_GetClass(VOID);

Function

    Obtains the pointer to the datebrowser gadget class for use with
    NewObject().  This function always returns a valid pointer so
    you do not need to check it.  The reason is that if the library
    opens fine, then the pointer returned is already setup.  (Of course
    this implies that if opening the library fails, you shouldn't be
    calling this.)

    Note that this function does not create the class, that is done
    when the class library is opened.

Inputs

    Nothing.

RESULT
    datebrowser_class - Pointer to the datebrowser gadget class.

JulianLeapYear()

JulianLeapYear -- Checks for a leap-year.

Synopsis

isleapyear = JulianLeapYear(year);
D0                          D0

BOOL JulianLeapYear(LONG);

Function

    This function will return TRUE if the given year is a leap year.

Inputs

    year -- the year.

RESULT
    days -- TRUE when the given year is a leap-year, otherwise FALSE.

JulianMonthDays()

JulianMonthDays -- Returns the length of a month.

Synopsis

days = JulianMonthDays(month, year);
D0                     D0     D1

WORD JulianMonthDays(WORD, LONG);

Function

    Based on the input parameters "month" and "year", this
    function returns the length of the given month.

Inputs

    month -- the month.
    year -- the year.

RESULT
    days -- the length of the given month.

JulianWeekDay()

JulianWeekDay -- Checks for leap-year.

Synopsis

wday = JulianWeekDay(day,month,year);
D0                   D0  D1    D2

WORD JulianWeekDay(WORD,WORD,LONG);

Function

    Return the weekday of the given date.

Inputs

    day -- the day (1-31).
    month -- the month (1-12).
    year -- the year.

RESULT
    wday -- the weekday of the given date, with 0 being Sunday and
       6 being Saturday.