" --------------------------------------------------------------------- "
" BoopsiDateBrowserTags Class is a Singleton class that allows the user "
" to reference BOOPSI DateBrowser class tags' hexadecimal values.       "
""
"  EXAMPLE:  'myTag <- dateBrowserTags getTag: #DATEBROWSER_Month'      "
""
" ALL singleton classes MUST contain the following:                     "
"" 
"  the methods:  isSingleton AND privateSetup     AND                   "
"                 uniqueInstance Class instance variable.               "
" --------------------------------------------------------------------- "

Class BoopsiDateBrowserTags :Dictionary ! uniqueInstance !
[
   isSingleton
     ^ true  
|  
   privateNew ! newinstance !
     newinstance <- super new.

     ^ newinstance
|
   new
     ^ self privateSetup
|
   getTag: tagKey
     ^ self at: tagKey
|
   privateInitializeDictionary

     " (UWORD) OM_NEW, OM_SET, OM_UPDATE, OM_GET
     * Selected/Current day of the month. Defaults to 1, which
     * is the first of the current month.
     "
     self at: #DATEBROWSER_Day          put: 16r8506100.

     " (UWORD) OM_NEW, OM_SET, OM_UPDATE, OM_GET
     * Calendar month to display. Defaults to 1, which is January.
     "
     self at: #DATEBROWSER_Month        put: 16r8506101.

     " (LONG) OM_NEW, OM_SET, OM_UPDATE, OM_GET
     * Calendar year to display. Defaults to 1978, which is
     * a long time ago now, back when dinosaurs walked the earth.
     "
     self at: #DATEBROWSER_Year         put: 16r8506102.

     " (ULONG) OM_NEW, OM_SET, OM_UPDATE, OM_GET
     * A 32 bit value, each bit represents a day of the month,
     * if set, the corrisponding calendar day is selected.
     * This is useful for multi-select mode to find out what
     * days are selected via one packed return value.
     "
     self at: #DATEBROWSER_SelectedDays put: 16r8506103.

     " (UWORD) OM_NEW, OM_SET, OM_UPDATE, OM_GET
     * Returns the day of the week for the currently
     * selected 'DATEBROWSER_Day'. A better solution may be
     * using datebrowser's public julian date functions.
     "
     self at: #DATEBROWSER_WeekDay     put: 16r8506104.

     " (UWORD) OM_NEW, OM_SET, OM_UPDATE, OM_GET
     * Returns the day of the week the first of the month
     * will fall on with the julian calendar.
     * Starting with 0 for Sunday, and 6 for Saterday.
     "
     self at: #DATEBROWSER_FirstWDay   put: 16r8506105.

     " (UWORD) OM_GET
     * Returns the number of days in the currently set month.
     * A better solution may be using datebrowser's public
     * julian date functions.
     "
     self at: #DATEBROWSER_NumDays     put: 16r8506106.

     " (BOOL) OM_NEW,OM_SET,OM_GET
     * Enables display of the week-day title bar.
     * NOTE:  If turned ON after layout group creation, you must be sure
     * to FlushLayoutDomainCache() and RethinkLayout(), and potentially
     * increase the window size to accomodate the possibly larger layout.
     * Simply toggling iconify on/off, or close & open of the window
     * class will achieve simular results.
     * NOTE:  If using a recent window.class you should use WM_RETHINK!!
     "
     self at: #DATEBROWSER_ShowTitle   put: 16r8506107.

     " (BOOL) OM_NEW, OM_SET, OM_UPDATE, OM_GET
     * Enables multi-selection of calendar days.
     "
     self at: #DATEBROWSER_MultiSelect put: 16r8506108.

     " (STRPTR *) OM_NEW, OM_SET, OM_UPDATE
     * Pointer to an array of STRPTR containing day titles.
     * Defaults to non-localized internal 'Mon', 'Tue', etc.
     "
     self at: #DATEBROWSER_DayTitles   put: 16r8506109.
|
   privateSetup
     (uniqueInstance isNil)
       ifTrue: [uniqueInstance <- self privateNew.
                
                self privateInitializeDictionary.
               ].
               
     ^ self    "or ^ uniqueInstance??"
]

